Android Hardware Abstraction Layer
Macros | Typedefs | Functions | Variables
bt_trace.h File Reference

Go to the source code of this file.

Macros

#define BTTRC_INCLUDED   FALSE
 
#define BTTRC_PARSER_INCLUDED   FALSE
 
#define MAX_TRACE_RAM_SIZE   10000
 
#define BTTRC_ID_STK_GKI   1
 
#define BTTRC_ID_STK_BTU   2
 
#define BTTRC_ID_STK_HCI   3
 
#define BTTRC_ID_STK_L2CAP   4
 
#define BTTRC_ID_STK_RFCM_MX   5
 
#define BTTRC_ID_STK_RFCM_PRT   6
 
#define BTTRC_ID_STK_OBEX_C   7
 
#define BTTRC_ID_STK_OBEX_S   8
 
#define BTTRC_ID_STK_AVCT   9
 
#define BTTRC_ID_STK_AVDT   10
 
#define BTTRC_ID_STK_AVRC   11
 
#define BTTRC_ID_STK_BIC   12
 
#define BTTRC_ID_STK_BIS   13
 
#define BTTRC_ID_STK_BNEP   14
 
#define BTTRC_ID_STK_BPP   15
 
#define BTTRC_ID_STK_BTM_ACL   16
 
#define BTTRC_ID_STK_BTM_PM   17
 
#define BTTRC_ID_STK_BTM_DEV_CTRL   18
 
#define BTTRC_ID_STK_BTM_SVC_DSC   19
 
#define BTTRC_ID_STK_BTM_INQ   20
 
#define BTTRC_ID_STK_BTM_SCO   21
 
#define BTTRC_ID_STK_BTM_SEC   22
 
#define BTTRC_ID_STK_DUN   23
 
#define BTTRC_ID_STK_HID   24
 
#define BTTRC_ID_STK_HSP2   25
 
#define BTTRC_ID_STK_CTP   26
 
#define BTTRC_ID_STK_FTC   27
 
#define BTTRC_ID_STK_FTS   28
 
#define BTTRC_ID_STK_GAP   29
 
#define BTTRC_ID_STK_GOEP   30
 
#define BTTRC_ID_STK_HCRP   31
 
#define BTTRC_ID_STK_ICP   32
 
#define BTTRC_ID_STK_OPC   33
 
#define BTTRC_ID_STK_OPS   34
 
#define BTTRC_ID_STK_PAN   35
 
#define BTTRC_ID_STK_SAP   36
 
#define BTTRC_ID_STK_SDP   37
 
#define BTTRC_ID_STK_SLIP   38
 
#define BTTRC_ID_STK_SPP   39
 
#define BTTRC_ID_STK_TCS   40
 
#define BTTRC_ID_STK_VDP   41
 
#define BTTRC_ID_STK_AMP   42
 
#define BTTRC_ID_STK_MCAP   43
 
#define BTTRC_ID_STK_GATT   44
 
#define BTTRC_ID_STK_SMP   45
 
#define BTTRC_ID_STK_NFC   46
 
#define BTTRC_ID_STK_NCI   47
 
#define BTTRC_ID_STK_IDEP   48
 
#define BTTRC_ID_STK_NDEP   49
 
#define BTTRC_ID_STK_LLCP   50
 
#define BTTRC_ID_STK_RW   51
 
#define BTTRC_ID_STK_CE   52
 
#define BTTRC_ID_STK_SNEP   53
 
#define BTTRC_ID_STK_NDEF   54
 
#define BTTRC_ID_BTA_ACC   55 /* Advanced Camera Client */
 
#define BTTRC_ID_BTA_AG   56 /* audio gateway */
 
#define BTTRC_ID_BTA_AV   57 /* Advanced audio */
 
#define BTTRC_ID_BTA_BIC   58 /* Basic Imaging Client */
 
#define BTTRC_ID_BTA_BIS   59 /* Basic Imaging Server */
 
#define BTTRC_ID_BTA_BP   60 /* Basic Printing Client */
 
#define BTTRC_ID_BTA_CG   61
 
#define BTTRC_ID_BTA_CT   62 /* cordless telephony terminal */
 
#define BTTRC_ID_BTA_DG   63 /* data gateway */
 
#define BTTRC_ID_BTA_DM   64 /* device manager */
 
#define BTTRC_ID_BTA_DM_SRCH   65 /* device manager search */
 
#define BTTRC_ID_BTA_DM_SEC   66 /* device manager security */
 
#define BTTRC_ID_BTA_FM   67
 
#define BTTRC_ID_BTA_FTC   68 /* file transfer client */
 
#define BTTRC_ID_BTA_FTS   69 /* file transfer server */
 
#define BTTRC_ID_BTA_HIDH   70
 
#define BTTRC_ID_BTA_HIDD   71
 
#define BTTRC_ID_BTA_JV   72
 
#define BTTRC_ID_BTA_OPC   73 /* object push client */
 
#define BTTRC_ID_BTA_OPS   74 /* object push server */
 
#define BTTRC_ID_BTA_PAN   75 /* Personal Area Networking */
 
#define BTTRC_ID_BTA_PR   76 /* Printer client */
 
#define BTTRC_ID_BTA_SC   77 /* SIM Card Access server */
 
#define BTTRC_ID_BTA_SS   78 /* synchronization server */
 
#define BTTRC_ID_BTA_SYS   79 /* system manager */
 
#define BTTRC_ID_AVDT_SCB   80 /* avdt scb */
 
#define BTTRC_ID_AVDT_CCB   81 /* avdt ccb */
 
#define BTTRC_ID_BTAPP   82
 
#define BTTRC_ID_MAX_ID   BTTRC_ID_BTAPP
 
#define BTTRC_ID_ALL_LAYERS   0xFF /* all trace layers */
 
#define BTTRC_TYPE_ERROR   0x81
 
#define BTTRC_TYPE_WARNING   0x82
 
#define BTTRC_TYPE_API   0x84
 
#define BTTRC_TYPE_EVENT   0x88
 
#define BTTRC_TYPE_ACTION   0x90
 
#define BTTRC_TYPE_DBG   0xA0
 
#define BTTRC_TRACE_LITE   0x80 /* MM Lite stack */
 
#define BTTRC_TRACE_EMBD   0x40 /* Embedded host stack */
 
#define BTTRC_PARAM_UINT8   1
 
#define BTTRC_PARAM_UINT16   2
 
#define BTTRC_PARAM_UINT32   3
 
#define BTTRC_TOKEN_SM_STATE   0xFFFF /* Token indicating the State of a State m/c */
 
#define BT_TRACE_VERBOSE   FALSE
 
#define BT_USE_TRACES   TRUE
 
#define BT_TRACE_PROTOCOL   FALSE /* Android requires FALSE */
 
#define HCI_INITIAL_TRACE_LEVEL   BT_TRACE_LEVEL_DEBUG
 
#define BTM_INITIAL_TRACE_LEVEL   BT_TRACE_LEVEL_DEBUG
 
#define L2CAP_INITIAL_TRACE_LEVEL   BT_TRACE_LEVEL_DEBUG
 
#define LLCP_INITIAL_TRACE_LEVEL   BT_TRACE_LEVEL_DEBUG
 
#define AMP_INITIAL_TRACE_LEVEL   BT_TRACE_LEVEL_DEBUG
 
#define RFCOMM_INITIAL_TRACE_LEVEL   BT_TRACE_LEVEL_DEBUG
 
#define OBX_INITIAL_TRACE_LEVEL   BT_TRACE_LEVEL_DEBUG
 
#define SDP_INITIAL_TRACE_LEVEL   BT_TRACE_LEVEL_DEBUG
 
#define TCS_INITIAL_TRACE_LEVEL   BT_TRACE_LEVEL_DEBUG
 
#define DUN_INITIAL_TRACE_LEVEL   BT_TRACE_LEVEL_DEBUG
 
#define GAP_INITIAL_TRACE_LEVEL   BT_TRACE_LEVEL_DEBUG
 
#define GOEP_INITIAL_TRACE_LEVEL   BT_TRACE_LEVEL_DEBUG
 
#define HSP2_INITIAL_TRACE_LEVEL   BT_TRACE_LEVEL_DEBUG
 
#define SPP_INITIAL_TRACE_LEVEL   BT_TRACE_LEVEL_DEBUG
 
#define ICP_INITIAL_TRACE_LEVEL   BT_TRACE_LEVEL_DEBUG
 
#define CTP_INITIAL_TRACE_LEVEL   BT_TRACE_LEVEL_DEBUG
 
#define HCRP_INITIAL_TRACE_LEVEL   BT_TRACE_LEVEL_DEBUG
 
#define HCRPM_INITIAL_TRACE_LEVEL   BT_TRACE_LEVEL_DEBUG
 
#define BPP_INITIAL_TRACE_LEVEL   BT_TRACE_LEVEL_DEBUG
 
#define BIP_INITIAL_TRACE_LEVEL   BT_TRACE_LEVEL_DEBUG
 
#define BNEP_INITIAL_TRACE_LEVEL   BT_TRACE_LEVEL_DEBUG
 
#define PAN_INITIAL_TRACE_LEVEL   BT_TRACE_LEVEL_DEBUG
 
#define SAP_INITIAL_TRACE_LEVEL   BT_TRACE_LEVEL_DEBUG
 
#define FTP_INITIAL_TRACE_LEVEL   BT_TRACE_LEVEL_DEBUG
 
#define OPP_INITIAL_TRACE_LEVEL   BT_TRACE_LEVEL_DEBUG
 
#define HFP_INITIAL_TRACE_LEVEL   BT_TRACE_LEVEL_DEBUG
 
#define A2D_INITIAL_TRACE_LEVEL   BT_TRACE_LEVEL_DEBUG
 
#define VDP_INITIAL_TRACE_LEVEL   BT_TRACE_LEVEL_DEBUG
 
#define AVDT_INITIAL_TRACE_LEVEL   BT_TRACE_LEVEL_DEBUG
 
#define AVCT_INITIAL_TRACE_LEVEL   BT_TRACE_LEVEL_DEBUG
 
#define AVRC_INITIAL_TRACE_LEVEL   BT_TRACE_LEVEL_DEBUG
 
#define MCA_INITIAL_TRACE_LEVEL   BT_TRACE_LEVEL_DEBUG
 
#define HID_INITIAL_TRACE_LEVEL   BT_TRACE_LEVEL_DEBUG
 
#define RPC_INITIAL_TRACE_LEVEL   BT_TRACE_LEVEL_DEBUG
 
#define APPL_INITIAL_TRACE_LEVEL   BT_TRACE_LEVEL_DEBUG
 
#define BT_TRACE_APPL   BT_USE_TRACES
 
#define NFC_INITIAL_TRACE_LEVEL   BT_TRACE_LEVEL_DEBUG
 
#define GATT_INITIAL_TRACE_LEVEL   BT_TRACE_LEVEL_DEBUG
 
#define SMP_INITIAL_TRACE_LEVEL   BT_TRACE_LEVEL_DEBUG
 
#define BTTRC_EVENT(lid, event, state)   {BTTRC_StackTrace1(lid, BTTRC_TYPE_EVENT, event, BTTRC_PARAM_UINT8, state);}
 
#define BTTRC_ACTION(lid, action)   {BTTRC_StackTrace0(lid, BTTRC_TYPE_ACTION, action);}
 
#define BTTRC_STATE(lid, state)   {BTTRC_StackTrace1(lid, BTTRC_TYPE_EVENT, BTTRC_TOKEN_SM_STATE, BTTRC_PARAM_UINT8, state);}
 
#define BTTRC_API0(lid, api)   {BTTRC_StackTrace0(lid, BTTRC_TYPE_API, api);}
 
#define BTTRC_API1(lid, api, p1_t, p1_v)   {BTTRC_StackTrace1(lid, BTTRC_TYPE_API, api, p1_t,p1_v);}
 
#define BTTRC_API2(lid, api, p1_t, p1_v, p2_t, p2_v)   {BTTRC_StackTrace2(lid, BTTRC_TYPE_API, api, p1_t,p1_v,p2_t,p2_v);}
 
#define BTTRC_API3(lid, api, p1_t, p1_v, p2_t, p2_v, p3_t, p3_v)   {BTTRC_StackTrace3(lid, BTTRC_TYPE_API, api, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v);}
 
#define BTTRC_API4(lid, api, p1_t, p1_v, p2_t, p2_v, p3_t, p3_v, p4_t, p4_v)   {BTTRC_StackTrace4(lid, BTTRC_TYPE_API, api, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v);}
 
#define BTTRC_API5(lid, api, p1_t, p1_v, p2_t, p2_v, p3_t, p3_v, p4_t, p4_v, p5_t, p5_v)   {BTTRC_StackTrace5(lid, BTTRC_TYPE_API, api, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v);}
 
#define BTTRC_API6(lid, api, p1_t, p1_v, p2_t, p2_v, p3_t, p3_v, p4_t, p4_v, p5_t, p5_v, p6_t, p6_v)   {BTTRC_StackTrace6(lid, BTTRC_TYPE_API, api, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v,p6_t,p6_v);}
 
#define BTTRC_DBG0(lid, dbg)   {BTTRC_StackTrace0(lid, BTTRC_TYPE_DBG, dbg);}
 
#define BTTRC_DBG1(lid, dbg, p1_t, p1_v)   {BTTRC_StackTrace1(lid, BTTRC_TYPE_DBG, dbg, p1_t,p1_v);}
 
#define BTTRC_DBG2(lid, dbg, p1_t, p1_v, p2_t, p2_v)   {BTTRC_StackTrace2(lid, BTTRC_TYPE_DBG, dbg, p1_t,p1_v,p2_t,p2_v);}
 
#define BTTRC_DBG3(lid, dbg, p1_t, p1_v, p2_t, p2_v, p3_t, p3_v)   {BTTRC_StackTrace3(lid, BTTRC_TYPE_DBG, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v);}
 
#define BTTRC_DBG4(lid, dbg, p1_t, p1_v, p2_t, p2_v, p3_t, p3_v, p4_t, p4_v)   {BTTRC_StackTrace4(lid, BTTRC_TYPE_DBG, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v);}
 
#define BTTRC_DBG5(lid, dbg, p1_t, p1_v, p2_t, p2_v, p3_t, p3_v, p4_t, p4_v, p5_t, p5_v)   {BTTRC_StackTrace5(lid, BTTRC_TYPE_DBG, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v);}
 
#define BTTRC_DBG6(lid, dbg, p1_t, p1_v, p2_t, p2_v, p3_t, p3_v, p4_t, p4_v, p5_t, p5_v, p6_t, p6_v)   {BTTRC_StackTrace6(lid, BTTRC_TYPE_DBG, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v,p6_t,p6_v);}
 
#define BTTRC_AVDT_API0(api)   BTTRC_API0(BTTRC_ID_STK_AVDT, api)
 
#define BTTRC_AVDT_API1(api, p1_t, p1_v)   BTTRC_API1(BTTRC_ID_STK_AVDT, api, p1_t, p1_v)
 
#define BTTRC_AVDT_API2(api, p1_t, p1_v, p2_t, p2_v)   BTTRC_API2(BTTRC_ID_STK_AVDT, api, p1_t, p1_v, p2_t, p2_v)
 
#define BTTRC_AVDT_SCB_EVENT(event, state)   BTTRC_EVENT(BTTRC_ID_AVDT_SCB, event, state)
 
#define BTTRC_AVDT_SCB_ACTION(action)   BTTRC_ACTION(BTTRC_ID_AVDT_SCB, action)
 
#define BTTRC_AVDT_SCB_STATE(next_state)   BTTRC_STATE(BTTRC_ID_AVDT_SCB, next_state)
 
#define BTTRC_AVDT_SCB_DBG0(dbg)   BTTRC_DBG0(BTTRC_ID_AVDT_SCB, dbg)
 
#define BTTRC_AVDT_SCB_DBG1(dbg, p1_t, p1_v)   BTTRC_DBG1(BTTRC_ID_AVDT_SCB, dbg, p1_t,p1_v)
 
#define BTTRC_AVDT_SCB_DBG2(dbg, p1_t, p1_v, p2_t, p2_v)   BTTRC_DBG2(BTTRC_ID_AVDT_SCB, dbg, p1_t,p1_v,p2_t,p2_v)
 
#define BTTRC_AVDT_SCB_DBG3(dbg, p1_t, p1_v, p2_t, p2_v, p3_t, p3_v)   BTTRC_DBG3(BTTRC_ID_AVDT_SCB, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v)
 
#define BTTRC_AVDT_SCB_DBG4(dbg, p1_t, p1_v, p2_t, p2_v, p3_t, p3_v, p4_t, p4_v)   BTTRC_DBG4(BTTRC_ID_AVDT_SCB, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v)
 
#define BTTRC_AVDT_SCB_DBG5(dbg, p1_t, p1_v, p2_t, p2_v, p3_t, p3_v, p4_t, p4_v, p5_t, p5_v)   BTTRC_DBG5(BTTRC_ID_AVDT_SCB, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v)
 
#define BTTRC_AVDT_SCB_DBG6(dbg, p1_t, p1_v, p2_t, p2_v, p3_t, p3_v, p4_t, p4_v, p5_t, p5_v, p6_t, p6_v)   BTTRC_DBG6(BTTRC_ID_AVDT_SCB, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v,p6_t,p6_v)
 
#define BTTRC_AVDT_CCB_EVENT(event, state)   BTTRC_EVENT(BTTRC_ID_AVDT_CCB, event, state)
 
#define BTTRC_AVDT_CCB_ACTION(action)   BTTRC_ACTION(BTTRC_ID_AVDT_CCB, action)
 
#define BTTRC_AVDT_CCB_STATE(next_state)   BTTRC_STATE(BTTRC_ID_AVDT_CCB, next_state)
 
#define BTTRC_AVDT_CCB_DBG0(dbg)   BTTRC_DBG0(BTTRC_ID_AVDT_CCB, dbg)
 
#define BTTRC_AVDT_CCB_DBG1(dbg, p1_t, p1_v)   BTTRC_DBG1(BTTRC_ID_AVDT_CCB, dbg, p1_t,p1_v)
 
#define BTTRC_AVDT_CCB_DBG2(dbg, p1_t, p1_v, p2_t, p2_v)   BTTRC_DBG2(BTTRC_ID_AVDT_CCB, dbg, p1_t,p1_v,p2_t,p2_v)
 
#define BTTRC_AVDT_CCB_DBG3(dbg, p1_t, p1_v, p2_t, p2_v, p3_t, p3_v)   BTTRC_DBG3(BTTRC_ID_AVDT_CCB, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v)
 
#define BTTRC_AVDT_CCB_DBG4(dbg, p1_t, p1_v, p2_t, p2_v, p3_t, p3_v, p4_t, p4_v)   BTTRC_DBG4(BTTRC_ID_AVDT_CCB, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v)
 
#define BTTRC_AVDT_CCB_DBG5(dbg, p1_t, p1_v, p2_t, p2_v, p3_t, p3_v, p4_t, p4_v, p5_t, p5_v)   BTTRC_DBG5(BTTRC_ID_AVDT_CCB, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v)
 
#define BTTRC_AVDT_CCB_DBG6(dbg, p1_t, p1_v, p2_t, p2_v, p3_t, p3_v, p4_t, p4_v, p5_t, p5_v, p6_t, p6_v)   BTTRC_DBG6(BTTRC_ID_AVDT_CCB, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v,p6_t,p6_v)
 
#define BT_TRACE_0(l, t, m)   LogMsg_0((TRACE_CTRL_GENERAL | (l) | TRACE_ORG_STACK | (t)),(m))
 
#define BT_TRACE_1(l, t, m, p1)   LogMsg_1(TRACE_CTRL_GENERAL | (l) | TRACE_ORG_STACK | (t),(m),(UINT32)(p1))
 
#define BT_TRACE_2(l, t, m, p1, p2)
 
#define BT_TRACE_3(l, t, m, p1, p2, p3)
 
#define BT_TRACE_4(l, t, m, p1, p2, p3, p4)
 
#define BT_TRACE_5(l, t, m, p1, p2, p3, p4, p5)
 
#define BT_TRACE_6(l, t, m, p1, p2, p3, p4, p5, p6)
 
#define BT_ERROR_TRACE_0(l, m)   LogMsg_0(TRACE_CTRL_GENERAL | (l) | TRACE_ORG_STACK | TRACE_TYPE_ERROR,(m))
 
#define BT_ERROR_TRACE_1(l, m, p1)   LogMsg_1(TRACE_CTRL_GENERAL | (l) | TRACE_ORG_STACK | TRACE_TYPE_ERROR,(m),(UINT32)(p1))
 
#define BT_ERROR_TRACE_2(l, m, p1, p2)   LogMsg_2(TRACE_CTRL_GENERAL | (l) | TRACE_ORG_STACK | TRACE_TYPE_ERROR,(m),(UINT32)(p1),(UINT32)(p2))
 
#define BT_ERROR_TRACE_3(l, m, p1, p2, p3)   LogMsg_3(TRACE_CTRL_GENERAL | (l) | TRACE_ORG_STACK | TRACE_TYPE_ERROR,(m),(UINT32)(p1),(UINT32)(p2),(UINT32)(p3))
 
#define HCI_TRACE_ERROR0(m)   {if (btu_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_HCI, TRACE_TYPE_ERROR, m);}
 
#define HCI_TRACE_ERROR1(m, p1)   {if (btu_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_HCI, TRACE_TYPE_ERROR, m,p1);}
 
#define HCI_TRACE_ERROR2(m, p1, p2)   {if (btu_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_HCI, TRACE_TYPE_ERROR, m,p1,p2);}
 
#define HCI_TRACE_ERROR3(m, p1, p2, p3)   {if (btu_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_HCI, TRACE_TYPE_ERROR, m,p1,p2,p3);}
 
