22 Commits

Author SHA1 Message Date
Stefan Wahren
55d4c0fba2 Remove trailing whitespace
Signed-off-by: Stefan Wahren <info@lategoodbye.de>
2013-09-13 17:53:33 +02:00
Robert Johansson
654905a94d bug fix in timeout config 2013-08-30 00:20:35 +09:00
Robert Johansson
fd5c9adffb made it possible to configure the TCP read timeout parameter 2013-08-30 00:05:22 +09:00
Stefan Wahren
858aea33ab add more checks in lower layers
to avoid segmentation faults, out of bounds access and integer overflow
make parseable for splint
suppress splint warnings about datatype cc_t
fix type of return value for read()
add checks before accessing tty
2013-05-13 08:41:38 +02:00
Stefan Wahren
4d85dad403 change TCP port datatype from int to uint16_t
because int doesn't match the range
add range check in every TCP binary
2013-05-12 21:26:38 +02:00
Stefan Wahren
3935b4013e make parseable for splint
- replace non standard u_char with unsigned char (ANSI)
- advice splint to ignore variadic macros
- move declarations from the middle to top of functions (C90)
- replace local library includes <> to ""
2013-05-04 18:14:18 +02:00
Stefan Wahren
e6a52f97ea Replaced magic resultcodes from mbus_recv_frame with defines 2012-07-11 23:33:52 +02:00
jakubovsky
b95f29fcc8 mbus_connect() and mbus_disconnect() return 0 on success and -1 otherwise 2012-07-09 12:33:32 +02:00
jakubovsky
e70c07e8f3 TCP and serial specific data structs renamed. 2012-07-06 11:29:46 +02:00
jakubovsky
ec50ab9286 Examples from bin directory updated. API usage updated in mbus-protocol-aux.h. 2012-07-04 19:49:54 +02:00
jakubovsky
34255c7237 free_auxdata() added to mbus_handle interface for freeing context specific data 2012-07-04 19:08:51 +02:00
jakubovsky
c848090f56 Rebuilding M-Bus context structs in progress
- changed local library file includes from <> to ""
- get rid of 'if (is_serial)' conditions
- mbus_context_serial() and mbus_context_tcp() allocates memory and initialize context specific function pointers
- simply mbus_connect() called instead of mbus_connect_tcp() or mbus_connect_serial()
- context specific data can still be accessed via (void* auxdata) pointer
- strdup(3) to copy host IP into TCP context struct
2012-07-04 17:18:36 +02:00
jakubovsky
5d079254cc Extended mbus_recv_frame() error codes, improved collision handling
- handling TCP connection reset and read(2) timeout
2012-07-03 14:35:07 +02:00
Stefan Wahren
9fd35b781b Improved collision detection for scan 2012-05-29 19:39:56 +02:00
Stefan Wahren
ad4d307b57 Fixed endless loop in receive function in case of a incomplete frame
(limit = 3 timeouts)
2012-05-29 19:15:52 +02:00
Stefan Wahren
45ebed05b7 Added error message in case of invalid parameter 2012-05-20 03:05:26 +02:00
Stefan Wahren
c6031f3287 Added missing header file 2012-05-20 02:39:29 +02:00
Stefan Wahren
b055dc612f Replaced deprecated BSD against ANSI functions (bzero -> memset, bcopy
-> memcopy)
2012-05-18 13:55:43 +02:00
Stefan Wahren
11f6392df3 Fixed potential segmentation faults 2012-05-18 13:35:02 +02:00
Stefan Wahren
f14b3beb84 Fixed bugs in wildcard search
- init slaves before search
- corrected return codes
- handle collisions (possibly more bytes than expected)
- sync recv frame (tcp vs serial)
- add tracing
2012-05-15 23:30:55 +02:00
Stefan Wahren
8f48d75fb0 Added 2 event callbacks to handle send and receive events outside the
library
(now it is possible to trigger a led from an application if m-bus data
is received)
2012-05-13 23:57:24 +02:00
Robert
c10b37e53d got rid of duplicate catalog libmbus/libmbus 2012-04-15 10:51:15 +09:00