free_auxdata() added to mbus_handle interface for freeing context specific data

This commit is contained in:
jakubovsky
2012-07-04 19:08:51 +02:00
parent 645e5eb482
commit 34255c7237
6 changed files with 49 additions and 0 deletions

View File

@ -77,6 +77,7 @@ struct _mbus_handle {
int (*close) (struct _mbus_handle *handle);
int (*send) (struct _mbus_handle *handle, mbus_frame *frame);
int (*recv) (struct _mbus_handle *handle, mbus_frame *frame);
void (*free_auxdata) (struct _mbus_handle *handle);
void *auxdata;
};
@ -159,6 +160,14 @@ mbus_handle * mbus_context_serial(const char *device);
mbus_handle * mbus_context_tcp(const char *host, int port);
/**
* Deallocate memory used by M-Bus context.
*
* @param handle Initialized handle
*
*/
void mbus_context_free(mbus_handle * handle);
/**
* Connect to serial bus or TCP gateway depending on context.
*
* @param handle Initialized handle