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
This commit is contained in:
Stefan Wahren
2013-10-13 21:49:40 +02:00
parent 9e23818152
commit 0cf57bfc35
6 changed files with 53 additions and 60 deletions

View File

@ -513,18 +513,9 @@ typedef struct _mbus_data_secondary_address {
//
// Event callback functions
//
extern void (*_mbus_recv_event)(unsigned char src_type, const char *buff, size_t len);
extern void (*_mbus_send_event)(unsigned char src_type, const char *buff, size_t len);
void mbus_dump_recv_event(unsigned char src_type, const char *buff, size_t len);
void mbus_dump_send_event(unsigned char src_type, const char *buff, size_t len);
//
// Event register functions
//
void mbus_register_recv_event(void (*event)(unsigned char src_type, const char *buff, size_t len));
void mbus_register_send_event(void (*event)(unsigned char src_type, const char *buff, size_t len));
//
// variable length records
//