SmartSnippets DA1459x SDK
dlg_debug.h
Go to the documentation of this file.
1 
43 #ifndef DLG_DEBUG_H_
44 #define DLG_DEBUG_H_
45 
46 #include "ble_service.h"
47 
48 
58 #define DLGDEBUG_HANDLER(CAT, CMD, CB, UD) \
59  { \
60  .cat = (CAT), \
61  .cmd = (CMD), \
62  .cb = (CB), \
63  .ud = (UD) \
64  }
65 
75 typedef void (* dlgdebug_call_cb_t) (uint16_t conn_idx, int argc, char **argv, void *ud);
76 
80 typedef struct {
82  const char *cat;
84  const char *cmd;
88  void *ud;
90 
102 
117 void dlgdebug_register_handler(ble_service_t *svc, const char *cat, const char *cmd,
118  dlgdebug_call_cb_t cb, void *ud);
119 
130 void dlgdebug_register_handlers(ble_service_t *svc, size_t len, const dlgdebug_handler_t *handlers);
131 
142 void dlgdebug_notify_str(ble_service_t *svc, uint16_t conn_idx, const char *fmt, ...);
143 
144 #endif /* DLG_DEBUG_H_ */
145 
dlgdebug_handler_t::cat
const char * cat
Definition: dlg_debug.h:82
dlgdebug_register_handler
void dlgdebug_register_handler(ble_service_t *svc, const char *cat, const char *cmd, dlgdebug_call_cb_t cb, void *ud)
Register handler.
dlgdebug_register_handlers
void dlgdebug_register_handlers(ble_service_t *svc, size_t len, const dlgdebug_handler_t *handlers)
Register handlers.
dlgdebug_handler_t::cb
dlgdebug_call_cb_t cb
Definition: dlg_debug.h:86
ble_service.h
Services handling routines API.
dlgdebug_handler_t
Definition: dlg_debug.h:80
dlgdebug_notify_str
void dlgdebug_notify_str(ble_service_t *svc, uint16_t conn_idx, const char *fmt,...)
Notification strings.
dlgdebug_handler_t::ud
void * ud
Definition: dlg_debug.h:88
dlgdebug_call_cb_t
void(* dlgdebug_call_cb_t)(uint16_t conn_idx, int argc, char **argv, void *ud)
Command handler callback.
Definition: dlg_debug.h:75
dlgdebug_init
ble_service_t * dlgdebug_init(const ble_service_config_t *cfg)
Register DLG debug instance.
dlgdebug_handler_t::cmd
const char * cmd
Definition: dlg_debug.h:84
ble_service_config_t
Definition: ble_service.h:150
ble_service
Definition: ble_service.h:132