- add new type for context options
- add new function mbus_context_set_option to set context specific options like retransmission or echo cancelation
This commit is contained in:
@ -24,6 +24,8 @@
|
||||
* or
|
||||
* mbus_handle = mbus_context_tcp(host, port);
|
||||
*
|
||||
* mbus_context_set_option(mbus_handle,option,value); // optional
|
||||
*
|
||||
* mbus_connect(mbus_handle);
|
||||
*
|
||||
* ...
|
||||
@ -136,6 +138,15 @@ typedef struct _mbus_record {
|
||||
char *quantity; /**< Quantity type (e.g. Energy) */
|
||||
} mbus_record;
|
||||
|
||||
/**
|
||||
* MBus handle option type
|
||||
*/
|
||||
enum _mbus_context_option {
|
||||
MBUS_OPTION_MAX_RETRY,
|
||||
MBUS_OPTION_PURGE_FIRST_FRAME
|
||||
};
|
||||
|
||||
typedef enum _mbus_context_option mbus_context_option;
|
||||
|
||||
/**
|
||||
* Event callback functions
|
||||
@ -194,6 +205,17 @@ int mbus_connect(mbus_handle * handle);
|
||||
*/
|
||||
int mbus_disconnect(mbus_handle * handle);
|
||||
|
||||
/**
|
||||
* Set option of a M-Bus context.
|
||||
*
|
||||
* @param handle Initialized handle
|
||||
* @param option option to set
|
||||
* @param value value to set
|
||||
*
|
||||
* @return Zero when successful.
|
||||
*/
|
||||
int mbus_context_set_option(mbus_handle * handle, mbus_context_option option, long value);
|
||||
|
||||
/**
|
||||
* Receives a frame using "unified" handle
|
||||
*
|
||||
@ -436,10 +458,10 @@ int mbus_scan_2nd_address_range(mbus_handle * handle, int pos, char *addr_mask);
|
||||
/**
|
||||
* Convert a buffer with hex values into a buffer with binary values.
|
||||
*
|
||||
* @param src_buff source buffer with hex values
|
||||
* @param src_len byte count of source buffer
|
||||
* @param dest_buff destination buffer with binary values
|
||||
* @param dest_len byte count of destination buffer
|
||||
* @param dst destination buffer with binary values
|
||||
* @param dst_len byte count of destination buffer
|
||||
* @param src source buffer with hex values
|
||||
* @param src_len byte count of source buffer
|
||||
*
|
||||
* @return byte count of successful converted values
|
||||
*/
|
||||
|
Reference in New Issue
Block a user