Dirk Zenker
5f0b5d5dd1
Beautify: replace tabs with spaces and remove trailing spaces
2014-02-24 15:20:42 +01:00
Stefan Wahren
0cf57bfc35
Move event handling from global variable to handle
...
- remove global event function pointer
- add event function pointer to handle structure
- add handle parameter to register functions
- move all register functions to mbus-protocol-aux.c
2013-10-13 21:49:40 +02:00
Stefan Wahren
55d4c0fba2
Remove trailing whitespace
...
Signed-off-by: Stefan Wahren <info@lategoodbye.de>
2013-09-13 17:53:33 +02:00
Stefan Wahren
d7168a4ea4
Fix return value and error message
2013-05-13 08:47:19 +02: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
Alexey Bondarchuk
4cd114e911
Fix undeclared variable
2013-01-14 12:28:14 +02:00
Tmtom
db343cba2b
First version of manpages. Added remaining baud rates for serial communication.
2012-07-17 21:50:02 +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
34255c7237
free_auxdata() added to mbus_handle interface for freeing context specific data
2012-07-04 19:08:51 +02:00
jakubovsky
645e5eb482
mbus_serial_connect() is ready
2012-07-04 18:38:50 +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
Stefan Wahren
7c304b34a0
Always wait until complete frame has been transmitted
2012-06-11 21:22:31 +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
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
980bbb1862
Fixed baud rate switching:
...
- added missing call of tcsetattr
- handle return values
- adjust timeout correctly
2012-05-15 23:17:49 +02:00
Stefan Wahren
5a7e69f90d
Merge remote branch 'upstream/master'
...
Conflicts:
mbus/mbus-serial.c
2012-05-14 00:09:05 +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 Johansson
59fca0a709
added option to dump frame in HEX to stdout before writing it to the serial port
2012-05-13 16:32:55 +09:00
Robert
c10b37e53d
got rid of duplicate catalog libmbus/libmbus
2012-04-15 10:51:15 +09:00