59 Commits

Author SHA1 Message Date
Tmtom
db343cba2b First version of manpages. Added remaining baud rates for serial communication. 2012-07-17 21:50:02 +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
97f2ac34ba M-Bus handle extended by maximum retry counter (in case of transmission
errors)
2012-07-14 16:15:45 +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
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
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
2093b4a9c0 Merge remote-tracking branch 'upstream/master' 2012-06-23 14:29:14 +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
Robert Johansson
82aec2ff97 repo cleanup, no need for .in files in the repository 2012-06-18 21:11:49 +09:00
Stefan Wahren
7c304b34a0 Always wait until complete frame has been transmitted 2012-06-11 21:22:31 +02:00
Stefan Wahren
f492e97186 Improved model mapping
- added und fixed mapping
2012-06-10 19:19:46 +02:00
Stefan Wahren
bf12395af9 Fixed segmentation fault in case of much XML output
Because of the multi telegrams it is impossible to use a fixed
buffer for XML output on the stack. Now the buffer is allocated on the
heap. These also leads to a change in return behaviour for all XML
functions, because it's possible that the buffer is NULL. For variable
data this buffer grows every time there are less than 1024 bytes left
for a new record.
2012-05-29 21:24:30 +02:00
Stefan Wahren
c2f7c0d48e Improved wildcard search results (still not all meters were found)
- sleep 1 second after each init frame
- select secondary address with enabled FCB bit
2012-05-29 20:51:34 +02:00
Stefan Wahren
989eada28a Improved model mapping
- initialize result buffer
- added new mappings
- added und fixed man codes
2012-05-29 20:33:09 +02:00
Stefan Wahren
0cb23161e7 Added receive timestamp for each data record in XML output 2012-05-29 20:17:05 +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
56bbccc0c1 Added a new function to select a device by it's secondary address 2012-05-20 03:58:16 +02:00
Stefan Wahren
ef630f2e5d Added a new function to select a device by it's secondary address 2012-05-20 03:52:15 +02:00
Stefan Wahren
d12d7dd052 Fixed bug in multi telegram readout with secondary address
- init slave before selecting secondary address
2012-05-20 03:44:06 +02:00
Stefan Wahren
f41b982093 New events for wildcard search 2012-05-20 03:22:02 +02:00
Stefan Wahren
45ebed05b7 Added error message in case of invalid parameter 2012-05-20 03:05:26 +02:00
Stefan Wahren
03d4876425 New events for wildcard search 2012-05-20 02:52:11 +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
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
f7c644bee6 Fixed output format of secondary address (always 16 digits, leading
zeros)
2012-05-15 23:06:14 +02:00
Stefan Wahren
8e56943fc8 Merge remote branch 'upstream/master' 2012-05-15 23:01:13 +02:00
Stefan Wahren
90aec91bff Added frame tracing (hex format) via debug switch 2012-05-15 22:57:03 +02:00
Stefan Wahren
61893a1b3d Fixed gcc warnings 2012-05-14 00:30:15 +02:00
Stefan Wahren
4178ffceb1 Added access to DRH in xml output function for data records 2012-05-14 00:26:41 +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
29201258e7 in mbus_frame_print for dumping frame in HEX format to stdout, now looping over all frames in a multi-telegram frame list 2012-05-13 16:33:53 +09: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 Johansson
6f76632728 fix bug in breakout of loop due to max_frames condition 2012-05-13 16:32:17 +09:00
Stefan Wahren
d617accea5 Added new function to generate XML with normalized values
(equivalent to mbus_frame_data_xml)
2012-05-06 23:00:59 +02:00
Stefan Wahren
b479412ab1 Migrated all new features also to mbus-protocol-aux.c:
- support for custom VIF
- support for date / time
- support for float
- fix for huge values
- hexdump of manufacturer specific data
2012-05-06 22:12:29 +02:00
Stefan Wahren
6dd17954d2 Added check to avoid segmentation fault 2012-05-06 21:55:39 +02:00
Stefan Wahren
42ed80a5b0 - init slave to get always the beginning of the records
- start read with FCB set
- fixed double free in case of send failure
2012-04-28 14:09:58 +02:00