#define HCI_TRACE_ERROR4(m, p1, p2, p3, p4)   {if (btu_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_HCI, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
 
#define HCI_TRACE_ERROR5(m, p1, p2, p3, p4, p5)   {if (btu_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_HCI, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
 
#define HCI_TRACE_ERROR6(m, p1, p2, p3, p4, p5, p6)   {if (btu_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_HCI, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
 
#define HCI_TRACE_WARNING0(m)   {if (btu_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_HCI, TRACE_TYPE_WARNING, m);}
 
#define HCI_TRACE_WARNING1(m, p1)   {if (btu_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_HCI, TRACE_TYPE_WARNING, m,p1);}
 
#define HCI_TRACE_WARNING2(m, p1, p2)   {if (btu_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_HCI, TRACE_TYPE_WARNING, m,p1,p2);}
 
#define HCI_TRACE_WARNING3(m, p1, p2, p3)   {if (btu_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_HCI, TRACE_TYPE_WARNING, m,p1,p2,p3);}
 
#define HCI_TRACE_WARNING4(m, p1, p2, p3, p4)   {if (btu_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_HCI, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
 
#define HCI_TRACE_WARNING5(m, p1, p2, p3, p4, p5)   {if (btu_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_HCI, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
 
#define HCI_TRACE_WARNING6(m, p1, p2, p3, p4, p5, p6)   {if (btu_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_HCI, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
 
#define HCI_TRACE_EVENT0(m)   {if (btu_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_HCI, TRACE_TYPE_EVENT, m);}
 
#define HCI_TRACE_EVENT1(m, p1)   {if (btu_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_HCI, TRACE_TYPE_EVENT, m, p1);}
 
#define HCI_TRACE_EVENT2(m, p1, p2)   {if (btu_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_HCI, TRACE_TYPE_EVENT, m,p1,p2);}
 
#define HCI_TRACE_EVENT3(m, p1, p2, p3)   {if (btu_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_HCI, TRACE_TYPE_EVENT, m,p1,p2,p3);}
 
#define HCI_TRACE_EVENT4(m, p1, p2, p3, p4)   {if (btu_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_HCI, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
 
#define HCI_TRACE_EVENT5(m, p1, p2, p3, p4, p5)   {if (btu_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_HCI, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
 
#define HCI_TRACE_EVENT6(m, p1, p2, p3, p4, p5, p6)   {if (btu_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_HCI, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
 
#define HCI_TRACE_DEBUG0(m)   {if (btu_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_HCI, TRACE_TYPE_DEBUG, m);}
 
#define HCI_TRACE_DEBUG1(m, p1)   {if (btu_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_HCI, TRACE_TYPE_DEBUG, m,p1);}
 
#define HCI_TRACE_DEBUG2(m, p1, p2)   {if (btu_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_HCI, TRACE_TYPE_DEBUG, m,p1,p2);}
 
#define HCI_TRACE_DEBUG3(m, p1, p2, p3)   {if (btu_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_HCI, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
 
#define HCI_TRACE_DEBUG4(m, p1, p2, p3, p4)   {if (btu_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_HCI, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
 
#define HCI_TRACE_DEBUG5(m, p1, p2, p3, p4, p5)   {if (btu_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_HCI, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
 
#define HCI_TRACE_DEBUG6(m, p1, p2, p3, p4, p5, p6)   {if (btu_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_HCI, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
 
#define BTM_TRACE_ERROR0(m)   {if (btm_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_BTM, TRACE_TYPE_ERROR, m);}
 
#define BTM_TRACE_ERROR1(m, p1)   {if (btm_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_BTM, TRACE_TYPE_ERROR, m,p1);}
 
#define BTM_TRACE_ERROR2(m, p1, p2)   {if (btm_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_BTM, TRACE_TYPE_ERROR, m,p1,p2);}
 
#define BTM_TRACE_ERROR3(m, p1, p2, p3)   {if (btm_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_BTM, TRACE_TYPE_ERROR, m,p1,p2,p3);}
 
#define BTM_TRACE_ERROR4(m, p1, p2, p3, p4)   {if (btm_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_BTM, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
 
#define BTM_TRACE_ERROR5(m, p1, p2, p3, p4, p5)   {if (btm_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_BTM, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
 
#define BTM_TRACE_ERROR6(m, p1, p2, p3, p4, p5, p6)   {if (btm_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_BTM, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
 
#define BTM_TRACE_WARNING0(m)   {if (btm_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_BTM, TRACE_TYPE_WARNING, m);}
 
#define BTM_TRACE_WARNING1(m, p1)   {if (btm_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_BTM, TRACE_TYPE_WARNING, m,p1);}
 
#define BTM_TRACE_WARNING2(m, p1, p2)   {if (btm_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_BTM, TRACE_TYPE_WARNING, m,p1,p2);}
 
#define BTM_TRACE_WARNING3(m, p1, p2, p3)   {if (btm_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_BTM, TRACE_TYPE_WARNING, m,p1,p2,p3);}
 
#define BTM_TRACE_WARNING4(m, p1, p2, p3, p4)   {if (btm_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_BTM, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
 
#define BTM_TRACE_WARNING5(m, p1, p2, p3, p4, p5)   {if (btm_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_BTM, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
 
#define BTM_TRACE_WARNING6(m, p1, p2, p3, p4, p5, p6)   {if (btm_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_BTM, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
 
#define BTM_TRACE_API0(m)   {if (btm_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_BTM, TRACE_TYPE_API, m);}
 
#define BTM_TRACE_API1(m, p1)   {if (btm_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_BTM, TRACE_TYPE_API, m, p1);}
 
#define BTM_TRACE_API2(m, p1, p2)   {if (btm_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_BTM, TRACE_TYPE_API, m,p1,p2);}
 
#define BTM_TRACE_API3(m, p1, p2, p3)   {if (btm_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_BTM, TRACE_TYPE_API, m,p1,p2,p3);}
 
#define BTM_TRACE_API4(m, p1, p2, p3, p4)   {if (btm_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_BTM, TRACE_TYPE_API, m,p1,p2,p3,p4);}
 
#define BTM_TRACE_API5(m, p1, p2, p3, p4, p5)   {if (btm_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_BTM, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
 
#define BTM_TRACE_API6(m, p1, p2, p3, p4, p5, p6)   {if (btm_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_BTM, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
 
#define BTM_TRACE_EVENT0(m)   {if (btm_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_BTM, TRACE_TYPE_EVENT, m);}
 
#define BTM_TRACE_EVENT1(m, p1)   {if (btm_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_BTM, TRACE_TYPE_EVENT, m, p1);}
 
#define BTM_TRACE_EVENT2(m, p1, p2)   {if (btm_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_BTM, TRACE_TYPE_EVENT, m,p1,p2);}
 
#define BTM_TRACE_EVENT3(m, p1, p2, p3)   {if (btm_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_BTM, TRACE_TYPE_EVENT, m,p1,p2,p3);}
 
#define BTM_TRACE_EVENT4(m, p1, p2, p3, p4)   {if (btm_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_BTM, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
 
#define BTM_TRACE_EVENT5(m, p1, p2, p3, p4, p5)   {if (btm_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_BTM, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
 
#define BTM_TRACE_EVENT6(m, p1, p2, p3, p4, p5, p6)   {if (btm_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_BTM, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
 
#define BTM_TRACE_DEBUG0(m)   {if (btm_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_BTM, TRACE_TYPE_DEBUG, m);}
 
#define BTM_TRACE_DEBUG1(m, p1)   {if (btm_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_BTM, TRACE_TYPE_DEBUG, m,p1);}
 
#define BTM_TRACE_DEBUG2(m, p1, p2)   {if (btm_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_BTM, TRACE_TYPE_DEBUG, m,p1,p2);}
 
#define BTM_TRACE_DEBUG3(m, p1, p2, p3)   {if (btm_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_BTM, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
 
#define BTM_TRACE_DEBUG4(m, p1, p2, p3, p4)   {if (btm_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_BTM, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
 
#define BTM_TRACE_DEBUG5(m, p1, p2, p3, p4, p5)   {if (btm_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_BTM, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
 
#define BTM_TRACE_DEBUG6(m, p1, p2, p3, p4, p5, p6)   {if (btm_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_BTM, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
 
#define L2CAP_TRACE_ERROR0(m)   {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_L2CAP, TRACE_TYPE_ERROR, m);}
 
#define L2CAP_TRACE_ERROR1(m, p1)   {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_L2CAP, TRACE_TYPE_ERROR, m,p1);}
 
#define L2CAP_TRACE_ERROR2(m, p1, p2)   {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_L2CAP, TRACE_TYPE_ERROR, m,p1,p2);}
 
#define L2CAP_TRACE_ERROR3(m, p1, p2, p3)   {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_L2CAP, TRACE_TYPE_ERROR, m,p1,p2,p3);}
 
#define L2CAP_TRACE_ERROR4(m, p1, p2, p3, p4)   {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_L2CAP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
 
#define L2CAP_TRACE_ERROR5(m, p1, p2, p3, p4, p5)   {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_L2CAP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
 
#define L2CAP_TRACE_ERROR6(m, p1, p2, p3, p4, p5, p6)   {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_L2CAP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
 
#define L2CAP_TRACE_WARNING0(m)   {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_L2CAP, TRACE_TYPE_WARNING, m);}
 
#define L2CAP_TRACE_WARNING1(m, p1)   {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_L2CAP, TRACE_TYPE_WARNING, m,p1);}
 
#define L2CAP_TRACE_WARNING2(m, p1, p2)   {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_L2CAP, TRACE_TYPE_WARNING, m,p1,p2);}
 
#define L2CAP_TRACE_WARNING3(m, p1, p2, p3)   {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_L2CAP, TRACE_TYPE_WARNING, m,p1,p2,p3);}
 
#define L2CAP_TRACE_WARNING4(m, p1, p2, p3, p4)   {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_L2CAP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
 
#define L2CAP_TRACE_WARNING5(m, p1, p2, p3, p4, p5)   {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_L2CAP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
 
#define L2CAP_TRACE_WARNING6(m, p1, p2, p3, p4, p5, p6)   {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_L2CAP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
 
#define L2CAP_TRACE_API0(m)   {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_L2CAP, TRACE_TYPE_API, m);}
 
#define L2CAP_TRACE_API1(m, p1)   {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_L2CAP, TRACE_TYPE_API, m,p1);}
 
#define L2CAP_TRACE_API2(m, p1, p2)   {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_L2CAP, TRACE_TYPE_API, m,p1,p2);}
 
#define L2CAP_TRACE_API3(m, p1, p2, p3)   {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_L2CAP, TRACE_TYPE_API, m,p1,p2,p3);}
 
#define L2CAP_TRACE_API4(m, p1, p2, p3, p4)   {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_L2CAP, TRACE_TYPE_API, m,p1,p2,p3,p4);}
 
#define L2CAP_TRACE_API5(m, p1, p2, p3, p4, p5)   {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_L2CAP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
 
#define L2CAP_TRACE_API6(m, p1, p2, p3, p4, p5, p6)   {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_L2CAP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
 
#define L2CAP_TRACE_EVENT0(m)   {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_L2CAP, TRACE_TYPE_EVENT, m);}
 
#define L2CAP_TRACE_EVENT1(m, p1)   {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_L2CAP, TRACE_TYPE_EVENT, m, p1);}
 
#define L2CAP_TRACE_EVENT2(m, p1, p2)   {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_L2CAP, TRACE_TYPE_EVENT, m,p1,p2);}
 
#define L2CAP_TRACE_EVENT3(m, p1, p2, p3)   {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_L2CAP, TRACE_TYPE_EVENT, m,p1,p2,p3);}
 
#define L2CAP_TRACE_EVENT4(m, p1, p2, p3, p4)   {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_L2CAP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
 
#define L2CAP_TRACE_EVENT5(m, p1, p2, p3, p4, p5)   {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_L2CAP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
 
#define L2CAP_TRACE_EVENT6(m, p1, p2, p3, p4, p5, p6)   {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_L2CAP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
 
#define L2CAP_TRACE_DEBUG0(m)   {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_L2CAP, TRACE_TYPE_DEBUG, m);}
 
#define L2CAP_TRACE_DEBUG1(m, p1)   {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_L2CAP, TRACE_TYPE_DEBUG, m,p1);}
 
#define L2CAP_TRACE_DEBUG2(m, p1, p2)   {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_L2CAP, TRACE_TYPE_DEBUG, m,p1,p2);}
 
#define L2CAP_TRACE_DEBUG3(m, p1, p2, p3)   {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_L2CAP, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
 
#define L2CAP_TRACE_DEBUG4(m, p1, p2, p3, p4)   {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_L2CAP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
 
#define L2CAP_TRACE_DEBUG5(m, p1, p2, p3, p4, p5)   {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_L2CAP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
 
#define L2CAP_TRACE_DEBUG6(m, p1, p2, p3, p4, p5, p6)   {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_L2CAP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
 
#define LLCP_TRACE_ERROR0(m)   {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_LLCP, TRACE_TYPE_ERROR, m);}
 
#define LLCP_TRACE_ERROR1(m, p1)   {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_LLCP, TRACE_TYPE_ERROR, m,p1);}
 
#define LLCP_TRACE_ERROR2(m, p1, p2)   {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_LLCP, TRACE_TYPE_ERROR, m,p1,p2);}
 
#define LLCP_TRACE_ERROR3(m, p1, p2, p3)   {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_LLCP, TRACE_TYPE_ERROR, m,p1,p2,p3);}
 
#define LLCP_TRACE_ERROR4(m, p1, p2, p3, p4)   {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_LLCP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
 
#define LLCP_TRACE_ERROR5(m, p1, p2, p3, p4, p5)   {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_LLCP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
 
#define LLCP_TRACE_ERROR6(m, p1, p2, p3, p4, p5, p6)   {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_LLCP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
 
#define LLCP_TRACE_WARNING0(m)   {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_LLCP, TRACE_TYPE_WARNING, m);}
 
#define LLCP_TRACE_WARNING1(m, p1)   {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_LLCP, TRACE_TYPE_WARNING, m,p1);}
 
#define LLCP_TRACE_WARNING2(m, p1, p2)   {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_LLCP, TRACE_TYPE_WARNING, m,p1,p2);}
 
#define LLCP_TRACE_WARNING3(m, p1, p2, p3)   {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_LLCP, TRACE_TYPE_WARNING, m,p1,p2,p3);}
 
#define LLCP_TRACE_WARNING4(m, p1, p2, p3, p4)   {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_LLCP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
 
#define LLCP_TRACE_WARNING5(m, p1, p2, p3, p4, p5)   {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_LLCP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
 
#define LLCP_TRACE_WARNING6(m, p1, p2, p3, p4, p5, p6)   {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_LLCP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
 
#define LLCP_TRACE_API0(m)   {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_LLCP, TRACE_TYPE_API, m);}
 
#define LLCP_TRACE_API1(m, p1)   {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_LLCP, TRACE_TYPE_API, m,p1);}
 
#define LLCP_TRACE_API2(m, p1, p2)   {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_LLCP, TRACE_TYPE_API, m,p1,p2);}
 
#define LLCP_TRACE_API3(m, p1, p2, p3)   {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_LLCP, TRACE_TYPE_API, m,p1,p2,p3);}
 
#define LLCP_TRACE_API4(m, p1, p2, p3, p4)   {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_LLCP, TRACE_TYPE_API, m,p1,p2,p3,p4);}
 
#define LLCP_TRACE_API5(m, p1, p2, p3, p4, p5)   {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_LLCP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
 
#define LLCP_TRACE_API6(m, p1, p2, p3, p4, p5, p6)   {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_LLCP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
 
#define LLCP_TRACE_EVENT0(m)   {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_LLCP, TRACE_TYPE_EVENT, m);}
 
#define LLCP_TRACE_EVENT1(m, p1)   {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_LLCP, TRACE_TYPE_EVENT, m, p1);}
 
#define LLCP_TRACE_EVENT2(m, p1, p2)   {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_LLCP, TRACE_TYPE_EVENT, m,p1,p2);}
 
#define LLCP_TRACE_EVENT3(m, p1, p2, p3)   {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_LLCP, TRACE_TYPE_EVENT, m,p1,p2,p3);}
 
#define LLCP_TRACE_EVENT4(m, p1, p2, p3, p4)   {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_LLCP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
 
#define LLCP_TRACE_EVENT5(m, p1, p2, p3, p4, p5)   {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_LLCP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
 
#define LLCP_TRACE_EVENT6(m, p1, p2, p3, p4, p5, p6)   {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_LLCP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
 
#define LLCP_TRACE_DEBUG0(m)   {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_LLCP, TRACE_TYPE_DEBUG, m);}
 
#define LLCP_TRACE_DEBUG1(m, p1)   {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_LLCP, TRACE_TYPE_DEBUG, m,p1);}
 
#define LLCP_TRACE_DEBUG2(m, p1, p2)   {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_LLCP, TRACE_TYPE_DEBUG, m,p1,p2);}
 
#define LLCP_TRACE_DEBUG3(m, p1, p2, p3)   {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_LLCP, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
 
#define LLCP_TRACE_DEBUG4(m, p1, p2, p3, p4)   {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_LLCP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
 
#define LLCP_TRACE_DEBUG5(m, p1, p2, p3, p4, p5)   {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_LLCP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
 
#define LLCP_TRACE_DEBUG6(m, p1, p2, p3, p4, p5, p6)   {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_LLCP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
 
#define SDP_TRACE_ERROR0(m)   {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_SDP, TRACE_TYPE_ERROR, m);}
 
#define SDP_TRACE_ERROR1(m, p1)   {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_SDP, TRACE_TYPE_ERROR, m,p1);}
 
#define SDP_TRACE_ERROR2(m, p1, p2)   {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_SDP, TRACE_TYPE_ERROR, m,p1,p2);}
 
#define SDP_TRACE_ERROR3(m, p1, p2, p3)   {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_SDP, TRACE_TYPE_ERROR, m,p1,p2,p3);}
 
#define SDP_TRACE_ERROR4(m, p1, p2, p3, p4)   {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_SDP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
 
#define SDP_TRACE_ERROR5(m, p1, p2, p3, p4, p5)   {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_SDP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
 
#define SDP_TRACE_ERROR6(m, p1, p2, p3, p4, p5, p6)   {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_SDP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
 
#define SDP_TRACE_WARNING0(m)   {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_SDP, TRACE_TYPE_WARNING, m);}
 
#define SDP_TRACE_WARNING1(m, p1)   {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_SDP, TRACE_TYPE_WARNING, m,p1);}
 
#define SDP_TRACE_WARNING2(m, p1, p2)   {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_SDP, TRACE_TYPE_WARNING, m,p1,p2);}
 
#define SDP_TRACE_WARNING3(m, p1, p2, p3)   {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_SDP, TRACE_TYPE_WARNING, m,p1,p2,p3);}
 
#define SDP_TRACE_WARNING4(m, p1, p2, p3, p4)   {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_SDP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
 
#define SDP_TRACE_WARNING5(m, p1, p2, p3, p4, p5)   {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_SDP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
 
#define SDP_TRACE_WARNING6(m, p1, p2, p3, p4, p5, p6)   {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_SDP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
 
#define SDP_TRACE_API0(m)   {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_SDP, TRACE_TYPE_API, m);}
 
#define SDP_TRACE_API1(m, p1)   {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_SDP, TRACE_TYPE_API, m,p1);}
 
#define SDP_TRACE_API2(m, p1, p2)   {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_SDP, TRACE_TYPE_API, m,p1,p2);}
 
#define SDP_TRACE_API3(m, p1, p2, p3)   {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_SDP, TRACE_TYPE_API, m,p1,p2,p3);}
 
#define SDP_TRACE_API4(m, p1, p2, p3, p4)   {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_SDP, TRACE_TYPE_API, m,p1,p2,p3,p4);}
 
#define SDP_TRACE_API5(m, p1, p2, p3, p4, p5)   {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_SDP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
 
#define SDP_TRACE_API6(m, p1, p2, p3, p4, p5, p6)   {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_SDP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
 
#define SDP_TRACE_EVENT0(m)   {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_SDP, TRACE_TYPE_EVENT, m);}
 
#define SDP_TRACE_EVENT1(m, p1)   {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_SDP, TRACE_TYPE_EVENT, m, p1);}
 
#define SDP_TRACE_EVENT2(m, p1, p2)   {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_SDP, TRACE_TYPE_EVENT, m,p1,p2);}
 
#define SDP_TRACE_EVENT3(m, p1, p2, p3)   {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_SDP, TRACE_TYPE_EVENT, m,p1,p2,p3);}
 
#define SDP_TRACE_EVENT4(m, p1, p2, p3, p4)   {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_SDP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
 
#define SDP_TRACE_EVENT5(m, p1, p2, p3, p4, p5)   {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_SDP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
 
#define SDP_TRACE_EVENT6(m, p1, p2, p3, p4, p5, p6)   {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_SDP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
 
#define SDP_TRACE_DEBUG0(m)   {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_SDP, TRACE_TYPE_DEBUG, m);}
 
#define SDP_TRACE_DEBUG1(m, p1)   {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_SDP, TRACE_TYPE_DEBUG, m,p1);}
 
#define SDP_TRACE_DEBUG2(m, p1, p2)   {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_SDP, TRACE_TYPE_DEBUG, m,p1,p2);}
 
#define SDP_TRACE_DEBUG3(m, p1, p2, p3)   {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_SDP, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
 
#define SDP_TRACE_DEBUG4(m, p1, p2, p3, p4)   {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_SDP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
 
#define SDP_TRACE_DEBUG5(m, p1, p2, p3, p4, p5)   {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_SDP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
 
#define SDP_TRACE_DEBUG6(m, p1, p2, p3, p4, p5, p6)   {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_SDP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
 
