X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/hmcfgusb/blobdiff_plain/3e34d2cea8844557376669f4782f07f5085253c9..6e621012d68aaa1b28c9c14eeeec6987d093c02f:/hmsniff.c?ds=sidebyside diff --git a/hmsniff.c b/hmsniff.c index 638ae1d..2ffb9e1 100644 --- a/hmsniff.c +++ b/hmsniff.c @@ -42,7 +42,7 @@ static int verbose = 0; /* See HMConfig.pm */ -char *hm_message_types(uint8_t type, uint8_t subtype) +const char *hm_message_types(uint8_t type, uint8_t subtype) { switch(type) { case 0x00: @@ -231,6 +231,7 @@ static int parse_hmuartlgw(enum hmuartlgw_dst dst, uint8_t *buf, int buf_len, vo switch(buf[0]) { case HMUARTLGW_APP_RECV: + buf[3] = buf_len - 4; dissect_hm(buf + 3, buf_len - 3); case HMUARTLGW_APP_ACK: break; @@ -322,7 +323,7 @@ int main(int argc, char **argv) buf[1] = speed; hmcfgusb_send(dev.hmcfgusb, buf, 2, 1); } else { - dev.hmuartlgw = hmuart_init(uart, parse_hmuartlgw, &rdata); + dev.hmuartlgw = hmuart_init(uart, parse_hmuartlgw, &rdata, 1); if (!dev.hmuartlgw) { fprintf(stderr, "Can't initialize HM-MOD-UART!\n"); exit(1);