projects
/
visomat-utils.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cfb7628
)
visomat-data-downloader: don't use a magic value for the datetime packet size
author
Antonio Ospite <ao2@ao2.it>
Wed, 14 Sep 2016 11:24:52 +0000
(13:24 +0200)
committer
Antonio Ospite <ao2@ao2.it>
Wed, 14 Sep 2016 11:24:52 +0000
(13:24 +0200)
src/visomat-data-downloader.c
patch
|
blob
|
history
diff --git
a/src/visomat-data-downloader.c
b/src/visomat-data-downloader.c
index
bc9ec90
..
a3282ba
100644
(file)
--- a/
src/visomat-data-downloader.c
+++ b/
src/visomat-data-downloader.c
@@
-63,6
+63,7
@@
static void debug_dump_buffer(const char *filename, uint8_t *buffer, unsigned in
#define STX 0x02
#define ETX 0x03
#define STX 0x02
#define ETX 0x03
+#define DATETIME_PACKET_SIZE 15
#define BASE_YEAR 2000
typedef enum {
#define BASE_YEAR 2000
typedef enum {
@@
-237,7
+238,7
@@
static int decode_datetime(uint8_t *buffer, unsigned int len)
struct datetime d;
uint8_t *pbuffer = buffer;
struct datetime d;
uint8_t *pbuffer = buffer;
- if (len !=
15
)
+ if (len !=
DATETIME_PACKET_SIZE
)
return -EINVAL;
code[0] = buffer[1];
return -EINVAL;
code[0] = buffer[1];