#define RFCOMM_TRACE_ERROR0(m)   {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_RFCOMM, TRACE_TYPE_ERROR, m);}
 
#define RFCOMM_TRACE_ERROR1(m, p1)   {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_RFCOMM, TRACE_TYPE_ERROR, m,p1);}
 
#define RFCOMM_TRACE_ERROR2(m, p1, p2)   {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_RFCOMM, TRACE_TYPE_ERROR, m,p1,p2);}
 
#define RFCOMM_TRACE_ERROR3(m, p1, p2, p3)   {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_RFCOMM, TRACE_TYPE_ERROR, m,p1,p2,p3);}
 
#define RFCOMM_TRACE_ERROR4(m, p1, p2, p3, p4)   {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_RFCOMM, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
 
#define RFCOMM_TRACE_ERROR5(m, p1, p2, p3, p4, p5)   {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_RFCOMM, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
 
#define RFCOMM_TRACE_ERROR6(m, p1, p2, p3, p4, p5, p6)   {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_RFCOMM, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
 
#define RFCOMM_TRACE_WARNING0(m)   {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_RFCOMM, TRACE_TYPE_WARNING, m);}
 
#define RFCOMM_TRACE_WARNING1(m, p1)   {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_RFCOMM, TRACE_TYPE_WARNING, m,p1);}
 
#define RFCOMM_TRACE_WARNING2(m, p1, p2)   {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_RFCOMM, TRACE_TYPE_WARNING, m,p1,p2);}
 
#define RFCOMM_TRACE_WARNING3(m, p1, p2, p3)   {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_RFCOMM, TRACE_TYPE_WARNING, m,p1,p2,p3);}
 
#define RFCOMM_TRACE_WARNING4(m, p1, p2, p3, p4)   {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_RFCOMM, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
 
#define RFCOMM_TRACE_WARNING5(m, p1, p2, p3, p4, p5)   {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_RFCOMM, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
 
#define RFCOMM_TRACE_WARNING6(m, p1, p2, p3, p4, p5, p6)   {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_RFCOMM, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
 
#define RFCOMM_TRACE_API0(m)   {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_RFCOMM, TRACE_TYPE_API, m);}
 
#define RFCOMM_TRACE_API1(m, p1)   {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_RFCOMM, TRACE_TYPE_API, m,p1);}
 
#define RFCOMM_TRACE_API2(m, p1, p2)   {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_RFCOMM, TRACE_TYPE_API, m,p1,p2);}
 
#define RFCOMM_TRACE_API3(m, p1, p2, p3)   {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_RFCOMM, TRACE_TYPE_API, m,p1,p2,p3);}
 
#define RFCOMM_TRACE_API4(m, p1, p2, p3, p4)   {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_RFCOMM, TRACE_TYPE_API, m,p1,p2,p3,p4);}
 
#define RFCOMM_TRACE_API5(m, p1, p2, p3, p4, p5)   {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_RFCOMM, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
 
#define RFCOMM_TRACE_API6(m, p1, p2, p3, p4, p5, p6)   {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_RFCOMM, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
 
#define RFCOMM_TRACE_EVENT0(m)   {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_RFCOMM, TRACE_TYPE_EVENT, m);}
 
#define RFCOMM_TRACE_EVENT1(m, p1)   {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_RFCOMM, TRACE_TYPE_EVENT, m, p1);}
 
#define RFCOMM_TRACE_EVENT2(m, p1, p2)   {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_RFCOMM, TRACE_TYPE_EVENT, m,p1,p2);}
 
#define RFCOMM_TRACE_EVENT3(m, p1, p2, p3)   {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_RFCOMM, TRACE_TYPE_EVENT, m,p1,p2,p3);}
 
#define RFCOMM_TRACE_EVENT4(m, p1, p2, p3, p4)   {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_RFCOMM, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
 
#define RFCOMM_TRACE_EVENT5(m, p1, p2, p3, p4, p5)   {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_RFCOMM, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
 
#define RFCOMM_TRACE_EVENT6(m, p1, p2, p3, p4, p5, p6)   {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_RFCOMM, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
 
#define RFCOMM_TRACE_DEBUG0(m)   {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_RFCOMM, TRACE_TYPE_DEBUG, m);}
 
#define RFCOMM_TRACE_DEBUG1(m, p1)   {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_RFCOMM, TRACE_TYPE_DEBUG, m,p1);}
 
#define RFCOMM_TRACE_DEBUG2(m, p1, p2)   {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_RFCOMM, TRACE_TYPE_DEBUG, m,p1,p2);}
 
#define RFCOMM_TRACE_DEBUG3(m, p1, p2, p3)   {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_RFCOMM, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
 
#define RFCOMM_TRACE_DEBUG4(m, p1, p2, p3, p4)   {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_RFCOMM, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
 
#define RFCOMM_TRACE_DEBUG5(m, p1, p2, p3, p4, p5)   {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_RFCOMM, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
 
#define RFCOMM_TRACE_DEBUG6(m, p1, p2, p3, p4, p5, p6)   {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_RFCOMM, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
 
#define SPP_TRACE_ERROR0(m)   {if (spp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_SPP, TRACE_TYPE_ERROR, m);}
 
#define SPP_TRACE_ERROR1(m, p1)   {if (spp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_SPP, TRACE_TYPE_ERROR, m,p1);}
 
#define SPP_TRACE_ERROR2(m, p1, p2)   {if (spp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_SPP, TRACE_TYPE_ERROR, m,p1,p2);}
 
#define SPP_TRACE_ERROR3(m, p1, p2, p3)   {if (spp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_SPP, TRACE_TYPE_ERROR, m,p1,p2,p3);}
 
#define SPP_TRACE_ERROR4(m, p1, p2, p3, p4)   {if (spp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_SPP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
 
#define SPP_TRACE_ERROR5(m, p1, p2, p3, p4, p5)   {if (spp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_SPP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
 
#define SPP_TRACE_ERROR6(m, p1, p2, p3, p4, p5, p6)   {if (spp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_SPP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
 
#define SPP_TRACE_WARNING0(m)   {if (spp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_SPP, TRACE_TYPE_WARNING, m);}
 
#define SPP_TRACE_WARNING1(m, p1)   {if (spp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_SPP, TRACE_TYPE_WARNING, m,p1);}
 
#define SPP_TRACE_WARNING2(m, p1, p2)   {if (spp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_SPP, TRACE_TYPE_WARNING, m,p1,p2);}
 
#define SPP_TRACE_WARNING3(m, p1, p2, p3)   {if (spp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_SPP, TRACE_TYPE_WARNING, m,p1,p2,p3);}
 
#define SPP_TRACE_WARNING4(m, p1, p2, p3, p4)   {if (spp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_SPP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
 
#define SPP_TRACE_WARNING5(m, p1, p2, p3, p4, p5)   {if (spp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_SPP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
 
#define SPP_TRACE_WARNING6(m, p1, p2, p3, p4, p5, p6)   {if (spp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_SPP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
 
#define SPP_TRACE_EVENT0(m)   {if (spp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_SPP, TRACE_TYPE_EVENT, m);}
 
#define SPP_TRACE_EVENT1(m, p1)   {if (spp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_SPP, TRACE_TYPE_EVENT, m, p1);}
 
#define SPP_TRACE_EVENT2(m, p1, p2)   {if (spp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_SPP, TRACE_TYPE_EVENT, m,p1,p2);}
 
#define SPP_TRACE_EVENT3(m, p1, p2, p3)   {if (spp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_SPP, TRACE_TYPE_EVENT, m,p1,p2,p3);}
 
#define SPP_TRACE_EVENT4(m, p1, p2, p3, p4)   {if (spp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_SPP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
 
#define SPP_TRACE_EVENT5(m, p1, p2, p3, p4, p5)   {if (spp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_SPP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
 
#define SPP_TRACE_EVENT6(m, p1, p2, p3, p4, p5, p6)   {if (spp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_SPP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
 
#define SPP_TRACE_API0(m)   {if (spp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_SPP, TRACE_TYPE_API, m);}
 
#define SPP_TRACE_API1(m, p1)   {if (spp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_SPP, TRACE_TYPE_API, m, p1);}
 
#define SPP_TRACE_API2(m, p1, p2)   {if (spp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_SPP, TRACE_TYPE_API, m,p1,p2);}
 
#define SPP_TRACE_API3(m, p1, p2, p3)   {if (spp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_SPP, TRACE_TYPE_API, m,p1,p2,p3);}
 
#define SPP_TRACE_API4(m, p1, p2, p3, p4)   {if (spp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_SPP, TRACE_TYPE_API, m,p1,p2,p3,p4);}
 
#define SPP_TRACE_API5(m, p1, p2, p3, p4, p5)   {if (spp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_SPP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
 
#define SPP_TRACE_API6(m, p1, p2, p3, p4, p5, p6)   {if (spp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_SPP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
 
#define SPP_TRACE_DEBUG0(m)   {if (spp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_SPP, TRACE_TYPE_DEBUG, m);}
 
#define SPP_TRACE_DEBUG1(m, p1)   {if (spp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_SPP, TRACE_TYPE_DEBUG, m,p1);}
 
#define SPP_TRACE_DEBUG2(m, p1, p2)   {if (spp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_SPP, TRACE_TYPE_DEBUG, m,p1,p2);}
 
#define SPP_TRACE_DEBUG3(m, p1, p2, p3)   {if (spp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_SPP, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
 
#define SPP_TRACE_DEBUG4(m, p1, p2, p3, p4)   {if (spp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_SPP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
 
#define SPP_TRACE_DEBUG5(m, p1, p2, p3, p4, p5)   {if (spp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_SPP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
 
#define SPP_TRACE_DEBUG6(m, p1, p2, p3, p4, p5, p6)   {if (spp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_SPP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
 
#define GAP_TRACE_ERROR0(m)   {if (gap_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_GAP, TRACE_TYPE_ERROR, m);}
 
#define GAP_TRACE_ERROR1(m, p1)   {if (gap_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_GAP, TRACE_TYPE_ERROR, m, p1);}
 
#define GAP_TRACE_ERROR2(m, p1, p2)   {if (gap_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_GAP, TRACE_TYPE_ERROR, m,p1,p2);}
 
#define GAP_TRACE_ERROR3(m, p1, p2, p3)   {if (gap_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_GAP, TRACE_TYPE_ERROR, m,p1,p2,p3);}
 
#define GAP_TRACE_ERROR4(m, p1, p2, p3, p4)   {if (gap_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_GAP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
 
#define GAP_TRACE_ERROR5(m, p1, p2, p3, p4, p5)   {if (gap_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_GAP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
 
#define GAP_TRACE_ERROR6(m, p1, p2, p3, p4, p5, p6)   {if (gap_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_GAP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
 
#define GAP_TRACE_EVENT0(m)   {if (gap_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_GAP, TRACE_TYPE_EVENT, m);}
 
#define GAP_TRACE_EVENT1(m, p1)   {if (gap_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_GAP, TRACE_TYPE_EVENT, m, p1);}
 
#define GAP_TRACE_EVENT2(m, p1, p2)   {if (gap_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_GAP, TRACE_TYPE_EVENT, m,p1,p2);}
 
#define GAP_TRACE_EVENT3(m, p1, p2, p3)   {if (gap_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_GAP, TRACE_TYPE_EVENT, m,p1,p2,p3);}
 
#define GAP_TRACE_EVENT4(m, p1, p2, p3, p4)   {if (gap_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_GAP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
 
#define GAP_TRACE_EVENT5(m, p1, p2, p3, p4, p5)   {if (gap_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_GAP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
 
#define GAP_TRACE_EVENT6(m, p1, p2, p3, p4, p5, p6)   {if (gap_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_GAP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
 
#define GAP_TRACE_API0(m)   {if (gap_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_GAP, TRACE_TYPE_API, m);}
 
#define GAP_TRACE_API1(m, p1)   {if (gap_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_GAP, TRACE_TYPE_API, m, p1);}
 
#define GAP_TRACE_API2(m, p1, p2)   {if (gap_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_GAP, TRACE_TYPE_API, m,p1,p2);}
 
#define GAP_TRACE_API3(m, p1, p2, p3)   {if (gap_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_GAP, TRACE_TYPE_API, m,p1,p2,p3);}
 
#define GAP_TRACE_API4(m, p1, p2, p3, p4)   {if (gap_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_GAP, TRACE_TYPE_API, m,p1,p2,p3,p4);}
 
#define GAP_TRACE_API5(m, p1, p2, p3, p4, p5)   {if (gap_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_GAP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
 
#define GAP_TRACE_API6(m, p1, p2, p3, p4, p5, p6)   {if (gap_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_GAP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
 
#define GAP_TRACE_WARNING0(m)   {if (gap_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_GAP, TRACE_TYPE_WARNING, m);}
 
#define GAP_TRACE_WARNING1(m, p1)   {if (gap_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_GAP, TRACE_TYPE_WARNING, m, p1);}
 
#define GAP_TRACE_WARNING2(m, p1, p2)   {if (gap_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_GAP, TRACE_TYPE_WARNING, m,p1,p2);}
 
#define GAP_TRACE_WARNING3(m, p1, p2, p3)   {if (gap_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_GAP, TRACE_TYPE_WARNING, m,p1,p2,p3);}
 
#define GAP_TRACE_WARNING4(m, p1, p2, p3, p4)   {if (gap_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_GAP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
 
#define GAP_TRACE_WARNING5(m, p1, p2, p3, p4, p5)   {if (gap_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_GAP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
 
#define GAP_TRACE_WARNING6(m, p1, p2, p3, p4, p5, p6)   {if (gap_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_GAP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
 
#define OBX_TRACE_ERROR0(m)   {if (obx_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_OBEX, TRACE_TYPE_ERROR, m);}
 
#define OBX_TRACE_ERROR1(m, p1)   {if (obx_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_OBEX, TRACE_TYPE_ERROR, m,p1);}
 
#define OBX_TRACE_ERROR2(m, p1, p2)   {if (obx_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_OBEX, TRACE_TYPE_ERROR, m,p1,p2);}
 
#define OBX_TRACE_ERROR3(m, p1, p2, p3)   {if (obx_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_OBEX, TRACE_TYPE_ERROR, m,p1,p2,p3);}
 
#define OBX_TRACE_ERROR4(m, p1, p2, p3, p4)   {if (obx_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_OBEX, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
 
#define OBX_TRACE_ERROR5(m, p1, p2, p3, p4, p5)   {if (obx_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_OBEX, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
 
#define OBX_TRACE_ERROR6(m, p1, p2, p3, p4, p5, p6)   {if (obx_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_OBEX, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
 
#define OBX_TRACE_WARNING0(m)   {if (obx_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_OBEX, TRACE_TYPE_WARNING, m);}
 
#define OBX_TRACE_WARNING1(m, p1)   {if (obx_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_OBEX, TRACE_TYPE_WARNING, m,p1);}
 
#define OBX_TRACE_WARNING2(m, p1, p2)   {if (obx_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_OBEX, TRACE_TYPE_WARNING, m,p1,p2);}
 
#define OBX_TRACE_WARNING3(m, p1, p2, p3)   {if (obx_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_OBEX, TRACE_TYPE_WARNING, m,p1,p2,p3);}
 
#define OBX_TRACE_WARNING4(m, p1, p2, p3, p4)   {if (obx_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_OBEX, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
 
#define OBX_TRACE_WARNING5(m, p1, p2, p3, p4, p5)   {if (obx_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_OBEX, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
 
#define OBX_TRACE_WARNING6(m, p1, p2, p3, p4, p5, p6)   {if (obx_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_OBEX, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
 
#define OBX_TRACE_EVENT0(m)   {if (obx_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_OBEX, TRACE_TYPE_EVENT, m);}
 
#define OBX_TRACE_EVENT1(m, p1)   {if (obx_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_OBEX, TRACE_TYPE_EVENT, m, p1);}
 
#define OBX_TRACE_EVENT2(m, p1, p2)   {if (obx_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_OBEX, TRACE_TYPE_EVENT, m,p1,p2);}
 
#define OBX_TRACE_EVENT3(m, p1, p2, p3)   {if (obx_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_OBEX, TRACE_TYPE_EVENT, m,p1,p2,p3);}
 
#define OBX_TRACE_EVENT4(m, p1, p2, p3, p4)   {if (obx_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_OBEX, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
 
#define OBX_TRACE_EVENT5(m, p1, p2, p3, p4, p5)   {if (obx_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_OBEX, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
 
#define OBX_TRACE_EVENT6(m, p1, p2, p3, p4, p5, p6)   {if (obx_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_OBEX, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
 
#define OBX_TRACE_DEBUG0(m)   {if (obx_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_OBEX, TRACE_TYPE_DEBUG, m);}
 
#define OBX_TRACE_DEBUG1(m, p1)   {if (obx_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_OBEX, TRACE_TYPE_DEBUG, m,p1);}
 
#define OBX_TRACE_DEBUG2(m, p1, p2)   {if (obx_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_OBEX, TRACE_TYPE_DEBUG, m,p1,p2);}
 
#define OBX_TRACE_DEBUG3(m, p1, p2, p3)   {if (obx_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_OBEX, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
 
#define OBX_TRACE_DEBUG4(m, p1, p2, p3, p4)   {if (obx_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_OBEX, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
 
#define OBX_TRACE_DEBUG5(m, p1, p2, p3, p4, p5)   {if (obx_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_OBEX, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
 
#define OBX_TRACE_DEBUG6(m, p1, p2, p3, p4, p5, p6)   {if (obx_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_OBEX, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
 
#define OBX_TRACE_API0(m)   {if (obx_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_OBEX, TRACE_TYPE_API, m);}
 
#define OBX_TRACE_API1(m, p1)   {if (obx_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_OBEX, TRACE_TYPE_API, m, p1);}
 
#define OBX_TRACE_API2(m, p1, p2)   {if (obx_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_OBEX, TRACE_TYPE_API, m,p1,p2);}
 
#define OBX_TRACE_API3(m, p1, p2, p3)   {if (obx_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_OBEX, TRACE_TYPE_API, m,p1,p2,p3);}
 
#define OBX_TRACE_API4(m, p1, p2, p3, p4)   {if (obx_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_OBEX, TRACE_TYPE_API, m,p1,p2,p3,p4);}
 
#define OBX_TRACE_API5(m, p1, p2, p3, p4, p5)   {if (obx_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_OBEX, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
 
#define OBX_TRACE_API6(m, p1, p2, p3, p4, p5, p6)   {if (obx_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_OBEX, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
 
#define GOEP_TRACE_ERROR0(m)   {if (goep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_GOEP, TRACE_TYPE_ERROR, m);}
 
#define GOEP_TRACE_ERROR1(m, p1)   {if (goep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_GOEP, TRACE_TYPE_ERROR, m,p1);}
 
#define GOEP_TRACE_ERROR2(m, p1, p2)   {if (goep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_GOEP, TRACE_TYPE_ERROR, m,p1,p2);}
 
#define GOEP_TRACE_ERROR3(m, p1, p2, p3)   {if (goep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_GOEP, TRACE_TYPE_ERROR, m,p1,p2,p3);}
 
#define GOEP_TRACE_ERROR4(m, p1, p2, p3, p4)   {if (goep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_GOEP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
 
#define GOEP_TRACE_ERROR5(m, p1, p2, p3, p4, p5)   {if (goep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_GOEP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
 
#define GOEP_TRACE_ERROR6(m, p1, p2, p3, p4, p5, p6)   {if (goep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_GOEP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
 
#define GOEP_TRACE_WARNING0(m)   {if (goep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_GOEP, TRACE_TYPE_WARNING, m);}
 
#define GOEP_TRACE_WARNING1(m, p1)   {if (goep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_GOEP, TRACE_TYPE_WARNING, m,p1);}
 
#define GOEP_TRACE_WARNING2(m, p1, p2)   {if (goep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_GOEP, TRACE_TYPE_WARNING, m,p1,p2);}
 
#define GOEP_TRACE_WARNING3(m, p1, p2, p3)   {if (goep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_GOEP, TRACE_TYPE_WARNING, m,p1,p2,p3);}
 
#define GOEP_TRACE_WARNING4(m, p1, p2, p3, p4)   {if (goep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_GOEP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
 
#define GOEP_TRACE_WARNING5(m, p1, p2, p3, p4, p5)   {if (goep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_GOEP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
 
#define GOEP_TRACE_WARNING6(m, p1, p2, p3, p4, p5, p6)   {if (goep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_GOEP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
 
#define GOEP_TRACE_EVENT0(m)   {if (goep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_GOEP, TRACE_TYPE_EVENT, m);}
 
#define GOEP_TRACE_EVENT1(m, p1)   {if (goep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_GOEP, TRACE_TYPE_EVENT, m, p1);}
 
#define GOEP_TRACE_EVENT2(m, p1, p2)   {if (goep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_GOEP, TRACE_TYPE_EVENT, m,p1,p2);}
 
#define GOEP_TRACE_EVENT3(m, p1, p2, p3)   {if (goep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_GOEP, TRACE_TYPE_EVENT, m,p1,p2,p3);}
 
#define GOEP_TRACE_EVENT4(m, p1, p2, p3, p4)   {if (goep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_GOEP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
 
#define GOEP_TRACE_EVENT5(m, p1, p2, p3, p4, p5)   {if (goep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_GOEP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
 
#define GOEP_TRACE_EVENT6(m, p1, p2, p3, p4, p5, p6)   {if (goep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_GOEP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
 
#define GOEP_TRACE_DEBUG0(m)   {if (goep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_GOEP, TRACE_TYPE_DEBUG, m);}
 
#define GOEP_TRACE_DEBUG1(m, p1)   {if (goep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_GOEP, TRACE_TYPE_DEBUG, m,p1);}
 
