Add protocol module API library
This commit is contained in:
parent
77199be682
commit
7d4283f8f5
7 changed files with 71 additions and 7 deletions
|
@ -59,7 +59,11 @@ size_t gmrf_iface_get_mtu(gmrf_t *gmrf, gmrf_iface_t *iface);
|
|||
bool gmrf_iface_send(gmrf_t *gmrf, gmrf_iface_t *iface, const void *data, size_t len, const gmrf_addr_t *dest);
|
||||
bool gmrf_iface_send_bc(gmrf_t *gmrf, gmrf_iface_t *iface, const void *data, size_t len);
|
||||
|
||||
gmrf_context_t* gmrf_init(gmrf_t *gmrf);
|
||||
void gmrf_handle_packet(gmrf_t *gmrf, gmrf_context_t *ctx, gmrf_iface_t *iface, const gmrf_addr_t *source, const void *data, size_t len);
|
||||
/* implemented by protocol */
|
||||
extern const char *gmrf_protocol_name;
|
||||
extern const char *gmrf_protocol_version;
|
||||
|
||||
gmrf_context_t* gmrf_protocol_init(gmrf_t *gmrf);
|
||||
void gmrf_protocol_handle_packet(gmrf_t *gmrf, gmrf_context_t *ctx, gmrf_iface_t *iface, const gmrf_addr_t *source, const void *data, size_t len);
|
||||
|
||||
#endif /* _GMRF_GMRF_H_ */
|
||||
|
|
|
@ -31,8 +31,8 @@
|
|||
|
||||
|
||||
typedef struct mmss_protocol {
|
||||
const char *name;
|
||||
const char *version;
|
||||
const char* (*get_name)(void);
|
||||
const char* (*get_version)(void);
|
||||
|
||||
gmrf_context_t* (*init)(gmrf_t *gmrf);
|
||||
void (*handle_packet)(gmrf_t *gmrf, gmrf_context_t *ctx, gmrf_iface_t *iface, const gmrf_addr_t *source, const void *data, size_t len);
|
||||
|
|
Reference in a new issue