65 Commits

Author SHA1 Message Date
Stefan Wahren
7f00f72b69 Add missing VIF=7Eh / FEh 2013-11-01 17:17:57 +01:00
Stefan Wahren
6021f3cc65 Fix VIF extension mappings for VIF=0FBh 2013-11-01 17:13:49 +01:00
Stefan Wahren
6afe7a10dc fix wrong decoding of integer / type B (now handle signedness correctly)
separate result code und decoded value for integer decoding (new
parameter)
refactor variable names
2013-10-31 22:25:34 +01:00
Stefan Wahren
663642b7ec Adopt retransmission for secondary address probing 2013-10-19 13:56:58 +02:00
Stefan Wahren
e6173103e2 Avoid unnecessary data request in mbus_read_slave 2013-10-19 13:43:00 +02:00
Stefan Wahren
31016929bc Seperate retransmission maximum in two parameters
one for data requests and another for search requests
- add new handle member for max search retransmission
- set default maximum for search retransmission to one
- rename define for retransmission option
2013-10-18 20:15:53 +02: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
9e23818152 Add new function to send a user data packet from master to slave 2013-10-13 14:52:45 +02:00
Stefan Wahren
55d4c0fba2 Remove trailing whitespace
Signed-off-by: Stefan Wahren <info@lategoodbye.de>
2013-09-13 17:53:33 +02:00
Robert Johansson
5160a10211 fixed warning 2013-07-04 23:59:41 +09:00
Stefan Wahren
dcc9e2c2b4 fix indent 2013-07-03 20:52:27 +02:00
Stefan Wahren
7b897494fd Improve wildcard search
- handle collisions after request for secondary address
- check frame type correctly
- ignore M-Bus devices without secondary address
2013-07-03 20:46:47 +02:00
Robert Johansson
e1164c87c9 error message if secondary address generation fails 2013-07-03 22:20:44 +09:00
Robert Johansson
973cc7ba30 use MBUS_ERROR instead of fprintf(stderr 2013-07-03 22:11:13 +09:00
Stefan Wahren
687ea60f54 Fixed correction in mbus_vib_unit_normalize 2013-06-09 23:14:08 +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
c59e763a84 minor fixes
remove unreachable code
add parameter checks to mbus_data_bcd_encode
init time structure in mbus_data_tm_decode as possible
mark falltrough for splint
remove unused variable val
fix removed realloc
2013-05-04 22:43:23 +02:00
Stefan Wahren
ee209023b8 fix memleaks
avoid memleak if memory is full
fix "memleak" at the end of mbus_parse_hex
2013-05-04 19:17:27 +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
0d6bb583c2 add missing initialization (thanks to valgrind) 2013-05-03 17:23:18 +02:00
Stefan Wahren
e1657399ff add new function to send application reset incl. subcode
fix typo in comment
add new program to test experimental feature application reset
add mbus-tcp-application-reset to build process
2013-04-27 13:16:44 +02:00
Stefan Wahren
5500db0898 add missing checks after memory allocation
add missing memset after memory allocation
2013-04-11 22:05:08 +02:00
Stefan Wahren
b1063db3bc replace magic numbers with defines
fix MBUS_MAX_PRIMARY_SLAVES to 250
2013-03-02 18:03:31 +01:00
Stefan Wahren
61fd2aa1c7 add new helper functions to check primary and secondary addresses 2012-12-31 13:37:17 +01:00
Stefan Wahren
404e245af5 replace magic number with define 2012-12-20 20:42:10 +01:00
Stefan Wahren
9b94df16b9 - add new type for context options
- add new function mbus_context_set_option to set context specific
options like retransmission or echo cancelation
2012-12-11 20:22:26 +01:00
Stefan Wahren
72868fdc3f add a new helper function ( mbus_hex2bin ) to convert hex values
into binary values
2012-12-10 21:16:46 +01:00
Stefan Wahren
cfa35db086 Fixed potential segmentation fault 2012-10-22 23:35:45 +02:00
Stefan Wahren
bc2c85c378 Add custom VIFE handling with a corrective factor (from Jakob
Skov-Pedersen)
2012-10-21 11:21:07 +02:00
Stefan Wahren
fef774d98d Purge behavior as new context parameter (default = purge master to
slave)
2012-10-04 22:33:22 +02:00
Stefan Wahren
78f16f0248 New defines for purge behavior (echo cancelation) 2012-10-04 22:30:53 +02:00
Stefan Wahren
af80dda0d8 Revert "Extend mbus_recv_frame with simple echo cancelation"
This reverts commit 169e37d360f5782dbbfe8bf9ccb5877cb6af7fb9.
2012-10-03 23:25:10 +02:00
Stefan Wahren
169e37d360 Extend mbus_recv_frame with simple echo cancelation 2012-10-03 23:06:11 +02:00
Stefan Wahren
564483e092 new error message in case of unknown vif 2012-09-15 02:11:14 +02:00
Stefan Wahren
b55d038899 fixed typo in vif list 2012-09-15 02:06:08 +02:00
Stefan Wahren
1a538e73aa New parameter for mbus_send_ping_frame to purge response 2012-09-01 22:51:44 +02:00
Stefan Wahren
d2608d5de7 add allocation error handling 2012-09-01 22:14:21 +02:00
Stefan Wahren
5467679f66 Reset retry counter after valid frame to be conform with M-Bus
documentation
2012-07-19 21:08:07 +02:00
Stefan Wahren
08a4c55443 - Initialize maximum retry counter to 3 for serial and tcp connections
- Retransmit request frame (just for mbus_sendrecv_request) in case of
timeout or invalid response
2012-07-14 16:22:25 +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
5f9052b284 Renamed mbus_recv_frame_dummy() to more descriptive mbus_purge_frames() 2012-07-09 10:48:13 +02:00
jakubovsky
e70c07e8f3 TCP and serial specific data structs renamed. 2012-07-06 11:29:46 +02:00
jakubovsky
6b2d43617f Merge remote-tracking branch 'upstream/master' 2012-07-06 11:14:47 +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
9f9e0fc008 Fixed mbus_recv_frame() return value to -1 when invalid m-bus handle 2012-07-03 17:17:10 +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
0d610b6a27 - fixed check of mbus_sendrecv_request and mbus_recv_frame
- initialize memory in mbus_sendrecv_request
- used defines for special address instead of magic numbers
2012-06-20 00:21:28 +02:00