#define GOEP_TRACE_DEBUG2(m, p1, p2)   {if (goep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_GOEP, TRACE_TYPE_DEBUG, m,p1,p2);}
 
#define GOEP_TRACE_DEBUG3(m, p1, p2, p3)   {if (goep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_GOEP, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
 
#define GOEP_TRACE_DEBUG4(m, p1, p2, p3, p4)   {if (goep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_GOEP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
 
#define GOEP_TRACE_DEBUG5(m, p1, p2, p3, p4, p5)   {if (goep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_GOEP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
 
#define GOEP_TRACE_DEBUG6(m, p1, p2, p3, p4, p5, p6)   {if (goep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_GOEP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
 
#define GOEP_TRACE_API0(m)   {if (goep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_GOEP, TRACE_TYPE_API, m);}
 
#define GOEP_TRACE_API1(m, p1)   {if (goep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_GOEP, TRACE_TYPE_API, m, p1);}
 
#define GOEP_TRACE_API2(m, p1, p2)   {if (goep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_GOEP, TRACE_TYPE_API, m,p1,p2);}
 
#define GOEP_TRACE_API3(m, p1, p2, p3)   {if (goep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_GOEP, TRACE_TYPE_API, m,p1,p2,p3);}
 
#define GOEP_TRACE_API4(m, p1, p2, p3, p4)   {if (goep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_GOEP, TRACE_TYPE_API, m,p1,p2,p3,p4);}
 
#define GOEP_TRACE_API5(m, p1, p2, p3, p4, p5)   {if (goep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_GOEP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
 
#define GOEP_TRACE_API6(m, p1, p2, p3, p4, p5, p6)   {if (goep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_GOEP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
 
#define BPP_TRACE_ERROR0(m)   {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_BPP, TRACE_TYPE_ERROR, m);}
 
#define BPP_TRACE_ERROR1(m, p1)   {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_BPP, TRACE_TYPE_ERROR, m,p1);}
 
#define BPP_TRACE_ERROR2(m, p1, p2)   {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_BPP, TRACE_TYPE_ERROR, m,p1,p2);}
 
#define BPP_TRACE_ERROR3(m, p1, p2, p3)   {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_BPP, TRACE_TYPE_ERROR, m,p1,p2,p3);}
 
#define BPP_TRACE_ERROR4(m, p1, p2, p3, p4)   {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_BPP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
 
#define BPP_TRACE_ERROR5(m, p1, p2, p3, p4, p5)   {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_BPP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
 
#define BPP_TRACE_ERROR6(m, p1, p2, p3, p4, p5, p6)   {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_BPP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
 
#define BPP_TRACE_WARNING0(m)   {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_BPP, TRACE_TYPE_WARNING, m);}
 
#define BPP_TRACE_WARNING1(m, p1)   {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_BPP, TRACE_TYPE_WARNING, m,p1);}
 
#define BPP_TRACE_WARNING2(m, p1, p2)   {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_BPP, TRACE_TYPE_WARNING, m,p1,p2);}
 
#define BPP_TRACE_WARNING3(m, p1, p2, p3)   {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_BPP, TRACE_TYPE_WARNING, m,p1,p2,p3);}
 
#define BPP_TRACE_WARNING4(m, p1, p2, p3, p4)   {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_BPP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
 
#define BPP_TRACE_WARNING5(m, p1, p2, p3, p4, p5)   {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_BPP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
 
#define BPP_TRACE_WARNING6(m, p1, p2, p3, p4, p5, p6)   {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_BPP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
 
#define BPP_TRACE_EVENT0(m)   {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_BPP, TRACE_TYPE_EVENT, m);}
 
#define BPP_TRACE_EVENT1(m, p1)   {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_BPP, TRACE_TYPE_EVENT, m, p1);}
 
#define BPP_TRACE_EVENT2(m, p1, p2)   {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_BPP, TRACE_TYPE_EVENT, m,p1,p2);}
 
#define BPP_TRACE_EVENT3(m, p1, p2, p3)   {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_BPP, TRACE_TYPE_EVENT, m,p1,p2,p3);}
 
#define BPP_TRACE_EVENT4(m, p1, p2, p3, p4)   {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_BPP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
 
#define BPP_TRACE_EVENT5(m, p1, p2, p3, p4, p5)   {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_BPP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
 
#define BPP_TRACE_EVENT6(m, p1, p2, p3, p4, p5, p6)   {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_BPP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
 
#define BPP_TRACE_DEBUG0(m)   {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_BPP, TRACE_TYPE_DEBUG, m);}
 
#define BPP_TRACE_DEBUG1(m, p1)   {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_BPP, TRACE_TYPE_DEBUG, m,p1);}
 
#define BPP_TRACE_DEBUG2(m, p1, p2)   {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_BPP, TRACE_TYPE_DEBUG, m,p1,p2);}
 
#define BPP_TRACE_DEBUG3(m, p1, p2, p3)   {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_BPP, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
 
#define BPP_TRACE_DEBUG4(m, p1, p2, p3, p4)   {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_BPP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
 
#define BPP_TRACE_DEBUG5(m, p1, p2, p3, p4, p5)   {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_BPP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
 
#define BPP_TRACE_DEBUG6(m, p1, p2, p3, p4, p5, p6)   {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_BPP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
 
#define BPP_TRACE_API0(m)   {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_BPP, TRACE_TYPE_API, m);}
 
#define BPP_TRACE_API1(m, p1)   {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_BPP, TRACE_TYPE_API, m, p1);}
 
#define BPP_TRACE_API2(m, p1, p2)   {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_BPP, TRACE_TYPE_API, m,p1,p2);}
 
#define BPP_TRACE_API3(m, p1, p2, p3)   {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_BPP, TRACE_TYPE_API, m,p1,p2,p3);}
 
#define BPP_TRACE_API4(m, p1, p2, p3, p4)   {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_BPP, TRACE_TYPE_API, m,p1,p2,p3,p4);}
 
#define BPP_TRACE_API5(m, p1, p2, p3, p4, p5)   {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_BPP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
 
#define BPP_TRACE_API6(m, p1, p2, p3, p4, p5, p6)   {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_BPP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
 
#define BIP_TRACE_ERROR0(m)   {if (bip_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_BIP, TRACE_TYPE_ERROR, m);}
 
#define BIP_TRACE_ERROR1(m, p1)   {if (bip_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_BIP, TRACE_TYPE_ERROR, m,p1);}
 
#define BIP_TRACE_ERROR2(m, p1, p2)   {if (bip_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_BIP, TRACE_TYPE_ERROR, m,p1,p2);}
 
#define BIP_TRACE_ERROR3(m, p1, p2, p3)   {if (bip_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_BIP, TRACE_TYPE_ERROR, m,p1,p2,p3);}
 
#define BIP_TRACE_ERROR4(m, p1, p2, p3, p4)   {if (bip_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_BIP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
 
#define BIP_TRACE_ERROR5(m, p1, p2, p3, p4, p5)   {if (bip_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_BIP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
 
#define BIP_TRACE_ERROR6(m, p1, p2, p3, p4, p5, p6)   {if (bip_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_BIP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
 
#define BIP_TRACE_WARNING0(m)   {if (bip_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_BIP, TRACE_TYPE_WARNING, m);}
 
#define BIP_TRACE_WARNING1(m, p1)   {if (bip_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_BIP, TRACE_TYPE_WARNING, m,p1);}
 
#define BIP_TRACE_WARNING2(m, p1, p2)   {if (bip_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_BIP, TRACE_TYPE_WARNING, m,p1,p2);}
 
#define BIP_TRACE_WARNING3(m, p1, p2, p3)   {if (bip_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_BIP, TRACE_TYPE_WARNING, m,p1,p2,p3);}
 
#define BIP_TRACE_WARNING4(m, p1, p2, p3, p4)   {if (bip_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_BIP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
 
#define BIP_TRACE_WARNING5(m, p1, p2, p3, p4, p5)   {if (bip_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_BIP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
 
#define BIP_TRACE_WARNING6(m, p1, p2, p3, p4, p5, p6)   {if (bip_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_BIP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
 
#define BIP_TRACE_EVENT0(m)   {if (bip_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_BIP, TRACE_TYPE_EVENT, m);}
 
#define BIP_TRACE_EVENT1(m, p1)   {if (bip_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_BIP, TRACE_TYPE_EVENT, m, p1);}
 
#define BIP_TRACE_EVENT2(m, p1, p2)   {if (bip_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_BIP, TRACE_TYPE_EVENT, m,p1,p2);}
 
#define BIP_TRACE_EVENT3(m, p1, p2, p3)   {if (bip_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_BIP, TRACE_TYPE_EVENT, m,p1,p2,p3);}
 
#define BIP_TRACE_EVENT4(m, p1, p2, p3, p4)   {if (bip_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_BIP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
 
#define BIP_TRACE_EVENT5(m, p1, p2, p3, p4, p5)   {if (bip_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_BIP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
 
#define BIP_TRACE_EVENT6(m, p1, p2, p3, p4, p5, p6)   {if (bip_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_BIP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
 
#define BIP_TRACE_DEBUG0(m)   {if (bip_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_BIP, TRACE_TYPE_DEBUG, m);}
 
#define BIP_TRACE_DEBUG1(m, p1)   {if (bip_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_BIP, TRACE_TYPE_DEBUG, m,p1);}
 
#define BIP_TRACE_DEBUG2(m, p1, p2)   {if (bip_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_BIP, TRACE_TYPE_DEBUG, m,p1,p2);}
 
#define BIP_TRACE_DEBUG3(m, p1, p2, p3)   {if (bip_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_BIP, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
 
#define BIP_TRACE_DEBUG4(m, p1, p2, p3, p4)   {if (bip_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_BIP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
 
#define BIP_TRACE_DEBUG5(m, p1, p2, p3, p4, p5)   {if (bip_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_BIP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
 
#define BIP_TRACE_DEBUG6(m, p1, p2, p3, p4, p5, p6)   {if (bip_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_BIP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
 
#define BIP_TRACE_API0(m)   {if (bip_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_BIP, TRACE_TYPE_API, m);}
 
#define BIP_TRACE_API1(m, p1)   {if (bip_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_BIP, TRACE_TYPE_API, m, p1);}
 
#define BIP_TRACE_API2(m, p1, p2)   {if (bip_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_BIP, TRACE_TYPE_API, m,p1,p2);}
 
#define BIP_TRACE_API3(m, p1, p2, p3)   {if (bip_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_BIP, TRACE_TYPE_API, m,p1,p2,p3);}
 
#define BIP_TRACE_API4(m, p1, p2, p3, p4)   {if (bip_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_BIP, TRACE_TYPE_API, m,p1,p2,p3,p4);}
 
#define BIP_TRACE_API5(m, p1, p2, p3, p4, p5)   {if (bip_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_BIP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
 
#define BIP_TRACE_API6(m, p1, p2, p3, p4, p5, p6)   {if (bip_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_BIP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
 
#define TCS_TRACE_ERROR0(m)   {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_TCS, TRACE_TYPE_ERROR, m);}
 
#define TCS_TRACE_ERROR1(m, p1)   {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_TCS, TRACE_TYPE_ERROR, m,p1);}
 
#define TCS_TRACE_ERROR2(m, p1, p2)   {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_TCS, TRACE_TYPE_ERROR, m,p1,p2);}
 
#define TCS_TRACE_ERROR3(m, p1, p2, p3)   {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_TCS, TRACE_TYPE_ERROR, m,p1,p2,p3);}
 
#define TCS_TRACE_ERROR4(m, p1, p2, p3, p4)   {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_TCS, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
 
#define TCS_TRACE_ERROR5(m, p1, p2, p3, p4, p5)   {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_TCS, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
 
#define TCS_TRACE_ERROR6(m, p1, p2, p3, p4, p5, p6)   {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_TCS, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
 
#define TCS_TRACE_WARNING0(m)   {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_TCS, TRACE_TYPE_WARNING, m);}
 
#define TCS_TRACE_WARNING1(m, p1)   {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_TCS, TRACE_TYPE_WARNING, m,p1);}
 
#define TCS_TRACE_WARNING2(m, p1, p2)   {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_TCS, TRACE_TYPE_WARNING, m,p1,p2);}
 
#define TCS_TRACE_WARNING3(m, p1, p2, p3)   {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_TCS, TRACE_TYPE_WARNING, m,p1,p2,p3);}
 
#define TCS_TRACE_WARNING4(m, p1, p2, p3, p4)   {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_TCS, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
 
#define TCS_TRACE_WARNING5(m, p1, p2, p3, p4, p5)   {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_TCS, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
 
#define TCS_TRACE_WARNING6(m, p1, p2, p3, p4, p5, p6)   {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_TCS, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
 
#define TCS_TRACE_EVENT0(m)   {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_TCS, TRACE_TYPE_EVENT, m);}
 
#define TCS_TRACE_EVENT1(m, p1)   {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_TCS, TRACE_TYPE_EVENT, m, p1);}
 
#define TCS_TRACE_EVENT2(m, p1, p2)   {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_TCS, TRACE_TYPE_EVENT, m,p1,p2);}
 
#define TCS_TRACE_EVENT3(m, p1, p2, p3)   {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_TCS, TRACE_TYPE_EVENT, m,p1,p2,p3);}
 
#define TCS_TRACE_EVENT4(m, p1, p2, p3, p4)   {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_TCS, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
 
#define TCS_TRACE_EVENT5(m, p1, p2, p3, p4, p5)   {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_TCS, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
 
#define TCS_TRACE_EVENT6(m, p1, p2, p3, p4, p5, p6)   {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_TCS, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
 
#define TCS_TRACE_DEBUG0(m)   {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_TCS, TRACE_TYPE_DEBUG, m);}
 
#define TCS_TRACE_DEBUG1(m, p1)   {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_TCS, TRACE_TYPE_DEBUG, m,p1);}
 
#define TCS_TRACE_DEBUG2(m, p1, p2)   {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_TCS, TRACE_TYPE_DEBUG, m,p1,p2);}
 
#define TCS_TRACE_DEBUG3(m, p1, p2, p3)   {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_TCS, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
 
#define TCS_TRACE_DEBUG4(m, p1, p2, p3, p4)   {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_TCS, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
 
#define TCS_TRACE_DEBUG5(m, p1, p2, p3, p4, p5)   {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_TCS, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
 
#define TCS_TRACE_DEBUG6(m, p1, p2, p3, p4, p5, p6)   {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_TCS, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
 
#define TCS_TRACE_API0(m)   {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_TCS, TRACE_TYPE_API, m);}
 
#define TCS_TRACE_API1(m, p1)   {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_TCS, TRACE_TYPE_API, m, p1);}
 
#define TCS_TRACE_API2(m, p1, p2)   {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_TCS, TRACE_TYPE_API, m,p1,p2);}
 
#define TCS_TRACE_API3(m, p1, p2, p3)   {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_TCS, TRACE_TYPE_API, m,p1,p2,p3);}
 
#define TCS_TRACE_API4(m, p1, p2, p3, p4)   {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_TCS, TRACE_TYPE_API, m,p1,p2,p3,p4);}
 
#define TCS_TRACE_API5(m, p1, p2, p3, p4, p5)   {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_TCS, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
 
#define TCS_TRACE_API6(m, p1, p2, p3, p4, p5, p6)   {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_TCS, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
 
#define ICP_TRACE_ERROR0(m)   {if (icp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_ICP, TRACE_TYPE_ERROR, m);}
 
#define ICP_TRACE_ERROR1(m, p1)   {if (icp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_ICP, TRACE_TYPE_ERROR, m,p1);}
 
#define ICP_TRACE_ERROR2(m, p1, p2)   {if (icp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_ICP, TRACE_TYPE_ERROR, m,p1,p2);}
 
#define ICP_TRACE_ERROR3(m, p1, p2, p3)   {if (icp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_ICP, TRACE_TYPE_ERROR, m,p1,p2,p3);}
 
#define ICP_TRACE_ERROR4(m, p1, p2, p3, p4)   {if (icp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_ICP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
 
#define ICP_TRACE_ERROR5(m, p1, p2, p3, p4, p5)   {if (icp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_ICP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
 
#define ICP_TRACE_ERROR6(m, p1, p2, p3, p4, p5, p6)   {if (icp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_ICP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
 
#define ICP_TRACE_WARNING0(m)   {if (icp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_ICP, TRACE_TYPE_WARNING, m);}
 
#define ICP_TRACE_WARNING1(m, p1)   {if (icp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_ICP, TRACE_TYPE_WARNING, m,p1);}
 
#define ICP_TRACE_WARNING2(m, p1, p2)   {if (icp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_ICP, TRACE_TYPE_WARNING, m,p1,p2);}
 
#define ICP_TRACE_WARNING3(m, p1, p2, p3)   {if (icp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_ICP, TRACE_TYPE_WARNING, m,p1,p2,p3);}
 
#define ICP_TRACE_WARNING4(m, p1, p2, p3, p4)   {if (icp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_ICP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
 
#define ICP_TRACE_WARNING5(m, p1, p2, p3, p4, p5)   {if (icp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_ICP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
 
#define ICP_TRACE_WARNING6(m, p1, p2, p3, p4, p5, p6)   {if (icp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_ICP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
 
#define ICP_TRACE_EVENT0(m)   {if (icp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_ICP, TRACE_TYPE_EVENT, m);}
 
#define ICP_TRACE_EVENT1(m, p1)   {if (icp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_ICP, TRACE_TYPE_EVENT, m, p1);}
 
#define ICP_TRACE_EVENT2(m, p1, p2)   {if (icp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_ICP, TRACE_TYPE_EVENT, m,p1,p2);}
 
#define ICP_TRACE_EVENT3(m, p1, p2, p3)   {if (icp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_ICP, TRACE_TYPE_EVENT, m,p1,p2,p3);}
 
#define ICP_TRACE_EVENT4(m, p1, p2, p3, p4)   {if (icp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_ICP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
 
#define ICP_TRACE_EVENT5(m, p1, p2, p3, p4, p5)   {if (icp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_ICP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
 
#define ICP_TRACE_EVENT6(m, p1, p2, p3, p4, p5, p6)   {if (icp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_ICP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
 
#define ICP_TRACE_DEBUG0(m)   {if (icp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_ICP, TRACE_TYPE_DEBUG, m);}
 
#define ICP_TRACE_DEBUG1(m, p1)   {if (icp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_ICP, TRACE_TYPE_DEBUG, m,p1);}
 
#define ICP_TRACE_DEBUG2(m, p1, p2)   {if (icp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_ICP, TRACE_TYPE_DEBUG, m,p1,p2);}
 
#define ICP_TRACE_DEBUG3(m, p1, p2, p3)   {if (icp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_ICP, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
 
#define ICP_TRACE_DEBUG4(m, p1, p2, p3, p4)   {if (icp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_ICP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
 
#define ICP_TRACE_DEBUG5(m, p1, p2, p3, p4, p5)   {if (icp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_ICP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
 
#define ICP_TRACE_DEBUG6(m, p1, p2, p3, p4, p5, p6)   {if (icp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_ICP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
 
#define ICP_TRACE_API0(m)   {if (icp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_ICP, TRACE_TYPE_API, m);}
 
#define ICP_TRACE_API1(m, p1)   {if (icp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_ICP, TRACE_TYPE_API, m, p1);}
 
#define ICP_TRACE_API2(m, p1, p2)   {if (icp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_ICP, TRACE_TYPE_API, m,p1,p2);}
 
#define ICP_TRACE_API3(m, p1, p2, p3)   {if (icp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_ICP, TRACE_TYPE_API, m,p1,p2,p3);}
 
#define ICP_TRACE_API4(m, p1, p2, p3, p4)   {if (icp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_ICP, TRACE_TYPE_API, m,p1,p2,p3,p4);}
 
#define ICP_TRACE_API5(m, p1, p2, p3, p4, p5)   {if (icp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_ICP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
 
#define ICP_TRACE_API6(m, p1, p2, p3, p4, p5, p6)   {if (icp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_ICP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
 
#define CTP_TRACE_ERROR0(m)   {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_CTP, TRACE_TYPE_ERROR, m);}
 
#define CTP_TRACE_ERROR1(m, p1)   {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_CTP, TRACE_TYPE_ERROR, m,p1);}
 
#define CTP_TRACE_ERROR2(m, p1, p2)   {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_CTP, TRACE_TYPE_ERROR, m,p1,p2);}
 
#define CTP_TRACE_ERROR3(m, p1, p2, p3)   {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_CTP, TRACE_TYPE_ERROR, m,p1,p2,p3);}
 
#define CTP_TRACE_ERROR4(m, p1, p2, p3, p4)   {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_CTP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
 
#define CTP_TRACE_ERROR5(m, p1, p2, p3, p4, p5)   {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_CTP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
 
#define CTP_TRACE_ERROR6(m, p1, p2, p3, p4, p5, p6)   {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_CTP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
 
#define CTP_TRACE_WARNING0(m)   {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_CTP, TRACE_TYPE_WARNING, m);}
 
#define CTP_TRACE_WARNING1(m, p1)   {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_CTP, TRACE_TYPE_WARNING, m,p1);}
 
#define CTP_TRACE_WARNING2(m, p1, p2)   {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_CTP, TRACE_TYPE_WARNING, m,p1,p2);}
 
#define CTP_TRACE_WARNING3(m, p1, p2, p3)   {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_CTP, TRACE_TYPE_WARNING, m,p1,p2,p3);}
 
#define CTP_TRACE_WARNING4(m, p1, p2, p3, p4)   {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_CTP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
 
#define CTP_TRACE_WARNING5(m, p1, p2, p3, p4, p5)   {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_CTP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
 
#define CTP_TRACE_WARNING6(m, p1, p2, p3, p4, p5, p6)   {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_CTP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
 
