projects
/
visomat-utils.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
a1f11bc
)
visomat-data-downloader: use uint8_t for bytes
author
Antonio Ospite <ao2@ao2.it>
Sat, 9 Jan 2016 16:51:33 +0000
(17:51 +0100)
committer
Antonio Ospite <ao2@ao2.it>
Sat, 9 Jan 2016 16:51:33 +0000
(17:51 +0100)
src/visomat-data-downloader.c
patch
|
blob
|
history
diff --git
a/src/visomat-data-downloader.c
b/src/visomat-data-downloader.c
index
1059368
..
1b4cde9
100644
(file)
--- a/
src/visomat-data-downloader.c
+++ b/
src/visomat-data-downloader.c
@@
-71,7
+71,7
@@
struct pressure {
unsigned int pulses;
};
unsigned int pulses;
};
-static inline int extract_datetime(u
nsigned char
*buffer, struct datetime *d)
+static inline int extract_datetime(u
int8_t
*buffer, struct datetime *d)
{
int ret;
{
int ret;
@@
-120,7
+120,7
@@
static void print_record_csv_compat(struct datetime *d, struct pressure *p)
}
/* TODO: it would be better to separate decoding data from printing it */
}
/* TODO: it would be better to separate decoding data from printing it */
-static int decode_eeprom(u
nsigned char
*buffer,
+static int decode_eeprom(u
int8_t
*buffer,
unsigned int len,
unsigned int user_mask)
{
unsigned int len,
unsigned int user_mask)
{
@@
-196,12
+196,12
@@
static int decode_eeprom(unsigned char *buffer,
return 0;
}
return 0;
}
-static int decode_datetime(u
nsigned char
*buffer, unsigned int len)
+static int decode_datetime(u
int8_t
*buffer, unsigned int len)
{
int ret;
{
int ret;
- u
nsigned char
code[4] = { 0 };
+ u
int8_t
code[4] = { 0 };
struct datetime d;
struct datetime d;
- u
nsigned char
*pbuffer = buffer;
+ u
int8_t
*pbuffer = buffer;
if (len != 15)
return -EINVAL;
if (len != 15)
return -EINVAL;
@@
-224,7
+224,7
@@
static int send_command(libusb_device_handle *dev, visomat_command cmd)
{
int ret;
int transferred;
{
int ret;
int transferred;
- u
nsigned char
request[5];
+ u
int8_t
request[5];
request[0] = STX;
request[1] = command_codes[cmd][0];
request[0] = STX;
request[1] = command_codes[cmd][0];
@@
-243,12
+243,12
@@
static int send_command(libusb_device_handle *dev, visomat_command cmd)
}
static int get_response(libusb_device_handle *dev,
}
static int get_response(libusb_device_handle *dev,
- u
nsigned char
*buffer,
+ u
int8_t
*buffer,
unsigned int len)
{
int ret;
int transferred;
unsigned int len)
{
int ret;
int transferred;
- u
nsigned char
response[64] = { 0 };
+ u
int8_t
response[64] = { 0 };
unsigned int i;
i = 0;
unsigned int i;
i = 0;
@@
-282,7
+282,7
@@
static int get_response(libusb_device_handle *dev,
static int visomat_dump_eeprom(visomat_device *dev, unsigned int user_mask)
{
/* Assuming an EEPROM of 1 KiB */
static int visomat_dump_eeprom(visomat_device *dev, unsigned int user_mask)
{
/* Assuming an EEPROM of 1 KiB */
- u
nsigned char
buffer[1024] = { 0 };
+ u
int8_t
buffer[1024] = { 0 };
int ret;
ret = send_command(dev, VISOMAT_CMD_DUMP_EEPROM);
int ret;
ret = send_command(dev, VISOMAT_CMD_DUMP_EEPROM);
@@
-302,7
+302,7
@@
static int visomat_dump_eeprom(visomat_device *dev, unsigned int user_mask)
static int visomat_get_datetime(visomat_device *dev)
{
static int visomat_get_datetime(visomat_device *dev)
{
- u
nsigned char
buffer[255] = { 0 };
+ u
int8_t
buffer[255] = { 0 };
int ret;
ret = send_command(dev, VISOMAT_CMD_GET_DATETIME);
int ret;
ret = send_command(dev, VISOMAT_CMD_GET_DATETIME);