SmartSnippets DA1459x SDK
Files | Data Structures | Macros | Typedefs | Functions

Debug service API. More...

Files

file  dlg_debug.h
 Debug service API.
 

Data Structures

struct  dlgdebug_handler_t
 

Macros

#define DLGDEBUG_HANDLER(CAT, CMD, CB, UD)
 Create debug handler. More...
 

Typedefs

typedef void(* dlgdebug_call_cb_t) (uint16_t conn_idx, int argc, char **argv, void *ud)
 Command handler callback. More...
 

Functions

ble_service_tdlgdebug_init (const ble_service_config_t *cfg)
 Register DLG debug instance. More...
 
void dlgdebug_register_handler (ble_service_t *svc, const char *cat, const char *cmd, dlgdebug_call_cb_t cb, void *ud)
 Register handler. More...
 
void dlgdebug_register_handlers (ble_service_t *svc, size_t len, const dlgdebug_handler_t *handlers)
 Register handlers. More...
 
void dlgdebug_notify_str (ble_service_t *svc, uint16_t conn_idx, const char *fmt,...)
 Notification strings. More...
 

Detailed Description

Debug service API.

Macro Definition Documentation

◆ DLGDEBUG_HANDLER

#define DLGDEBUG_HANDLER (   CAT,
  CMD,
  CB,
  UD 
)
Value:
{ \
.cat = (CAT), \
.cmd = (CMD), \
.cb = (CB), \
.ud = (UD) \
}

Create debug handler.

Parameters
[in]CATcategory
[in]CMDcommand
[in]CBapplication callback
[in]UDuser data

Typedef Documentation

◆ dlgdebug_call_cb_t

typedef void(* dlgdebug_call_cb_t) (uint16_t conn_idx, int argc, char **argv, void *ud)

Command handler callback.

Parameters
[in]conn_idxconnection index
[in]argcarguments count
[in]argvstring arguments
[in]uduser data

Function Documentation

◆ dlgdebug_init()

ble_service_t* dlgdebug_init ( const ble_service_config_t cfg)

Register DLG debug instance.

Function registers DLG debug service with UUID 6b559111-c4df-4660-818e-234f9e17b290.

Parameters
[in]cfggeneral service configuration
Returns
service instance

◆ dlgdebug_notify_str()

void dlgdebug_notify_str ( ble_service_t svc,
uint16_t  conn_idx,
const char *  fmt,
  ... 
)

Notification strings.

Send notification to connected peer.

Parameters
[in]svcservice instance
[in]conn_idxconnection index
[in]fmtstring data

◆ 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.

Registers handler when command is written to CP characteristic of Debug Service. Command has format "<cat> <cmd> <...>". Characteristic UUID: 6b559111-c4df-4660-818e-234f9e17b291.

Parameters
[in]svcservice instance
[in]catcategory
[in]cmdcommand
[in]cbapplication callback
[in]uduser data

◆ dlgdebug_register_handlers()

void dlgdebug_register_handlers ( ble_service_t svc,
size_t  len,
const dlgdebug_handler_t handlers 
)

Register handlers.

Registers handlers array. See dlgdebug_register_handler function's description for more details.

Parameters
[in]svcservice instance
[in]lenarray length
[in]handlersdebug handlers array