#define CTP_TRACE_EVENT0(m)   {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_CTP, TRACE_TYPE_EVENT, m);}
 
#define CTP_TRACE_EVENT1(m, p1)   {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_CTP, TRACE_TYPE_EVENT, m, p1);}
 
#define CTP_TRACE_EVENT2(m, p1, p2)   {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_CTP, TRACE_TYPE_EVENT, m,p1,p2);}
 
#define CTP_TRACE_EVENT3(m, p1, p2, p3)   {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_CTP, TRACE_TYPE_EVENT, m,p1,p2,p3);}
 
#define CTP_TRACE_EVENT4(m, p1, p2, p3, p4)   {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_CTP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
 
#define CTP_TRACE_EVENT5(m, p1, p2, p3, p4, p5)   {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_CTP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
 
#define CTP_TRACE_EVENT6(m, p1, p2, p3, p4, p5, p6)   {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_CTP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
 
#define CTP_TRACE_DEBUG0(m)   {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_CTP, TRACE_TYPE_DEBUG, m);}
 
#define CTP_TRACE_DEBUG1(m, p1)   {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_CTP, TRACE_TYPE_DEBUG, m,p1);}
 
#define CTP_TRACE_DEBUG2(m, p1, p2)   {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_CTP, TRACE_TYPE_DEBUG, m,p1,p2);}
 
#define CTP_TRACE_DEBUG3(m, p1, p2, p3)   {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_CTP, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
 
#define CTP_TRACE_DEBUG4(m, p1, p2, p3, p4)   {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_CTP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
 
#define CTP_TRACE_DEBUG5(m, p1, p2, p3, p4, p5)   {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_CTP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
 
#define CTP_TRACE_DEBUG6(m, p1, p2, p3, p4, p5, p6)   {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_CTP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
 
#define HIDH_TRACE_ERROR0(m)   {if (hh_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m);}
 
#define HIDH_TRACE_ERROR1(m, p1)   {if (hh_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m, p1);}
 
#define HIDH_TRACE_ERROR2(m, p1, p2)   {if (hh_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m,p1,p2);}
 
#define HIDH_TRACE_ERROR3(m, p1, p2, p3)   {if (hh_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m,p1,p2,p3);}
 
#define HIDH_TRACE_ERROR4(m, p1, p2, p3, p4)   {if (hh_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
 
#define HIDH_TRACE_ERROR5(m, p1, p2, p3, p4, p5)   {if (hh_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
 
#define HIDH_TRACE_ERROR6(m, p1, p2, p3, p4, p5, p6)   {if (hh_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
 
#define HIDH_TRACE_WARNING0(m)   {if (hh_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m);}
 
#define HIDH_TRACE_WARNING1(m, p1)   {if (hh_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m,p1);}
 
#define HIDH_TRACE_WARNING2(m, p1, p2)   {if (hh_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m,p1,p2);}
 
#define HIDH_TRACE_WARNING3(m, p1, p2, p3)   {if (hh_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m,p1,p2,p3);}
 
#define HIDH_TRACE_WARNING4(m, p1, p2, p3, p4)   {if (hh_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
 
#define HIDH_TRACE_WARNING5(m, p1, p2, p3, p4, p5)   {if (hh_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
 
#define HIDH_TRACE_WARNING6(m, p1, p2, p3, p4, p5, p6)   {if (hh_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
 
#define HIDH_TRACE_API0(m)   {if (hh_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_HID, TRACE_TYPE_API, m);}
 
#define HIDH_TRACE_API1(m, p1)   {if (hh_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_HID, TRACE_TYPE_API, m, p1);}
 
#define HIDH_TRACE_API2(m, p1, p2)   {if (hh_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_HID, TRACE_TYPE_API, m,p1,p2);}
 
#define HIDH_TRACE_API3(m, p1, p2, p3)   {if (hh_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_HID, TRACE_TYPE_API, m,p1,p2,p3);}
 
#define HIDH_TRACE_API4(m, p1, p2, p3, p4)   {if (hh_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_HID, TRACE_TYPE_API, m,p1,p2,p3,p4);}
 
#define HIDH_TRACE_API5(m, p1, p2, p3, p4, p5)   {if (hh_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_HID, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
 
#define HIDH_TRACE_API6(m, p1, p2, p3, p4, p5, p6)   {if (hh_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_HID, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
 
#define HIDH_TRACE_EVENT0(m)   {if (hh_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_HID, TRACE_TYPE_EVENT, m);}
 
#define HIDH_TRACE_EVENT1(m, p1)   {if (hh_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_HID, TRACE_TYPE_EVENT, m, p1);}
 
#define HIDH_TRACE_EVENT2(m, p1, p2)   {if (hh_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_HID, TRACE_TYPE_EVENT, m,p1,p2);}
 
#define HIDH_TRACE_EVENT3(m, p1, p2, p3)   {if (hh_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_HID, TRACE_TYPE_EVENT, m,p1,p2,p3);}
 
#define HIDH_TRACE_EVENT4(m, p1, p2, p3, p4)   {if (hh_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_HID, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
 
#define HIDH_TRACE_EVENT5(m, p1, p2, p3, p4, p5)   {if (hh_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_HID, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
 
#define HIDH_TRACE_EVENT6(m, p1, p2, p3, p4, p5, p6)   {if (hh_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_HID, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
 
#define HIDH_TRACE_DEBUG0(m)   {if (hh_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m);}
 
#define HIDH_TRACE_DEBUG1(m, p1)   {if (hh_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m,p1);}
 
#define HIDH_TRACE_DEBUG2(m, p1, p2)   {if (hh_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m,p1,p2);}
 
#define HIDH_TRACE_DEBUG3(m, p1, p2, p3)   {if (hh_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
 
#define HIDH_TRACE_DEBUG4(m, p1, p2, p3, p4)   {if (hh_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
 
#define HIDH_TRACE_DEBUG5(m, p1, p2, p3, p4, p5)   {if (hh_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
 
#define HIDH_TRACE_DEBUG6(m, p1, p2, p3, p4, p5, p6)   {if (hh_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
 
#define HIDD_TRACE_ERROR0(m)   {if (hd_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m);}
 
#define HIDD_TRACE_ERROR1(m, p1)   {if (hd_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m, p1);}
 
#define HIDD_TRACE_ERROR2(m, p1, p2)   {if (hd_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m,p1,p2);}
 
#define HIDD_TRACE_ERROR3(m, p1, p2, p3)   {if (hd_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m,p1,p2,p3);}
 
#define HIDD_TRACE_ERROR4(m, p1, p2, p3, p4)   {if (hd_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
 
#define HIDD_TRACE_ERROR5(m, p1, p2, p3, p4, p5)   {if (hd_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
 
#define HIDD_TRACE_ERROR6(m, p1, p2, p3, p4, p5, p6)   {if (hd_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
 
#define HIDD_TRACE_WARNING0(m)   {if (hd_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m);}
 
#define HIDD_TRACE_WARNING1(m, p1)   {if (hd_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m,p1);}
 
#define HIDD_TRACE_WARNING2(m, p1, p2)   {if (hd_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m,p1,p2);}
 
#define HIDD_TRACE_WARNING3(m, p1, p2, p3)   {if (hd_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m,p1,p2,p3);}
 
#define HIDD_TRACE_WARNING4(m, p1, p2, p3, p4)   {if (hd_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
 
#define HIDD_TRACE_WARNING5(m, p1, p2, p3, p4, p5)   {if (hd_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
 
#define HIDD_TRACE_WARNING6(m, p1, p2, p3, p4, p5, p6)   {if (hd_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
 
#define HIDD_TRACE_API0(m)   {if (hd_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_HID, TRACE_TYPE_API, m);}
 
#define HIDD_TRACE_API1(m, p1)   {if (hd_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_HID, TRACE_TYPE_API, m, p1);}
 
#define HIDD_TRACE_API2(m, p1, p2)   {if (hd_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_HID, TRACE_TYPE_API, m,p1,p2);}
 
#define HIDD_TRACE_API3(m, p1, p2, p3)   {if (hd_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_HID, TRACE_TYPE_API, m,p1,p2,p3);}
 
#define HIDD_TRACE_API4(m, p1, p2, p3, p4)   {if (hd_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_HID, TRACE_TYPE_API, m,p1,p2,p3,p4);}
 
#define HIDD_TRACE_API5(m, p1, p2, p3, p4, p5)   {if (hd_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_HID, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
 
#define HIDD_TRACE_API6(m, p1, p2, p3, p4, p5, p6)   {if (hd_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_HID, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
 
#define HIDD_TRACE_EVENT0(m)   {if (hd_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_HID, TRACE_TYPE_EVENT, m);}
 
#define HIDD_TRACE_EVENT1(m, p1)   {if (hd_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_HID, TRACE_TYPE_EVENT, m, p1);}
 
#define HIDD_TRACE_EVENT2(m, p1, p2)   {if (hd_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_HID, TRACE_TYPE_EVENT, m,p1,p2);}
 
#define HIDD_TRACE_EVENT3(m, p1, p2, p3)   {if (hd_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_HID, TRACE_TYPE_EVENT, m,p1,p2,p3);}
 
#define HIDD_TRACE_EVENT4(m, p1, p2, p3, p4)   {if (hd_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_HID, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
 
#define HIDD_TRACE_EVENT5(m, p1, p2, p3, p4, p5)   {if (hd_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_HID, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
 
#define HIDD_TRACE_EVENT6(m, p1, p2, p3, p4, p5, p6)   {if (hd_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_HID, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
 
#define HIDD_TRACE_DEBUG0(m)   {if (hd_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m);}
 
#define HIDD_TRACE_DEBUG1(m, p1)   {if (hd_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m,p1);}
 
#define HIDD_TRACE_DEBUG2(m, p1, p2)   {if (hd_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m,p1,p2);}
 
#define HIDD_TRACE_DEBUG3(m, p1, p2, p3)   {if (hd_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
 
#define HIDD_TRACE_DEBUG4(m, p1, p2, p3, p4)   {if (hd_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
 
#define HIDD_TRACE_DEBUG5(m, p1, p2, p3, p4, p5)   {if (hd_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
 
#define HIDD_TRACE_DEBUG6(m, p1, p2, p3, p4, p5, p6)   {if (hd_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
 
#define HSP2_TRACE_ERROR0(pcb, m)   {if (pcb->trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_HSP2, TRACE_TYPE_ERROR, m);}
 
#define HSP2_TRACE_ERROR1(pcb, m, p1)   {if (pcb->trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_HSP2, TRACE_TYPE_ERROR, m, p1);}
 
#define HSP2_TRACE_ERROR2(pcb, m, p1, p2)   {if (pcb->trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_HSP2, TRACE_TYPE_ERROR, m,p1,p2);}
 
#define HSP2_TRACE_ERROR3(pcb, m, p1, p2, p3)   {if (pcb->trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_HSP2, TRACE_TYPE_ERROR, m,p1,p2,p3);}
 
#define HSP2_TRACE_ERROR4(pcb, m, p1, p2, p3, p4)   {if (pcb->trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_HSP2, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
 
#define HSP2_TRACE_ERROR5(pcb, m, p1, p2, p3, p4, p5)   {if (pcb->trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_HSP2, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
 
#define HSP2_TRACE_ERROR6(pcb, m, p1, p2, p3, p4, p5, p6)   {if (pcb->trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_HSP2, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
 
#define HSP2_TRACE_WARNING0(pcb, m)   {if (pcb->trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_HSP2, TRACE_TYPE_WARNING, m);}
 
#define HSP2_TRACE_WARNING1(pcb, m, p1)   {if (pcb->trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_HSP2, TRACE_TYPE_WARNING, m,p1);}
 
#define HSP2_TRACE_WARNING2(pcb, m, p1, p2)   {if (pcb->trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_HSP2, TRACE_TYPE_WARNING, m,p1,p2);}
 
#define HSP2_TRACE_WARNING3(pcb, m, p1, p2, p3)   {if (pcb->trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_HSP2, TRACE_TYPE_WARNING, m,p1,p2,p3);}
 
#define HSP2_TRACE_WARNING4(pcb, m, p1, p2, p3, p4)   {if (pcb->trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_HSP2, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
 
#define HSP2_TRACE_WARNING5(pcb, m, p1, p2, p3, p4, p5)   {if (pcb->trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_HSP2, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
 
#define HSP2_TRACE_WARNING6(pcb, m, p1, p2, p3, p4, p5, p6)   {if (pcb->trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_HSP2, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
 
#define HSP2_TRACE_API0(pcb, m)   {if (pcb->trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_HSP2, TRACE_TYPE_API, m);}
 
#define HSP2_TRACE_API1(pcb, m, p1)   {if (pcb->trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_HSP2, TRACE_TYPE_API, m, p1);}
 
#define HSP2_TRACE_API2(pcb, m, p1, p2)   {if (pcb->trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_HSP2, TRACE_TYPE_API, m,p1,p2);}
 
#define HSP2_TRACE_API3(pcb, m, p1, p2, p3)   {if (pcb->trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_HSP2, TRACE_TYPE_API, m,p1,p2,p3);}
 
#define HSP2_TRACE_API4(pcb, m, p1, p2, p3, p4)   {if (pcb->trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_HSP2, TRACE_TYPE_API, m,p1,p2,p3,p4);}
 
#define HSP2_TRACE_API5(pcb, m, p1, p2, p3, p4, p5)   {if (pcb->trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_HSP2, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
 
#define HSP2_TRACE_API6(pcb, m, p1, p2, p3, p4, p5, p6)   {if (pcb->trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_HSP2, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
 
#define HSP2_TRACE_EVENT0(pcb, m)   {if (pcb->trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_HSP2, TRACE_TYPE_EVENT, m);}
 
#define HSP2_TRACE_EVENT1(pcb, m, p1)   {if (pcb->trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_HSP2, TRACE_TYPE_EVENT, m, p1);}
 
#define HSP2_TRACE_EVENT2(pcb, m, p1, p2)   {if (pcb->trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_HSP2, TRACE_TYPE_EVENT, m,p1,p2);}
 
#define HSP2_TRACE_EVENT3(pcb, m, p1, p2, p3)   {if (pcb->trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_HSP2, TRACE_TYPE_EVENT, m,p1,p2,p3);}
 
#define HSP2_TRACE_EVENT4(pcb, m, p1, p2, p3, p4)   {if (pcb->trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_HSP2, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
 
#define HSP2_TRACE_EVENT5(pcb, m, p1, p2, p3, p4, p5)   {if (pcb->trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_HSP2, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
 
#define HSP2_TRACE_EVENT6(pcb, m, p1, p2, p3, p4, p5, p6)   {if (pcb->trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_HSP2, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
 
#define HSP2_TRACE_DEBUG0(pcb, m)   {if (pcb->trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_HSP2, TRACE_TYPE_DEBUG, m);}
 
#define HSP2_TRACE_DEBUG1(pcb, m, p1)   {if (pcb->trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_HSP2, TRACE_TYPE_DEBUG, m,p1);}
 
#define HSP2_TRACE_DEBUG2(pcb, m, p1, p2)   {if (pcb->trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_HSP2, TRACE_TYPE_DEBUG, m,p1,p2);}
 
#define HSP2_TRACE_DEBUG3(pcb, m, p1, p2, p3)   {if (pcb->trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_HSP2, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
 
#define HSP2_TRACE_DEBUG4(pcb, m, p1, p2, p3, p4)   {if (pcb->trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_HSP2, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
 
#define HSP2_TRACE_DEBUG5(pcb, m, p1, p2, p3, p4, p5)   {if (pcb->trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_HSP2, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
 
#define HSP2_TRACE_DEBUG6(pcb, m, p1, p2, p3, p4, p5, p6)   {if (pcb->trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_HSP2, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
 
#define NFC_TRACE_ERROR0(m)   {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_NFC, TRACE_TYPE_ERROR, m);}
 
#define NFC_TRACE_ERROR1(m, p1)   {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_NFC, TRACE_TYPE_ERROR, m,p1);}
 
#define NFC_TRACE_ERROR2(m, p1, p2)   {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_NFC, TRACE_TYPE_ERROR, m,p1,p2);}
 
#define NFC_TRACE_ERROR3(m, p1, p2, p3)   {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_NFC, TRACE_TYPE_ERROR, m,p1,p2,p3);}
 
#define NFC_TRACE_ERROR4(m, p1, p2, p3, p4)   {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_NFC, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
 
#define NFC_TRACE_ERROR5(m, p1, p2, p3, p4, p5)   {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_NFC, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
 
#define NFC_TRACE_ERROR6(m, p1, p2, p3, p4, p5, p6)   {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_NFC, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
 
#define NFC_TRACE_WARNING0(m)   {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_NFC, TRACE_TYPE_WARNING, m);}
 
#define NFC_TRACE_WARNING1(m, p1)   {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_NFC, TRACE_TYPE_WARNING, m,p1);}
 
#define NFC_TRACE_WARNING2(m, p1, p2)   {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_NFC, TRACE_TYPE_WARNING, m,p1,p2);}
 
#define NFC_TRACE_WARNING3(m, p1, p2, p3)   {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_NFC, TRACE_TYPE_WARNING, m,p1,p2,p3);}
 
#define NFC_TRACE_WARNING4(m, p1, p2, p3, p4)   {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_NFC, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
 
#define NFC_TRACE_WARNING5(m, p1, p2, p3, p4, p5)   {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_NFC, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
 
#define NFC_TRACE_WARNING6(m, p1, p2, p3, p4, p5, p6)   {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_NFC, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
 
#define NFC_TRACE_API0(m)   {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_NFC, TRACE_TYPE_API, m);}
 
#define NFC_TRACE_API1(m, p1)   {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_NFC, TRACE_TYPE_API, m,p1);}
 
#define NFC_TRACE_API2(m, p1, p2)   {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_NFC, TRACE_TYPE_API, m,p1,p2);}
 
#define NFC_TRACE_API3(m, p1, p2, p3)   {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_NFC, TRACE_TYPE_API, m,p1,p2,p3);}
 
#define NFC_TRACE_API4(m, p1, p2, p3, p4)   {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_NFC, TRACE_TYPE_API, m,p1,p2,p3,p4);}
 
#define NFC_TRACE_API5(m, p1, p2, p3, p4, p5)   {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_NFC, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
 
#define NFC_TRACE_API6(m, p1, p2, p3, p4, p5, p6)   {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_NFC, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
 
#define NFC_TRACE_EVENT0(m)   {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_NFC, TRACE_TYPE_EVENT, m);}
 
#define NFC_TRACE_EVENT1(m, p1)   {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_NFC, TRACE_TYPE_EVENT, m, p1);}
 
#define NFC_TRACE_EVENT2(m, p1, p2)   {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_NFC, TRACE_TYPE_EVENT, m,p1,p2);}
 
#define NFC_TRACE_EVENT3(m, p1, p2, p3)   {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_NFC, TRACE_TYPE_EVENT, m,p1,p2,p3);}
 
#define NFC_TRACE_EVENT4(m, p1, p2, p3, p4)   {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_NFC, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
 
#define NFC_TRACE_EVENT5(m, p1, p2, p3, p4, p5)   {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_NFC, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
 
#define NFC_TRACE_EVENT6(m, p1, p2, p3, p4, p5, p6)   {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_NFC, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
 
#define NFC_TRACE_DEBUG0(m)   {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_NFC, TRACE_TYPE_DEBUG, m);}
 
#define NFC_TRACE_DEBUG1(m, p1)   {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_NFC, TRACE_TYPE_DEBUG, m,p1);}
 
#define NFC_TRACE_DEBUG2(m, p1, p2)   {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_NFC, TRACE_TYPE_DEBUG, m,p1,p2);}
 
#define NFC_TRACE_DEBUG3(m, p1, p2, p3)   {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_NFC, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
 
#define NFC_TRACE_DEBUG4(m, p1, p2, p3, p4)   {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_NFC, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
 
#define NFC_TRACE_DEBUG5(m, p1, p2, p3, p4, p5)   {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_NFC, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
 
#define NFC_TRACE_DEBUG6(m, p1, p2, p3, p4, p5, p6)   {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_NFC, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
 
#define NCI_TRACE_ERROR0(m)   {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_NCI, TRACE_TYPE_ERROR, m);}
 
#define NCI_TRACE_ERROR1(m, p1)   {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_NCI, TRACE_TYPE_ERROR, m,p1);}
 
#define NCI_TRACE_ERROR2(m, p1, p2)   {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_NCI, TRACE_TYPE_ERROR, m,p1,p2);}
 
#define NCI_TRACE_ERROR3(m, p1, p2, p3)   {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_NCI, TRACE_TYPE_ERROR, m,p1,p2,p3);}
 
#define NCI_TRACE_ERROR4(m, p1, p2, p3, p4)   {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_NCI, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
 
#define NCI_TRACE_ERROR5(m, p1, p2, p3, p4, p5)   {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_NCI, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
 
#define NCI_TRACE_ERROR6(m, p1, p2, p3, p4, p5, p6)   {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_NCI, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
 
#define NCI_TRACE_WARNING0(m)   {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_NCI, TRACE_TYPE_WARNING, m);}
 
#define NCI_TRACE_WARNING1(m, p1)   {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_NCI, TRACE_TYPE_WARNING, m,p1);}
 
#define NCI_TRACE_WARNING2(m, p1, p2)   {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_NCI, TRACE_TYPE_WARNING, m,p1,p2);}
 
#define NCI_TRACE_WARNING3(m, p1, p2, p3)   {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_NCI, TRACE_TYPE_WARNING, m,p1,p2,p3);}
 
#define NCI_TRACE_WARNING4(m, p1, p2, p3, p4)   {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_NCI, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
 
#define NCI_TRACE_WARNING5(m, p1, p2, p3, p4, p5)   {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_NCI, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
 
#define NCI_TRACE_WARNING6(m, p1, p2, p3, p4, p5, p6)   {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_NCI, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
 
#define NCI_TRACE_API0(m)   {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_NCI, TRACE_TYPE_API, m);}
 
#define NCI_TRACE_API1(m, p1)   {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_NCI, TRACE_TYPE_API, m,p1);}
 
#define NCI_TRACE_API2(m, p1, p2)   {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_NCI, TRACE_TYPE_API, m,p1,p2);}
 
#define NCI_TRACE_API3(m, p1, p2, p3)   {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_NCI, TRACE_TYPE_API, m,p1,p2,p3);}
 
#define NCI_TRACE_API4(m, p1, p2, p3, p4)   {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_NCI, TRACE_TYPE_API, m,p1,p2,p3,p4);}
 
#define NCI_TRACE_API5(m, p1, p2, p3, p4, p5)   {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_NCI, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
 
#define NCI_TRACE_API6(m, p1, p2, p3, p4, p5, p6)   {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_NCI, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
 
#define NCI_TRACE_EVENT0(m)   {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_NCI, TRACE_TYPE_EVENT, m);}
 
#define NCI_TRACE_EVENT1(m, p1)   {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_NCI, TRACE_TYPE_EVENT, m, p1);}
 
#define NCI_TRACE_EVENT2(m, p1, p2)   {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_NCI, TRACE_TYPE_EVENT, m,p1,p2);}
 
#define NCI_TRACE_EVENT3(m, p1, p2, p3)   {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_NCI, TRACE_TYPE_EVENT, m,p1,p2,p3);}
 
#define NCI_TRACE_EVENT4(m, p1, p2, p3, p4)   {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_NCI, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
 
#define NCI_TRACE_EVENT5(m, p1, p2, p3, p4, p5)   {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_NCI, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
 
#define NCI_TRACE_EVENT6(m, p1, p2, p3, p4, p5, p6)   {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_NCI, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
 
#define NCI_TRACE_DEBUG0(m)   {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_NCI, TRACE_TYPE_DEBUG, m);}
 
#define NCI_TRACE_DEBUG1(m, p1)   {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_NCI, TRACE_TYPE_DEBUG, m,p1);}
 
#define NCI_TRACE_DEBUG2(m, p1, p2)   {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_NCI, TRACE_TYPE_DEBUG, m,p1,p2);}
 
#define NCI_TRACE_DEBUG3(m, p1, p2, p3)   {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_NCI, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
 
#define NCI_TRACE_DEBUG4(m, p1, p2, p3, p4)   {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_NCI, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
 
#define NCI_TRACE_DEBUG5(m, p1, p2, p3, p4, p5)   {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_NCI, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
 
#define NCI_TRACE_DEBUG6(m, p1, p2, p3, p4, p5, p6)   {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_NCI, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
 
#define RW_TRACE_ERROR0(m)   {if (rw_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_RW, TRACE_TYPE_ERROR, m);}
 
#define RW_TRACE_ERROR1(m, p1)   {if (rw_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_RW, TRACE_TYPE_ERROR, m,p1);}
 
#define RW_TRACE_ERROR2(m, p1, p2)   {if (rw_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_RW, TRACE_TYPE_ERROR, m,p1,p2);}
 
#define RW_TRACE_ERROR3(m, p1, p2, p3)   {if (rw_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_RW, TRACE_TYPE_ERROR, m,p1,p2,p3);}
 
#define RW_TRACE_ERROR4(m, p1, p2, p3, p4)   {if (rw_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_RW, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
 
#define RW_TRACE_ERROR5(m, p1, p2, p3, p4, p5)   {if (rw_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_RW, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
 
#define RW_TRACE_ERROR6(m, p1, p2, p3, p4, p5, p6)   {if (rw_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_RW, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
 
#define RW_TRACE_WARNING0(m)   {if (rw_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_RW, TRACE_TYPE_WARNING, m);}
 
#define RW_TRACE_WARNING1(m, p1)   {if (rw_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_RW, TRACE_TYPE_WARNING, m,p1);}
 
#define RW_TRACE_WARNING2(m, p1, p2)   {if (rw_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_RW, TRACE_TYPE_WARNING, m,p1,p2);}
 
#define RW_TRACE_WARNING3(m, p1, p2, p3)   {if (rw_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_RW, TRACE_TYPE_WARNING, m,p1,p2,p3);}
 
#define RW_TRACE_WARNING4(m, p1, p2, p3, p4)   {if (rw_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_RW, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
 
#define RW_TRACE_WARNING5(m, p1, p2, p3, p4, p5)   {if (rw_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_RW, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
 
#define RW_TRACE_WARNING6(m, p1, p2, p3, p4, p5, p6)   {if (rw_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_RW, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
 
#define RW_TRACE_API0(m)   {if (rw_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_RW, TRACE_TYPE_API, m);}
 
#define RW_TRACE_API1(m, p1)   {if (rw_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_RW, TRACE_TYPE_API, m,p1);}
 
#define RW_TRACE_API2(m, p1, p2)   {if (rw_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_RW, TRACE_TYPE_API, m,p1,p2);}
 
#define RW_TRACE_API3(m, p1, p2, p3)   {if (rw_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_RW, TRACE_TYPE_API, m,p1,p2,p3);}
 
#define RW_TRACE_API4(m, p1, p2, p3, p4)   {if (rw_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_RW, TRACE_TYPE_API, m,p1,p2,p3,p4);}
 
#define RW_TRACE_API5(m, p1, p2, p3, p4, p5)   {if (rw_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_RW, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
 
#define RW_TRACE_API6(m, p1, p2, p3, p4, p5, p6)   {if (rw_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_RW, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
 
#define RW_TRACE_EVENT0(m)   {if (rw_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_RW, TRACE_TYPE_EVENT, m);}
 
#define RW_TRACE_EVENT1(m, p1)   {if (rw_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_RW, TRACE_TYPE_EVENT, m, p1);}
 
#define RW_TRACE_EVENT2(m, p1, p2)   {if (rw_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_RW, TRACE_TYPE_EVENT, m,p1,p2);}
 
#define RW_TRACE_EVENT3(m, p1, p2, p3)   {if (rw_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_RW, TRACE_TYPE_EVENT, m,p1,p2,p3);}
 
#define RW_TRACE_EVENT4(m, p1, p2, p3, p4)   {if (rw_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_RW, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
 
#define RW_TRACE_EVENT5(m, p1, p2, p3, p4, p5)   {if (rw_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_RW, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
 
#define RW_TRACE_EVENT6(m, p1, p2, p3, p4, p5, p6)   {if (rw_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_RW, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
 
#define RW_TRACE_DEBUG0(m)   {if (rw_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_RW, TRACE_TYPE_DEBUG, m);}
 
#define RW_TRACE_DEBUG1(m, p1)   {if (rw_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_RW, TRACE_TYPE_DEBUG, m,p1);}
 
#define RW_TRACE_DEBUG2(m, p1, p2)   {if (rw_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_RW, TRACE_TYPE_DEBUG, m,p1,p2);}
 
#define RW_TRACE_DEBUG3(m, p1, p2, p3)   {if (rw_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_RW, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
 
#define RW_TRACE_DEBUG4(m, p1, p2, p3, p4)   {if (rw_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_RW, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
 
#define RW_TRACE_DEBUG5(m, p1, p2, p3, p4, p5)   {if (rw_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_RW, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
 
#define RW_TRACE_DEBUG6(m, p1, p2, p3, p4, p5, p6)   {if (rw_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_RW, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
 
#define CE_TRACE_ERROR0(m)   {if (ce_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_CE, TRACE_TYPE_ERROR, m);}
 
#define CE_TRACE_ERROR1(m, p1)   {if (ce_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_CE, TRACE_TYPE_ERROR, m,p1);}
 
#define CE_TRACE_ERROR2(m, p1, p2)   {if (ce_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_CE, TRACE_TYPE_ERROR, m,p1,p2);}
 
#define CE_TRACE_ERROR3(m, p1, p2, p3)   {if (ce_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_CE, TRACE_TYPE_ERROR, m,p1,p2,p3);}
 
#define CE_TRACE_ERROR4(m, p1, p2, p3, p4)   {if (ce_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_CE, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
 
#define CE_TRACE_ERROR5(m, p1, p2, p3, p4, p5)   {if (ce_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_CE, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
 
#define CE_TRACE_ERROR6(m, p1, p2, p3, p4, p5, p6)   {if (ce_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_CE, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
 
#define CE_TRACE_WARNING0(m)   {if (ce_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_CE, TRACE_TYPE_WARNING, m);}
 
#define CE_TRACE_WARNING1(m, p1)   {if (ce_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_CE, TRACE_TYPE_WARNING, m,p1);}
 
#define CE_TRACE_WARNING2(m, p1, p2)   {if (ce_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_CE, TRACE_TYPE_WARNING, m,p1,p2);}
 
#define CE_TRACE_WARNING3(m, p1, p2, p3)   {if (ce_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_CE, TRACE_TYPE_WARNING, m,p1,p2,p3);}
 
#define CE_TRACE_WARNING4(m, p1, p2, p3, p4)   {if (ce_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_CE, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
 
#define CE_TRACE_WARNING5(m, p1, p2, p3, p4, p5)   {if (ce_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_CE, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
 
#define CE_TRACE_WARNING6(m, p1, p2, p3, p4, p5, p6)   {if (ce_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_CE, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
 
#define CE_TRACE_API0(m)   {if (ce_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_CE, TRACE_TYPE_API, m);}
 
#define CE_TRACE_API1(m, p1)   {if (ce_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_CE, TRACE_TYPE_API, m,p1);}
 
#define CE_TRACE_API2(m, p1, p2)   {if (ce_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_CE, TRACE_TYPE_API, m,p1,p2);}
 
#define CE_TRACE_API3(m, p1, p2, p3)   {if (ce_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_CE, TRACE_TYPE_API, m,p1,p2,p3);}
 
#define CE_TRACE_API4(m, p1, p2, p3, p4)   {if (ce_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_CE, TRACE_TYPE_API, m,p1,p2,p3,p4);}
 
#define CE_TRACE_API5(m, p1, p2, p3, p4, p5)   {if (ce_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_CE, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
 
#define CE_TRACE_API6(m, p1, p2, p3, p4, p5, p6)   {if (ce_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_CE, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
 
#define CE_TRACE_EVENT0(m)   {if (ce_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_CE, TRACE_TYPE_EVENT, m);}
 
#define CE_TRACE_EVENT1(m, p1)   {if (ce_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_CE, TRACE_TYPE_EVENT, m, p1);}
 
#define CE_TRACE_EVENT2(m, p1, p2)   {if (ce_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_CE, TRACE_TYPE_EVENT, m,p1,p2);}
 
#define CE_TRACE_EVENT3(m, p1, p2, p3)   {if (ce_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_CE, TRACE_TYPE_EVENT, m,p1,p2,p3);}
 
#define CE_TRACE_EVENT4(m, p1, p2, p3, p4)   {if (ce_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_CE, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
 
#define CE_TRACE_EVENT5(m, p1, p2, p3, p4, p5)   {if (ce_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_CE, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
 
#define CE_TRACE_EVENT6(m, p1, p2, p3, p4, p5, p6)   {if (ce_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_CE, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
 
#define CE_TRACE_DEBUG0(m)   {if (ce_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_CE, TRACE_TYPE_DEBUG, m);}
 
#define CE_TRACE_DEBUG1(m, p1)   {if (ce_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_CE, TRACE_TYPE_DEBUG, m,p1);}
 
#define CE_TRACE_DEBUG2(m, p1, p2)   {if (ce_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_CE, TRACE_TYPE_DEBUG, m,p1,p2);}
 
#define CE_TRACE_DEBUG3(m, p1, p2, p3)   {if (ce_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_CE, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
 
#define CE_TRACE_DEBUG4(m, p1, p2, p3, p4)   {if (ce_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_CE, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
 
#define CE_TRACE_DEBUG5(m, p1, p2, p3, p4, p5)   {if (ce_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_CE, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
 
#define CE_TRACE_DEBUG6(m, p1, p2, p3, p4, p5, p6)   {if (ce_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_CE, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
 
#define NDEF_TRACE_ERROR0(m)   {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_NDEF, TRACE_TYPE_ERROR, m);}
 
#define NDEF_TRACE_ERROR1(m, p1)   {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_NDEF, TRACE_TYPE_ERROR, m,p1);}
 
#define NDEF_TRACE_ERROR2(m, p1, p2)   {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_NDEF, TRACE_TYPE_ERROR, m,p1,p2);}
 
#define NDEF_TRACE_ERROR3(m, p1, p2, p3)   {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_NDEF, TRACE_TYPE_ERROR, m,p1,p2,p3);}
 
#define NDEF_TRACE_ERROR4(m, p1, p2, p3, p4)   {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_NDEF, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
 
#define NDEF_TRACE_ERROR5(m, p1, p2, p3, p4, p5)   {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_NDEF, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
 
#define NDEF_TRACE_ERROR6(m, p1, p2, p3, p4, p5, p6)   {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_NDEF, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
 
#define NDEF_TRACE_WARNING0(m)   {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_NDEF, TRACE_TYPE_WARNING, m);}
 
#define NDEF_TRACE_WARNING1(m, p1)   {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_NDEF, TRACE_TYPE_WARNING, m,p1);}
 
#define NDEF_TRACE_WARNING2(m, p1, p2)   {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_NDEF, TRACE_TYPE_WARNING, m,p1,p2);}
 
#define NDEF_TRACE_WARNING3(m, p1, p2, p3)   {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_NDEF, TRACE_TYPE_WARNING, m,p1,p2,p3);}
 
#define NDEF_TRACE_WARNING4(m, p1, p2, p3, p4)   {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_NDEF, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
 
#define NDEF_TRACE_WARNING5(m, p1, p2, p3, p4, p5)   {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_NDEF, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
 
#define NDEF_TRACE_WARNING6(m, p1, p2, p3, p4, p5, p6)   {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_NDEF, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
 
#define NDEF_TRACE_API0(m)   {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_NDEF, TRACE_TYPE_API, m);}
 
#define NDEF_TRACE_API1(m, p1)   {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_NDEF, TRACE_TYPE_API, m,p1);}
 
#define NDEF_TRACE_API2(m, p1, p2)   {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_NDEF, TRACE_TYPE_API, m,p1,p2);}
 
#define NDEF_TRACE_API3(m, p1, p2, p3)   {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_NDEF, TRACE_TYPE_API, m,p1,p2,p3);}
 
#define NDEF_TRACE_API4(m, p1, p2, p3, p4)   {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_NDEF, TRACE_TYPE_API, m,p1,p2,p3,p4);}
 
#define NDEF_TRACE_API5(m, p1, p2, p3, p4, p5)   {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_NDEF, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
 
#define NDEF_TRACE_API6(m, p1, p2, p3, p4, p5, p6)   {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_NDEF, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
 
#define NDEF_TRACE_EVENT0(m)   {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_NDEF, TRACE_TYPE_EVENT, m);}
 
#define NDEF_TRACE_EVENT1(m, p1)   {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_NDEF, TRACE_TYPE_EVENT, m, p1);}
 
#define NDEF_TRACE_EVENT2(m, p1, p2)   {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_NDEF, TRACE_TYPE_EVENT, m,p1,p2);}
 
#define NDEF_TRACE_EVENT3(m, p1, p2, p3)   {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_NDEF, TRACE_TYPE_EVENT, m,p1,p2,p3);}
 
#define NDEF_TRACE_EVENT4(m, p1, p2, p3, p4)   {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_NDEF, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
 
#define NDEF_TRACE_EVENT5(m, p1, p2, p3, p4, p5)   {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_NDEF, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
 
#define NDEF_TRACE_EVENT6(m, p1, p2, p3, p4, p5, p6)   {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_NDEF, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
 
#define NDEF_TRACE_DEBUG0(m)   {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_NDEF, TRACE_TYPE_DEBUG, m);}
 
#define NDEF_TRACE_DEBUG1(m, p1)   {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_NDEF, TRACE_TYPE_DEBUG, m,p1);}
 
#define NDEF_TRACE_DEBUG2(m, p1, p2)   {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_NDEF, TRACE_TYPE_DEBUG, m,p1,p2);}
 
#define NDEF_TRACE_DEBUG3(m, p1, p2, p3)   {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_NDEF, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
 
#define NDEF_TRACE_DEBUG4(m, p1, p2, p3, p4)   {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_NDEF, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
 
#define NDEF_TRACE_DEBUG5(m, p1, p2, p3, p4, p5)   {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_NDEF, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
 
#define NDEF_TRACE_DEBUG6(m, p1, p2, p3, p4, p5, p6)   {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_NDEF, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
 
#define NFA_TRACE_ERROR0(m)   {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_NFA, TRACE_TYPE_ERROR, m);}
 
#define NFA_TRACE_ERROR1(m, p1)   {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_NFA, TRACE_TYPE_ERROR, m,p1);}
 
#define NFA_TRACE_ERROR2(m, p1, p2)   {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_NFA, TRACE_TYPE_ERROR, m,p1,p2);}
 
#define NFA_TRACE_ERROR3(m, p1, p2, p3)   {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_NFA, TRACE_TYPE_ERROR, m,p1,p2,p3);}
 
#define NFA_TRACE_ERROR4(m, p1, p2, p3, p4)   {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_NFA, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
 
#define NFA_TRACE_ERROR5(m, p1, p2, p3, p4, p5)   {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_NFA, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
 
#define NFA_TRACE_ERROR6(m, p1, p2, p3, p4, p5, p6)   {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_NFA, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
 
#define NFA_TRACE_WARNING0(m)   {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_NFA, TRACE_TYPE_WARNING, m);}
 
#define NFA_TRACE_WARNING1(m, p1)   {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_NFA, TRACE_TYPE_WARNING, m,p1);}
 
#define NFA_TRACE_WARNING2(m, p1, p2)   {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_NFA, TRACE_TYPE_WARNING, m,p1,p2);}
 
#define NFA_TRACE_WARNING3(m, p1, p2, p3)   {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_NFA, TRACE_TYPE_WARNING, m,p1,p2,p3);}
 
#define NFA_TRACE_WARNING4(m, p1, p2, p3, p4)   {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_NFA, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
 
#define NFA_TRACE_WARNING5(m, p1, p2, p3, p4, p5)   {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_NFA, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
 
#define NFA_TRACE_WARNING6(m, p1, p2, p3, p4, p5, p6)   {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_NFA, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
 
#define NFA_TRACE_API0(m)   {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_NFA, TRACE_TYPE_API, m);}
 
#define NFA_TRACE_API1(m, p1)   {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_NFA, TRACE_TYPE_API, m,p1);}
 
#define NFA_TRACE_API2(m, p1, p2)   {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_NFA, TRACE_TYPE_API, m,p1,p2);}
 
#define NFA_TRACE_API3(m, p1, p2, p3)   {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_NFA, TRACE_TYPE_API, m,p1,p2,p3);}
 
#define NFA_TRACE_API4(m, p1, p2, p3, p4)   {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_NFA, TRACE_TYPE_API, m,p1,p2,p3,p4);}
 
#define NFA_TRACE_API5(m, p1, p2, p3, p4, p5)   {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_NFA, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
 
#define NFA_TRACE_API6(m, p1, p2, p3, p4, p5, p6)   {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_NFA, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
 
#define NFA_TRACE_EVENT0(m)   {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_NFA, TRACE_TYPE_EVENT, m);}
 
#define NFA_TRACE_EVENT1(m, p1)   {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_NFA, TRACE_TYPE_EVENT, m, p1);}
 
#define NFA_TRACE_EVENT2(m, p1, p2)   {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_NFA, TRACE_TYPE_EVENT, m,p1,p2);}
 
#define NFA_TRACE_EVENT3(m, p1, p2, p3)   {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_NFA, TRACE_TYPE_EVENT, m,p1,p2,p3);}
 
#define NFA_TRACE_EVENT4(m, p1, p2, p3, p4)   {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_NFA, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
 
#define NFA_TRACE_EVENT5(m, p1, p2, p3, p4, p5)   {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_NFA, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
 
#define NFA_TRACE_EVENT6(m, p1, p2, p3, p4, p5, p6)   {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_NFA, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
 
#define NFA_TRACE_DEBUG0(m)   {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_NFA, TRACE_TYPE_DEBUG, m);}
 
#define NFA_TRACE_DEBUG1(m, p1)   {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_NFA, TRACE_TYPE_DEBUG, m,p1);}
 
#define NFA_TRACE_DEBUG2(m, p1, p2)   {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_NFA, TRACE_TYPE_DEBUG, m,p1,p2);}
 
#define NFA_TRACE_DEBUG3(m, p1, p2, p3)   {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_NFA, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
 
#define NFA_TRACE_DEBUG4(m, p1, p2, p3, p4)   {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_NFA, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
 
#define NFA_TRACE_DEBUG5(m, p1, p2, p3, p4, p5)   {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_NFA, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
 
#define NFA_TRACE_DEBUG6(m, p1, p2, p3, p4, p5, p6)   {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_NFA, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
 
#define P2P_TRACE_ERROR0(m)   {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_P2P, TRACE_TYPE_ERROR, m);}
 
#define P2P_TRACE_ERROR1(m, p1)   {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_P2P, TRACE_TYPE_ERROR, m,p1);}
 
#define P2P_TRACE_ERROR2(m, p1, p2)   {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_P2P, TRACE_TYPE_ERROR, m,p1,p2);}
 
#define P2P_TRACE_ERROR3(m, p1, p2, p3)   {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_P2P, TRACE_TYPE_ERROR, m,p1,p2,p3);}
 
#define P2P_TRACE_ERROR4(m, p1, p2, p3, p4)   {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_P2P, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
 
#define P2P_TRACE_ERROR5(m, p1, p2, p3, p4, p5)   {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_P2P, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
 
#define P2P_TRACE_ERROR6(m, p1, p2, p3, p4, p5, p6)   {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_P2P, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
 
#define P2P_TRACE_WARNING0(m)   {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_P2P, TRACE_TYPE_WARNING, m);}
 
#define P2P_TRACE_WARNING1(m, p1)   {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_P2P, TRACE_TYPE_WARNING, m,p1);}
 
#define P2P_TRACE_WARNING2(m, p1, p2)   {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_P2P, TRACE_TYPE_WARNING, m,p1,p2);}
 
#define P2P_TRACE_WARNING3(m, p1, p2, p3)   {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_P2P, TRACE_TYPE_WARNING, m,p1,p2,p3);}
 
#define P2P_TRACE_WARNING4(m, p1, p2, p3, p4)   {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_P2P, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
 
#define P2P_TRACE_WARNING5(m, p1, p2, p3, p4, p5)   {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_P2P, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
 
#define P2P_TRACE_WARNING6(m, p1, p2, p3, p4, p5, p6)   {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_P2P, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
 
#define P2P_TRACE_API0(m)   {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_P2P, TRACE_TYPE_API, m);}
 
#define P2P_TRACE_API1(m, p1)   {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_P2P, TRACE_TYPE_API, m,p1);}
 
#define P2P_TRACE_API2(m, p1, p2)   {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_P2P, TRACE_TYPE_API, m,p1,p2);}
 
#define P2P_TRACE_API3(m, p1, p2, p3)   {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_P2P, TRACE_TYPE_API, m,p1,p2,p3);}
 
#define P2P_TRACE_API4(m, p1, p2, p3, p4)   {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_P2P, TRACE_TYPE_API, m,p1,p2,p3,p4);}
 
#define P2P_TRACE_API5(m, p1, p2, p3, p4, p5)   {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_P2P, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
 
#define P2P_TRACE_API6(m, p1, p2, p3, p4, p5, p6)   {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_P2P, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
 
#define P2P_TRACE_EVENT0(m)   {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_P2P, TRACE_TYPE_EVENT, m);}
 
#define P2P_TRACE_EVENT1(m, p1)   {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_P2P, TRACE_TYPE_EVENT, m, p1);}
 
#define P2P_TRACE_EVENT2(m, p1, p2)   {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_P2P, TRACE_TYPE_EVENT, m,p1,p2);}
 
#define P2P_TRACE_EVENT3(m, p1, p2, p3)   {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_P2P, TRACE_TYPE_EVENT, m,p1,p2,p3);}
 
#define P2P_TRACE_EVENT4(m, p1, p2, p3, p4)   {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_P2P, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
 
#define P2P_TRACE_EVENT5(m, p1, p2, p3, p4, p5)   {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_P2P, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
 
#define P2P_TRACE_EVENT6(m, p1, p2, p3, p4, p5, p6)   {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_P2P, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
 
#define P2P_TRACE_DEBUG0(m)   {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_P2P, TRACE_TYPE_DEBUG, m);}
 
#define P2P_TRACE_DEBUG1(m, p1)   {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_P2P, TRACE_TYPE_DEBUG, m,p1);}
 
#define P2P_TRACE_DEBUG2(m, p1, p2)   {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_P2P, TRACE_TYPE_DEBUG, m,p1,p2);}
 
#define P2P_TRACE_DEBUG3(m, p1, p2, p3)   {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_P2P, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
 
#define P2P_TRACE_DEBUG4(m, p1, p2, p3, p4)   {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_P2P, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
 
#define P2P_TRACE_DEBUG5(m, p1, p2, p3, p4, p5)   {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_P2P, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
 
#define P2P_TRACE_DEBUG6(m, p1, p2, p3, p4, p5, p6)   {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_P2P, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
 
#define CHO_TRACE_ERROR0(m)   {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_CHO, TRACE_TYPE_ERROR, m);}
 
#define CHO_TRACE_ERROR1(m, p1)   {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_CHO, TRACE_TYPE_ERROR, m,p1);}
 
#define CHO_TRACE_ERROR2(m, p1, p2)   {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_CHO, TRACE_TYPE_ERROR, m,p1,p2);}
 
#define CHO_TRACE_ERROR3(m, p1, p2, p3)   {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_CHO, TRACE_TYPE_ERROR, m,p1,p2,p3);}
 
#define CHO_TRACE_ERROR4(m, p1, p2, p3, p4)   {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_CHO, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
 
#define CHO_TRACE_ERROR5(m, p1, p2, p3, p4, p5)   {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_CHO, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
 
#define CHO_TRACE_ERROR6(m, p1, p2, p3, p4, p5, p6)   {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_CHO, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
 
#define CHO_TRACE_WARNING0(m)   {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_CHO, TRACE_TYPE_WARNING, m);}
 
#define CHO_TRACE_WARNING1(m, p1)   {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_CHO, TRACE_TYPE_WARNING, m,p1);}
 
#define CHO_TRACE_WARNING2(m, p1, p2)   {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_CHO, TRACE_TYPE_WARNING, m,p1,p2);}
 
#define CHO_TRACE_WARNING3(m, p1, p2, p3)   {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_CHO, TRACE_TYPE_WARNING, m,p1,p2,p3);}
 
#define CHO_TRACE_WARNING4(m, p1, p2, p3, p4)   {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_CHO, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
 
#define CHO_TRACE_WARNING5(m, p1, p2, p3, p4, p5)   {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_CHO, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
 
#define CHO_TRACE_WARNING6(m, p1, p2, p3, p4, p5, p6)   {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_CHO, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
 
#define CHO_TRACE_API0(m)   {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_CHO, TRACE_TYPE_API, m);}
 
#define CHO_TRACE_API1(m, p1)   {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_CHO, TRACE_TYPE_API, m,p1);}
 
#define CHO_TRACE_API2(m, p1, p2)   {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_CHO, TRACE_TYPE_API, m,p1,p2);}
 
#define CHO_TRACE_API3(m, p1, p2, p3)   {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_CHO, TRACE_TYPE_API, m,p1,p2,p3);}
 
#define CHO_TRACE_API4(m, p1, p2, p3, p4)   {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_CHO, TRACE_TYPE_API, m,p1,p2,p3,p4);}
 
#define CHO_TRACE_API5(m, p1, p2, p3, p4, p5)   {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_CHO, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
 
#define CHO_TRACE_API6(m, p1, p2, p3, p4, p5, p6)   {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_CHO, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
 
#define CHO_TRACE_EVENT0(m)   {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_CHO, TRACE_TYPE_EVENT, m);}
 
#define CHO_TRACE_EVENT1(m, p1)   {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_CHO, TRACE_TYPE_EVENT, m, p1);}
 
#define CHO_TRACE_EVENT2(m, p1, p2)   {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_CHO, TRACE_TYPE_EVENT, m,p1,p2);}
 
#define CHO_TRACE_EVENT3(m, p1, p2, p3)   {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_CHO, TRACE_TYPE_EVENT, m,p1,p2,p3);}
 
#define CHO_TRACE_EVENT4(m, p1, p2, p3, p4)   {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_CHO, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
 
#define CHO_TRACE_EVENT5(m, p1, p2, p3, p4, p5)   {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_CHO, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
 
#define CHO_TRACE_EVENT6(m, p1, p2, p3, p4, p5, p6)   {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_CHO, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
 
#define CHO_TRACE_DEBUG0(m)   {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_CHO, TRACE_TYPE_DEBUG, m);}
 
#define CHO_TRACE_DEBUG1(m, p1)   {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_CHO, TRACE_TYPE_DEBUG, m,p1);}
 
#define CHO_TRACE_DEBUG2(m, p1, p2)   {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_CHO, TRACE_TYPE_DEBUG, m,p1,p2);}
 
#define CHO_TRACE_DEBUG3(m, p1, p2, p3)   {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_CHO, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
 
#define CHO_TRACE_DEBUG4(m, p1, p2, p3, p4)   {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_CHO, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
 
#define CHO_TRACE_DEBUG5(m, p1, p2, p3, p4, p5)   {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_CHO, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
 
#define CHO_TRACE_DEBUG6(m, p1, p2, p3, p4, p5, p6)   {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_CHO, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
 
#define SNEP_TRACE_ERROR0(m)   {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_SNEP, TRACE_TYPE_ERROR, m);}
 
#define SNEP_TRACE_ERROR1(m, p1)   {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_SNEP, TRACE_TYPE_ERROR, m,p1);}
 
#define SNEP_TRACE_ERROR2(m, p1, p2)   {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_SNEP, TRACE_TYPE_ERROR, m,p1,p2);}
 
#define SNEP_TRACE_ERROR3(m, p1, p2, p3)   {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_SNEP, TRACE_TYPE_ERROR, m,p1,p2,p3);}
 
#define SNEP_TRACE_ERROR4(m, p1, p2, p3, p4)   {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_SNEP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
 
#define SNEP_TRACE_ERROR5(m, p1, p2, p3, p4, p5)   {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_SNEP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
 
#define SNEP_TRACE_ERROR6(m, p1, p2, p3, p4, p5, p6)   {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_SNEP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
 
#define SNEP_TRACE_WARNING0(m)   {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_SNEP, TRACE_TYPE_WARNING, m);}
 
#define SNEP_TRACE_WARNING1(m, p1)   {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_SNEP, TRACE_TYPE_WARNING, m,p1);}
 
#define SNEP_TRACE_WARNING2(m, p1, p2)   {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_SNEP, TRACE_TYPE_WARNING, m,p1,p2);}
 
#define SNEP_TRACE_WARNING3(m, p1, p2, p3)   {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_SNEP, TRACE_TYPE_WARNING, m,p1,p2,p3);}
 
#define SNEP_TRACE_WARNING4(m, p1, p2, p3, p4)   {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_SNEP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
 
#define SNEP_TRACE_WARNING5(m, p1, p2, p3, p4, p5)   {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_SNEP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
 
#define SNEP_TRACE_WARNING6(m, p1, p2, p3, p4, p5, p6)   {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_SNEP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
 
#define SNEP_TRACE_API0(m)   {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_SNEP, TRACE_TYPE_API, m);}
 
#define SNEP_TRACE_API1(m, p1)   {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_SNEP, TRACE_TYPE_API, m,p1);}
 
#define SNEP_TRACE_API2(m, p1, p2)   {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_SNEP, TRACE_TYPE_API, m,p1,p2);}
 
#define SNEP_TRACE_API3(m, p1, p2, p3)   {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_SNEP, TRACE_TYPE_API, m,p1,p2,p3);}
 
#define SNEP_TRACE_API4(m, p1, p2, p3, p4)   {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_SNEP, TRACE_TYPE_API, m,p1,p2,p3,p4);}
 
#define SNEP_TRACE_API5(m, p1, p2, p3, p4, p5)   {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_SNEP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
 
#define SNEP_TRACE_API6(m, p1, p2, p3, p4, p5, p6)   {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_SNEP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
 
#define SNEP_TRACE_EVENT0(m)   {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_SNEP, TRACE_TYPE_EVENT, m);}
 
#define SNEP_TRACE_EVENT1(m, p1)   {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_SNEP, TRACE_TYPE_EVENT, m, p1);}
 
#define SNEP_TRACE_EVENT2(m, p1, p2)   {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_SNEP, TRACE_TYPE_EVENT, m,p1,p2);}
 
#define SNEP_TRACE_EVENT3(m, p1, p2, p3)   {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_SNEP, TRACE_TYPE_EVENT, m,p1,p2,p3);}
 
#define SNEP_TRACE_EVENT4(m, p1, p2, p3, p4)   {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_SNEP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
 
#define SNEP_TRACE_EVENT5(m, p1, p2, p3, p4, p5)   {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_SNEP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
 
#define SNEP_TRACE_EVENT6(m, p1, p2, p3, p4, p5, p6)   {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_SNEP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
 
#define SNEP_TRACE_DEBUG0(m)   {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_SNEP, TRACE_TYPE_DEBUG, m);}
 
#define SNEP_TRACE_DEBUG1(m, p1)   {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_SNEP, TRACE_TYPE_DEBUG, m,p1);}
 
#define SNEP_TRACE_DEBUG2(m, p1, p2)   {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_SNEP, TRACE_TYPE_DEBUG, m,p1,p2);}
 
#define SNEP_TRACE_DEBUG3(m, p1, p2, p3)   {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_SNEP, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
 
#define SNEP_TRACE_DEBUG4(m, p1, p2, p3, p4)   {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_SNEP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
 
#define SNEP_TRACE_DEBUG5(m, p1, p2, p3, p4, p5)   {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_SNEP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
 
#define SNEP_TRACE_DEBUG6(m, p1, p2, p3, p4, p5, p6)   {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_SNEP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
 
#define MMI_TRACE_0(m)
 
#define MMI_TRACE_1(m, p1)
 
#define MMI_TRACE_2(m, p1, p2)
 
#define MMI_TRACE_3(m, p1, p2, p3)
 
#define MMI_TRACE_4(m, p1, p2, p3, p4)
 
#define MMI_TRACE_5(m, p1, p2, p3, p4, p5)
 
#define MMI_TRACE_6(m, p1, p2, p3, p4, p5, p6)
 
#define MMI_DEBUG_0(m)   BT_TRACE_0(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m)
 
#define MMI_DEBUG_1(m, p1)   BT_TRACE_1(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m,p1)
 
#define MMI_DEBUG_2(m, p1, p2)   BT_TRACE_2(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m,p1,p2)
 
#define MMI_DEBUG_3(m, p1, p2, p3)   BT_TRACE_3(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m,p1,p2,p3)
 
#define MMI_DEBUG_4(m, p1, p2, p3, p4)   BT_TRACE_4(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4)
 
#define MMI_DEBUG_5(m, p1, p2, p3, p4, p5)   BT_TRACE_5(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5)
 
#define MMI_DEBUG_6(m, p1, p2, p3, p4, p5, p6)   BT_TRACE_6(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6)
 
#define MMI_WARNING_0(m)   BT_TRACE_0(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m)
 
#define MMI_WARNING_1(m, p1)   BT_TRACE_1(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m,p1)
 
#define MMI_WARNING_2(m, p1, p2)   BT_TRACE_2(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m,p1,p2)
 
#define MMI_WARNING_3(m, p1, p2, p3)   BT_TRACE_3(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m,p1,p2,p3)
 
#define MMI_WARNING_4(m, p1, p2, p3, p4)   BT_TRACE_4(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m,p1,p2,p3,p4)
 
#define MMI_WARNING_5(m, p1, p2, p3, p4, p5)   BT_TRACE_5(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5)
 
#define MMI_WARNING_6(m, p1, p2, p3, p4, p5, p6)   BT_TRACE_6(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6)
 
#define MMI_ERROR_0(m)   BT_TRACE_0(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m)
 
#define MMI_ERROR_1(m, p1)   BT_TRACE_1(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m,p1)
 
#define MMI_ERROR_2(m, p1, p2)   BT_TRACE_2(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m,p1,p2)
 
#define MMI_ERROR_3(m, p1, p2, p3)   BT_TRACE_3(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m,p1,p2,p3)
 
#define MMI_ERROR_4(m, p1, p2, p3, p4)   BT_TRACE_4(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m,p1,p2,p3,p4)
 
#define MMI_ERROR_5(m, p1, p2, p3, p4, p5)   BT_TRACE_5(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5)
 
#define MMI_ERROR_6(m, p1, p2, p3, p4, p5, p6)   BT_TRACE_6(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6)
 
#define TAK_TRACE_0(m)   MMI_Echo(m)
 
#define MSKB_TRACE_0(m)   MMI_Echo(m)
 
#define MSKB_TRACE_1(m, p1)   MMI_Echo(m,p1)
 
#define MSKB_TRACE_2(m, p1, p2)   MMI_Echo(m,p1,p2)
 
#define MSKB_TRACE_3(m, p1, p2, p3)   MMI_Echo(m,p1,p2,p3)
 
#define MSKB_TRACE_4(m, p1, p2, p3, p4)   MMI_Echo(m,p1,p2,p3,p4)
 
#define MSKB_TRACE_5(m, p1, p2, p3, p4, p5)   MMI_Echo(m,p1,p2,p3,p4,p5)
 
#define MSKB_TRACE_6(m, p1, p2, p3, p4, p5, p6)   MMI_Echo(m,p1,p2,p3,p4,p5,p6)
 
#define MSKB_DEBUG_0(m)   MMI_Echo(m)
 
#define MSKB_DEBUG_1(m, p1)   MMI_Echo(m,p1)
 
#define MSKB_DEBUG_2(m, p1, p2)   MMI_Echo(m,p1,p2)
 
#define MSKB_DEBUG_3(m, p1, p2, p3)   MMI_Echo(m,p1,p2,p3)
 
#define MSKB_DEBUG_4(m, p1, p2, p3, p4)   MMI_Echo(m,p1,p2,p3,p4)
 
#define MSKB_DEBUG_5(m, p1, p2, p3, p4, p5)   MMI_Echo(m,p1,p2,p3,p4,p5)
 
#define MSKB_DEBUG_6(m, p1, p2, p3, p4, p5, p6)   MMI_Echo(m,p1,p2,p3,p4,p5,p6)
 
#define MSKB_ERROR_0(m)   MMI_Echo(m)
 
#define MSKB_ERROR_1(m, p1)   MMI_Echo(m,p1)
 
#define MSKB_ERROR_2(m, p1, p2)   MMI_Echo(m,p1,p2)
 
#define MSKB_ERROR_3(m, p1, p2, p3)   MMI_Echo(m,p1,p2,p3)
 
#define MSKB_ERROR_4(m, p1, p2, p3, p4)   MMI_Echo(m,p1,p2,p3,p4)
 
#define MSKB_ERROR_5(m, p1, p2, p3, p4, p5)   MMI_Echo(m,p1,p2,p3,p4,p5)
 
#define MSKB_ERROR_6(m, p1, p2, p3, p4, p5, p6)   MMI_Echo(m,p1,p2,p3,p4,p5,p6)
 
#define DUN_TRACE_ERROR0(m)   {if (dun_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_DUN, TRACE_TYPE_ERROR, m);}
 
#define DUN_TRACE_ERROR1(m, p1)   {if (dun_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_DUN, TRACE_TYPE_ERROR, m, p1);}
 
#define DUN_TRACE_ERROR2(m, p1, p2)   {if (dun_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_DUN, TRACE_TYPE_ERROR, m,p1,p2);}
 
#define DUN_TRACE_ERROR3(m, p1, p2, p3)   {if (dun_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_DUN, TRACE_TYPE_ERROR, m,p1,p2,p3);}
 
#define DUN_TRACE_ERROR4(m, p1, p2, p3, p4)   {if (dun_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_DUN, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
 
#define DUN_TRACE_ERROR5(m, p1, p2, p3, p4, p5)   {if (dun_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_DUN, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
 
#define DUN_TRACE_ERROR6(m, p1, p2, p3, p4, p5, p6)   {if (dun_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_DUN, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
 
#define DUN_TRACE_WARNING0(m)   {if (dun_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_DUN, TRACE_TYPE_WARNING, m);}
 
#define DUN_TRACE_WARNING1(m, p1)   {if (dun_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_DUN, TRACE_TYPE_WARNING, m,p1);}
 
#define DUN_TRACE_WARNING2(m, p1, p2)   {if (dun_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_DUN, TRACE_TYPE_WARNING, m,p1,p2);}
 
#define DUN_TRACE_WARNING3(m, p1, p2, p3)   {if (dun_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_DUN, TRACE_TYPE_WARNING, m,p1,p2,p3);}
 
#define DUN_TRACE_WARNING4(m, p1, p2, p3, p4)   {if (dun_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_DUN, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
 
#define DUN_TRACE_WARNING5(m, p1, p2, p3, p4, p5)   {if (dun_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_DUN, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
 
#define DUN_TRACE_WARNING6(m, p1, p2, p3, p4, p5, p6)   {if (dun_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_DUN, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
 
#define DUN_TRACE_API0(m)   {if (dun_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_DUN, TRACE_TYPE_API, m);}
 
#define DUN_TRACE_API1(m, p1)   {if (dun_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_DUN, TRACE_TYPE_API, m, p1);}
 
#define DUN_TRACE_API2(m, p1, p2)   {if (dun_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_DUN, TRACE_TYPE_API, m,p1,p2);}
 
#define DUN_TRACE_API3(m, p1, p2, p3)   {if (dun_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_DUN, TRACE_TYPE_API, m,p1,p2,p3);}
 
#define DUN_TRACE_API4(m, p1, p2, p3, p4)   {if (dun_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_DUN, TRACE_TYPE_API, m,p1,p2,p3,p4);}
 
#define DUN_TRACE_API5(m, p1, p2, p3, p4, p5)   {if (dun_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_DUN, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
 
#define DUN_TRACE_API6(m, p1, p2, p3, p4, p5, p6)   {if (dun_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_DUN, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
 
#define DUN_TRACE_EVENT0(m)   {if (dun_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_DUN, TRACE_TYPE_EVENT, m);}
 
#define DUN_TRACE_EVENT1(m, p1)   {if (dun_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_DUN, TRACE_TYPE_EVENT, m, p1);}
 
#define DUN_TRACE_EVENT2(m, p1, p2)   {if (dun_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_DUN, TRACE_TYPE_EVENT, m,p1,p2);}
 
#define DUN_TRACE_EVENT3(m, p1, p2, p3)   {if (dun_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_DUN, TRACE_TYPE_EVENT, m,p1,p2,p3);}
 
#define DUN_TRACE_EVENT4(m, p1, p2, p3, p4)   {if (dun_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_DUN, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
 
#define DUN_TRACE_EVENT5(m, p1, p2, p3, p4, p5)   {if (dun_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_DUN, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
 
#define DUN_TRACE_EVENT6(m, p1, p2, p3, p4, p5, p6)   {if (dun_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_DUN, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
 
#define DUN_TRACE_DEBUG0(m)   {if (dun_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_DUN, TRACE_TYPE_DEBUG, m);}
 
#define DUN_TRACE_DEBUG1(m, p1)   {if (dun_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_DUN, TRACE_TYPE_DEBUG, m,p1);}
 
#define DUN_TRACE_DEBUG2(m, p1, p2)   {if (dun_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_DUN, TRACE_TYPE_DEBUG, m,p1,p2);}
 
#define DUN_TRACE_DEBUG3(m, p1, p2, p3)   {if (dun_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_DUN, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
 
#define DUN_TRACE_DEBUG4(m, p1, p2, p3, p4)   {if (dun_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_DUN, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
 
#define DUN_TRACE_DEBUG5(m, p1, p2, p3, p4, p5)   {if (dun_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_DUN, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
 
#define DUN_TRACE_DEBUG6(m, p1, p2, p3, p4, p5, p6)   {if (dun_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_DUN, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
 
#define HCRP_TRACE_ERROR0(m)   {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_HCRP, TRACE_TYPE_ERROR, m);}
 
#define HCRP_TRACE_ERROR1(m, p1)   {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_HCRP, TRACE_TYPE_ERROR, m, p1);}
 
#define HCRP_TRACE_ERROR2(m, p1, p2)   {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_HCRP, TRACE_TYPE_ERROR, m,p1,p2);}
 
#define HCRP_TRACE_ERROR3(m, p1, p2, p3)   {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_HCRP, TRACE_TYPE_ERROR, m,p1,p2,p3);}
 
#define HCRP_TRACE_ERROR4(m, p1, p2, p3, p4)   {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_HCRP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
 
#define HCRP_TRACE_ERROR5(m, p1, p2, p3, p4, p5)   {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_HCRP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
 
#define HCRP_TRACE_ERROR6(m, p1, p2, p3, p4, p5, p6)   {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_HCRP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
 
#define HCRP_TRACE_WARNING0(m)   {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_HCRP, TRACE_TYPE_WARNING, m);}
 
#define HCRP_TRACE_WARNING1(m, p1)   {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_HCRP, TRACE_TYPE_WARNING, m,p1);}
 
#define HCRP_TRACE_WARNING2(m, p1, p2)   {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_HCRP, TRACE_TYPE_WARNING, m,p1,p2);}
 
#define HCRP_TRACE_WARNING3(m, p1, p2, p3)   {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_HCRP, TRACE_TYPE_WARNING, m,p1,p2,p3);}
 
#define HCRP_TRACE_WARNING4(m, p1, p2, p3, p4)   {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_HCRP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
 
#define HCRP_TRACE_WARNING5(m, p1, p2, p3, p4, p5)   {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_HCRP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
 
#define HCRP_TRACE_WARNING6(m, p1, p2, p3, p4, p5, p6)   {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_HCRP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
 
#define HCRP_TRACE_API0(m)   {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_HCRP, TRACE_TYPE_API, m);}
 
#define HCRP_TRACE_API1(m, p1)   {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_HCRP, TRACE_TYPE_API, m, p1);}
 
#define HCRP_TRACE_API2(m, p1, p2)   {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_HCRP, TRACE_TYPE_API, m,p1,p2);}
 
#define HCRP_TRACE_API3(m, p1, p2, p3)   {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_HCRP, TRACE_TYPE_API, m,p1,p2,p3);}
 
#define HCRP_TRACE_API4(m, p1, p2, p3, p4)   {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_HCRP, TRACE_TYPE_API, m,p1,p2,p3,p4);}
 
#define HCRP_TRACE_API5(m, p1, p2, p3, p4, p5)   {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_HCRP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
 
#define HCRP_TRACE_API6(m, p1, p2, p3, p4, p5, p6)   {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_HCRP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
 
#define HCRP_TRACE_EVENT0(m)   {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_HCRP, TRACE_TYPE_EVENT, m);}
 
#define HCRP_TRACE_EVENT1(m, p1)   {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_HCRP, TRACE_TYPE_EVENT, m, p1);}
 
#define HCRP_TRACE_EVENT2(m, p1, p2)   {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_HCRP, TRACE_TYPE_EVENT, m,p1,p2);}
 
#define HCRP_TRACE_EVENT3(m, p1, p2, p3)   {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_HCRP, TRACE_TYPE_EVENT, m,p1,p2,p3);}
 
#define HCRP_TRACE_EVENT4(m, p1, p2, p3, p4)   {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_HCRP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
 
#define HCRP_TRACE_EVENT5(m, p1, p2, p3, p4, p5)   {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_HCRP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
 
#define HCRP_TRACE_EVENT6(m, p1, p2, p3, p4, p5, p6)   {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_HCRP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
 
#define HCRP_TRACE_DEBUG0(m)   {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_HCRP, TRACE_TYPE_DEBUG, m);}
 
#define HCRP_TRACE_DEBUG1(m, p1)   {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_HCRP, TRACE_TYPE_DEBUG, m,p1);}
 
#define HCRP_TRACE_DEBUG2(m, p1, p2)   {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_HCRP, TRACE_TYPE_DEBUG, m,p1,p2);}
 
#define HCRP_TRACE_DEBUG3(m, p1, p2, p3)   {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_HCRP, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
 
#define HCRP_TRACE_DEBUG4(m, p1, p2, p3, p4)   {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_HCRP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
 
#define HCRP_TRACE_DEBUG5(m, p1, p2, p3, p4, p5)   {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_HCRP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
 
#define HCRP_TRACE_DEBUG6(m, p1, p2, p3, p4, p5, p6)   {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_HCRP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
 
#define HCRPM_TRACE_ERROR0(m)   {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_HCRP, TRACE_TYPE_ERROR, m);}
 
#define HCRPM_TRACE_ERROR1(m, p1)   {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_HCRP, TRACE_TYPE_ERROR, m, p1);}
 
#define HCRPM_TRACE_ERROR2(m, p1, p2)   {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_HCRP, TRACE_TYPE_ERROR, m,p1,p2);}
 
#define HCRPM_TRACE_ERROR3(m, p1, p2, p3)   {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_HCRP, TRACE_TYPE_ERROR, m,p1,p2,p3);}
 
#define HCRPM_TRACE_ERROR4(m, p1, p2, p3, p4)   {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_HCRP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
 
#define HCRPM_TRACE_ERROR5(m, p1, p2, p3, p4, p5)   {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_HCRP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
 
#define HCRPM_TRACE_ERROR6(m, p1, p2, p3, p4, p5, p6)   {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_HCRP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
 
#define HCRPM_TRACE_WARNING0(m)   {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_HCRP, TRACE_TYPE_WARNING, m);}
 
#define HCRPM_TRACE_WARNING1(m, p1)   {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_HCRP, TRACE_TYPE_WARNING, m,p1);}
 
#define HCRPM_TRACE_WARNING2(m, p1, p2)   {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_HCRP, TRACE_TYPE_WARNING, m,p1,p2);}
 
#define HCRPM_TRACE_WARNING3(m, p1, p2, p3)   {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_HCRP, TRACE_TYPE_WARNING, m,p1,p2,p3);}
 
#define HCRPM_TRACE_WARNING4(m, p1, p2, p3, p4)   {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_HCRP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
 
#define HCRPM_TRACE_WARNING5(m, p1, p2, p3, p4, p5)   {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_HCRP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
 
#define HCRPM_TRACE_WARNING6(m, p1, p2, p3, p4, p5, p6)   {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_HCRP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
 
#define HCRPM_TRACE_API0(m)   {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_HCRP, TRACE_TYPE_API, m);}
 
#define HCRPM_TRACE_API1(m, p1)   {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_HCRP, TRACE_TYPE_API, m, p1);}
 
#define HCRPM_TRACE_API2(m, p1, p2)   {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_HCRP, TRACE_TYPE_API, m,p1,p2);}
 
#define HCRPM_TRACE_API3(m, p1, p2, p3)   {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_HCRP, TRACE_TYPE_API, m,p1,p2,p3);}
 
#define HCRPM_TRACE_API4(m, p1, p2, p3, p4)   {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_HCRP, TRACE_TYPE_API, m,p1,p2,p3,p4);}
 
#define HCRPM_TRACE_API5(m, p1, p2, p3, p4, p5)   {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_HCRP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
 
#define HCRPM_TRACE_API6(m, p1, p2, p3, p4, p5, p6)   {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_HCRP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
 
#define HCRPM_TRACE_EVENT0(m)   {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_HCRP, TRACE_TYPE_EVENT, m);}
 
#define HCRPM_TRACE_EVENT1(m, p1)   {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_HCRP, TRACE_TYPE_EVENT, m, p1);}
 
#define HCRPM_TRACE_EVENT2(m, p1, p2)   {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_HCRP, TRACE_TYPE_EVENT, m,p1,p2);}
 
#define HCRPM_TRACE_EVENT3(m, p1, p2, p3)   {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_HCRP, TRACE_TYPE_EVENT, m,p1,p2,p3);}
 
#define HCRPM_TRACE_EVENT4(m, p1, p2, p3, p4)   {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_HCRP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
 
#define HCRPM_TRACE_EVENT5(m, p1, p2, p3, p4, p5)   {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_HCRP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
 
#define HCRPM_TRACE_EVENT6(m, p1, p2, p3, p4, p5, p6)   {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_HCRP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
 
#define HCRPM_TRACE_DEBUG0(m)   {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_HCRP, TRACE_TYPE_DEBUG, m);}
 
#define HCRPM_TRACE_DEBUG1(m, p1)   {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_HCRP, TRACE_TYPE_DEBUG, m,p1);}
 
#define HCRPM_TRACE_DEBUG2(m, p1, p2)   {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_HCRP, TRACE_TYPE_DEBUG, m,p1,p2);}
 
#define HCRPM_TRACE_DEBUG3(m, p1, p2, p3)   {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_HCRP, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
 
#define HCRPM_TRACE_DEBUG4(m, p1, p2, p3, p4)   {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_HCRP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
 
#define HCRPM_TRACE_DEBUG5(m, p1, p2, p3, p4, p5)   {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_HCRP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
 
#define HCRPM_TRACE_DEBUG6(m, p1, p2, p3, p4, p5, p6)   {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_HCRP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
 
#define RPC_TRACE_ERROR0(m)   {if (rpc_trace_level >= BT_TRACE_LEVEL_ERROR) LogMsg_0(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_ERROR, (m));}
 
#define RPC_TRACE_ERROR1(m, p1)
 
#define RPC_TRACE_ERROR2(m, p1, p2)
 
#define RPC_TRACE_ERROR3(m, p1, p2, p3)
 
#define RPC_TRACE_ERROR4(m, p1, p2, p3, p4)
 
#define RPC_TRACE_ERROR5(m, p1, p2, p3, p4, p5)
 
#define RPC_TRACE_ERROR6(m, p1, p2, p3, p4, p5, p6)
 
#define RPC_TRACE_WARNING0(m)   {if (rpc_trace_level >= BT_TRACE_LEVEL_WARNING) LogMsg_0(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_WARNING, (m));}
 
#define RPC_TRACE_WARNING1(m, p1)
 
#define RPC_TRACE_WARNING2(m, p1, p2)
 
#define RPC_TRACE_WARNING3(m, p1, p2, p3)
 
#define RPC_TRACE_WARNING4(m, p1, p2, p3, p4)
 
#define RPC_TRACE_WARNING5(m, p1, p2, p3, p4, p5)
 
#define RPC_TRACE_WARNING6(m, p1, p2, p3, p4, p5, p6)
 
#define RPC_TRACE_API0(m)   {if (rpc_trace_level >= BT_TRACE_LEVEL_API) LogMsg_0(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_API, (m));}
 
#define RPC_TRACE_API1(m, p1)
 
#define RPC_TRACE_API2(m, p1, p2)
 
#define RPC_TRACE_API3(m, p1, p2, p3)
 
#define RPC_TRACE_API4(m, p1, p2, p3, p4)
 
#define RPC_TRACE_API5(m, p1, p2, p3, p4, p5)
 
#define RPC_TRACE_API6(m, p1, p2, p3, p4, p5, p6)
 
#define RPC_TRACE_EVENT0(m)   {if (rpc_trace_level >= BT_TRACE_LEVEL_EVENT) LogMsg_0(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_EVENT, (m));}
 
#define RPC_TRACE_EVENT1(m, p1)
 
#define RPC_TRACE_EVENT2(m, p1, p2)
 
#define RPC_TRACE_EVENT3(m, p1, p2, p3)
 
#define RPC_TRACE_EVENT4(m, p1, p2, p3, p4)
 
#define RPC_TRACE_EVENT5(m, p1, p2, p3, p4, p5)
 
#define RPC_TRACE_EVENT6(m, p1, p2, p3, p4, p5, p6)
 
#define RPC_TRACE_DEBUG0(m)   {if (rpc_trace_level >= BT_TRACE_LEVEL_DEBUG) LogMsg_0(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_DEBUG, (m));}
 
#define RPC_TRACE_DEBUG1(m, p1)
 
#define RPC_TRACE_DEBUG2(m, p1, p2)
 
#define RPC_TRACE_DEBUG3(m, p1, p2, p3)
 
#define RPC_TRACE_DEBUG4(m, p1, p2, p3, p4)
 
#define RPC_TRACE_DEBUG5(m, p1, p2, p3, p4, p5)
 
#define RPC_TRACE_DEBUG6(m, p1, p2, p3, p4, p5, p6)
 
#define BNEP_TRACE_ERROR0(m)   {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_BNEP, TRACE_TYPE_ERROR, m);}
 
#define BNEP_TRACE_ERROR1(m, p1)   {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_BNEP, TRACE_TYPE_ERROR, m, p1);}
 
#define BNEP_TRACE_ERROR2(m, p1, p2)   {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_BNEP, TRACE_TYPE_ERROR, m,p1,p2);}
 
#define BNEP_TRACE_ERROR3(m, p1, p2, p3)   {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_BNEP, TRACE_TYPE_ERROR, m,p1,p2,p3);}
 
#define BNEP_TRACE_ERROR4(m, p1, p2, p3, p4)   {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_BNEP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
 
#define BNEP_TRACE_ERROR5(m, p1, p2, p3, p4, p5)   {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_BNEP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
 
#define BNEP_TRACE_ERROR6(m, p1, p2, p3, p4, p5, p6)   {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_BNEP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
 
#define BNEP_TRACE_WARNING0(m)   {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_BNEP, TRACE_TYPE_WARNING, m);}
 
#define BNEP_TRACE_WARNING1(m, p1)   {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_BNEP, TRACE_TYPE_WARNING, m,p1);}
 
#define BNEP_TRACE_WARNING2(m, p1, p2)   {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_BNEP, TRACE_TYPE_WARNING, m,p1,p2);}
 
#define BNEP_TRACE_WARNING3(m, p1, p2, p3)   {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_BNEP, TRACE_TYPE_WARNING, m,p1,p2,p3);}
 
#define BNEP_TRACE_WARNING4(m, p1, p2, p3, p4)   {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_BNEP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
 
#define BNEP_TRACE_WARNING5(m, p1, p2, p3, p4, p5)   {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_BNEP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
 
#define BNEP_TRACE_WARNING6(m, p1, p2, p3, p4, p5, p6)   {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_BNEP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
 
#define BNEP_TRACE_API0(m)   {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_BNEP, TRACE_TYPE_API, m);}
 
#define BNEP_TRACE_API1(m, p1)   {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_BNEP, TRACE_TYPE_API, m, p1);}
 
#define BNEP_TRACE_API2(m, p1, p2)   {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_BNEP, TRACE_TYPE_API, m,p1,p2);}
 
#define BNEP_TRACE_API3(m, p1, p2, p3)   {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_BNEP, TRACE_TYPE_API, m,p1,p2,p3);}
 
#define BNEP_TRACE_API4(m, p1, p2, p3, p4)   {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_BNEP, TRACE_TYPE_API, m,p1,p2,p3,p4);}
 
#define BNEP_TRACE_API5(m, p1, p2, p3, p4, p5)   {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_BNEP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
 
#define BNEP_TRACE_API6(m, p1, p2, p3, p4, p5, p6)   {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_BNEP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
 
#define BNEP_TRACE_EVENT0(m)   {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_BNEP, TRACE_TYPE_EVENT, m);}
 
#define BNEP_TRACE_EVENT1(m, p1)   {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_BNEP, TRACE_TYPE_EVENT, m, p1);}
 
#define BNEP_TRACE_EVENT2(m, p1, p2)   {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_BNEP, TRACE_TYPE_EVENT, m,p1,p2);}
 
#define BNEP_TRACE_EVENT3(m, p1, p2, p3)   {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_BNEP, TRACE_TYPE_EVENT, m,p1,p2,p3);}
 
#define BNEP_TRACE_EVENT4(m, p1, p2, p3, p4)   {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_BNEP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
 
#define BNEP_TRACE_EVENT5(m, p1, p2, p3, p4, p5)   {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_BNEP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
 
#define BNEP_TRACE_EVENT6(m, p1, p2, p3, p4, p5, p6)   {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_BNEP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
 
#define BNEP_TRACE_DEBUG0(m)   {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_BNEP, TRACE_TYPE_DEBUG, m);}
 
#define BNEP_TRACE_DEBUG1(m, p1)   {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_BNEP, TRACE_TYPE_DEBUG, m,p1);}
 
#define BNEP_TRACE_DEBUG2(m, p1, p2)   {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_BNEP, TRACE_TYPE_DEBUG, m,p1,p2);}
 
#define BNEP_TRACE_DEBUG3(m, p1, p2, p3)   {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_BNEP, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
 
#define BNEP_TRACE_DEBUG4(m, p1, p2, p3, p4)   {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_BNEP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
 
#define BNEP_TRACE_DEBUG5(m, p1, p2, p3, p4, p5)   {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_BNEP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
 
#define BNEP_TRACE_DEBUG6(m, p1, p2, p3, p4, p5, p6)   {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_BNEP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
 
#define PAN_TRACE_ERROR0(m)   {if (pan_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_PAN, TRACE_TYPE_ERROR, m);}
 
#define PAN_TRACE_ERROR1(m, p1)   {if (pan_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_PAN, TRACE_TYPE_ERROR, m, p1);}
 
#define PAN_TRACE_ERROR2(m, p1, p2)   {if (pan_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_PAN, TRACE_TYPE_ERROR, m,p1,p2);}
 
#define PAN_TRACE_ERROR3(m, p1, p2, p3)   {if (pan_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_PAN, TRACE_TYPE_ERROR, m,p1,p2,p3);}
 
#define PAN_TRACE_ERROR4(m, p1, p2, p3, p4)   {if (pan_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_PAN, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
 
#define PAN_TRACE_ERROR5(m, p1, p2, p3, p4, p5)   {if (pan_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_PAN, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
 
#define PAN_TRACE_ERROR6(m, p1, p2, p3, p4, p5, p6)   {if (pan_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_PAN, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
 
#define PAN_TRACE_WARNING0(m)   {if (pan_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_PAN, TRACE_TYPE_WARNING, m);}
 
#define PAN_TRACE_WARNING1(m, p1)   {if (pan_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_PAN, TRACE_TYPE_WARNING, m,p1);}
 
#define PAN_TRACE_WARNING2(m, p1, p2)   {if (pan_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_PAN, TRACE_TYPE_WARNING, m,p1,p2);}
 
#define PAN_TRACE_WARNING3(m, p1, p2, p3)   {if (pan_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_PAN, TRACE_TYPE_WARNING, m,p1,p2,p3);}
 
#define PAN_TRACE_WARNING4(m, p1, p2, p3, p4)   {if (pan_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_PAN, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
 
#define PAN_TRACE_WARNING5(m, p1, p2, p3, p4, p5)   {if (pan_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_PAN, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
 
#define PAN_TRACE_WARNING6(m, p1, p2, p3, p4, p5, p6)   {if (pan_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_PAN, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
 
#define PAN_TRACE_API0(m)   {if (pan_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_PAN, TRACE_TYPE_API, m);}
 
#define PAN_TRACE_API1(m, p1)   {if (pan_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_PAN, TRACE_TYPE_API, m, p1);}
 
#define PAN_TRACE_API2(m, p1, p2)   {if (pan_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_PAN, TRACE_TYPE_API, m,p1,p2);}
 
#define PAN_TRACE_API3(m, p1, p2, p3)   {if (pan_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_PAN, TRACE_TYPE_API, m,p1,p2,p3);}
 
#define PAN_TRACE_API4(m, p1, p2, p3, p4)   {if (pan_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_PAN, TRACE_TYPE_API, m,p1,p2,p3,p4);}
 
#define PAN_TRACE_API5(m, p1, p2, p3, p4, p5)   {if (pan_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_PAN, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
 
#define PAN_TRACE_API6(m, p1, p2, p3, p4, p5, p6)   {if (pan_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_PAN, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
 
#define PAN_TRACE_EVENT0(m)   {if (pan_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_PAN, TRACE_TYPE_EVENT, m);}
 
#define PAN_TRACE_EVENT1(m, p1)   {if (pan_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_PAN, TRACE_TYPE_EVENT, m, p1);}
 
#define PAN_TRACE_EVENT2(m, p1, p2)   {if (pan_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_PAN, TRACE_TYPE_EVENT, m,p1,p2);}
 
#define PAN_TRACE_EVENT3(m, p1, p2, p3)   {if (pan_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_PAN, TRACE_TYPE_EVENT, m,p1,p2,p3);}
 
#define PAN_TRACE_EVENT4(m, p1, p2, p3, p4)   {if (pan_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(