diff options
author | Sharvil Nanavati <sharvil@google.com> | 2014-05-04 10:03:35 -0700 |
---|---|---|
committer | Sharvil Nanavati <sharvil@google.com> | 2014-06-19 06:45:38 +0000 |
commit | b44cc59d286ad255e872c60df02e032bd8d9d75b (patch) | |
tree | ad3782bbb41034c5bc740b9c54e453608574d1ed | |
parent | 158084e065230a10ffeba6b24ab2fd22b422baed (diff) | |
download | android_system_bt-b44cc59d286ad255e872c60df02e032bd8d9d75b.tar.gz android_system_bt-b44cc59d286ad255e872c60df02e032bd8d9d75b.tar.bz2 android_system_bt-b44cc59d286ad255e872c60df02e032bd8d9d75b.zip |
Logging cleanup: AVRC, MCA, GATT, and SMP.
Change-Id: I6d1e61ff023b5fd19f144955cff16831cc18c6e6
34 files changed, 697 insertions, 969 deletions
diff --git a/include/bt_trace.h b/include/bt_trace.h index 40e9b3c5e..4f8f4a3dc 100644 --- a/include/bt_trace.h +++ b/include/bt_trace.h @@ -716,171 +716,35 @@ EXPORT_API extern void BTTRC_StackTrace6(tBTTRC_LAYER_ID layer_id, /* Define tracing for the AVRCP profile */ -#define AVRC_TRACE_ERROR0(m) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_ERROR,m);} -#define AVRC_TRACE_ERROR1(m,p1) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_ERROR,m,p1);} -#define AVRC_TRACE_ERROR2(m,p1,p2) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_ERROR,m,p1,p2);} -#define AVRC_TRACE_ERROR3(m,p1,p2,p3) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_ERROR,m,p1,p2,p3);} -#define AVRC_TRACE_ERROR4(m,p1,p2,p3,p4) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_ERROR,m,p1,p2,p3,p4);} -#define AVRC_TRACE_ERROR5(m,p1,p2,p3,p4,p5) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_ERROR,m,p1,p2,p3,p4,p5);} -#define AVRC_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_ERROR,m,p1,p2,p3,p4,p5,p6);} - -#define AVRC_TRACE_WARNING0(m) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_WARNING,m);} -#define AVRC_TRACE_WARNING1(m,p1) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_WARNING,m,p1);} -#define AVRC_TRACE_WARNING2(m,p1,p2) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_WARNING,m,p1,p2);} -#define AVRC_TRACE_WARNING3(m,p1,p2,p3) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_WARNING,m,p1,p2,p3);} -#define AVRC_TRACE_WARNING4(m,p1,p2,p3,p4) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_WARNING,m,p1,p2,p3,p4);} -#define AVRC_TRACE_WARNING5(m,p1,p2,p3,p4,p5) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_WARNING,m,p1,p2,p3,p4,p5);} -#define AVRC_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_WARNING,m,p1,p2,p3,p4,p5,p6);} - -#define AVRC_TRACE_EVENT0(m) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_EVENT,m);} -#define AVRC_TRACE_EVENT1(m,p1) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_EVENT,m, p1);} -#define AVRC_TRACE_EVENT2(m,p1,p2) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_EVENT,m,p1,p2);} -#define AVRC_TRACE_EVENT3(m,p1,p2,p3) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_EVENT,m,p1,p2,p3);} -#define AVRC_TRACE_EVENT4(m,p1,p2,p3,p4) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_EVENT,m,p1,p2,p3,p4);} -#define AVRC_TRACE_EVENT5(m,p1,p2,p3,p4,p5) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_EVENT,m,p1,p2,p3,p4,p5);} -#define AVRC_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_EVENT,m,p1,p2,p3,p4,p5,p6);} - -#define AVRC_TRACE_DEBUG0(m) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_DEBUG,m);} -#define AVRC_TRACE_DEBUG1(m,p1) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_DEBUG,m,p1);} -#define AVRC_TRACE_DEBUG2(m,p1,p2) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_DEBUG,m,p1,p2);} -#define AVRC_TRACE_DEBUG3(m,p1,p2,p3) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_DEBUG,m,p1,p2,p3);} -#define AVRC_TRACE_DEBUG4(m,p1,p2,p3,p4) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_DEBUG,m,p1,p2,p3,p4);} -#define AVRC_TRACE_DEBUG5(m,p1,p2,p3,p4,p5) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_DEBUG,m,p1,p2,p3,p4,p5);} -#define AVRC_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_DEBUG,m,p1,p2,p3,p4,p5,p6);} - -#define AVRC_TRACE_API0(m) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_API,m);} -#define AVRC_TRACE_API1(m,p1) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_API,m, p1);} -#define AVRC_TRACE_API2(m,p1,p2) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_API,m,p1,p2);} -#define AVRC_TRACE_API3(m,p1,p2,p3) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_API,m,p1,p2,p3);} -#define AVRC_TRACE_API4(m,p1,p2,p3,p4) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_API,m,p1,p2,p3,p4);} -#define AVRC_TRACE_API5(m,p1,p2,p3,p4,p5) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_API,m,p1,p2,p3,p4,p5);} -#define AVRC_TRACE_API6(m,p1,p2,p3,p4,p5,p6) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_API,m,p1,p2,p3,p4,p5,p6);} +#define AVRC_TRACE_ERROR(...) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_ERROR, ##__VA_ARGS__);} +#define AVRC_TRACE_WARNING(...) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_WARNING, ##__VA_ARGS__);} +#define AVRC_TRACE_EVENT(...) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_EVENT, ##__VA_ARGS__);} +#define AVRC_TRACE_DEBUG(...) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_DEBUG, ##__VA_ARGS__);} +#define AVRC_TRACE_API(...) {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_AVP, TRACE_TYPE_API, ##__VA_ARGS__);} /* MCAP */ -#define MCA_TRACE_ERROR0(m) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_ERROR, m);} -#define MCA_TRACE_ERROR1(m,p1) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_ERROR, m,p1);} -#define MCA_TRACE_ERROR2(m,p1,p2) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_ERROR, m,p1,p2);} -#define MCA_TRACE_ERROR3(m,p1,p2,p3) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_ERROR, m,p1,p2,p3);} -#define MCA_TRACE_ERROR4(m,p1,p2,p3,p4) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);} -#define MCA_TRACE_ERROR5(m,p1,p2,p3,p4,p5) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);} -#define MCA_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);} - -#define MCA_TRACE_WARNING0(m) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_WARNING, m);} -#define MCA_TRACE_WARNING1(m,p1) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_WARNING, m,p1);} -#define MCA_TRACE_WARNING2(m,p1,p2) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_WARNING, m,p1,p2);} -#define MCA_TRACE_WARNING3(m,p1,p2,p3) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_WARNING, m,p1,p2,p3);} -#define MCA_TRACE_WARNING4(m,p1,p2,p3,p4) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);} -#define MCA_TRACE_WARNING5(m,p1,p2,p3,p4,p5) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);} -#define MCA_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);} - -#define MCA_TRACE_EVENT0(m) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_EVENT, m);} -#define MCA_TRACE_EVENT1(m,p1) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_EVENT, m, p1);} -#define MCA_TRACE_EVENT2(m,p1,p2) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_EVENT, m,p1,p2);} -#define MCA_TRACE_EVENT3(m,p1,p2,p3) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_EVENT, m,p1,p2,p3);} -#define MCA_TRACE_EVENT4(m,p1,p2,p3,p4) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);} -#define MCA_TRACE_EVENT5(m,p1,p2,p3,p4,p5) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);} -#define MCA_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);} - -#define MCA_TRACE_DEBUG0(m) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_DEBUG, m);} -#define MCA_TRACE_DEBUG1(m,p1) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_DEBUG, m,p1);} -#define MCA_TRACE_DEBUG2(m,p1,p2) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_DEBUG, m,p1,p2);} -#define MCA_TRACE_DEBUG3(m,p1,p2,p3) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_DEBUG, m,p1,p2,p3);} -#define MCA_TRACE_DEBUG4(m,p1,p2,p3,p4) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);} -#define MCA_TRACE_DEBUG5(m,p1,p2,p3,p4,p5) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);} -#define MCA_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);} - -#define MCA_TRACE_API0(m) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_API, m);} -#define MCA_TRACE_API1(m,p1) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_API, m,p1);} -#define MCA_TRACE_API2(m,p1,p2) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_API, m,p1,p2);} -#define MCA_TRACE_API3(m,p1,p2,p3) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_API, m,p1,p2,p3);} -#define MCA_TRACE_API4(m,p1,p2,p3,p4) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_API, m,p1,p2,p3,p4);} -#define MCA_TRACE_API5(m,p1,p2,p3,p4,p5) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);} -#define MCA_TRACE_API6(m,p1,p2,p3,p4,p5,p6) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);} +#define MCA_TRACE_ERROR(...) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_ERROR, ##__VA_ARGS__);} +#define MCA_TRACE_WARNING(...) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_WARNING, ##__VA_ARGS__);} +#define MCA_TRACE_EVENT(...) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_EVENT, ##__VA_ARGS__);} +#define MCA_TRACE_DEBUG(...) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_DEBUG, ##__VA_ARGS__);} +#define MCA_TRACE_API(...) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_MCA, TRACE_TYPE_API, ##__VA_ARGS__);} /* Define tracing for the ATT/GATT unit */ -#define GATT_TRACE_ERROR0(m) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_ERROR, m);} -#define GATT_TRACE_ERROR1(m,p1) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_ERROR, m,p1);} -#define GATT_TRACE_ERROR2(m,p1,p2) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_ERROR, m,p1,p2);} -#define GATT_TRACE_ERROR3(m,p1,p2,p3) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_ERROR, m,p1,p2,p3);} -#define GATT_TRACE_ERROR4(m,p1,p2,p3,p4) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);} -#define GATT_TRACE_ERROR5(m,p1,p2,p3,p4,p5) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);} -#define GATT_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);} - -#define GATT_TRACE_WARNING0(m) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_WARNING, m);} -#define GATT_TRACE_WARNING1(m,p1) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_WARNING, m,p1);} -#define GATT_TRACE_WARNING2(m,p1,p2) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_WARNING, m,p1,p2);} -#define GATT_TRACE_WARNING3(m,p1,p2,p3) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_WARNING, m,p1,p2,p3);} -#define GATT_TRACE_WARNING4(m,p1,p2,p3,p4) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);} -#define GATT_TRACE_WARNING5(m,p1,p2,p3,p4,p5) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);} -#define GATT_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);} - -#define GATT_TRACE_API0(m) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_API, m);} -#define GATT_TRACE_API1(m,p1) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_API, m,p1);} -#define GATT_TRACE_API2(m,p1,p2) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_API, m,p1,p2);} -#define GATT_TRACE_API3(m,p1,p2,p3) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_API, m,p1,p2,p3);} -#define GATT_TRACE_API4(m,p1,p2,p3,p4) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_API, m,p1,p2,p3,p4);} -#define GATT_TRACE_API5(m,p1,p2,p3,p4,p5) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);} -#define GATT_TRACE_API6(m,p1,p2,p3,p4,p5,p6) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);} - -#define GATT_TRACE_EVENT0(m) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_EVENT, m);} -#define GATT_TRACE_EVENT1(m,p1) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_EVENT, m, p1);} -#define GATT_TRACE_EVENT2(m,p1,p2) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_EVENT, m,p1,p2);} -#define GATT_TRACE_EVENT3(m,p1,p2,p3) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_EVENT, m,p1,p2,p3);} -#define GATT_TRACE_EVENT4(m,p1,p2,p3,p4) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);} -#define GATT_TRACE_EVENT5(m,p1,p2,p3,p4,p5) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);} -#define GATT_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);} - -#define GATT_TRACE_DEBUG0(m) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_DEBUG, m);} -#define GATT_TRACE_DEBUG1(m,p1) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_DEBUG, m,p1);} -#define GATT_TRACE_DEBUG2(m,p1,p2) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_DEBUG, m,p1,p2);} -#define GATT_TRACE_DEBUG3(m,p1,p2,p3) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_DEBUG, m,p1,p2,p3);} -#define GATT_TRACE_DEBUG4(m,p1,p2,p3,p4) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);} -#define GATT_TRACE_DEBUG5(m,p1,p2,p3,p4,p5) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);} -#define GATT_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);} +#define GATT_TRACE_ERROR(...) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_ERROR, ##__VA_ARGS__);} +#define GATT_TRACE_WARNING(...) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_WARNING, ##__VA_ARGS__);} +#define GATT_TRACE_API(...) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_API, ##__VA_ARGS__);} +#define GATT_TRACE_EVENT(...) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_EVENT, ##__VA_ARGS__);} +#define GATT_TRACE_DEBUG(...) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_ATT, TRACE_TYPE_DEBUG, ##__VA_ARGS__);} /* Define tracing for the SMP unit */ -#define SMP_TRACE_ERROR0(m) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_ERROR, m);} -#define SMP_TRACE_ERROR1(m,p1) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_ERROR, m,p1);} -#define SMP_TRACE_ERROR2(m,p1,p2) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_ERROR, m,p1,p2);} -#define SMP_TRACE_ERROR3(m,p1,p2,p3) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_ERROR, m,p1,p2,p3);} -#define SMP_TRACE_ERROR4(m,p1,p2,p3,p4) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);} -#define SMP_TRACE_ERROR5(m,p1,p2,p3,p4,p5) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);} -#define SMP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);} - -#define SMP_TRACE_WARNING0(m) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_WARNING, m);} -#define SMP_TRACE_WARNING1(m,p1) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_WARNING, m,p1);} -#define SMP_TRACE_WARNING2(m,p1,p2) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_WARNING, m,p1,p2);} -#define SMP_TRACE_WARNING3(m,p1,p2,p3) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_WARNING, m,p1,p2,p3);} -#define SMP_TRACE_WARNING4(m,p1,p2,p3,p4) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);} -#define SMP_TRACE_WARNING5(m,p1,p2,p3,p4,p5) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);} -#define SMP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);} - -#define SMP_TRACE_API0(m) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_API, m);} -#define SMP_TRACE_API1(m,p1) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_API, m,p1);} -#define SMP_TRACE_API2(m,p1,p2) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_API, m,p1,p2);} -#define SMP_TRACE_API3(m,p1,p2,p3) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_API, m,p1,p2,p3);} -#define SMP_TRACE_API4(m,p1,p2,p3,p4) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_API, m,p1,p2,p3,p4);} -#define SMP_TRACE_API5(m,p1,p2,p3,p4,p5) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);} -#define SMP_TRACE_API6(m,p1,p2,p3,p4,p5,p6) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);} - -#define SMP_TRACE_EVENT0(m) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_EVENT, m);} -#define SMP_TRACE_EVENT1(m,p1) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_EVENT, m, p1);} -#define SMP_TRACE_EVENT2(m,p1,p2) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_EVENT, m,p1,p2);} -#define SMP_TRACE_EVENT3(m,p1,p2,p3) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_EVENT, m,p1,p2,p3);} -#define SMP_TRACE_EVENT4(m,p1,p2,p3,p4) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);} -#define SMP_TRACE_EVENT5(m,p1,p2,p3,p4,p5) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);} -#define SMP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);} - -#define SMP_TRACE_DEBUG0(m) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_DEBUG, m);} -#define SMP_TRACE_DEBUG1(m,p1) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_DEBUG, m,p1);} -#define SMP_TRACE_DEBUG2(m,p1,p2) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_DEBUG, m,p1,p2);} -#define SMP_TRACE_DEBUG3(m,p1,p2,p3) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_DEBUG, m,p1,p2,p3);} -#define SMP_TRACE_DEBUG4(m,p1,p2,p3,p4) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);} -#define SMP_TRACE_DEBUG5(m,p1,p2,p3,p4,p5) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);} -#define SMP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);} +#define SMP_TRACE_ERROR(...) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_ERROR, ##__VA_ARGS__);} +#define SMP_TRACE_WARNING(...) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_WARNING, ##__VA_ARGS__);} +#define SMP_TRACE_API(...) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_API, ##__VA_ARGS__);} +#define SMP_TRACE_EVENT(...) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_EVENT, ##__VA_ARGS__);} +#define SMP_TRACE_DEBUG(...) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE(TRACE_LAYER_SMP, TRACE_TYPE_DEBUG, ##__VA_ARGS__);} /* END OF USE TRACES */ #else @@ -984,171 +848,35 @@ EXPORT_API extern void BTTRC_StackTrace6(tBTTRC_LAYER_ID layer_id, /* Define tracing for the AVRCP profile */ -#define AVRC_TRACE_ERROR0(m) -#define AVRC_TRACE_ERROR1(m,p1) -#define AVRC_TRACE_ERROR2(m,p1,p2) -#define AVRC_TRACE_ERROR3(m,p1,p2,p3) -#define AVRC_TRACE_ERROR4(m,p1,p2,p3,p4) -#define AVRC_TRACE_ERROR5(m,p1,p2,p3,p4,p5) -#define AVRC_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6) - -#define AVRC_TRACE_WARNING0(m) -#define AVRC_TRACE_WARNING1(m,p1) -#define AVRC_TRACE_WARNING2(m,p1,p2) -#define AVRC_TRACE_WARNING3(m,p1,p2,p3) -#define AVRC_TRACE_WARNING4(m,p1,p2,p3,p4) -#define AVRC_TRACE_WARNING5(m,p1,p2,p3,p4,p5) -#define AVRC_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) - -#define AVRC_TRACE_EVENT0(m) -#define AVRC_TRACE_EVENT1(m,p1) -#define AVRC_TRACE_EVENT2(m,p1,p2) -#define AVRC_TRACE_EVENT3(m,p1,p2,p3) -#define AVRC_TRACE_EVENT4(m,p1,p2,p3,p4) -#define AVRC_TRACE_EVENT5(m,p1,p2,p3,p4,p5) -#define AVRC_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6) - -#define AVRC_TRACE_DEBUG0(m) -#define AVRC_TRACE_DEBUG1(m,p1) -#define AVRC_TRACE_DEBUG2(m,p1,p2) -#define AVRC_TRACE_DEBUG3(m,p1,p2,p3) -#define AVRC_TRACE_DEBUG4(m,p1,p2,p3,p4) -#define AVRC_TRACE_DEBUG5(m,p1,p2,p3,p4,p5) -#define AVRC_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6) - -#define AVRC_TRACE_API0(m) -#define AVRC_TRACE_API1(m,p1) -#define AVRC_TRACE_API2(m,p1,p2) -#define AVRC_TRACE_API3(m,p1,p2,p3) -#define AVRC_TRACE_API4(m,p1,p2,p3,p4) -#define AVRC_TRACE_API5(m,p1,p2,p3,p4,p5) -#define AVRC_TRACE_API6(m,p1,p2,p3,p4,p5,p6) +#define AVRC_TRACE_ERROR(...) +#define AVRC_TRACE_WARNING(...) +#define AVRC_TRACE_EVENT(...) +#define AVRC_TRACE_DEBUG(...) +#define AVRC_TRACE_API(...) /* MCAP */ -#define MCA_TRACE_ERROR0(m) -#define MCA_TRACE_ERROR1(m,p1) -#define MCA_TRACE_ERROR2(m,p1,p2) -#define MCA_TRACE_ERROR3(m,p1,p2,p3) -#define MCA_TRACE_ERROR4(m,p1,p2,p3,p4) -#define MCA_TRACE_ERROR5(m,p1,p2,p3,p4,p5) -#define MCA_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6) - -#define MCA_TRACE_WARNING0(m) -#define MCA_TRACE_WARNING1(m,p1) -#define MCA_TRACE_WARNING2(m,p1,p2) -#define MCA_TRACE_WARNING3(m,p1,p2,p3) -#define MCA_TRACE_WARNING4(m,p1,p2,p3,p4) -#define MCA_TRACE_WARNING5(m,p1,p2,p3,p4,p5) -#define MCA_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) - -#define MCA_TRACE_EVENT0(m) -#define MCA_TRACE_EVENT1(m,p1) -#define MCA_TRACE_EVENT2(m,p1,p2) -#define MCA_TRACE_EVENT3(m,p1,p2,p3) -#define MCA_TRACE_EVENT4(m,p1,p2,p3,p4) -#define MCA_TRACE_EVENT5(m,p1,p2,p3,p4,p5) -#define MCA_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6) - -#define MCA_TRACE_DEBUG0(m) -#define MCA_TRACE_DEBUG1(m,p1) -#define MCA_TRACE_DEBUG2(m,p1,p2) -#define MCA_TRACE_DEBUG3(m,p1,p2,p3) -#define MCA_TRACE_DEBUG4(m,p1,p2,p3,p4) -#define MCA_TRACE_DEBUG5(m,p1,p2,p3,p4,p5) -#define MCA_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6) - -#define MCA_TRACE_API0(m) -#define MCA_TRACE_API1(m,p1) -#define MCA_TRACE_API2(m,p1,p2) -#define MCA_TRACE_API3(m,p1,p2,p3) -#define MCA_TRACE_API4(m,p1,p2,p3,p4) -#define MCA_TRACE_API5(m,p1,p2,p3,p4,p5) -#define MCA_TRACE_API6(m,p1,p2,p3,p4,p5,p6) +#define MCA_TRACE_ERROR(...) +#define MCA_TRACE_WARNING(...) +#define MCA_TRACE_EVENT(...) +#define MCA_TRACE_DEBUG(...) +#define MCA_TRACE_API(...) /* Define tracing for the GATT */ -#define GATT_TRACE_ERROR0(m) -#define GATT_TRACE_ERROR1(m,p1) -#define GATT_TRACE_ERROR2(m,p1,p2) -#define GATT_TRACE_ERROR3(m,p1,p2,p3) -#define GATT_TRACE_ERROR4(m,p1,p2,p3,p4) -#define GATT_TRACE_ERROR5(m,p1,p2,p3,p4,p5) -#define GATT_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6) - -#define GATT_TRACE_WARNING0(m) -#define GATT_TRACE_WARNING1(m,p1) -#define GATT_TRACE_WARNING2(m,p1,p2) -#define GATT_TRACE_WARNING3(m,p1,p2,p3) -#define GATT_TRACE_WARNING4(m,p1,p2,p3,p4) -#define GATT_TRACE_WARNING5(m,p1,p2,p3,p4,p5) -#define GATT_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) - -#define GATT_TRACE_API0(m) -#define GATT_TRACE_API1(m,p1) -#define GATT_TRACE_API2(m,p1,p2) -#define GATT_TRACE_API3(m,p1,p2,p3) -#define GATT_TRACE_API4(m,p1,p2,p3,p4) -#define GATT_TRACE_API5(m,p1,p2,p3,p4,p5) -#define GATT_TRACE_API6(m,p1,p2,p3,p4,p5,p6) - -#define GATT_TRACE_EVENT0(m) -#define GATT_TRACE_EVENT1(m,p1) -#define GATT_TRACE_EVENT2(m,p1,p2) -#define GATT_TRACE_EVENT3(m,p1,p2,p3) -#define GATT_TRACE_EVENT4(m,p1,p2,p3,p4) -#define GATT_TRACE_EVENT5(m,p1,p2,p3,p4,p5) -#define GATT_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6) - -#define GATT_TRACE_DEBUG0(m) -#define GATT_TRACE_DEBUG1(m,p1) -#define GATT_TRACE_DEBUG2(m,p1,p2) -#define GATT_TRACE_DEBUG3(m,p1,p2,p3) -#define GATT_TRACE_DEBUG4(m,p1,p2,p3,p4) -#define GATT_TRACE_DEBUG5(m,p1,p2,p3,p4,p5) -#define GATT_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6) +#define GATT_TRACE_ERROR(...) +#define GATT_TRACE_WARNING(...) +#define GATT_TRACE_API(...) +#define GATT_TRACE_EVENT(...) +#define GATT_TRACE_DEBUG(...) /* Define tracing for the SMP unit */ -#define SMP_TRACE_ERROR0(m) -#define SMP_TRACE_ERROR1(m,p1) -#define SMP_TRACE_ERROR2(m,p1,p2) -#define SMP_TRACE_ERROR3(m,p1,p2,p3) -#define SMP_TRACE_ERROR4(m,p1,p2,p3,p4) -#define SMP_TRACE_ERROR5(m,p1,p2,p3,p4,p5) -#define SMP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6) - -#define SMP_TRACE_WARNING0(m) -#define SMP_TRACE_WARNING1(m,p1) -#define SMP_TRACE_WARNING2(m,p1,p2) -#define SMP_TRACE_WARNING3(m,p1,p2,p3) -#define SMP_TRACE_WARNING4(m,p1,p2,p3,p4) -#define SMP_TRACE_WARNING5(m,p1,p2,p3,p4,p5) -#define SMP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) - -#define SMP_TRACE_API0(m) -#define SMP_TRACE_API1(m,p1) -#define SMP_TRACE_API2(m,p1,p2) -#define SMP_TRACE_API3(m,p1,p2,p3) -#define SMP_TRACE_API4(m,p1,p2,p3,p4) -#define SMP_TRACE_API5(m,p1,p2,p3,p4,p5) -#define SMP_TRACE_API6(m,p1,p2,p3,p4,p5,p6) - -#define SMP_TRACE_EVENT0(m) -#define SMP_TRACE_EVENT1(m,p1) -#define SMP_TRACE_EVENT2(m,p1,p2) -#define SMP_TRACE_EVENT3(m,p1,p2,p3) -#define SMP_TRACE_EVENT4(m,p1,p2,p3,p4) -#define SMP_TRACE_EVENT5(m,p1,p2,p3,p4,p5) -#define SMP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6) - -#define SMP_TRACE_DEBUG0(m) -#define SMP_TRACE_DEBUG1(m,p1) -#define SMP_TRACE_DEBUG2(m,p1,p2) -#define SMP_TRACE_DEBUG3(m,p1,p2,p3) -#define SMP_TRACE_DEBUG4(m,p1,p2,p3,p4) -#define SMP_TRACE_DEBUG5(m,p1,p2,p3,p4,p5) -#define SMP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6) +#define SMP_TRACE_ERROR(...) +#define SMP_TRACE_WARNING(...) +#define SMP_TRACE_API(...) +#define SMP_TRACE_EVENT(...) +#define SMP_TRACE_DEBUG(...) #endif diff --git a/stack/avrc/avrc_api.c b/stack/avrc/avrc_api.c index 09f167a6f..04f59a02d 100644 --- a/stack/avrc/avrc_api.c +++ b/stack/avrc/avrc_api.c @@ -128,7 +128,7 @@ static void avrc_prep_end_frag(UINT8 handle) UINT8 *p_data, *p_orig_data; UINT8 rsp_type; - AVRC_TRACE_DEBUG0 ("avrc_prep_end_frag" ); + AVRC_TRACE_DEBUG ("avrc_prep_end_frag" ); p_fcb = &avrc_cb.fcb[handle]; /* The response type of the end fragment should be the same as the the PDU of "End Fragment @@ -172,7 +172,7 @@ static void avrc_send_continue_frag(UINT8 handle, UINT8 label) p_fcb = &avrc_cb.fcb[handle]; p_pkt = p_fcb->p_fmsg; - AVRC_TRACE_DEBUG1 ("avrc_send_continue_frag len(%d) / AVRC_MAX_CTRL_DATA_LEN", p_pkt->len ); + AVRC_TRACE_DEBUG ("avrc_send_continue_frag len(%d) / AVRC_MAX_CTRL_DATA_LEN", p_pkt->len ); if (p_pkt->len > AVRC_MAX_CTRL_DATA_LEN) { p_pkt_old = p_fcb->p_fmsg; @@ -202,7 +202,7 @@ static void avrc_send_continue_frag(UINT8 handle, UINT8 label) p_pkt = p_fcb->p_fmsg; p_fcb->p_fmsg = NULL; p_fcb->frag_enabled = FALSE; - AVRC_TRACE_ERROR0 ("AVRC_MsgReq no buffers for fragmentation - send internal error" ); + AVRC_TRACE_ERROR ("AVRC_MsgReq no buffers for fragmentation - send internal error" ); p_data = (UINT8 *)(p_pkt+1) + p_pkt->offset; *p_data++ = AVRC_PDU_REQUEST_CONTINUATION_RSP; *p_data++ = 0; @@ -250,7 +250,7 @@ static BT_HDR * avrc_proc_vendor_command(UINT8 handle, UINT8 label, if (pkt_type != AVRC_PKT_SINGLE) { /* reject - commands can only be in single packets at AVRCP level */ - AVRC_TRACE_ERROR1 ("commands must be in single packet pdu:0x%x", *p_data ); + AVRC_TRACE_ERROR ("commands must be in single packet pdu:0x%x", *p_data ); /* use the current GKI buffer to send the reject */ status = AVRC_STS_BAD_CMD; } @@ -291,7 +291,7 @@ static BT_HDR * avrc_proc_vendor_command(UINT8 handle, UINT8 label, else { /* the pdu id does not match - reject the command using the current GKI buffer */ - AVRC_TRACE_ERROR2("avrc_proc_vendor_command continue pdu: 0x%x does not match \ + AVRC_TRACE_ERROR("avrc_proc_vendor_command continue pdu: 0x%x does not match \ current re-assembly pdu: 0x%x", *(p_data + 4), p_fcb->frag_pdu); status = AVRC_STS_BAD_PARAM; @@ -366,7 +366,7 @@ static UINT8 avrc_proc_far_msg(UINT8 handle, UINT8 label, UINT8 cr, BT_HDR **pp_ p_data += AVRC_VENDOR_HDR_SIZE; pkt_type = *(p_data + 1) & AVRC_PKT_TYPE_MASK; - AVRC_TRACE_DEBUG1 ("pkt_type %d", pkt_type ); + AVRC_TRACE_DEBUG ("pkt_type %d", pkt_type ); p_rcb = &avrc_cb.rcb[handle]; if (p_msg->company_id == AVRC_CO_METADATA) { @@ -409,7 +409,7 @@ static UINT8 avrc_proc_far_msg(UINT8 handle, UINT8 label, UINT8 cr, BT_HDR **pp_ { /* Unable to allocate buffer for fragmented avrc message. Reuse START buffer for reassembly (re-assembled message may fit into ACL buf) */ - AVRC_TRACE_DEBUG0 ("Unable to allocate buffer for fragmented avrc message, \ + AVRC_TRACE_DEBUG ("Unable to allocate buffer for fragmented avrc message, \ reusing START buffer for reassembly"); p_rcb->rasm_offset = p_pkt->offset; p_rcb->p_rmsg = p_pkt; @@ -423,7 +423,7 @@ static UINT8 avrc_proc_far_msg(UINT8 handle, UINT8 label, UINT8 cr, BT_HDR **pp_ { /* Received a CONTINUE/END, but no corresponding START (or previous fragmented response was dropped) */ - AVRC_TRACE_DEBUG0 ("Received a CONTINUE/END without no corresponding START \ + AVRC_TRACE_DEBUG ("Received a CONTINUE/END without no corresponding START \ (or previous fragmented response was dropped)"); drop = 5; GKI_freebuf(p_pkt); @@ -439,7 +439,7 @@ static UINT8 avrc_proc_far_msg(UINT8 handle, UINT8 label, UINT8 cr, BT_HDR **pp_ /* verify length */ if ((p_rcb->p_rmsg->offset + p_pkt->len) > buf_len) { - AVRC_TRACE_WARNING0("Fragmented message too big! - report the partial message"); + AVRC_TRACE_WARNING("Fragmented message too big! - report the partial message"); p_pkt->len = buf_len - p_rcb->p_rmsg->offset; pkt_type = AVRC_PKT_END; } @@ -463,7 +463,7 @@ static UINT8 avrc_proc_far_msg(UINT8 handle, UINT8 label, UINT8 cr, BT_HDR **pp_ p_data = p_msg->p_vendor_data + 1; /* skip pdu */ *p_data++ = AVRC_PKT_SINGLE; UINT16_TO_BE_STREAM(p_data, (p_msg->vendor_len - AVRC_MIN_META_HDR_SIZE)); - AVRC_TRACE_DEBUG3("end frag:%d, total len:%d, offset:%d", p_pkt->len, + AVRC_TRACE_DEBUG("end frag:%d, total len:%d, offset:%d", p_pkt->len, p_pkt_new->len, p_pkt_new->offset); } else @@ -563,7 +563,7 @@ static void avrc_msg_cback(UINT8 handle, UINT8 label, UINT8 cr, memset(&msg, 0, sizeof(tAVRC_MSG) ); { msg.hdr.ctype = p_data[0] & AVRC_CTYPE_MASK; - AVRC_TRACE_DEBUG4("avrc_msg_cback handle:%d, ctype:%d, offset:%d, len: %d", + AVRC_TRACE_DEBUG("avrc_msg_cback handle:%d, ctype:%d, offset:%d, len: %d", handle, msg.hdr.ctype, p_pkt->offset, p_pkt->len); msg.hdr.subunit_type = (p_data[1] & AVRC_SUBTYPE_MASK) >> AVRC_SUBTYPE_SHIFT; msg.hdr.subunit_id = p_data[1] & AVRC_SUBID_MASK; @@ -770,7 +770,7 @@ static void avrc_msg_cback(UINT8 handle, UINT8 label, UINT8 cr, #if (BT_USE_TRACES == TRUE) else { - AVRC_TRACE_WARNING5("avrc_msg_cback %s msg handle:%d, control:%d, cr:%d, opcode:x%x", + AVRC_TRACE_WARNING("avrc_msg_cback %s msg handle:%d, control:%d, cr:%d, opcode:x%x", p_drop_msg, handle, avrc_cb.ccb[handle].control, cr, opcode); } @@ -905,7 +905,7 @@ UINT16 AVRC_Open(UINT8 *p_handle, tAVRC_CONN_CB *p_ccb, BD_ADDR_PTR peer_addr) memset(&avrc_cb.rcb[*p_handle], 0, sizeof(tAVRC_RASM_CB)); #endif } - AVRC_TRACE_DEBUG4("AVRC_Open role: %d, control:%d status:%d, handle:%d", cc.role, cc.control, + AVRC_TRACE_DEBUG("AVRC_Open role: %d, control:%d status:%d, handle:%d", cc.role, cc.control, status, *p_handle); return status; @@ -931,7 +931,7 @@ UINT16 AVRC_Open(UINT8 *p_handle, tAVRC_CONN_CB *p_ccb, BD_ADDR_PTR peer_addr) ******************************************************************************/ UINT16 AVRC_Close(UINT8 handle) { - AVRC_TRACE_DEBUG1("AVRC_Close handle:%d", handle); + AVRC_TRACE_DEBUG("AVRC_Close handle:%d", handle); return AVCT_RemoveConn(handle); } @@ -1013,7 +1013,7 @@ UINT16 AVRC_MsgReq (UINT8 handle, UINT8 label, UINT8 ctype, BT_HDR *p_pkt) { if (p_pkt->len > AVRC_MAX_CTRL_DATA_LEN) { - AVRC_TRACE_DEBUG1 ("p_pkt->len(%d) > AVRC_MAX_CTRL_DATA_LEN", p_pkt->len ); + AVRC_TRACE_DEBUG ("p_pkt->len(%d) > AVRC_MAX_CTRL_DATA_LEN", p_pkt->len ); p_pkt_new = (BT_HDR *)GKI_getbuf((UINT16)(AVRC_PACKET_LEN + AVCT_MSG_OFFSET + BT_HDR_SIZE)); if (p_pkt_new) @@ -1040,11 +1040,11 @@ UINT16 AVRC_MsgReq (UINT8 handle, UINT8 label, UINT8 ctype, BT_HDR *p_pkt) /* prepare the left over for as an end fragment */ avrc_prep_end_frag (handle); - AVRC_TRACE_DEBUG3 ("p_pkt len:%d/%d, next len:%d", p_pkt->len, len, p_fcb->p_fmsg->len ); + AVRC_TRACE_DEBUG ("p_pkt len:%d/%d, next len:%d", p_pkt->len, len, p_fcb->p_fmsg->len ); } else { - AVRC_TRACE_ERROR0 ("AVRC_MsgReq no buffers for fragmentation" ); + AVRC_TRACE_ERROR ("AVRC_MsgReq no buffers for fragmentation" ); GKI_freebuf(p_pkt); return AVRC_NO_RESOURCES; } diff --git a/stack/avrc/avrc_bld_ct.c b/stack/avrc/avrc_bld_ct.c index 039eab806..7e2396768 100644 --- a/stack/avrc/avrc_bld_ct.c +++ b/stack/avrc/avrc_bld_ct.c @@ -42,7 +42,7 @@ static tAVRC_STS avrc_bld_next_cmd (tAVRC_NEXT_CMD *p_cmd, BT_HDR *p_pkt) { UINT8 *p_data, *p_start; - AVRC_TRACE_API0("avrc_bld_next_cmd"); + AVRC_TRACE_API("avrc_bld_next_cmd"); /* get the existing length, if any, and also the num attributes */ p_start = (UINT8 *)(p_pkt + 1) + p_pkt->offset; @@ -75,7 +75,7 @@ static tAVRC_STS avrc_bld_set_abs_volume_cmd (tAVRC_SET_VOLUME_CMD *p_cmd, BT_HD { UINT8 *p_data, *p_start; - AVRC_TRACE_API0("avrc_bld_set_abs_volume_cmd"); + AVRC_TRACE_API("avrc_bld_set_abs_volume_cmd"); /* get the existing length, if any, and also the num attributes */ p_start = (UINT8 *)(p_pkt + 1) + p_pkt->offset; p_data = p_start + 2; /* pdu + rsvd */ @@ -100,7 +100,7 @@ static tAVRC_STS avrc_bld_vol_change_notfn(BT_HDR * p_pkt) { UINT8 *p_data, *p_start; - AVRC_TRACE_API0("avrc_bld_vol_change"); + AVRC_TRACE_API("avrc_bld_vol_change"); /* get the existing length, if any, and also the num attributes */ // Set the notify value p_start = (UINT8 *)(p_pkt + 1) + p_pkt->offset; @@ -131,7 +131,7 @@ static BT_HDR *avrc_bld_init_cmd_buffer(tAVRC_COMMAND *p_cmd) UINT8 opcode; opcode = avrc_opcode_from_pdu(p_cmd->pdu); - AVRC_TRACE_API2("avrc_bld_init_cmd_buffer: pdu=%x, opcode=%x", p_cmd->pdu, opcode); + AVRC_TRACE_API("avrc_bld_init_cmd_buffer: pdu=%x, opcode=%x", p_cmd->pdu, opcode); switch (opcode) { @@ -194,10 +194,10 @@ tAVRC_STS AVRC_BldCommand( tAVRC_COMMAND *p_cmd, BT_HDR **pp_pkt) BT_HDR *p_pkt; BOOLEAN alloc = FALSE; - AVRC_TRACE_API2("AVRC_BldCommand: pdu=%x status=%x", p_cmd->cmd.pdu, p_cmd->cmd.status); + AVRC_TRACE_API("AVRC_BldCommand: pdu=%x status=%x", p_cmd->cmd.pdu, p_cmd->cmd.status); if (!p_cmd || !pp_pkt) { - AVRC_TRACE_API2("AVRC_BldCommand. Invalid parameters passed. p_cmd=%p, pp_pkt=%p", + AVRC_TRACE_API("AVRC_BldCommand. Invalid parameters passed. p_cmd=%p, pp_pkt=%p", p_cmd, pp_pkt); return AVRC_STS_BAD_PARAM; } @@ -206,7 +206,7 @@ tAVRC_STS AVRC_BldCommand( tAVRC_COMMAND *p_cmd, BT_HDR **pp_pkt) { if ((*pp_pkt = avrc_bld_init_cmd_buffer(p_cmd)) == NULL) { - AVRC_TRACE_API0("AVRC_BldCommand: Failed to initialize command buffer"); + AVRC_TRACE_API("AVRC_BldCommand: Failed to initialize command buffer"); return AVRC_STS_INTERNAL_ERR; } alloc = TRUE; @@ -243,7 +243,7 @@ tAVRC_STS AVRC_BldCommand( tAVRC_COMMAND *p_cmd, BT_HDR **pp_pkt) GKI_freebuf(p_pkt); *pp_pkt = NULL; } - AVRC_TRACE_API1("AVRC_BldCommand: returning %d", status); + AVRC_TRACE_API("AVRC_BldCommand: returning %d", status); return status; } #endif /* (AVRC_METADATA_INCLUDED == TRUE) */ diff --git a/stack/avrc/avrc_bld_tg.c b/stack/avrc/avrc_bld_tg.c index 6fe645ae6..a9b1a2adf 100644 --- a/stack/avrc/avrc_bld_tg.c +++ b/stack/avrc/avrc_bld_tg.c @@ -49,12 +49,12 @@ static tAVRC_STS avrc_bld_get_capability_rsp (tAVRC_GET_CAPS_RSP *p_rsp, BT_HDR if (!(AVRC_IS_VALID_CAP_ID(p_rsp->capability_id))) { - AVRC_TRACE_ERROR1("avrc_bld_get_capability_rsp bad parameter. p_rsp: %x", p_rsp); + AVRC_TRACE_ERROR("avrc_bld_get_capability_rsp bad parameter. p_rsp: %x", p_rsp); status = AVRC_STS_BAD_PARAM; return status; } - AVRC_TRACE_API0("avrc_bld_get_capability_rsp"); + AVRC_TRACE_API("avrc_bld_get_capability_rsp"); /* get the existing length, if any, and also the num attributes */ p_start = (UINT8 *)(p_pkt + 1) + p_pkt->offset; p_data = p_len = p_start + 2; /* pdu + rsvd */ @@ -122,7 +122,7 @@ static tAVRC_STS avrc_bld_list_app_settings_attr_rsp (tAVRC_LIST_APP_ATTR_RSP *p UINT16 len = 0; UINT8 xx; - AVRC_TRACE_API0("avrc_bld_list_app_settings_attr_rsp"); + AVRC_TRACE_API("avrc_bld_list_app_settings_attr_rsp"); /* get the existing length, if any, and also the num attributes */ p_start = (UINT8 *)(p_pkt + 1) + p_pkt->offset; p_data = p_len = p_start + 2; /* pdu + rsvd */ @@ -174,7 +174,7 @@ static tAVRC_STS avrc_bld_list_app_settings_values_rsp (tAVRC_LIST_APP_VALUES_RS UINT8 xx; UINT16 len; - AVRC_TRACE_API0("avrc_bld_list_app_settings_values_rsp"); + AVRC_TRACE_API("avrc_bld_list_app_settings_values_rsp"); p_start = (UINT8 *)(p_pkt + 1) + p_pkt->offset; p_data = p_len = p_start + 2; /* pdu + rsvd */ @@ -226,11 +226,11 @@ static tAVRC_STS avrc_bld_get_cur_app_setting_value_rsp (tAVRC_GET_CUR_APP_VALUE if (!p_rsp->p_vals) { - AVRC_TRACE_ERROR0("avrc_bld_get_cur_app_setting_value_rsp NULL parameter"); + AVRC_TRACE_ERROR("avrc_bld_get_cur_app_setting_value_rsp NULL parameter"); return AVRC_STS_BAD_PARAM; } - AVRC_TRACE_API0("avrc_bld_get_cur_app_setting_value_rsp"); + AVRC_TRACE_API("avrc_bld_get_cur_app_setting_value_rsp"); /* get the existing length, if any, and also the num attributes */ p_start = (UINT8 *)(p_pkt + 1) + p_pkt->offset; p_data = p_len = p_start + 2; /* pdu + rsvd */ @@ -281,7 +281,7 @@ static tAVRC_STS avrc_bld_set_app_setting_value_rsp (tAVRC_RSP *p_rsp, BT_HDR *p UNUSED(p_pkt); /* nothing to be added. */ - AVRC_TRACE_API0("avrc_bld_set_app_setting_value_rsp"); + AVRC_TRACE_API("avrc_bld_set_app_setting_value_rsp"); return AVRC_STS_NO_ERROR; } @@ -306,7 +306,7 @@ static tAVRC_STS avrc_bld_app_setting_text_rsp (tAVRC_GET_APP_ATTR_TXT_RSP *p_rs if (!p_rsp->p_attrs) { - AVRC_TRACE_ERROR0("avrc_bld_app_setting_text_rsp NULL parameter"); + AVRC_TRACE_ERROR("avrc_bld_app_setting_text_rsp NULL parameter"); return AVRC_STS_BAD_PARAM; } /* get the existing length, if any, and also the num attributes */ @@ -331,7 +331,7 @@ static tAVRC_STS avrc_bld_app_setting_text_rsp (tAVRC_GET_APP_ATTR_TXT_RSP *p_rs { if (len_left < (p_rsp->p_attrs[xx].str_len + 4)) { - AVRC_TRACE_ERROR3("avrc_bld_app_setting_text_rsp out of room (str_len:%d, left:%d)", + AVRC_TRACE_ERROR("avrc_bld_app_setting_text_rsp out of room (str_len:%d, left:%d)", xx, p_rsp->p_attrs[xx].str_len, len_left); p_rsp->num_attr = num_added; sts = AVRC_STS_INTERNAL_ERR; @@ -339,7 +339,7 @@ static tAVRC_STS avrc_bld_app_setting_text_rsp (tAVRC_GET_APP_ATTR_TXT_RSP *p_rs } if ( !p_rsp->p_attrs[xx].str_len || !p_rsp->p_attrs[xx].p_str ) { - AVRC_TRACE_ERROR1("avrc_bld_app_setting_text_rsp NULL attr text[%d]", xx); + AVRC_TRACE_ERROR("avrc_bld_app_setting_text_rsp NULL attr text[%d]", xx); continue; } UINT8_TO_BE_STREAM(p_data, p_rsp->p_attrs[xx].attr_id); @@ -370,7 +370,7 @@ static tAVRC_STS avrc_bld_app_setting_text_rsp (tAVRC_GET_APP_ATTR_TXT_RSP *p_rs static tAVRC_STS avrc_bld_get_app_setting_attr_text_rsp (tAVRC_GET_APP_ATTR_TXT_RSP *p_rsp, BT_HDR *p_pkt) { - AVRC_TRACE_API0("avrc_bld_get_app_setting_attr_text_rsp"); + AVRC_TRACE_API("avrc_bld_get_app_setting_attr_text_rsp"); return avrc_bld_app_setting_text_rsp(p_rsp, p_pkt); } @@ -388,7 +388,7 @@ static tAVRC_STS avrc_bld_get_app_setting_attr_text_rsp (tAVRC_GET_APP_ATTR_TXT_ static tAVRC_STS avrc_bld_get_app_setting_value_text_rsp (tAVRC_GET_APP_ATTR_TXT_RSP *p_rsp, BT_HDR *p_pkt) { - AVRC_TRACE_API0("avrc_bld_get_app_setting_value_text_rsp"); + AVRC_TRACE_API("avrc_bld_get_app_setting_value_text_rsp"); return avrc_bld_app_setting_text_rsp(p_rsp, p_pkt); } @@ -409,7 +409,7 @@ static tAVRC_STS avrc_bld_inform_charset_rsp (tAVRC_RSP *p_rsp, BT_HDR *p_pkt) UNUSED(p_pkt); /* nothing to be added. */ - AVRC_TRACE_API0("avrc_bld_inform_charset_rsp"); + AVRC_TRACE_API("avrc_bld_inform_charset_rsp"); return AVRC_STS_NO_ERROR; } @@ -430,7 +430,7 @@ static tAVRC_STS avrc_bld_inform_battery_status_rsp (tAVRC_RSP *p_rsp, BT_HDR *p UNUSED(p_pkt); /* nothing to be added. */ - AVRC_TRACE_API0("avrc_bld_inform_battery_status_rsp"); + AVRC_TRACE_API("avrc_bld_inform_battery_status_rsp"); return AVRC_STS_NO_ERROR; } @@ -451,10 +451,10 @@ static tAVRC_STS avrc_bld_get_elem_attrs_rsp (tAVRC_GET_ELEM_ATTRS_RSP *p_rsp, B UINT16 len; UINT8 xx; - AVRC_TRACE_API0("avrc_bld_get_elem_attrs_rsp"); + AVRC_TRACE_API("avrc_bld_get_elem_attrs_rsp"); if (!p_rsp->p_attrs) { - AVRC_TRACE_ERROR0("avrc_bld_get_elem_attrs_rsp NULL parameter"); + AVRC_TRACE_ERROR("avrc_bld_get_elem_attrs_rsp NULL parameter"); return AVRC_STS_BAD_PARAM; } @@ -479,7 +479,7 @@ static tAVRC_STS avrc_bld_get_elem_attrs_rsp (tAVRC_GET_ELEM_ATTRS_RSP *p_rsp, B { if (!AVRC_IS_VALID_MEDIA_ATTRIBUTE(p_rsp->p_attrs[xx].attr_id)) { - AVRC_TRACE_ERROR2("avrc_bld_get_elem_attrs_rsp invalid attr id[%d]: %d", xx, p_rsp->p_attrs[xx].attr_id); + AVRC_TRACE_ERROR("avrc_bld_get_elem_attrs_rsp invalid attr id[%d]: %d", xx, p_rsp->p_attrs[xx].attr_id); continue; } if ( !p_rsp->p_attrs[xx].name.p_str ) @@ -513,7 +513,7 @@ static tAVRC_STS avrc_bld_get_play_status_rsp (tAVRC_GET_PLAY_STATUS_RSP *p_rsp, { UINT8 *p_data, *p_start; - AVRC_TRACE_API0("avrc_bld_get_play_status_rsp"); + AVRC_TRACE_API("avrc_bld_get_play_status_rsp"); p_start = (UINT8 *)(p_pkt + 1) + p_pkt->offset; p_data = p_start + 2; @@ -545,7 +545,7 @@ static tAVRC_STS avrc_bld_notify_rsp (tAVRC_REG_NOTIF_RSP *p_rsp, BT_HDR *p_pkt) UINT8 xx; tAVRC_STS status = AVRC_STS_NO_ERROR; - AVRC_TRACE_API0("avrc_bld_notify_rsp"); + AVRC_TRACE_API("avrc_bld_notify_rsp"); p_start = (UINT8 *)(p_pkt + 1) + p_pkt->offset; p_data = p_len = p_start + 2; /* pdu + rsvd */ @@ -564,7 +564,7 @@ static tAVRC_STS avrc_bld_notify_rsp (tAVRC_REG_NOTIF_RSP *p_rsp, BT_HDR *p_pkt) } else { - AVRC_TRACE_ERROR0("bad play state"); + AVRC_TRACE_ERROR("bad play state"); status = AVRC_STS_BAD_PARAM; } break; @@ -592,7 +592,7 @@ static tAVRC_STS avrc_bld_notify_rsp (tAVRC_REG_NOTIF_RSP *p_rsp, BT_HDR *p_pkt) } else { - AVRC_TRACE_ERROR0("bad battery status"); + AVRC_TRACE_ERROR("bad battery status"); status = AVRC_STS_BAD_PARAM; } break; @@ -605,7 +605,7 @@ static tAVRC_STS avrc_bld_notify_rsp (tAVRC_REG_NOTIF_RSP *p_rsp, BT_HDR *p_pkt) } else { - AVRC_TRACE_ERROR0("bad system status"); + AVRC_TRACE_ERROR("bad system status"); status = AVRC_STS_BAD_PARAM; } break; @@ -628,7 +628,7 @@ static tAVRC_STS avrc_bld_notify_rsp (tAVRC_REG_NOTIF_RSP *p_rsp, BT_HDR *p_pkt) } else { - AVRC_TRACE_ERROR0("bad player app seeting attribute or value"); + AVRC_TRACE_ERROR("bad player app seeting attribute or value"); status = AVRC_STS_BAD_PARAM; break; } @@ -641,7 +641,7 @@ static tAVRC_STS avrc_bld_notify_rsp (tAVRC_REG_NOTIF_RSP *p_rsp, BT_HDR *p_pkt) default: status = AVRC_STS_BAD_PARAM; - AVRC_TRACE_ERROR0("unknown event_id"); + AVRC_TRACE_ERROR("unknown event_id"); } UINT16_TO_BE_STREAM(p_len, len); @@ -667,7 +667,7 @@ static tAVRC_STS avrc_bld_next_rsp (tAVRC_RSP *p_rsp, BT_HDR *p_pkt) UNUSED(p_pkt); /* nothing to be added. */ - AVRC_TRACE_API0("avrc_bld_next_rsp"); + AVRC_TRACE_API("avrc_bld_next_rsp"); return AVRC_STS_NO_ERROR; } @@ -688,11 +688,11 @@ tAVRC_STS avrc_bld_group_navigation_rsp (UINT16 navi_id, BT_HDR *p_pkt) if (!AVRC_IS_VALID_GROUP(navi_id)) { - AVRC_TRACE_ERROR1("avrc_bld_group_navigation_rsp bad navigation op id: %d", navi_id); + AVRC_TRACE_ERROR("avrc_bld_group_navigation_rsp bad navigation op id: %d", navi_id); return AVRC_STS_BAD_PARAM; } - AVRC_TRACE_API0("avrc_bld_group_navigation_rsp"); + AVRC_TRACE_API("avrc_bld_group_navigation_rsp"); p_data = (UINT8 *)(p_pkt+1) + p_pkt->offset; UINT16_TO_BE_STREAM(p_data, navi_id); p_pkt->len = 2; @@ -713,11 +713,11 @@ static tAVRC_STS avrc_bld_rejected_rsp( tAVRC_RSP *p_rsp, BT_HDR *p_pkt ) { UINT8 *p_data, *p_start; - AVRC_TRACE_API2("avrc_bld_rejected_rsp: status=%d, pdu:x%x", p_rsp->status, p_rsp->pdu); + AVRC_TRACE_API("avrc_bld_rejected_rsp: status=%d, pdu:x%x", p_rsp->status, p_rsp->pdu); p_start = (UINT8 *)(p_pkt + 1) + p_pkt->offset; p_data = p_start + 2; - AVRC_TRACE_DEBUG1("pdu:x%x", *p_start); + AVRC_TRACE_DEBUG("pdu:x%x", *p_start); UINT16_TO_BE_STREAM(p_data, 1); UINT8_TO_BE_STREAM(p_data, p_rsp->status); @@ -742,13 +742,13 @@ static BT_HDR *avrc_bld_init_rsp_buffer(tAVRC_RESPONSE *p_rsp) BT_HDR *p_pkt=NULL; UINT8 opcode = avrc_opcode_from_pdu(p_rsp->pdu); - AVRC_TRACE_API3("avrc_bld_init_rsp_buffer: pdu=%x, opcode=%x/%x", p_rsp->pdu, opcode, + AVRC_TRACE_API("avrc_bld_init_rsp_buffer: pdu=%x, opcode=%x/%x", p_rsp->pdu, opcode, p_rsp->rsp.opcode); if (opcode != p_rsp->rsp.opcode && p_rsp->rsp.status != AVRC_STS_NO_ERROR && avrc_is_valid_opcode(p_rsp->rsp.opcode)) { opcode = p_rsp->rsp.opcode; - AVRC_TRACE_API1("opcode=%x", opcode); + AVRC_TRACE_API("opcode=%x", opcode); } switch (opcode) @@ -817,7 +817,7 @@ tAVRC_STS AVRC_BldResponse( UINT8 handle, tAVRC_RESPONSE *p_rsp, BT_HDR **pp_pkt if (!p_rsp || !pp_pkt) { - AVRC_TRACE_API2("AVRC_BldResponse. Invalid parameters passed. p_rsp=%p, pp_pkt=%p", + AVRC_TRACE_API("AVRC_BldResponse. Invalid parameters passed. p_rsp=%p, pp_pkt=%p", p_rsp, pp_pkt); return AVRC_STS_BAD_PARAM; } @@ -826,7 +826,7 @@ tAVRC_STS AVRC_BldResponse( UINT8 handle, tAVRC_RESPONSE *p_rsp, BT_HDR **pp_pkt { if ((*pp_pkt = avrc_bld_init_rsp_buffer(p_rsp)) == NULL) { - AVRC_TRACE_API0("AVRC_BldResponse: Failed to initialize response buffer"); + AVRC_TRACE_API("AVRC_BldResponse: Failed to initialize response buffer"); return AVRC_STS_INTERNAL_ERR; } alloc = TRUE; @@ -834,7 +834,7 @@ tAVRC_STS AVRC_BldResponse( UINT8 handle, tAVRC_RESPONSE *p_rsp, BT_HDR **pp_pkt status = AVRC_STS_NO_ERROR; p_pkt = *pp_pkt; - AVRC_TRACE_API2("AVRC_BldResponse: pdu=%x status=%x", p_rsp->rsp.pdu, p_rsp->rsp.status); + AVRC_TRACE_API("AVRC_BldResponse: pdu=%x status=%x", p_rsp->rsp.pdu, p_rsp->rsp.status); if (p_rsp->rsp.status != AVRC_STS_NO_ERROR) { return( avrc_bld_rejected_rsp(&p_rsp->rsp, p_pkt) ); @@ -909,7 +909,7 @@ tAVRC_STS AVRC_BldResponse( UINT8 handle, tAVRC_RESPONSE *p_rsp, BT_HDR **pp_pkt GKI_freebuf(p_pkt); *pp_pkt = NULL; } - AVRC_TRACE_API1("AVRC_BldResponse: returning %d", status); + AVRC_TRACE_API("AVRC_BldResponse: returning %d", status); return status; } diff --git a/stack/avrc/avrc_pars_ct.c b/stack/avrc/avrc_pars_ct.c index f3b4af553..143ce81e0 100644 --- a/stack/avrc/avrc_pars_ct.c +++ b/stack/avrc/avrc_pars_ct.c @@ -58,7 +58,7 @@ static tAVRC_STS avrc_pars_vendor_rsp(tAVRC_MSG_VENDOR *p_msg, tAVRC_RESPONSE *p BE_STREAM_TO_UINT8 (p_result->pdu, p); p++; /* skip the reserved/packe_type byte */ BE_STREAM_TO_UINT16 (len, p); - AVRC_TRACE_DEBUG4("avrc_pars_vendor_rsp() ctype:0x%x pdu:0x%x, len:%d/0x%x", p_msg->hdr.ctype, p_result->pdu, len, len); + AVRC_TRACE_DEBUG("avrc_pars_vendor_rsp() ctype:0x%x pdu:0x%x, len:%d/0x%x", p_msg->hdr.ctype, p_result->pdu, len, len); if (p_msg->hdr.ctype == AVRC_RSP_REJ) { p_result->rsp.status = *p; @@ -92,7 +92,7 @@ static tAVRC_STS avrc_pars_vendor_rsp(tAVRC_MSG_VENDOR *p_msg, tAVRC_RESPONSE *p p_result->reg_notif.event_id=eventid; BE_STREAM_TO_UINT8 (p_result->reg_notif.param.volume, p); } - AVRC_TRACE_DEBUG2("avrc_pars_vendor_rsp PDU reg notif response:event %x, volume %x",eventid, + AVRC_TRACE_DEBUG("avrc_pars_vendor_rsp PDU reg notif response:event %x, volume %x",eventid, p_result->reg_notif.param.volume); #endif /* (AVRC_ADV_CTRL_INCLUDED == TRUE) */ break; @@ -138,7 +138,7 @@ tAVRC_STS AVRC_ParsResponse (tAVRC_MSG *p_msg, tAVRC_RESPONSE *p_result, UINT8 * break; default: - AVRC_TRACE_ERROR1("AVRC_ParsResponse() unknown opcode:0x%x", p_msg->hdr.opcode); + AVRC_TRACE_ERROR("AVRC_ParsResponse() unknown opcode:0x%x", p_msg->hdr.opcode); break; } p_result->rsp.opcode = p_msg->hdr.opcode; diff --git a/stack/avrc/avrc_pars_tg.c b/stack/avrc/avrc_pars_tg.c index d3d5262fa..4a603d3d7 100644 --- a/stack/avrc/avrc_pars_tg.c +++ b/stack/avrc/avrc_pars_tg.c @@ -52,10 +52,10 @@ static tAVRC_STS avrc_pars_vendor_cmd(tAVRC_MSG_VENDOR *p_msg, tAVRC_COMMAND *p_ UINT16 size_needed; p_result->pdu = *p++; - AVRC_TRACE_DEBUG1("avrc_pars_vendor_cmd() pdu:0x%x", p_result->pdu); + AVRC_TRACE_DEBUG("avrc_pars_vendor_cmd() pdu:0x%x", p_result->pdu); if (!AVRC_IsValidAvcType (p_result->pdu, p_msg->hdr.ctype)) { - AVRC_TRACE_DEBUG0("avrc_pars_vendor_cmd() detects wrong AV/C type!"); + AVRC_TRACE_DEBUG("avrc_pars_vendor_cmd() detects wrong AV/C type!"); status = AVRC_STS_BAD_CMD; } @@ -132,14 +132,14 @@ static tAVRC_STS avrc_pars_vendor_cmd(tAVRC_MSG_VENDOR *p_msg, tAVRC_COMMAND *p_ } if (xx != p_result->set_app_val.num_val) { - AVRC_TRACE_ERROR2("AVRC_PDU_SET_PLAYER_APP_VALUE not enough room:%d orig num_val:%d", + AVRC_TRACE_ERROR("AVRC_PDU_SET_PLAYER_APP_VALUE not enough room:%d orig num_val:%d", xx, p_result->set_app_val.num_val); p_result->set_app_val.num_val = xx; } } else { - AVRC_TRACE_ERROR0("AVRC_PDU_SET_PLAYER_APP_VALUE NULL decode buffer or bad len"); + AVRC_TRACE_ERROR("AVRC_PDU_SET_PLAYER_APP_VALUE NULL decode buffer or bad len"); status = AVRC_STS_INTERNAL_ERR; } break; @@ -301,13 +301,13 @@ tAVRC_STS AVRC_ParsCommand (tAVRC_MSG *p_msg, tAVRC_COMMAND *p_result, UINT8 *p_ break; default: - AVRC_TRACE_ERROR1("AVRC_ParsCommand() unknown opcode:0x%x", p_msg->hdr.opcode); + AVRC_TRACE_ERROR("AVRC_ParsCommand() unknown opcode:0x%x", p_msg->hdr.opcode); break; } p_result->cmd.opcode = p_msg->hdr.opcode; p_result->cmd.status = status; } - AVRC_TRACE_DEBUG1("AVRC_ParsCommand() return status:0x%x", status); + AVRC_TRACE_DEBUG("AVRC_ParsCommand() return status:0x%x", status); return status; } diff --git a/stack/avrc/avrc_sdp.c b/stack/avrc/avrc_sdp.c index a6325e17d..f08b7c907 100644 --- a/stack/avrc/avrc_sdp.c +++ b/stack/avrc/avrc_sdp.c @@ -81,7 +81,7 @@ const tSDP_PROTO_LIST_ELEM avrc_add_proto_list [] = ******************************************************************************/ static void avrc_sdp_cback(UINT16 status) { - AVRC_TRACE_API1("avrc_sdp_cback status: %d", status); + AVRC_TRACE_API("avrc_sdp_cback status: %d", status); /* reset service_uuid, so can start another find service */ avrc_cb.service_uuid = 0; @@ -141,7 +141,7 @@ UINT16 AVRC_FindService(UINT16 service_uuid, BD_ADDR bd_addr, ATTR_ID_SUPPORTED_FEATURES, ATTR_ID_PROVIDER_NAME}; - AVRC_TRACE_API1("AVRC_FindService uuid: %x", service_uuid); + AVRC_TRACE_API("AVRC_FindService uuid: %x", service_uuid); if( (service_uuid != UUID_SERVCLASS_AV_REM_CTRL_TARGET && service_uuid != UUID_SERVCLASS_AV_REMOTE_CONTROL) || p_db == NULL || p_db->p_db == NULL || p_cback == NULL) return AVRC_BAD_PARAM; @@ -220,7 +220,7 @@ UINT16 AVRC_AddRecord(UINT16 service_uuid, char *p_service_name, UINT16 class_list[2]; - AVRC_TRACE_API1("AVRC_AddRecord uuid: %x", service_uuid); + AVRC_TRACE_API("AVRC_AddRecord uuid: %x", service_uuid); if( service_uuid != UUID_SERVCLASS_AV_REM_CTRL_TARGET && service_uuid != UUID_SERVCLASS_AV_REMOTE_CONTROL ) return AVRC_BAD_PARAM; diff --git a/stack/avrc/avrc_utils.c b/stack/avrc/avrc_utils.c index 01254fa9b..432ecc0cd 100644 --- a/stack/avrc/avrc_utils.c +++ b/stack/avrc/avrc_utils.c @@ -118,7 +118,7 @@ BOOLEAN avrc_is_valid_player_attrib_value(UINT8 attrib, UINT8 value) result = TRUE; if (!result) - AVRC_TRACE_ERROR2( + AVRC_TRACE_ERROR( "avrc_is_valid_player_attrib_value() found not matching attrib(x%x)-value(x%x) pair!", attrib, value); diff --git a/stack/gap/gap_ble.c b/stack/gap/gap_ble.c index 0d10f88ca..932c5e54e 100644 --- a/stack/gap/gap_ble.c +++ b/stack/gap/gap_ble.c @@ -210,7 +210,7 @@ UINT16 gap_get_conn_id_if_connected (BD_ADDR bd_addr) } /* If here, failed to allocate a client control block */ - GATT_TRACE_DEBUG0 ("gap_get_conn_id_if_connected: not connected"); + GATT_TRACE_DEBUG ("gap_get_conn_id_if_connected: not connected"); return(GATT_INVALID_CONN_ID); } diff --git a/stack/gatt/att_protocol.c b/stack/gatt/att_protocol.c index 51ea28490..53a640e52 100644 --- a/stack/gatt/att_protocol.c +++ b/stack/gatt/att_protocol.c @@ -335,7 +335,7 @@ BT_HDR *attp_build_value_cmd (UINT16 payload_size, UINT8 op_code, UINT16 handle, if (op_code == GATT_RSP_READ_BY_TYPE) *p_pair_len = (len + 2); - GATT_TRACE_WARNING1("attribute value too long, to be truncated to %d", len); + GATT_TRACE_WARNING("attribute value too long, to be truncated to %d", len); } ARRAY_TO_STREAM (p, p_data, len); @@ -364,7 +364,7 @@ BOOLEAN attp_send_msg_to_L2CAP(tGATT_TCB *p_tcb, BT_HDR *p_toL2CAP) if (l2cap_ret == L2CAP_DW_FAILED) { - GATT_TRACE_ERROR1("ATT failed to pass msg:0x%0x to L2CAP", + GATT_TRACE_ERROR("ATT failed to pass msg:0x%0x to L2CAP", *((UINT8 *)(p_toL2CAP + 1) + p_toL2CAP->offset)); GKI_freebuf(p_toL2CAP); return FALSE; @@ -391,7 +391,7 @@ BT_HDR *attp_build_sr_msg(tGATT_TCB *p_tcb, UINT8 op_code, tGATT_SR_MSG *p_msg) { case GATT_RSP_READ_BLOB: case GATT_RSP_PREPARE_WRITE: - GATT_TRACE_EVENT2 ("ATT_RSP_READ_BLOB/GATT_RSP_PREPARE_WRITE: len = %d offset = %d", + GATT_TRACE_EVENT ("ATT_RSP_READ_BLOB/GATT_RSP_PREPARE_WRITE: len = %d offset = %d", p_msg->attr_value.len, p_msg->attr_value.offset); offset = p_msg->attr_value.offset; /* Coverity: [FALSE-POSITIVE error] intended fall through */ @@ -426,12 +426,12 @@ BT_HDR *attp_build_sr_msg(tGATT_TCB *p_tcb, UINT8 op_code, tGATT_SR_MSG *p_msg) break; default: - GATT_TRACE_DEBUG1("attp_build_sr_msg: unknown op code = %d", op_code); + GATT_TRACE_DEBUG("attp_build_sr_msg: unknown op code = %d", op_code); break; } if (!p_cmd) - GATT_TRACE_ERROR0("No resources"); + GATT_TRACE_ERROR("No resources"); return p_cmd; } @@ -625,7 +625,7 @@ tGATT_STATUS attp_send_cl_msg (tGATT_TCB *p_tcb, UINT16 clcb_idx, UINT8 op_code, } else { - GATT_TRACE_ERROR0("Peer device not connected"); + GATT_TRACE_ERROR("Peer device not connected"); } return status; diff --git a/stack/gatt/gatt_api.c b/stack/gatt/gatt_api.c index 0321fe841..2fd0f6bc8 100644 --- a/stack/gatt/gatt_api.c +++ b/stack/gatt/gatt_api.c @@ -151,11 +151,11 @@ UINT16 GATTS_CreateService (tGATT_IF gatt_if, tBT_UUID *p_svc_uuid, tBT_UUID *p_app_uuid128; - GATT_TRACE_API0 ("GATTS_CreateService" ); + GATT_TRACE_API ("GATTS_CreateService" ); if (p_reg == NULL) { - GATT_TRACE_ERROR1 ("Inavlid gatt_if=%d", gatt_if); + GATT_TRACE_ERROR ("Inavlid gatt_if=%d", gatt_if); return(0); } @@ -164,7 +164,7 @@ UINT16 GATTS_CreateService (tGATT_IF gatt_if, tBT_UUID *p_svc_uuid, if ((p_list = gatt_find_hdl_buffer_by_app_id(p_app_uuid128, p_svc_uuid, svc_inst)) != NULL) { s_hdl = p_list->asgn_range.s_handle; - GATT_TRACE_DEBUG0 ("Service already been created!!"); + GATT_TRACE_DEBUG ("Service already been created!!"); } else { @@ -196,14 +196,14 @@ UINT16 GATTS_CreateService (tGATT_IF gatt_if, tBT_UUID *p_svc_uuid, /* check for space */ if (num_handles > (0xFFFF - s_hdl + 1)) { - GATT_TRACE_ERROR2 ("GATTS_ReserveHandles: no handles, s_hdl: %u needed: %u", s_hdl, num_handles); + GATT_TRACE_ERROR ("GATTS_ReserveHandles: no handles, s_hdl: %u needed: %u", s_hdl, num_handles); return(0); } if ( (p_list = gatt_alloc_hdl_buffer()) == NULL) { /* No free entry */ - GATT_TRACE_ERROR0 ("GATTS_ReserveHandles: no free handle blocks"); + GATT_TRACE_ERROR ("GATTS_ReserveHandles: no free handle blocks"); return(0); } @@ -224,7 +224,7 @@ UINT16 GATTS_CreateService (tGATT_IF gatt_if, tBT_UUID *p_svc_uuid, if ( (p_buf = gatt_add_pending_new_srv_start(&p_list->asgn_range)) == NULL) { /* No free entry */ - GATT_TRACE_ERROR0 ("gatt_add_pending_new_srv_start: no free blocks"); + GATT_TRACE_ERROR ("gatt_add_pending_new_srv_start: no free blocks"); if (p_list) { @@ -234,13 +234,13 @@ UINT16 GATTS_CreateService (tGATT_IF gatt_if, tBT_UUID *p_svc_uuid, return(0); } - GATT_TRACE_DEBUG0 ("Add a new srv chg item"); + GATT_TRACE_DEBUG ("Add a new srv chg item"); } } if (!gatts_init_service_db(&p_list->svc_db, p_svc_uuid, is_pri, s_hdl , num_handles)) { - GATT_TRACE_ERROR0 ("GATTS_ReserveHandles: service DB initialization failed"); + GATT_TRACE_ERROR ("GATTS_ReserveHandles: service DB initialization failed"); if (p_list) { gatt_remove_an_item_from_list(p_list_info, p_list); @@ -252,7 +252,7 @@ UINT16 GATTS_CreateService (tGATT_IF gatt_if, tBT_UUID *p_svc_uuid, return(0); } - GATT_TRACE_DEBUG6 ("GATTS_CreateService(success): handles needed:%u s_hdl=%u e_hdl=%u %s[%x] is_primary=%d", + GATT_TRACE_DEBUG ("GATTS_CreateService(success): handles needed:%u s_hdl=%u e_hdl=%u %s[%x] is_primary=%d", num_handles, p_list->asgn_range.s_handle , p_list->asgn_range.e_handle, ((p_list->asgn_range.svc_uuid.len == 2) ? "uuid16": "uuid128" ), p_list->asgn_range.svc_uuid.uu.uuid16, @@ -281,12 +281,12 @@ UINT16 GATTS_AddIncludeService (UINT16 service_handle, UINT16 include_svc_handle if ((p_decl = gatt_find_hdl_buffer_by_handle(service_handle)) == NULL) { - GATT_TRACE_DEBUG0("Service not created"); + GATT_TRACE_DEBUG("Service not created"); return 0; } if ((p_incl_decl = gatt_find_hdl_buffer_by_handle(include_svc_handle)) == NULL) { - GATT_TRACE_DEBUG0("Included Service not created"); + GATT_TRACE_DEBUG("Included Service not created"); return 0; } @@ -319,14 +319,14 @@ UINT16 GATTS_AddCharacteristic (UINT16 service_handle, tBT_UUID *p_char_uuid, if ((p_decl = gatt_find_hdl_buffer_by_handle(service_handle)) == NULL) { - GATT_TRACE_DEBUG0("Service not created"); + GATT_TRACE_DEBUG("Service not created"); return 0; } /* data validity checking */ if ( ((property & GATT_CHAR_PROP_BIT_AUTH) && !(perm & GATT_WRITE_SIGNED_PERM)) || ((perm & GATT_WRITE_SIGNED_PERM) && !(property & GATT_CHAR_PROP_BIT_AUTH)) ) { - GATT_TRACE_DEBUG2("Invalid configuration property=0x%x perm=0x%x ", property, perm); + GATT_TRACE_DEBUG("Invalid configuration property=0x%x perm=0x%x ", property, perm); return 0; } @@ -362,14 +362,14 @@ UINT16 GATTS_AddCharDescriptor (UINT16 service_handle, if ((p_decl = gatt_find_hdl_buffer_by_handle(service_handle)) == NULL) { - GATT_TRACE_DEBUG0("Service not created"); + GATT_TRACE_DEBUG("Service not created"); return 0; } if (p_descr_uuid == NULL || (p_descr_uuid->len != LEN_UUID_128 && p_descr_uuid->len != LEN_UUID_16 && p_descr_uuid->len != LEN_UUID_32)) { - GATT_TRACE_DEBUG0("Illegal parameter"); + GATT_TRACE_DEBUG("Illegal parameter"); return 0; } @@ -401,18 +401,18 @@ BOOLEAN GATTS_DeleteService (tGATT_IF gatt_if, tBT_UUID *p_svc_uuid, UINT16 svc_ tGATT_REG *p_reg = gatt_get_regcb(gatt_if); tBT_UUID *p_app_uuid128; - GATT_TRACE_DEBUG0 ("GATTS_DeleteService"); + GATT_TRACE_DEBUG ("GATTS_DeleteService"); if (p_reg == NULL) { - GATT_TRACE_ERROR0 ("Applicaiton not foud"); + GATT_TRACE_ERROR ("Applicaiton not foud"); return(FALSE); } p_app_uuid128 = &p_reg->app_uuid128; if ((p_list = gatt_find_hdl_buffer_by_app_id(p_app_uuid128, p_svc_uuid, svc_inst)) == NULL) { - GATT_TRACE_ERROR0 ("No Service found"); + GATT_TRACE_ERROR ("No Service found"); return(FALSE); } @@ -420,7 +420,7 @@ BOOLEAN GATTS_DeleteService (tGATT_IF gatt_if, tBT_UUID *p_svc_uuid, UINT16 svc_ &p_list->asgn_range.svc_uuid, p_list->asgn_range.svc_inst)) != NULL) { - GATT_TRACE_DEBUG0 ("Delete a new service changed item - the service has not yet started"); + GATT_TRACE_DEBUG ("Delete a new service changed item - the service has not yet started"); GKI_freebuf (GKI_remove_from_queue (&gatt_cb.pending_new_srv_start_q, p_buf)); } else @@ -435,7 +435,7 @@ BOOLEAN GATTS_DeleteService (tGATT_IF gatt_if, tBT_UUID *p_svc_uuid, UINT16 svc_ GATTS_StopService(gatt_cb.sr_reg[i_sreg].s_hdl); } - GATT_TRACE_DEBUG2 ("released handles s_hdl=%u e_hdl=%u", + GATT_TRACE_DEBUG ("released handles s_hdl=%u e_hdl=%u", p_list->asgn_range.s_handle , p_list->asgn_range.e_handle ); if ( (p_list->asgn_range.s_handle >= gatt_cb.hdl_cfg.app_start_hdl) @@ -472,19 +472,19 @@ tGATT_STATUS GATTS_StartService (tGATT_IF gatt_if, UINT16 service_handle, tGATTS_PENDING_NEW_SRV_START *p_buf; - GATT_TRACE_API0 ("GATTS_StartService"); + GATT_TRACE_API ("GATTS_StartService"); if (p_reg == NULL) { /* Not found */ - GATT_TRACE_ERROR0 ("Applicaiton not found "); + GATT_TRACE_ERROR ("Applicaiton not found "); return GATT_NOT_FOUND; } if ((p_list = gatt_find_hdl_buffer_by_handle(service_handle)) == NULL) { /* Not found */ - GATT_TRACE_ERROR0 ("no service found"); + GATT_TRACE_ERROR ("no service found"); return GATT_NOT_FOUND; } @@ -492,14 +492,14 @@ tGATT_STATUS GATTS_StartService (tGATT_IF gatt_if, UINT16 service_handle, &p_list->asgn_range.svc_uuid, p_list->asgn_range.svc_inst) != GATT_MAX_SR_PROFILES) { - GATT_TRACE_ERROR0 ("Duplicate Service start - Service already started"); + GATT_TRACE_ERROR ("Duplicate Service start - Service already started"); return GATT_SERVICE_STARTED; } /*this is a new application servoce start */ if ((i_sreg = gatt_sr_alloc_rcb(p_list)) == GATT_MAX_SR_PROFILES) { - GATT_TRACE_ERROR0 ("GATTS_StartService: no free server registration block"); + GATT_TRACE_ERROR ("GATTS_StartService: no free server registration block"); return GATT_NO_RESOURCES; } @@ -526,9 +526,9 @@ tGATT_STATUS GATTS_StartService (tGATT_IF gatt_if, UINT16 service_handle, gatt_add_a_srv_to_list(&gatt_cb.srv_list_info, &gatt_cb.srv_list[i_sreg]); - GATT_TRACE_DEBUG1 ("allocated i_sreg=%d ",i_sreg); + GATT_TRACE_DEBUG ("allocated i_sreg=%d ",i_sreg); - GATT_TRACE_DEBUG5 ("s_hdl=%d e_hdl=%d type=0x%x svc_inst=%d sdp_hdl=0x%x", + GATT_TRACE_DEBUG ("s_hdl=%d e_hdl=%d type=0x%x svc_inst=%d sdp_hdl=0x%x", p_sreg->s_hdl,p_sreg->e_hdl, p_sreg->type, p_sreg->service_instance, p_sreg->sdp_handle); @@ -561,7 +561,7 @@ void GATTS_StopService (UINT16 service_handle) { UINT8 ii = gatt_sr_find_i_rcb_by_handle(service_handle); - GATT_TRACE_API1("GATTS_StopService %u", service_handle); + GATT_TRACE_API("GATTS_StopService %u", service_handle); /* Index 0 is reserved for GATT, and is never stopped */ if ( (ii > 0) && (ii < GATT_MAX_SR_PROFILES) && (gatt_cb.sr_reg[ii].in_use) ) @@ -576,7 +576,7 @@ void GATTS_StopService (UINT16 service_handle) } else { - GATT_TRACE_ERROR1("GATTS_StopService service_handle: %u is not in use", service_handle); + GATT_TRACE_ERROR("GATTS_StopService service_handle: %u is not in use", service_handle); } } /******************************************************************************* @@ -606,10 +606,10 @@ tGATT_STATUS GATTS_HandleValueIndication (UINT16 conn_id, UINT16 attr_handle, U tGATT_TCB *p_tcb = gatt_get_tcb_by_idx(tcb_idx); - GATT_TRACE_API0 ("GATTS_HandleValueIndication"); + GATT_TRACE_API ("GATTS_HandleValueIndication"); if ( (p_reg == NULL) || (p_tcb == NULL)) { - GATT_TRACE_ERROR1 ("GATTS_HandleValueIndication Unknown conn_id: %u ", conn_id); + GATT_TRACE_ERROR ("GATTS_HandleValueIndication Unknown conn_id: %u ", conn_id); return(tGATT_STATUS) GATT_INVALID_CONN_ID; } indication.conn_id = conn_id; @@ -622,7 +622,7 @@ tGATT_STATUS GATTS_HandleValueIndication (UINT16 conn_id, UINT16 attr_handle, U { if (GATT_HANDLE_IS_VALID(p_tcb->indicate_handle)) { - GATT_TRACE_DEBUG0 ("Add a pending indication"); + GATT_TRACE_DEBUG ("Add a pending indication"); if ((p_buf = gatt_add_pending_ind(p_tcb, &indication)) !=NULL) { cmd_status = GATT_SUCCESS; @@ -675,11 +675,11 @@ tGATT_STATUS GATTS_HandleValueNotification (UINT16 conn_id, UINT16 attr_handle, tGATT_REG *p_reg = gatt_get_regcb(gatt_if); tGATT_TCB *p_tcb = gatt_get_tcb_by_idx(tcb_idx); - GATT_TRACE_API0 ("GATTS_HandleValueNotification"); + GATT_TRACE_API ("GATTS_HandleValueNotification"); if ( (p_reg == NULL) || (p_tcb == NULL)) { - GATT_TRACE_ERROR1 ("GATTS_HandleValueNotification Unknown conn_id: %u ", conn_id); + GATT_TRACE_ERROR ("GATTS_HandleValueNotification Unknown conn_id: %u ", conn_id); return(tGATT_STATUS) GATT_INVALID_CONN_ID; } @@ -724,18 +724,18 @@ tGATT_STATUS GATTS_SendRsp (UINT16 conn_id, UINT32 trans_id, tGATT_REG *p_reg = gatt_get_regcb(gatt_if); tGATT_TCB *p_tcb = gatt_get_tcb_by_idx(tcb_idx); - GATT_TRACE_API3 ("GATTS_SendRsp: conn_id: %u trans_id: %u Status: 0x%04x", + GATT_TRACE_API ("GATTS_SendRsp: conn_id: %u trans_id: %u Status: 0x%04x", conn_id, trans_id, status); if ( (p_reg == NULL) || (p_tcb == NULL)) { - GATT_TRACE_ERROR1 ("GATTS_SendRsp Unknown conn_id: %u ", conn_id); + GATT_TRACE_ERROR ("GATTS_SendRsp Unknown conn_id: %u ", conn_id); return(tGATT_STATUS) GATT_INVALID_CONN_ID; } if (p_tcb->sr_cmd.trans_id != trans_id) { - GATT_TRACE_ERROR2 ("GATTS_SendRsp conn_id: %u waiting for op_code = %02x", + GATT_TRACE_ERROR ("GATTS_SendRsp conn_id: %u waiting for op_code = %02x", conn_id, p_tcb->sr_cmd.op_code); return(GATT_WRONG_STATE); @@ -779,7 +779,7 @@ tGATT_STATUS GATTC_ConfigureMTU (UINT16 conn_id, UINT16 mtu) tGATT_CLCB *p_clcb; - GATT_TRACE_API2 ("GATTC_ConfigureMTU conn_id=%d mtu=%d", conn_id, mtu ); + GATT_TRACE_API ("GATTC_ConfigureMTU conn_id=%d mtu=%d", conn_id, mtu ); // Validate that the link is BLE, not BR/EDR // ???? @@ -791,7 +791,7 @@ tGATT_STATUS GATTC_ConfigureMTU (UINT16 conn_id, UINT16 mtu) if (gatt_is_clcb_allocated(conn_id)) { - GATT_TRACE_ERROR1("GATTC_ConfigureMTU GATT_BUSY conn_id = %d", conn_id); + GATT_TRACE_ERROR("GATTC_ConfigureMTU GATT_BUSY conn_id = %d", conn_id); return GATT_BUSY; } @@ -830,19 +830,19 @@ tGATT_STATUS GATTC_Discover (UINT16 conn_id, tGATT_DISC_TYPE disc_type, tGATT_REG *p_reg = gatt_get_regcb(gatt_if); - GATT_TRACE_API2 ("GATTC_Discover conn_id=%d disc_type=%d",conn_id, disc_type); + GATT_TRACE_API ("GATTC_Discover conn_id=%d disc_type=%d",conn_id, disc_type); if ( (p_tcb == NULL) || (p_reg==NULL) ||(p_param == NULL) || (disc_type >= GATT_DISC_MAX)) { - GATT_TRACE_ERROR2("GATTC_Discover Illegal param: disc_type %d conn_id = %d", disc_type, conn_id); + GATT_TRACE_ERROR("GATTC_Discover Illegal param: disc_type %d conn_id = %d", disc_type, conn_id); return GATT_ILLEGAL_PARAMETER; } if (gatt_is_clcb_allocated(conn_id)) { - GATT_TRACE_ERROR1("GATTC_Discover GATT_BUSY conn_id = %d", conn_id); + GATT_TRACE_ERROR("GATTC_Discover GATT_BUSY conn_id = %d", conn_id); return GATT_BUSY; } @@ -899,17 +899,17 @@ tGATT_STATUS GATTC_Read (UINT16 conn_id, tGATT_READ_TYPE type, tGATT_READ_PARAM tGATT_REG *p_reg = gatt_get_regcb(gatt_if); - GATT_TRACE_API2 ("GATTC_Read conn_id=%d type=%d", conn_id, type); + GATT_TRACE_API ("GATTC_Read conn_id=%d type=%d", conn_id, type); if ( (p_tcb == NULL) || (p_reg==NULL) || (p_read == NULL) || ((type >= GATT_READ_MAX) || (type == 0))) { - GATT_TRACE_ERROR2("GATT_Read Illegal param: conn_id %d, type 0%d,", conn_id, type); + GATT_TRACE_ERROR("GATT_Read Illegal param: conn_id %d, type 0%d,", conn_id, type); return GATT_ILLEGAL_PARAMETER; } if (gatt_is_clcb_allocated(conn_id)) { - GATT_TRACE_ERROR1("GATTC_Read GATT_BUSY conn_id = %d", conn_id); + GATT_TRACE_ERROR("GATTC_Read GATT_BUSY conn_id = %d", conn_id); return GATT_BUSY; } @@ -989,13 +989,13 @@ tGATT_STATUS GATTC_Write (UINT16 conn_id, tGATT_WRITE_TYPE type, tGATT_VALUE *p_ if ( (p_tcb == NULL) || (p_reg==NULL) || (p_write == NULL) || ((type != GATT_WRITE) && (type != GATT_WRITE_PREPARE) && (type != GATT_WRITE_NO_RSP)) ) { - GATT_TRACE_ERROR2("GATT_Write Illegal param: conn_id %d, type 0%d,", conn_id, type); + GATT_TRACE_ERROR("GATT_Write Illegal param: conn_id %d, type 0%d,", conn_id, type); return GATT_ILLEGAL_PARAMETER; } if (gatt_is_clcb_allocated(conn_id)) { - GATT_TRACE_ERROR1("GATTC_Write GATT_BUSY conn_id = %d", conn_id); + GATT_TRACE_ERROR("GATTC_Write GATT_BUSY conn_id = %d", conn_id); return GATT_BUSY; } @@ -1060,17 +1060,17 @@ tGATT_STATUS GATTC_ExecuteWrite (UINT16 conn_id, BOOLEAN is_execute) tGATT_TCB *p_tcb = gatt_get_tcb_by_idx(tcb_idx); tGATT_REG *p_reg = gatt_get_regcb(gatt_if); - GATT_TRACE_API2 ("GATTC_ExecuteWrite conn_id=%d is_execute=%d", conn_id, is_execute); + GATT_TRACE_API ("GATTC_ExecuteWrite conn_id=%d is_execute=%d", conn_id, is_execute); if ( (p_tcb == NULL) || (p_reg==NULL) ) { - GATT_TRACE_ERROR1("GATTC_ExecuteWrite Illegal param: conn_id %d", conn_id); + GATT_TRACE_ERROR("GATTC_ExecuteWrite Illegal param: conn_id %d", conn_id); return GATT_ILLEGAL_PARAMETER; } if (gatt_is_clcb_allocated(conn_id)) { - GATT_TRACE_ERROR1("GATTC_Write GATT_BUSY conn_id = %d", conn_id); + GATT_TRACE_ERROR("GATTC_Write GATT_BUSY conn_id = %d", conn_id); return GATT_BUSY; } @@ -1082,7 +1082,7 @@ tGATT_STATUS GATTC_ExecuteWrite (UINT16 conn_id, BOOLEAN is_execute) } else { - GATT_TRACE_ERROR1("Unable to allocate client CB for conn_id %d ", conn_id); + GATT_TRACE_ERROR("Unable to allocate client CB for conn_id %d ", conn_id); status = GATT_NO_RESOURCES; } return status; @@ -1106,7 +1106,7 @@ tGATT_STATUS GATTC_SendHandleValueConfirm (UINT16 conn_id, UINT16 handle) tGATT_STATUS ret = GATT_ILLEGAL_PARAMETER; tGATT_TCB *p_tcb=gatt_get_tcb_by_idx(GATT_GET_TCB_IDX(conn_id)); - GATT_TRACE_API2 ("GATTC_SendHandleValueConfirm conn_id=%d handle=0x%x", conn_id, handle); + GATT_TRACE_API ("GATTC_SendHandleValueConfirm conn_id=%d handle=0x%x", conn_id, handle); if (p_tcb) { @@ -1114,7 +1114,7 @@ tGATT_STATUS GATTC_SendHandleValueConfirm (UINT16 conn_id, UINT16 handle) { btu_stop_timer (&p_tcb->ind_ack_timer_ent); - GATT_TRACE_DEBUG1 ("notif_count=%d ", p_tcb->ind_count); + GATT_TRACE_DEBUG ("notif_count=%d ", p_tcb->ind_count); /* send confirmation now */ ret = attp_send_cl_msg(p_tcb, 0, GATT_HANDLE_VALUE_CONF, (tGATT_CL_MSG *)&handle); @@ -1123,13 +1123,13 @@ tGATT_STATUS GATTC_SendHandleValueConfirm (UINT16 conn_id, UINT16 handle) } else { - GATT_TRACE_DEBUG1 ("GATTC_SendHandleValueConfirm - conn_id: %u - ignored not waiting for indicaiton ack", conn_id); + GATT_TRACE_DEBUG ("GATTC_SendHandleValueConfirm - conn_id: %u - ignored not waiting for indicaiton ack", conn_id); ret = GATT_SUCCESS; } } else { - GATT_TRACE_ERROR1 ("GATTC_SendHandleValueConfirm - Unknown conn_id: %u", conn_id); + GATT_TRACE_ERROR ("GATTC_SendHandleValueConfirm - Unknown conn_id: %u", conn_id); } return ret; } @@ -1170,7 +1170,7 @@ void GATT_SetIdleTimeout (BD_ADDR bd_addr, UINT16 idle_tout, tBT_TRANSPORT trans } } - GATT_TRACE_API2 ("GATT_SetIdleTimeout idle_tout=%d status=%d(1-OK 0-not performed)", + GATT_TRACE_API ("GATT_SetIdleTimeout idle_tout=%d status=%d(1-OK 0-not performed)", idle_tout, status); } @@ -1194,14 +1194,14 @@ tGATT_IF GATT_Register (tBT_UUID *p_app_uuid128, tGATT_CBACK *p_cb_info) UINT8 i_gatt_if=0; tGATT_IF gatt_if=0; - GATT_TRACE_API0 ("GATT_Register"); + GATT_TRACE_API ("GATT_Register"); gatt_dbg_display_uuid(*p_app_uuid128); for (i_gatt_if = 0, p_reg = gatt_cb.cl_rcb; i_gatt_if < GATT_MAX_APPS; i_gatt_if++, p_reg++) { if (p_reg->in_use && !memcmp(p_app_uuid128->uu.uuid128, p_reg->app_uuid128.uu.uuid128, LEN_UUID_128)) { - GATT_TRACE_ERROR0("application already registered."); + GATT_TRACE_ERROR("application already registered."); return 0; } } @@ -1221,7 +1221,7 @@ tGATT_IF GATT_Register (tBT_UUID *p_app_uuid128, tGATT_CBACK *p_cb_info) break; } } - GATT_TRACE_API1 ("allocated gatt_if=%d", gatt_if); + GATT_TRACE_API ("allocated gatt_if=%d", gatt_if); return gatt_if; } @@ -1245,11 +1245,11 @@ void GATT_Deregister (tGATT_IF gatt_if) UINT8 i, ii, j; tGATT_SR_REG *p_sreg; - GATT_TRACE_API1 ("GATT_Deregister gatt_if=%d", gatt_if); + GATT_TRACE_API ("GATT_Deregister gatt_if=%d", gatt_if); /* Index 0 is GAP and is never deregistered */ if ( (gatt_if == 0) || (p_reg == NULL) ) { - GATT_TRACE_ERROR1 ("GATT_Deregister with invalid gatt_if: %u", gatt_if); + GATT_TRACE_ERROR ("GATT_Deregister with invalid gatt_if: %u", gatt_if); return; } @@ -1331,7 +1331,7 @@ void GATT_StartIf (tGATT_IF gatt_if) UINT16 conn_id; tGATT_TRANSPORT transport ; - GATT_TRACE_API1 ("GATT_StartIf gatt_if=%d", gatt_if); + GATT_TRACE_API ("GATT_StartIf gatt_if=%d", gatt_if); if ((p_reg = gatt_get_regcb(gatt_if)) != NULL) { p_reg = &gatt_cb.cl_rcb[gatt_if - 1]; @@ -1369,12 +1369,12 @@ BOOLEAN GATT_Connect (tGATT_IF gatt_if, BD_ADDR bd_addr, BOOLEAN is_direct, tBT_ tGATT_REG *p_reg; BOOLEAN status = FALSE; - GATT_TRACE_API1 ("GATT_Connect gatt_if=%d", gatt_if); + GATT_TRACE_API ("GATT_Connect gatt_if=%d", gatt_if); /* Make sure app is registered */ if ((p_reg = gatt_get_regcb(gatt_if)) == NULL) { - GATT_TRACE_ERROR1("GATT_Connect - gatt_if =%d is not registered", gatt_if); + GATT_TRACE_ERROR("GATT_Connect - gatt_if =%d is not registered", gatt_if); return(FALSE); } @@ -1386,7 +1386,7 @@ BOOLEAN GATT_Connect (tGATT_IF gatt_if, BD_ADDR bd_addr, BOOLEAN is_direct, tBT_ status = gatt_update_auto_connect_dev(gatt_if,TRUE, bd_addr, TRUE); else { - GATT_TRACE_ERROR0("Unsupported transport for background connection"); + GATT_TRACE_ERROR("Unsupported transport for background connection"); } } @@ -1415,11 +1415,11 @@ BOOLEAN GATT_CancelConnect (tGATT_IF gatt_if, BD_ADDR bd_addr, BOOLEAN is_direct tGATT_IF temp_gatt_if; UINT8 start_idx, found_idx; - GATT_TRACE_API1 ("GATT_CancelConnect gatt_if=%d", gatt_if); + GATT_TRACE_API ("GATT_CancelConnect gatt_if=%d", gatt_if); if ((gatt_if != 0) && ((p_reg = gatt_get_regcb(gatt_if)) == NULL)) { - GATT_TRACE_ERROR1("GATT_CancelConnect - gatt_if =%d is not registered", gatt_if); + GATT_TRACE_ERROR("GATT_CancelConnect - gatt_if =%d is not registered", gatt_if); return(FALSE); } @@ -1427,7 +1427,7 @@ BOOLEAN GATT_CancelConnect (tGATT_IF gatt_if, BD_ADDR bd_addr, BOOLEAN is_direct { if (!gatt_if) { - GATT_TRACE_DEBUG0("GATT_CancelConnect - unconditional"); + GATT_TRACE_DEBUG("GATT_CancelConnect - unconditional"); start_idx = 0; /* only LE connection can be cancelled */ p_tcb = gatt_find_tcb_by_addr(bd_addr, BT_TRANSPORT_LE); @@ -1441,7 +1441,7 @@ BOOLEAN GATT_CancelConnect (tGATT_IF gatt_if, BD_ADDR bd_addr, BOOLEAN is_direct } else { - GATT_TRACE_ERROR0("GATT_CancelConnect - no app found"); + GATT_TRACE_ERROR("GATT_CancelConnect - no app found"); status = FALSE; } } @@ -1461,7 +1461,7 @@ BOOLEAN GATT_CancelConnect (tGATT_IF gatt_if, BD_ADDR bd_addr, BOOLEAN is_direct } else { - GATT_TRACE_ERROR0("GATT_CancelConnect -no app associated with the bg device for unconditional removal"); + GATT_TRACE_ERROR("GATT_CancelConnect -no app associated with the bg device for unconditional removal"); status = FALSE; } } @@ -1493,7 +1493,7 @@ tGATT_STATUS GATT_Disconnect (UINT16 conn_id) tGATT_IF gatt_if=GATT_GET_GATT_IF(conn_id); UINT8 tcb_idx = GATT_GET_TCB_IDX(conn_id); - GATT_TRACE_API1 ("GATT_Disconnect conn_id=%d ", conn_id); + GATT_TRACE_API ("GATT_Disconnect conn_id=%d ", conn_id); p_tcb = gatt_get_tcb_by_idx(tcb_idx); @@ -1534,7 +1534,7 @@ BOOLEAN GATT_GetConnectionInfor(UINT16 conn_id, tGATT_IF *p_gatt_if, BD_ADDR bd_ tGATT_TCB *p_tcb= gatt_get_tcb_by_idx(tcb_idx); BOOLEAN status=FALSE; - GATT_TRACE_API1 ("GATT_GetConnectionInfor conn_id=%d", conn_id); + GATT_TRACE_API ("GATT_GetConnectionInfor conn_id=%d", conn_id); if (p_tcb && p_reg ) { @@ -1575,7 +1575,7 @@ BOOLEAN GATT_GetConnIdIfConnected(tGATT_IF gatt_if, BD_ADDR bd_addr, UINT16 *p_c status = TRUE; } - GATT_TRACE_API1 ("GATT_GetConnIdIfConnected status=%d", status); + GATT_TRACE_API ("GATT_GetConnIdIfConnected status=%d", status); return status; } @@ -1600,12 +1600,12 @@ BOOLEAN GATT_Listen (tGATT_IF gatt_if, BOOLEAN start, BD_ADDR_PTR bd_addr) tGATT_REG *p_reg; BOOLEAN status = TRUE; - GATT_TRACE_API1 ("GATT_Listen gatt_if=%d", gatt_if); + GATT_TRACE_API ("GATT_Listen gatt_if=%d", gatt_if); /* Make sure app is registered */ if ((p_reg = gatt_get_regcb(gatt_if)) == NULL) { - GATT_TRACE_ERROR1("GATT_Listen - gatt_if =%d is not registered", gatt_if); + GATT_TRACE_ERROR("GATT_Listen - gatt_if =%d is not registered", gatt_if); return(FALSE); } diff --git a/stack/gatt/gatt_attr.c b/stack/gatt/gatt_attr.c index 60beaa7a7..f74a26855 100644 --- a/stack/gatt/gatt_attr.c +++ b/stack/gatt/gatt_attr.c @@ -190,16 +190,16 @@ static void gatt_profile_request_cback (UINT16 conn_id, UINT32 trans_id, tGATTS_ case GATTS_REQ_TYPE_WRITE_EXEC: case GATT_CMD_WRITE: ignore = TRUE; - GATT_TRACE_EVENT0("Ignore GATT_REQ_EXEC_WRITE/WRITE_CMD" ); + GATT_TRACE_EVENT("Ignore GATT_REQ_EXEC_WRITE/WRITE_CMD" ); break; case GATTS_REQ_TYPE_MTU: - GATT_TRACE_EVENT1("Get MTU exchange new mtu size: %d", p_data->mtu); + GATT_TRACE_EVENT("Get MTU exchange new mtu size: %d", p_data->mtu); ignore = TRUE; break; default: - GATT_TRACE_EVENT1("Unknown/unexpected LE GAP ATT request: 0x%02x", type); + GATT_TRACE_EVENT("Unknown/unexpected LE GAP ATT request: 0x%02x", type); break; } @@ -223,7 +223,7 @@ static void gatt_profile_connect_cback (tGATT_IF gatt_if, BD_ADDR bda, UINT16 co { UNUSED(gatt_if); - GATT_TRACE_EVENT5 ("gatt_profile_connect_cback: from %08x%04x connected:%d conn_id=%d reason = 0x%04x", + GATT_TRACE_EVENT ("gatt_profile_connect_cback: from %08x%04x connected:%d conn_id=%d reason = 0x%04x", (bda[0]<<24)+(bda[1]<<16)+(bda[2]<<8)+bda[3], (bda[4]<<8)+bda[5], connected, conn_id, reason); @@ -231,7 +231,7 @@ static void gatt_profile_connect_cback (tGATT_IF gatt_if, BD_ADDR bda, UINT16 co { if (gatt_profile_clcb_alloc(conn_id, bda, transport) == NULL) { - GATT_TRACE_ERROR0 ("gatt_profile_connect_cback: no_resource"); + GATT_TRACE_ERROR ("gatt_profile_connect_cback: no_resource"); return; } } @@ -272,14 +272,14 @@ void gatt_profile_db_init (void) gatt_cb.gattp_attr.handle = gatt_cb.handle_of_h_r = GATTS_AddCharacteristic(service_handle, &uuid, 0, GATT_CHAR_PROP_BIT_INDICATE); - GATT_TRACE_DEBUG1 ("gatt_profile_db_init: handle of service changed%d", + GATT_TRACE_DEBUG ("gatt_profile_db_init: handle of service changed%d", gatt_cb.handle_of_h_r ); /* start service */ status = GATTS_StartService (gatt_cb.gatt_if, service_handle, GATTP_TRANSPORT_SUPPORTED ); - GATT_TRACE_DEBUG2 ("gatt_profile_db_init: gatt_if=%d start status%d", + GATT_TRACE_DEBUG ("gatt_profile_db_init: gatt_if=%d start status%d", gatt_cb.gatt_if, status); } diff --git a/stack/gatt/gatt_auth.c b/stack/gatt/gatt_auth.c index b09372532..8386d880f 100644 --- a/stack/gatt/gatt_auth.c +++ b/stack/gatt/gatt_auth.c @@ -115,7 +115,7 @@ void gatt_verify_signature(tGATT_TCB *p_tcb, BT_HDR *p_buf) else { /* if this is a bad signature, assume from attacker, ignore it */ - GATT_TRACE_ERROR0("Signature Verification Failed, data ignored"); + GATT_TRACE_ERROR("Signature Verification Failed, data ignored"); } return; @@ -165,7 +165,7 @@ void gatt_enc_cmpl_cback(BD_ADDR bd_addr, tBT_TRANSPORT transport, void *p_ref_d UINT16 count; UNUSED(p_ref_data); - GATT_TRACE_DEBUG0("gatt_enc_cmpl_cback"); + GATT_TRACE_DEBUG("gatt_enc_cmpl_cback"); if ((p_tcb = gatt_find_tcb_by_addr(bd_addr, transport)) != NULL) { if (gatt_get_sec_act(p_tcb) == GATT_SEC_ENC_PENDING) @@ -206,12 +206,12 @@ void gatt_enc_cmpl_cback(BD_ADDR bd_addr, tBT_TRANSPORT transport, void *p_ref_d } else { - GATT_TRACE_ERROR0("Unknown operation encryption completed"); + GATT_TRACE_ERROR("Unknown operation encryption completed"); } } else { - GATT_TRACE_ERROR0("enc callback for unknown bd_addr"); + GATT_TRACE_ERROR("enc callback for unknown bd_addr"); } } @@ -262,7 +262,7 @@ void gatt_notify_enc_cmpl(BD_ADDR bd_addr) } else { - GATT_TRACE_DEBUG0("notify GATT for encryption completion of unknown device"); + GATT_TRACE_DEBUG("notify GATT for encryption completion of unknown device"); } return; } @@ -428,7 +428,7 @@ tGATT_STATUS gatt_get_link_encrypt_status(tGATT_TCB *p_tcb) encrypt_status = GATT_ENCRYPED_MITM; } - GATT_TRACE_DEBUG1("gatt_get_link_encrypt_status status=0x%x",encrypt_status); + GATT_TRACE_DEBUG("gatt_get_link_encrypt_status status=0x%x",encrypt_status); return encrypt_status ; } @@ -489,7 +489,7 @@ BOOLEAN gatt_security_check_start(tGATT_CLCB *p_clcb) switch (gatt_sec_act ) { case GATT_SEC_SIGN_DATA: - GATT_TRACE_DEBUG0("gatt_security_check_start: Do data signing"); + GATT_TRACE_DEBUG("gatt_security_check_start: Do data signing"); gatt_sign_data(p_clcb); break; case GATT_SEC_ENCRYPT: @@ -497,12 +497,12 @@ BOOLEAN gatt_security_check_start(tGATT_CLCB *p_clcb) case GATT_SEC_ENCRYPT_MITM: if (sec_act_old < GATT_SEC_ENCRYPT) { - GATT_TRACE_DEBUG0("gatt_security_check_start: Encrypt now or key upgreade first"); + GATT_TRACE_DEBUG("gatt_security_check_start: Encrypt now or key upgreade first"); gatt_convert_sec_action(gatt_sec_act, &btm_ble_sec_act); btm_status = BTM_SetEncryption(p_tcb->peer_bda, p_tcb->transport , gatt_enc_cmpl_cback, &btm_ble_sec_act); if ( (btm_status != BTM_SUCCESS) && (btm_status != BTM_CMD_STARTED)) { - GATT_TRACE_ERROR1("gatt_security_check_start BTM_SetEncryption failed btm_status=%d", btm_status); + GATT_TRACE_ERROR("gatt_security_check_start BTM_SetEncryption failed btm_status=%d", btm_status); status = FALSE; } } diff --git a/stack/gatt/gatt_cl.c b/stack/gatt/gatt_cl.c index 930cd35ee..55d1d5940 100644 --- a/stack/gatt/gatt_cl.c +++ b/stack/gatt/gatt_cl.c @@ -172,7 +172,7 @@ void gatt_act_read (tGATT_CLCB *p_clcb, UINT16 offset) else p_clcb->first_read_blob_after_read = FALSE; - GATT_TRACE_DEBUG1("gatt_act_read first_read_blob_after_read=%d", + GATT_TRACE_DEBUG("gatt_act_read first_read_blob_after_read=%d", p_clcb->first_read_blob_after_read); op_code = GATT_REQ_READ_BLOB; msg.read_blob.offset = offset; @@ -199,7 +199,7 @@ void gatt_act_read (tGATT_CLCB *p_clcb, UINT16 offset) break; default: - GATT_TRACE_ERROR1("Unknown read type: %d", p_clcb->op_subtype); + GATT_TRACE_ERROR("Unknown read type: %d", p_clcb->op_subtype); break; } @@ -268,7 +268,7 @@ void gatt_act_write (tGATT_CLCB *p_clcb, UINT8 sec_act) default: rt = GATT_INTERNAL_ERROR; - GATT_TRACE_ERROR1("Unknown write type: %d", p_clcb->op_subtype); + GATT_TRACE_ERROR("Unknown write type: %d", p_clcb->op_subtype); break; } } @@ -280,7 +280,7 @@ void gatt_act_write (tGATT_CLCB *p_clcb, UINT8 sec_act) { if (rt != GATT_SUCCESS) { - GATT_TRACE_ERROR1("gatt_act_write() failed op_code=0x%x", op_code); + GATT_TRACE_ERROR("gatt_act_write() failed op_code=0x%x", op_code); } gatt_end_operation(p_clcb, rt, NULL); } @@ -298,7 +298,7 @@ void gatt_send_queue_write_cancel (tGATT_TCB *p_tcb, tGATT_CLCB *p_clcb, tGATT_E { UINT8 rt ; - GATT_TRACE_DEBUG0("gatt_send_queue_write_cancel "); + GATT_TRACE_DEBUG("gatt_send_queue_write_cancel "); rt = attp_send_cl_msg(p_tcb, p_clcb->clcb_idx, GATT_REQ_EXEC_WRITE, (tGATT_CL_MSG *)&flag); @@ -322,7 +322,7 @@ BOOLEAN gatt_check_write_long_terminate(tGATT_TCB *p_tcb, tGATT_CLCB *p_clcb, t BOOLEAN exec = FALSE; tGATT_EXEC_FLAG flag = GATT_PREP_WRITE_EXEC; - GATT_TRACE_DEBUG0("gatt_check_write_long_terminate "); + GATT_TRACE_DEBUG("gatt_check_write_long_terminate "); /* check the first write response status */ if (p_rsp_value != NULL) { @@ -366,7 +366,7 @@ void gatt_send_prepare_write(tGATT_TCB *p_tcb, tGATT_CLCB *p_clcb) UINT8 rt = GATT_SUCCESS; UINT8 type = p_clcb->op_subtype; - GATT_TRACE_DEBUG1("gatt_send_prepare_write type=0x%x", type ); + GATT_TRACE_DEBUG("gatt_send_prepare_write type=0x%x", type ); to_send = p_attr->len - p_attr->offset; if (to_send > (p_tcb->payload_size - GATT_WRITE_LONG_HDR_SIZE)) /* 2 = UINT16 offset bytes */ @@ -380,7 +380,7 @@ void gatt_send_prepare_write(tGATT_TCB *p_tcb, tGATT_CLCB *p_clcb) offset += p_clcb->start_offset; } - GATT_TRACE_DEBUG2("offset =0x%x len=%d", offset, to_send ); + GATT_TRACE_DEBUG("offset =0x%x len=%d", offset, to_send ); rt = gatt_send_write_msg(p_tcb, p_clcb->clcb_idx, @@ -417,7 +417,7 @@ void gatt_process_find_type_value_rsp (tGATT_TCB *p_tcb, tGATT_CLCB *p_clcb, UIN UNUSED(p_tcb); - GATT_TRACE_DEBUG0("gatt_process_find_type_value_rsp "); + GATT_TRACE_DEBUG("gatt_process_find_type_value_rsp "); /* unexpected response */ if (p_clcb->operation != GATTC_OPTYPE_DISCOVERY || p_clcb->op_subtype != GATT_DISC_SRVC_BY_UUID) return; @@ -466,7 +466,7 @@ void gatt_process_read_info_rsp(tGATT_TCB *p_tcb, tGATT_CLCB *p_clcb, UINT8 op_c if (len < GATT_INFO_RSP_MIN_LEN) { - GATT_TRACE_ERROR0("invalid Info Response PDU received, discard."); + GATT_TRACE_ERROR("invalid Info Response PDU received, discard."); gatt_end_operation(p_clcb, GATT_INVALID_PDU, NULL); return; } @@ -522,7 +522,7 @@ void gatt_proc_disc_error_rsp(tGATT_TCB *p_tcb, tGATT_CLCB *p_clcb, UINT8 opcode UNUSED(p_tcb); UNUSED(handle); - GATT_TRACE_DEBUG2("gatt_proc_disc_error_rsp reason: %02x cmd_code %04x", reason, opcode); + GATT_TRACE_DEBUG("gatt_proc_disc_error_rsp reason: %02x cmd_code %04x", reason, opcode); switch (opcode) { @@ -533,11 +533,11 @@ void gatt_proc_disc_error_rsp(tGATT_TCB *p_tcb, tGATT_CLCB *p_clcb, UINT8 opcode if (reason == GATT_NOT_FOUND) { status = GATT_SUCCESS; - GATT_TRACE_DEBUG0("Discovery completed"); + GATT_TRACE_DEBUG("Discovery completed"); } break; default: - GATT_TRACE_ERROR1("Incorrect discovery opcode %04x", opcode); + GATT_TRACE_ERROR("Incorrect discovery opcode %04x", opcode); break; } @@ -564,7 +564,7 @@ void gatt_process_error_rsp(tGATT_TCB *p_tcb, tGATT_CLCB *p_clcb, UINT8 op_code, UNUSED(op_code); UNUSED(len); - GATT_TRACE_DEBUG0("gatt_process_error_rsp "); + GATT_TRACE_DEBUG("gatt_process_error_rsp "); STREAM_TO_UINT8(opcode, p); STREAM_TO_UINT16(handle, p); STREAM_TO_UINT8(reason, p); @@ -613,11 +613,11 @@ void gatt_process_prep_write_rsp (tGATT_TCB *p_tcb, tGATT_CLCB *p_clcb, UINT8 op tGATT_VALUE value = {0}; UINT8 *p= p_data; - GATT_TRACE_ERROR2("value resp op_code = %s len = %d", gatt_dbg_op_name(op_code), len); + GATT_TRACE_ERROR("value resp op_code = %s len = %d", gatt_dbg_op_name(op_code), len); if (len < GATT_PREP_WRITE_RSP_MIN_LEN) { - GATT_TRACE_ERROR0("illegal prepare write response length, discard"); + GATT_TRACE_ERROR("illegal prepare write response length, discard"); gatt_end_operation(p_clcb, GATT_INVALID_PDU, &value); return; } @@ -665,11 +665,11 @@ void gatt_process_notification(tGATT_TCB *p_tcb, UINT8 op_code, UINT8 *p= p_data, i, event = (op_code == GATT_HANDLE_VALUE_NOTIF) ? GATTC_OPTYPE_NOTIFICATION : GATTC_OPTYPE_INDICATION; - GATT_TRACE_DEBUG0("gatt_process_notification "); + GATT_TRACE_DEBUG("gatt_process_notification "); if (len < GATT_NOTIFICATION_MIN_LEN) { - GATT_TRACE_ERROR0("illegal notification PDU length, discard"); + GATT_TRACE_ERROR("illegal notification PDU length, discard"); return; } @@ -694,7 +694,7 @@ void gatt_process_notification(tGATT_TCB *p_tcb, UINT8 op_code, For now, just log the error reset the counter. Later we need to disconnect the link unconditionally. */ - GATT_TRACE_ERROR1("gatt_process_notification rcv Ind. but ind_count=%d (will reset ind_count)", p_tcb->ind_count); + GATT_TRACE_ERROR("gatt_process_notification rcv Ind. but ind_count=%d (will reset ind_count)", p_tcb->ind_count); } p_tcb->ind_count = 0; } @@ -755,7 +755,7 @@ void gatt_process_read_by_type_rsp (tGATT_TCB *p_tcb, tGATT_CLCB *p_clcb, UINT8 if (len < GATT_READ_BY_TYPE_RSP_MIN_LEN) { - GATT_TRACE_ERROR0("Illegal ReadByType/ReadByGroupType Response length, discard"); + GATT_TRACE_ERROR("Illegal ReadByType/ReadByGroupType Response length, discard"); gatt_end_operation(p_clcb, GATT_INVALID_PDU, NULL); return; } @@ -766,7 +766,7 @@ void gatt_process_read_by_type_rsp (tGATT_TCB *p_tcb, tGATT_CLCB *p_clcb, UINT8 { /* this is an error case that server's response containing a value length which is larger than MTU-2 or value_len > message total length -1 */ - GATT_TRACE_ERROR4("gatt_process_read_by_type_rsp: Discard response op_code=%d vale_len=%d > (MTU-2=%d or msg_len-1=%d)", + GATT_TRACE_ERROR("gatt_process_read_by_type_rsp: Discard response op_code=%d vale_len=%d > (MTU-2=%d or msg_len-1=%d)", op_code, value_len, (p_tcb->payload_size - 2), (len-1)); gatt_end_operation(p_clcb, GATT_ERROR, NULL); return; @@ -812,7 +812,7 @@ void gatt_process_read_by_type_rsp (tGATT_TCB *p_tcb, tGATT_CLCB *p_clcb, UINT8 record_value.group_value.e_handle = handle; if (!gatt_parse_uuid_from_cmd(&record_value.group_value.service_type, value_len, &p)) { - GATT_TRACE_ERROR0("discover all service response parsing failure"); + GATT_TRACE_ERROR("discover all service response parsing failure"); break; } } @@ -848,7 +848,7 @@ void gatt_process_read_by_type_rsp (tGATT_TCB *p_tcb, tGATT_CLCB *p_clcb, UINT8 } else { - GATT_TRACE_ERROR1("gatt_process_read_by_type_rsp INCL_SRVC failed with invalid data value_len=%d", value_len); + GATT_TRACE_ERROR("gatt_process_read_by_type_rsp INCL_SRVC failed with invalid data value_len=%d", value_len); gatt_end_operation(p_clcb, GATT_INVALID_PDU, (void *)p); return; } @@ -980,7 +980,7 @@ void gatt_process_read_rsp(tGATT_TCB *p_tcb, tGATT_CLCB *p_clcb, UINT8 op_code, if (len == (p_tcb->payload_size - 1) && /* full packet for read or read blob rsp */ len + offset < GATT_MAX_ATTR_LEN) { - GATT_TRACE_DEBUG3("full pkt issue read blob for remianing bytes old offset=%d len=%d new offset=%d", + GATT_TRACE_DEBUG("full pkt issue read blob for remianing bytes old offset=%d len=%d new offset=%d", offset, len, p_clcb->counter); gatt_act_read(p_clcb, p_clcb->counter); } @@ -991,7 +991,7 @@ void gatt_process_read_rsp(tGATT_TCB *p_tcb, tGATT_CLCB *p_clcb, UINT8 op_code, } else /* exception, should not happen */ { - GATT_TRACE_ERROR2("attr offset = %d p_attr_buf = %d ", offset, p_clcb->p_attr_buf); + GATT_TRACE_ERROR("attr offset = %d p_attr_buf = %d ", offset, p_clcb->p_attr_buf); gatt_end_operation(p_clcb, GATT_NO_RESOURCES, (void *)p_clcb->p_attr_buf); } } @@ -1054,7 +1054,7 @@ void gatt_process_mtu_rsp(tGATT_TCB *p_tcb, tGATT_CLCB *p_clcb, UINT16 len, UINT if (len < GATT_MTU_RSP_MIN_LEN) { - GATT_TRACE_ERROR0("invalid MTU response PDU received, discard."); + GATT_TRACE_ERROR("invalid MTU response PDU received, discard."); status = GATT_INVALID_PDU; } else @@ -1132,7 +1132,7 @@ BOOLEAN gatt_cl_send_next_cmd_inq(tGATT_TCB *p_tcb) } else { - GATT_TRACE_ERROR0("gatt_cl_send_next_cmd_inq: L2CAP sent error"); + GATT_TRACE_ERROR("gatt_cl_send_next_cmd_inq: L2CAP sent error"); memset(p_cmd, 0, sizeof(tGATT_CMD_Q)); p_tcb->pending_cl_req ++; @@ -1168,7 +1168,7 @@ void gatt_client_handle_server_rsp (tGATT_TCB *p_tcb, UINT8 op_code, if (p_clcb == NULL || (rsp_code != op_code && op_code != GATT_RSP_ERROR)) { - GATT_TRACE_WARNING2 ("ATT - Ignore wrong response. Receives (%02x) \ + GATT_TRACE_WARNING ("ATT - Ignore wrong response. Receives (%02x) \ Request(%02x) Ignored", op_code, rsp_code); return; @@ -1183,7 +1183,7 @@ void gatt_client_handle_server_rsp (tGATT_TCB *p_tcb, UINT8 op_code, /* The message has to be smaller than the agreed MTU, len does not count op_code */ if (len >= p_tcb->payload_size) { - GATT_TRACE_ERROR2("invalid response/indicate pkt size: %d, PDU size: %d", len + 1, p_tcb->payload_size); + GATT_TRACE_ERROR("invalid response/indicate pkt size: %d, PDU size: %d", len + 1, p_tcb->payload_size); if (op_code != GATT_HANDLE_VALUE_NOTIF && op_code != GATT_HANDLE_VALUE_IND) gatt_end_operation(p_clcb, GATT_ERROR, NULL); @@ -1237,7 +1237,7 @@ void gatt_client_handle_server_rsp (tGATT_TCB *p_tcb, UINT8 op_code, break; default: - GATT_TRACE_ERROR1("Unknown opcode = %d", op_code); + GATT_TRACE_ERROR("Unknown opcode = %d", op_code); break; } } diff --git a/stack/gatt/gatt_db.c b/stack/gatt/gatt_db.c index a1b0a8aa7..12852239f 100644 --- a/stack/gatt/gatt_db.c +++ b/stack/gatt/gatt_db.c @@ -64,12 +64,12 @@ BOOLEAN gatts_init_service_db (tGATT_SVC_DB *p_db, tBT_UUID *p_service, BOOLEAN { if (!allocate_svc_db_buf(p_db)) { - GATT_TRACE_ERROR0("gatts_init_service_db failed, no resources"); + GATT_TRACE_ERROR("gatts_init_service_db failed, no resources"); return FALSE; } - GATT_TRACE_DEBUG0("gatts_init_service_db"); - GATT_TRACE_DEBUG2("s_hdl = %d num_handle = %d", s_hdl, num_handle ); + GATT_TRACE_DEBUG("gatts_init_service_db"); + GATT_TRACE_DEBUG("s_hdl = %d num_handle = %d", s_hdl, num_handle ); /* update service database information */ p_db->next_handle = s_hdl; @@ -94,7 +94,7 @@ tBT_UUID * gatts_get_service_uuid (tGATT_SVC_DB *p_db) { if (!p_db || !p_db->p_attr_list) { - GATT_TRACE_ERROR0("service DB empty"); + GATT_TRACE_ERROR("service DB empty"); return NULL; } @@ -131,32 +131,32 @@ static tGATT_STATUS gatts_check_attr_readability(tGATT_ATTR16 *p_attr, if (!(perm & GATT_READ_ALLOWED)) { - GATT_TRACE_ERROR0( "GATT_READ_NOT_PERMIT"); + GATT_TRACE_ERROR( "GATT_READ_NOT_PERMIT"); return GATT_READ_NOT_PERMIT; } if ((perm & GATT_READ_AUTH_REQUIRED ) && !(sec_flag & GATT_SEC_FLAG_LKEY_UNAUTHED) && !(sec_flag & BTM_SEC_FLAG_ENCRYPTED)) { - GATT_TRACE_ERROR0( "GATT_INSUF_AUTHENTICATION"); + GATT_TRACE_ERROR( "GATT_INSUF_AUTHENTICATION"); return GATT_INSUF_AUTHENTICATION; } if ((perm & GATT_READ_MITM_REQUIRED ) && !(sec_flag & GATT_SEC_FLAG_LKEY_AUTHED)) { - GATT_TRACE_ERROR0( "GATT_INSUF_AUTHENTICATION: MITM Required"); + GATT_TRACE_ERROR( "GATT_INSUF_AUTHENTICATION: MITM Required"); return GATT_INSUF_AUTHENTICATION; } if ((perm & GATT_READ_ENCRYPTED_REQUIRED ) && !(sec_flag & GATT_SEC_FLAG_ENCRYPTED)) { - GATT_TRACE_ERROR0( "GATT_INSUF_ENCRYPTION"); + GATT_TRACE_ERROR( "GATT_INSUF_ENCRYPTION"); return GATT_INSUF_ENCRYPTION; } if ( (perm & GATT_READ_ENCRYPTED_REQUIRED) && (sec_flag & GATT_SEC_FLAG_ENCRYPTED) && (key_size < min_key_size)) { - GATT_TRACE_ERROR0( "GATT_INSUF_KEY_SIZE"); + GATT_TRACE_ERROR( "GATT_INSUF_KEY_SIZE"); return GATT_INSUF_KEY_SIZE; } @@ -173,7 +173,7 @@ static tGATT_STATUS gatts_check_attr_readability(tGATT_ATTR16 *p_attr, case GATT_UUID_CHAR_CLIENT_CONFIG: case GATT_UUID_CHAR_SRVR_CONFIG: case GATT_UUID_CHAR_PRESENT_FORMAT: - GATT_TRACE_ERROR0("GATT_NOT_LONG"); + GATT_TRACE_ERROR("GATT_NOT_LONG"); return GATT_NOT_LONG; default: @@ -217,7 +217,7 @@ static tGATT_STATUS read_attr_value (void *p_attr, UINT16 read_long_uuid=0; tGATT_ATTR16 *p_attr16 = (tGATT_ATTR16 *)p_attr; - GATT_TRACE_DEBUG5("read_attr_value uuid=0x%04x perm=0x%0x sec_flag=0x%x offset=%d read_long=%d", + GATT_TRACE_DEBUG("read_attr_value uuid=0x%04x perm=0x%0x sec_flag=0x%x offset=%d read_long=%d", p_attr16->uuid, p_attr16->permission, sec_flag, @@ -398,7 +398,7 @@ tGATT_STATUS gatts_db_read_attr_value_by_type (tGATT_TCB *p_tcb, } else { - GATT_TRACE_ERROR0("format mismatch"); + GATT_TRACE_ERROR("format mismatch"); status = GATT_NO_RESOURCES; break; } @@ -454,12 +454,12 @@ UINT16 gatts_add_included_service (tGATT_SVC_DB *p_db, UINT16 s_handle, UINT16 e tGATT_ATTR16 *p_attr; tBT_UUID uuid = {LEN_UUID_16, {GATT_UUID_INCLUDE_SERVICE}}; - GATT_TRACE_DEBUG3("gatts_add_included_service: s_hdl = 0x%04x e_hdl = 0x%04x uuid = 0x%04x", + GATT_TRACE_DEBUG("gatts_add_included_service: s_hdl = 0x%04x e_hdl = 0x%04x uuid = 0x%04x", s_handle, e_handle, service.uu.uuid16); if (service.len == 0 || s_handle == 0 || e_handle == 0) { - GATT_TRACE_ERROR0("gatts_add_included_service Illegal Params."); + GATT_TRACE_ERROR("gatts_add_included_service Illegal Params."); return 0; } @@ -504,7 +504,7 @@ UINT16 gatts_add_characteristic (tGATT_SVC_DB *p_db, tGATT_PERM perm, tGATT_ATTR16 *p_char_decl, *p_char_val; tBT_UUID uuid = {LEN_UUID_16, {GATT_UUID_CHAR_DECLARE}}; - GATT_TRACE_DEBUG2("gatts_add_characteristic perm=0x%0x property=0x%0x", perm, property); + GATT_TRACE_DEBUG("gatts_add_characteristic perm=0x%0x property=0x%0x", perm, property); if ((p_char_decl = (tGATT_ATTR16 *)allocate_attr_in_db(p_db, &uuid, GATT_PERM_READ)) != NULL) { @@ -596,7 +596,7 @@ UINT16 gatts_add_char_descr (tGATT_SVC_DB *p_db, tGATT_PERM perm, { tGATT_ATTR16 *p_char_dscptr; - GATT_TRACE_DEBUG1("gatts_add_char_descr uuid=0x%04x", p_descr_uuid->uu.uuid16); + GATT_TRACE_DEBUG("gatts_add_char_descr uuid=0x%04x", p_descr_uuid->uu.uuid16); /* Add characteristic descriptors */ if ((p_char_dscptr = (tGATT_ATTR16 *)allocate_attr_in_db(p_db, @@ -604,7 +604,7 @@ UINT16 gatts_add_char_descr (tGATT_SVC_DB *p_db, tGATT_PERM perm, perm)) == NULL) { - GATT_TRACE_DEBUG0("gatts_add_char_descr Fail for adding char descriptors."); + GATT_TRACE_DEBUG("gatts_add_char_descr Fail for adding char descriptors."); return 0; } else @@ -749,7 +749,7 @@ tGATT_STATUS gatts_write_attr_perm_check (tGATT_SVC_DB *p_db, UINT8 op_code, tGATT_PERM perm; UINT16 min_key_size; - GATT_TRACE_DEBUG6( "gatts_write_attr_perm_check op_code=0x%0x handle=0x%04x offset=%d len=%d sec_flag=0x%0x key_size=%d", + GATT_TRACE_DEBUG( "gatts_write_attr_perm_check op_code=0x%0x handle=0x%04x offset=%d len=%d sec_flag=0x%0x key_size=%d", op_code, handle, offset, len, sec_flag, key_size); if (p_db != NULL) @@ -766,7 +766,7 @@ tGATT_STATUS gatts_write_attr_perm_check (tGATT_SVC_DB *p_db, UINT8 op_code, { min_key_size +=6; } - GATT_TRACE_DEBUG2( "gatts_write_attr_perm_check p_attr->permission =0x%04x min_key_size==0x%04x", + GATT_TRACE_DEBUG( "gatts_write_attr_perm_check p_attr->permission =0x%04x min_key_size==0x%04x", p_attr->permission, min_key_size); @@ -793,45 +793,45 @@ tGATT_STATUS gatts_write_attr_perm_check (tGATT_SVC_DB *p_db, UINT8 op_code, if ((op_code == GATT_SIGN_CMD_WRITE) && !(perm & GATT_WRITE_SIGNED_PERM)) { status = GATT_WRITE_NOT_PERMIT; - GATT_TRACE_DEBUG0( "gatts_write_attr_perm_check - sign cmd write not allowed"); + GATT_TRACE_DEBUG( "gatts_write_attr_perm_check - sign cmd write not allowed"); } if ((op_code == GATT_SIGN_CMD_WRITE) && (sec_flag & GATT_SEC_FLAG_ENCRYPTED)) { status = GATT_INVALID_PDU; - GATT_TRACE_ERROR0( "gatts_write_attr_perm_check - Error!! sign cmd write sent on a encypted link"); + GATT_TRACE_ERROR( "gatts_write_attr_perm_check - Error!! sign cmd write sent on a encypted link"); } else if (!(perm & GATT_WRITE_ALLOWED)) { status = GATT_WRITE_NOT_PERMIT; - GATT_TRACE_ERROR0( "gatts_write_attr_perm_check - GATT_WRITE_NOT_PERMIT"); + GATT_TRACE_ERROR( "gatts_write_attr_perm_check - GATT_WRITE_NOT_PERMIT"); } /* require authentication, but not been authenticated */ else if ((perm & GATT_WRITE_AUTH_REQUIRED ) && !(sec_flag & GATT_SEC_FLAG_LKEY_UNAUTHED)) { status = GATT_INSUF_AUTHENTICATION; - GATT_TRACE_ERROR0( "gatts_write_attr_perm_check - GATT_INSUF_AUTHENTICATION"); + GATT_TRACE_ERROR( "gatts_write_attr_perm_check - GATT_INSUF_AUTHENTICATION"); } else if ((perm & GATT_WRITE_MITM_REQUIRED ) && !(sec_flag & GATT_SEC_FLAG_LKEY_AUTHED)) { status = GATT_INSUF_AUTHENTICATION; - GATT_TRACE_ERROR0( "gatts_write_attr_perm_check - GATT_INSUF_AUTHENTICATION: MITM required"); + GATT_TRACE_ERROR( "gatts_write_attr_perm_check - GATT_INSUF_AUTHENTICATION: MITM required"); } else if ((perm & GATT_WRITE_ENCRYPTED_PERM ) && !(sec_flag & GATT_SEC_FLAG_ENCRYPTED)) { status = GATT_INSUF_ENCRYPTION; - GATT_TRACE_ERROR0( "gatts_write_attr_perm_check - GATT_INSUF_ENCRYPTION"); + GATT_TRACE_ERROR( "gatts_write_attr_perm_check - GATT_INSUF_ENCRYPTION"); } else if ((perm & GATT_WRITE_ENCRYPTED_PERM ) && (sec_flag & GATT_SEC_FLAG_ENCRYPTED) && (key_size < min_key_size)) { status = GATT_INSUF_KEY_SIZE; - GATT_TRACE_ERROR0( "gatts_write_attr_perm_check - GATT_INSUF_KEY_SIZE"); + GATT_TRACE_ERROR( "gatts_write_attr_perm_check - GATT_INSUF_KEY_SIZE"); } /* LE security mode 2 attribute */ else if (perm & GATT_WRITE_SIGNED_PERM && op_code != GATT_SIGN_CMD_WRITE && !(sec_flag & GATT_SEC_FLAG_ENCRYPTED) && (perm & GATT_WRITE_ALLOWED) == 0) { status = GATT_INSUF_AUTHENTICATION; - GATT_TRACE_ERROR0( "gatts_write_attr_perm_check - GATT_INSUF_AUTHENTICATION: LE security mode 2 required"); + GATT_TRACE_ERROR( "gatts_write_attr_perm_check - GATT_INSUF_AUTHENTICATION: LE security mode 2 required"); } else /* writable: must be char value declaration or char descritpors */ { @@ -882,12 +882,12 @@ tGATT_STATUS gatts_write_attr_perm_check (tGATT_SVC_DB *p_db, UINT8 op_code, if (op_code == GATT_REQ_PREPARE_WRITE && offset != 0) /* does not allow write blob */ { status = GATT_NOT_LONG; - GATT_TRACE_ERROR0( "gatts_write_attr_perm_check - GATT_NOT_LONG"); + GATT_TRACE_ERROR( "gatts_write_attr_perm_check - GATT_NOT_LONG"); } else if (len != max_size) /* data does not match the required format */ { status = GATT_INVALID_ATTR_LEN; - GATT_TRACE_ERROR0( "gatts_write_attr_perm_check - GATT_INVALID_PDU"); + GATT_TRACE_ERROR( "gatts_write_attr_perm_check - GATT_INVALID_PDU"); } else { @@ -929,7 +929,7 @@ static void *allocate_attr_in_db(tGATT_SVC_DB *p_db, tBT_UUID *p_uuid, tGATT_PER if (p_uuid == NULL) { - GATT_TRACE_ERROR0("illegal UUID"); + GATT_TRACE_ERROR("illegal UUID"); return NULL; } @@ -938,11 +938,11 @@ static void *allocate_attr_in_db(tGATT_SVC_DB *p_db, tBT_UUID *p_uuid, tGATT_PER else if (p_uuid->len == LEN_UUID_32) len = sizeof(tGATT_ATTR32); - GATT_TRACE_DEBUG1("allocate attr %d bytes ",len); + GATT_TRACE_DEBUG("allocate attr %d bytes ",len); if (p_db->end_handle <= p_db->next_handle) { - GATT_TRACE_DEBUG2("handle space full. handle_max = %d next_handle = %d", + GATT_TRACE_DEBUG("handle space full. handle_max = %d next_handle = %d", p_db->end_handle, p_db->next_handle); return NULL; } @@ -951,7 +951,7 @@ static void *allocate_attr_in_db(tGATT_SVC_DB *p_db, tBT_UUID *p_uuid, tGATT_PER { if (!allocate_svc_db_buf(p_db)) { - GATT_TRACE_ERROR0("allocate_attr_in_db failed, no resources"); + GATT_TRACE_ERROR("allocate_attr_in_db failed, no resources"); return NULL; } } @@ -998,17 +998,17 @@ static void *allocate_attr_in_db(tGATT_SVC_DB *p_db, tBT_UUID *p_uuid, tGATT_PER if (p_attr16->uuid_type == GATT_ATTR_UUID_TYPE_16) { - GATT_TRACE_DEBUG3("=====> handle = [0x%04x] uuid16 = [0x%04x] perm=0x%02x ", + GATT_TRACE_DEBUG("=====> handle = [0x%04x] uuid16 = [0x%04x] perm=0x%02x ", p_attr16->handle, p_attr16->uuid, p_attr16->permission); } else if (p_attr16->uuid_type == GATT_ATTR_UUID_TYPE_32) { - GATT_TRACE_DEBUG3("=====> handle = [0x%04x] uuid32 = [0x%08x] perm=0x%02x ", + GATT_TRACE_DEBUG("=====> handle = [0x%04x] uuid32 = [0x%08x] perm=0x%02x ", p_attr32->handle, p_attr32->uuid, p_attr32->permission); } else { - GATT_TRACE_DEBUG4("=====> handle = [0x%04x] uuid128 = [0x%02x:0x%02x] perm=0x%02x ", + GATT_TRACE_DEBUG("=====> handle = [0x%04x] uuid128 = [0x%02x:0x%02x] perm=0x%02x ", p_attr128->handle, p_attr128->uuid[0],p_attr128->uuid[1], p_attr128->permission); } @@ -1083,7 +1083,7 @@ static BOOLEAN copy_extra_byte_in_db(tGATT_SVC_DB *p_db, void **p_dst, UINT16 le { if (!allocate_svc_db_buf(p_db)) { - GATT_TRACE_ERROR0("copy_extra_byte_in_db failed, no resources"); + GATT_TRACE_ERROR("copy_extra_byte_in_db failed, no resources"); return FALSE; } } @@ -1110,11 +1110,11 @@ static BOOLEAN allocate_svc_db_buf(tGATT_SVC_DB *p_db) { BT_HDR *p_buf; - GATT_TRACE_DEBUG0("allocate_svc_db_buf allocating extra buffer"); + GATT_TRACE_DEBUG("allocate_svc_db_buf allocating extra buffer"); if ((p_buf = (BT_HDR *)GKI_getpoolbuf(GATT_DB_POOL_ID)) == NULL) { - GATT_TRACE_ERROR0("allocate_svc_db_buf failed, no resources"); + GATT_TRACE_ERROR("allocate_svc_db_buf failed, no resources"); return FALSE; } @@ -1190,7 +1190,7 @@ static BOOLEAN gatts_db_add_service_declaration(tGATT_SVC_DB *p_db, tBT_UUID *p_ tBT_UUID uuid = {LEN_UUID_16, {0}}; BOOLEAN rt = FALSE; - GATT_TRACE_DEBUG0( "add_service_declaration"); + GATT_TRACE_DEBUG( "add_service_declaration"); if (is_pri) uuid.uu.uuid16 = GATT_UUID_PRI_SERVICE; diff --git a/stack/gatt/gatt_main.c b/stack/gatt/gatt_main.c index 59c6759d9..a36083062 100644 --- a/stack/gatt/gatt_main.c +++ b/stack/gatt/gatt_main.c @@ -89,7 +89,7 @@ void gatt_init (void) { tL2CAP_FIXED_CHNL_REG fixed_reg; - GATT_TRACE_DEBUG0("gatt_init()"); + GATT_TRACE_DEBUG("gatt_init()"); memset (&gatt_cb, 0, sizeof(tGATT_CB)); @@ -117,7 +117,7 @@ void gatt_init (void) /* Now, register with L2CAP for ATT PSM over BR/EDR */ if (!L2CA_Register (BT_PSM_ATT, (tL2CAP_APPL_INFO *) &dyn_info)) { - GATT_TRACE_ERROR0 ("ATT Dynamic Registration failed"); + GATT_TRACE_ERROR ("ATT Dynamic Registration failed"); } BTM_SetSecurityLevel(TRUE, "", BTM_SEC_SERVICE_ATT, BTM_SEC_NONE, BT_PSM_ATT, 0, 0); @@ -180,7 +180,7 @@ BOOLEAN gatt_disconnect (tGATT_TCB *p_tcb) { BOOLEAN ret = FALSE; tGATT_CH_STATE ch_state; - GATT_TRACE_DEBUG0 ("gatt_disconnect "); + GATT_TRACE_DEBUG ("gatt_disconnect "); if (p_tcb != NULL) { @@ -207,7 +207,7 @@ BOOLEAN gatt_disconnect (tGATT_TCB *p_tcb) } else { - GATT_TRACE_DEBUG0 ("gatt_disconnect already in closing state"); + GATT_TRACE_DEBUG ("gatt_disconnect already in closing state"); } } @@ -230,7 +230,7 @@ void gatt_update_app_hold_link_status (tGATT_IF gatt_if, tGATT_TCB *p_tcb, BOOLE if (p_tcb == NULL) { - GATT_TRACE_ERROR0("gatt_update_app_hold_link_status p_tcb=NULL"); + GATT_TRACE_ERROR("gatt_update_app_hold_link_status p_tcb=NULL"); return; } @@ -261,7 +261,7 @@ void gatt_update_app_hold_link_status (tGATT_IF gatt_if, tGATT_TCB *p_tcb, BOOLE } } - GATT_TRACE_DEBUG4("gatt_update_app_hold_link_status found=%d[1-found] idx=%d gatt_if=%d is_add=%d", found, i, gatt_if, is_add); + GATT_TRACE_DEBUG("gatt_update_app_hold_link_status found=%d[1-found] idx=%d gatt_if=%d is_add=%d", found, i, gatt_if, is_add); } @@ -277,7 +277,7 @@ void gatt_update_app_hold_link_status (tGATT_IF gatt_if, tGATT_TCB *p_tcb, BOOLE *******************************************************************************/ void gatt_update_app_use_link_flag (tGATT_IF gatt_if, tGATT_TCB *p_tcb, BOOLEAN is_add, BOOLEAN check_acl_link) { - GATT_TRACE_DEBUG2("gatt_update_app_use_link_flag is_add=%d chk_link=%d", + GATT_TRACE_DEBUG("gatt_update_app_use_link_flag is_add=%d chk_link=%d", is_add, check_acl_link); gatt_update_app_hold_link_status(gatt_if, p_tcb, is_add); @@ -289,7 +289,7 @@ void gatt_update_app_use_link_flag (tGATT_IF gatt_if, tGATT_TCB *p_tcb, BOOLEAN { if (is_add) { - GATT_TRACE_DEBUG0("GATT disables link idle timer"); + GATT_TRACE_DEBUG("GATT disables link idle timer"); /* acl link is connected disable the idle timeout */ GATT_SetIdleTimeout(p_tcb->peer_bda, GATT_LINK_NO_IDLE_TIMEOUT, p_tcb->transport); } @@ -299,7 +299,7 @@ void gatt_update_app_use_link_flag (tGATT_IF gatt_if, tGATT_TCB *p_tcb, BOOLEAN { /* acl link is connected but no application needs to use the link so set the timeout value to GATT_LINK_IDLE_TIMEOUT_WHEN_NO_APP seconds */ - GATT_TRACE_DEBUG1("GATT starts link idle timer =%d sec", GATT_LINK_IDLE_TIMEOUT_WHEN_NO_APP); + GATT_TRACE_DEBUG("GATT starts link idle timer =%d sec", GATT_LINK_IDLE_TIMEOUT_WHEN_NO_APP); GATT_SetIdleTimeout(p_tcb->peer_bda, GATT_LINK_IDLE_TIMEOUT_WHEN_NO_APP, p_tcb->transport); } @@ -346,7 +346,7 @@ BOOLEAN gatt_act_connect (tGATT_REG *p_reg, BD_ADDR bd_addr, tBT_TRANSPORT trans { if (!gatt_connect(bd_addr, p_tcb, transport)) { - GATT_TRACE_ERROR0("gatt_connect failed"); + GATT_TRACE_ERROR("gatt_connect failed"); memset(p_tcb, 0, sizeof(tGATT_TCB)); } else @@ -355,7 +355,7 @@ BOOLEAN gatt_act_connect (tGATT_REG *p_reg, BD_ADDR bd_addr, tBT_TRANSPORT trans else { ret = 0; - GATT_TRACE_ERROR1("Max TCB for gatt_if [%d] reached.", p_reg->gatt_if); + GATT_TRACE_ERROR("Max TCB for gatt_if [%d] reached.", p_reg->gatt_if); } } @@ -388,7 +388,7 @@ static void gatt_le_connect_cback (BD_ADDR bd_addr, BOOLEAN connected, if (transport == BT_TRANSPORT_BR_EDR) return; - GATT_TRACE_DEBUG3 ("GATT ATT protocol channel with BDA: %08x%04x is %s", + GATT_TRACE_DEBUG ("GATT ATT protocol channel with BDA: %08x%04x is %s", (bd_addr[0]<<24)+(bd_addr[1]<<16)+(bd_addr[2]<<8)+bd_addr[3], (bd_addr[4]<<8)+bd_addr[5], (connected) ? "connected" : "disconnected"); @@ -439,14 +439,14 @@ static void gatt_le_connect_cback (BD_ADDR bd_addr, BOOLEAN connected, } else { - GATT_TRACE_ERROR0("CCB max out, no rsources"); + GATT_TRACE_ERROR("CCB max out, no rsources"); } } } else { gatt_cleanup_upon_disc(bd_addr, reason, transport); - GATT_TRACE_DEBUG0 ("ATT disconnected"); + GATT_TRACE_DEBUG ("ATT disconnected"); } } @@ -481,7 +481,7 @@ static void gatt_le_data_ind (BD_ADDR bd_addr, BT_HDR *p_buf) if (p_tcb != NULL) { - GATT_TRACE_WARNING1 ("ATT - Ignored L2CAP data while in state: %d", + GATT_TRACE_WARNING ("ATT - Ignored L2CAP data while in state: %d", gatt_get_ch_state(p_tcb)); } } @@ -506,7 +506,7 @@ static void gatt_l2cif_connect_ind_cback (BD_ADDR bd_addr, UINT16 lcid, UINT16 tGATT_TCB *p_tcb = gatt_find_tcb_by_addr(bd_addr, BT_TRANSPORT_BR_EDR); UNUSED(psm); - GATT_TRACE_ERROR1("Connection indication cid = %d", lcid); + GATT_TRACE_ERROR("Connection indication cid = %d", lcid); /* new connection ? */ if (p_tcb == NULL) { @@ -561,7 +561,7 @@ void gatt_l2cif_connect_cfm_cback(UINT16 lcid, UINT16 result) /* look up clcb for this channel */ if ((p_tcb = gatt_find_tcb_by_cid(lcid)) != NULL) { - GATT_TRACE_DEBUG3("gatt_l2c_connect_cfm_cback result: %d ch_state: %d, lcid:0x%x", result, gatt_get_ch_state(p_tcb), p_tcb->att_lcid); + GATT_TRACE_DEBUG("gatt_l2c_connect_cfm_cback result: %d ch_state: %d, lcid:0x%x", result, gatt_get_ch_state(p_tcb), p_tcb->att_lcid); /* if in correct state */ if (gatt_get_ch_state(p_tcb) == GATT_CH_CONN) @@ -895,12 +895,12 @@ void gatt_data_process (tGATT_TCB *p_tcb, BT_HDR *p_buf) } else { - GATT_TRACE_ERROR1 ("ATT - Rcvd L2CAP data, unknown cmd: 0x%x", op_code); + GATT_TRACE_ERROR ("ATT - Rcvd L2CAP data, unknown cmd: 0x%x", op_code); } } else { - GATT_TRACE_ERROR0 ("invalid data length, ignore"); + GATT_TRACE_ERROR ("invalid data length, ignore"); } GKI_freebuf (p_buf); @@ -949,7 +949,7 @@ void gatt_send_srv_chg_ind (BD_ADDR peer_bda) UINT8 *p = handle_range; UINT16 conn_id; - GATT_TRACE_DEBUG0("gatt_send_srv_chg_ind"); + GATT_TRACE_DEBUG("gatt_send_srv_chg_ind"); if (gatt_cb.handle_of_h_r) { @@ -964,7 +964,7 @@ void gatt_send_srv_chg_ind (BD_ADDR peer_bda) } else { - GATT_TRACE_ERROR2("Unable to find conn_id for %08x%04x ", + GATT_TRACE_ERROR("Unable to find conn_id for %08x%04x ", (peer_bda[0]<<24)+(peer_bda[1]<<16)+(peer_bda[2]<<8)+peer_bda[3], (peer_bda[4]<<8)+peer_bda[5] ); } @@ -983,7 +983,7 @@ void gatt_send_srv_chg_ind (BD_ADDR peer_bda) *******************************************************************************/ void gatt_chk_srv_chg(tGATTS_SRV_CHG *p_srv_chg_clt) { - GATT_TRACE_DEBUG1("gatt_chk_srv_chg srv_changed=%d", p_srv_chg_clt->srv_changed ); + GATT_TRACE_DEBUG("gatt_chk_srv_chg srv_changed=%d", p_srv_chg_clt->srv_changed ); if (p_srv_chg_clt->srv_changed) { @@ -1009,14 +1009,14 @@ void gatt_init_srv_chg (void) UINT8 num_clients,i; tGATTS_SRV_CHG srv_chg_clt; - GATT_TRACE_DEBUG0("gatt_init_srv_chg"); + GATT_TRACE_DEBUG("gatt_init_srv_chg"); if (gatt_cb.cb_info.p_srv_chg_callback) { status = (*gatt_cb.cb_info.p_srv_chg_callback)(GATTS_SRV_CHG_CMD_READ_NUM_CLENTS, NULL, &rsp); if (status && rsp.num_clients) { - GATT_TRACE_DEBUG1("gatt_init_srv_chg num_srv_chg_clt_clients=%d", rsp.num_clients); + GATT_TRACE_DEBUG("gatt_init_srv_chg num_srv_chg_clt_clients=%d", rsp.num_clients); num_clients = rsp.num_clients; i = 1; /* use one based index */ while ((i <= num_clients) && status) @@ -1027,7 +1027,7 @@ void gatt_init_srv_chg (void) memcpy(&srv_chg_clt, &rsp.srv_chg ,sizeof(tGATTS_SRV_CHG)); if (gatt_add_srv_chg_clt(&srv_chg_clt) == NULL) { - GATT_TRACE_ERROR0("Unable to add a service change client"); + GATT_TRACE_ERROR("Unable to add a service change client"); status = FALSE; } } @@ -1037,7 +1037,7 @@ void gatt_init_srv_chg (void) } else { - GATT_TRACE_DEBUG0("gatt_init_srv_chg callback not registered yet"); + GATT_TRACE_DEBUG("gatt_init_srv_chg callback not registered yet"); } } @@ -1058,7 +1058,7 @@ void gatt_proc_srv_chg (void) tGATT_TCB *p_tcb; tBT_TRANSPORT transport; - GATT_TRACE_DEBUG0 ("gatt_proc_srv_chg"); + GATT_TRACE_DEBUG ("gatt_proc_srv_chg"); if (gatt_cb.cb_info.p_srv_chg_callback && gatt_cb.handle_of_h_r) { @@ -1075,7 +1075,7 @@ void gatt_proc_srv_chg (void) } else { - GATT_TRACE_DEBUG0 ("discard srv chg - already has one in the queue"); + GATT_TRACE_DEBUG ("discard srv chg - already has one in the queue"); } start_idx = ++found_idx; } @@ -1095,7 +1095,7 @@ void gatt_set_ch_state(tGATT_TCB *p_tcb, tGATT_CH_STATE ch_state) { if (p_tcb) { - GATT_TRACE_DEBUG2 ("gatt_set_ch_state: old=%d new=%d", p_tcb->ch_state, ch_state); + GATT_TRACE_DEBUG ("gatt_set_ch_state: old=%d new=%d", p_tcb->ch_state, ch_state); p_tcb->ch_state = ch_state; } } @@ -1114,7 +1114,7 @@ tGATT_CH_STATE gatt_get_ch_state(tGATT_TCB *p_tcb) tGATT_CH_STATE ch_state = GATT_CH_CLOSE; if (p_tcb) { - GATT_TRACE_DEBUG1 ("gatt_get_ch_state: ch_state=%d", p_tcb->ch_state); + GATT_TRACE_DEBUG ("gatt_get_ch_state: ch_state=%d", p_tcb->ch_state); ch_state = p_tcb->ch_state; } return ch_state; diff --git a/stack/gatt/gatt_sr.c b/stack/gatt/gatt_sr.c index 226aad0dc..69e7b0d23 100644 --- a/stack/gatt/gatt_sr.c +++ b/stack/gatt/gatt_sr.c @@ -98,10 +98,10 @@ BOOLEAN gatt_sr_cmd_empty (tGATT_TCB *p_tcb) void gatt_dequeue_sr_cmd (tGATT_TCB *p_tcb) { /* Double check in case any buffers are queued */ - GATT_TRACE_DEBUG0("gatt_dequeue_sr_cmd" ); + GATT_TRACE_DEBUG("gatt_dequeue_sr_cmd" ); if (p_tcb->sr_cmd.p_rsp_msg) { - GATT_TRACE_ERROR1("free p_tcb->sr_cmd.p_rsp_msg = %d", p_tcb->sr_cmd.p_rsp_msg); + GATT_TRACE_ERROR("free p_tcb->sr_cmd.p_rsp_msg = %d", p_tcb->sr_cmd.p_rsp_msg); GKI_freebuf (p_tcb->sr_cmd.p_rsp_msg); } @@ -129,7 +129,7 @@ static BOOLEAN process_read_multi_rsp (tGATT_SR_CMD *p_cmd, tGATT_STATUS status, UINT8 *p; BOOLEAN is_overflow = FALSE; - GATT_TRACE_DEBUG2 ("process_read_multi_rsp status=%d mtu=%d", status, mtu); + GATT_TRACE_DEBUG ("process_read_multi_rsp status=%d mtu=%d", status, mtu); if (p_buf == NULL) { @@ -144,7 +144,7 @@ static BOOLEAN process_read_multi_rsp (tGATT_SR_CMD *p_cmd, tGATT_STATUS status, p_cmd->status = status; if (status == GATT_SUCCESS) { - GATT_TRACE_DEBUG2 ("Multi read count=%d num_hdls=%d", + GATT_TRACE_DEBUG ("Multi read count=%d num_hdls=%d", p_cmd->multi_rsp_q.count, p_cmd->multi_req.num_handles); /* Wait till we get all the responses */ if (p_cmd->multi_rsp_q.count == p_cmd->multi_req.num_handles) @@ -186,7 +186,7 @@ static BOOLEAN process_read_multi_rsp (tGATT_SR_CMD *p_cmd, tGATT_STATUS status, /* just send the partial response for the overflow case */ len = p_rsp->attr_value.len - (total_len - mtu); is_overflow = TRUE; - GATT_TRACE_DEBUG2 ("multi read overflow available len=%d val_len=%d", len, p_rsp->attr_value.len ); + GATT_TRACE_DEBUG ("multi read overflow available len=%d val_len=%d", len, p_rsp->attr_value.len ); } else { @@ -222,10 +222,10 @@ static BOOLEAN process_read_multi_rsp (tGATT_SR_CMD *p_cmd, tGATT_STATUS status, /* Sanity check on the buffer length */ if (p_buf->len == 0) { - GATT_TRACE_ERROR0("process_read_multi_rsp - nothing found!!"); + GATT_TRACE_ERROR("process_read_multi_rsp - nothing found!!"); p_cmd->status = GATT_NOT_FOUND; GKI_freebuf (p_buf); - GATT_TRACE_DEBUG0(" GKI_freebuf (p_buf)"); + GATT_TRACE_DEBUG(" GKI_freebuf (p_buf)"); } else if (p_cmd->p_rsp_msg != NULL) { @@ -265,7 +265,7 @@ tGATT_STATUS gatt_sr_process_app_rsp (tGATT_TCB *p_tcb, tGATT_IF gatt_if, tGATT_STATUS ret_code = GATT_SUCCESS; UNUSED(trans_id); - GATT_TRACE_DEBUG1("gatt_sr_process_app_rsp gatt_if=%d", gatt_if); + GATT_TRACE_DEBUG("gatt_sr_process_app_rsp gatt_if=%d", gatt_if); gatt_sr_update_cback_cnt(p_tcb, gatt_if, FALSE, FALSE); @@ -294,7 +294,7 @@ tGATT_STATUS gatt_sr_process_app_rsp (tGATT_TCB *p_tcb, tGATT_IF gatt_if, } else { - GATT_TRACE_ERROR0("Exception!!! already has respond message"); + GATT_TRACE_ERROR("Exception!!! already has respond message"); } } } @@ -313,7 +313,7 @@ tGATT_STATUS gatt_sr_process_app_rsp (tGATT_TCB *p_tcb, tGATT_IF gatt_if, gatt_dequeue_sr_cmd(p_tcb); } - GATT_TRACE_DEBUG1("gatt_sr_process_app_rsp ret_code=%d", ret_code); + GATT_TRACE_DEBUG("gatt_sr_process_app_rsp ret_code=%d", ret_code); return ret_code; } @@ -341,7 +341,7 @@ void gatt_process_exec_write_req (tGATT_TCB *p_tcb, UINT8 op_code, UINT16 len, U #if GATT_CONFORMANCE_TESTING == TRUE if (gatt_cb.enable_err_rsp && gatt_cb.req_op_code == op_code) { - GATT_TRACE_DEBUG1("Conformance tst: forced err rspv for Execute Write: error status=%d", + GATT_TRACE_DEBUG("Conformance tst: forced err rspv for Execute Write: error status=%d", gatt_cb.err_status); gatt_send_error_rsp (p_tcb, gatt_cb.err_status, gatt_cb.req_op_code, gatt_cb.handle, FALSE); @@ -378,7 +378,7 @@ void gatt_process_exec_write_req (tGATT_TCB *p_tcb, UINT8 op_code, UINT16 len, U } else /* nothing needs to be executed , send response now */ { - GATT_TRACE_ERROR0("gatt_process_exec_write_req: no prepare write pending"); + GATT_TRACE_ERROR("gatt_process_exec_write_req: no prepare write pending"); if ((p_buf = attp_build_sr_msg(p_tcb, GATT_RSP_EXEC_WRITE, NULL)) != NULL) { @@ -407,7 +407,7 @@ void gatt_process_read_multi_req (tGATT_TCB *p_tcb, UINT8 op_code, UINT16 len, U UINT8 sec_flag, key_size; tGATTS_RSP *p_msg; - GATT_TRACE_DEBUG0("gatt_process_read_multi_req" ); + GATT_TRACE_DEBUG("gatt_process_read_multi_req" ); p_tcb->sr_cmd.multi_req.num_handles = 0; gatt_sr_get_sec_info(p_tcb->peer_bda, @@ -418,7 +418,7 @@ void gatt_process_read_multi_req (tGATT_TCB *p_tcb, UINT8 op_code, UINT16 len, U #if GATT_CONFORMANCE_TESTING == TRUE if (gatt_cb.enable_err_rsp && gatt_cb.req_op_code == op_code) { - GATT_TRACE_DEBUG1("Conformance tst: forced err rspvofr ReadMultiple: error status=%d", gatt_cb.err_status); + GATT_TRACE_DEBUG("Conformance tst: forced err rspvofr ReadMultiple: error status=%d", gatt_cb.err_status); STREAM_TO_UINT16(handle, p); @@ -444,7 +444,7 @@ void gatt_process_read_multi_req (tGATT_TCB *p_tcb, UINT8 op_code, UINT16 len, U key_size)) != GATT_SUCCESS) { - GATT_TRACE_DEBUG1("read permission denied : 0x%02x", err); + GATT_TRACE_DEBUG("read permission denied : 0x%02x", err); break; } } @@ -459,7 +459,7 @@ void gatt_process_read_multi_req (tGATT_TCB *p_tcb, UINT8 op_code, UINT16 len, U if (ll != 0) { - GATT_TRACE_ERROR0("max attribute handle reached in ReadMultiple Request."); + GATT_TRACE_ERROR("max attribute handle reached in ReadMultiple Request."); } if (p_tcb->sr_cmd.multi_req.num_handles == 0) @@ -583,7 +583,7 @@ static tGATT_STATUS gatt_build_primary_service_rsp (BT_HDR *p_msg, tGATT_TCB *p_ if (p_list->p_last_primary == p_srv && p_list->p_last_primary == p_list->p_last) { - GATT_TRACE_DEBUG0("Use 0xFFFF for the last primary attribute"); + GATT_TRACE_DEBUG("Use 0xFFFF for the last primary attribute"); UINT16_TO_STREAM(p, 0xFFFF); /* see GATT ERRATA 4065, 4063, ATT ERRATA 4062 */ } else @@ -669,7 +669,7 @@ static tGATT_STATUS gatt_build_find_info_rsp(tGATT_SR_REG *p_rcb, BT_HDR *p_msg, } else { - GATT_TRACE_ERROR0("format mismatch"); + GATT_TRACE_ERROR("format mismatch"); status = GATT_NO_RESOURCES; break; /* format mismatch */ @@ -734,7 +734,7 @@ static tGATT_STATUS gatts_validate_packet_format(UINT8 op_code, UINT16 *p_len, if (gatt_parse_uuid_from_cmd (p_uuid_filter, uuid_len, &p) == FALSE || p_uuid_filter->len == 0) { - GATT_TRACE_DEBUG0("UUID filter does not exsit"); + GATT_TRACE_DEBUG("UUID filter does not exsit"); reason = GATT_INVALID_PDU; } else @@ -790,7 +790,7 @@ void gatts_process_primary_service_req(tGATT_TCB *p_tcb, UINT8 op_code, UINT16 l { if ((p_msg = (BT_HDR *)GKI_getbuf(msg_len)) == NULL) { - GATT_TRACE_ERROR0("gatts_process_primary_service_req failed. no resources."); + GATT_TRACE_ERROR("gatts_process_primary_service_req failed. no resources."); reason = GATT_NO_RESOURCES; } else @@ -805,13 +805,13 @@ void gatts_process_primary_service_req(tGATT_TCB *p_tcb, UINT8 op_code, UINT16 l if (op_code == GATT_REQ_READ_BY_GRP_TYPE) { reason = GATT_UNSUPPORT_GRP_TYPE; - GATT_TRACE_DEBUG1("unexpected ReadByGrpType Group: 0x%04x", uuid.uu.uuid16); + GATT_TRACE_DEBUG("unexpected ReadByGrpType Group: 0x%04x", uuid.uu.uuid16); } else { /* we do not support ReadByTypeValue with any non-primamry_service type */ reason = GATT_NOT_FOUND; - GATT_TRACE_DEBUG1("unexpected ReadByTypeValue type: 0x%04x", uuid.uu.uuid16); + GATT_TRACE_DEBUG("unexpected ReadByTypeValue type: 0x%04x", uuid.uu.uuid16); } } } @@ -925,7 +925,7 @@ static void gatts_process_mtu_req (tGATT_TCB *p_tcb, UINT16 len, UINT8 *p_data) } else if (len < GATT_MTU_REQ_MIN_LEN) { - GATT_TRACE_ERROR0("invalid MTU request PDU received."); + GATT_TRACE_ERROR("invalid MTU request PDU received."); gatt_send_error_rsp (p_tcb, GATT_INVALID_PDU, GATT_REQ_MTU, 0, FALSE); } else @@ -939,7 +939,7 @@ static void gatts_process_mtu_req (tGATT_TCB *p_tcb, UINT16 len, UINT8 *p_data) else p_tcb->payload_size = mtu; - GATT_TRACE_ERROR1("MTU request PDU with MTU size %d", p_tcb->payload_size); + GATT_TRACE_ERROR("MTU request PDU with MTU size %d", p_tcb->payload_size); if ((p_buf = attp_build_sr_msg(p_tcb, GATT_RSP_MTU, (tGATT_SR_MSG *) &p_tcb->payload_size)) != NULL) { @@ -996,7 +996,7 @@ void gatts_process_read_by_type_req(tGATT_TCB *p_tcb, UINT8 op_code, UINT16 len, #if GATT_CONFORMANCE_TESTING == TRUE if (gatt_cb.enable_err_rsp && gatt_cb.req_op_code == op_code) { - GATT_TRACE_DEBUG1("Conformance tst: forced err rsp for ReadByType: error status=%d", gatt_cb.err_status); + GATT_TRACE_DEBUG("Conformance tst: forced err rsp for ReadByType: error status=%d", gatt_cb.err_status); gatt_send_error_rsp (p_tcb, gatt_cb.err_status, gatt_cb.req_op_code, s_hdl, FALSE); @@ -1008,7 +1008,7 @@ void gatts_process_read_by_type_req(tGATT_TCB *p_tcb, UINT8 op_code, UINT16 len, { if ((p_msg = (BT_HDR *)GKI_getbuf(msg_len)) == NULL) { - GATT_TRACE_ERROR0("gatts_process_find_info failed. no resources."); + GATT_TRACE_ERROR("gatts_process_find_info failed. no resources."); reason = GATT_NO_RESOURCES; } @@ -1115,7 +1115,7 @@ void gatts_process_write_req (tGATT_TCB *p_tcb, UINT8 i_rcb, UINT16 handle, case GATT_SIGN_CMD_WRITE: if (op_code == GATT_SIGN_CMD_WRITE) { - GATT_TRACE_DEBUG0("Write CMD with data sigining" ); + GATT_TRACE_DEBUG("Write CMD with data sigining" ); len -= GATT_AUTH_SIGN_LEN; } /* fall through */ @@ -1158,7 +1158,7 @@ void gatts_process_write_req (tGATT_TCB *p_tcb, UINT8 i_rcb, UINT16 handle, } else { - GATT_TRACE_ERROR0("max pending command, send error"); + GATT_TRACE_ERROR("max pending command, send error"); status = GATT_BUSY; /* max pending command, application error */ } } @@ -1194,7 +1194,7 @@ static void gatts_process_read_req(tGATT_TCB *p_tcb, tGATT_SR_REG *p_rcb, UINT8 UNUSED (len); if ((p_msg = (BT_HDR *)GKI_getbuf(buf_len)) == NULL) { - GATT_TRACE_ERROR0("gatts_process_find_info failed. no resources."); + GATT_TRACE_ERROR("gatts_process_find_info failed. no resources."); reason = GATT_NO_RESOURCES; } @@ -1263,7 +1263,7 @@ void gatts_process_attribute_req (tGATT_TCB *p_tcb, UINT8 op_code, if (len < 2) { - GATT_TRACE_ERROR0("Illegal PDU length, discard request"); + GATT_TRACE_ERROR("Illegal PDU length, discard request"); status = GATT_INVALID_PDU; } else @@ -1276,7 +1276,7 @@ void gatts_process_attribute_req (tGATT_TCB *p_tcb, UINT8 op_code, gatt_cb.handle = handle; if (gatt_cb.enable_err_rsp && gatt_cb.req_op_code == op_code) { - GATT_TRACE_DEBUG1("Conformance tst: forced err rsp: error status=%d", gatt_cb.err_status); + GATT_TRACE_DEBUG("Conformance tst: forced err rsp: error status=%d", gatt_cb.err_status); gatt_send_error_rsp (p_tcb, gatt_cb.err_status, gatt_cb.req_op_code, handle, FALSE); @@ -1340,11 +1340,11 @@ static void gatts_proc_srv_chg_ind_ack(tGATT_TCB *p_tcb ) tGATTS_SRV_CHG_REQ req; tGATTS_SRV_CHG *p_buf = NULL; - GATT_TRACE_DEBUG0("gatts_proc_srv_chg_ind_ack"); + GATT_TRACE_DEBUG("gatts_proc_srv_chg_ind_ack"); if ((p_buf = gatt_is_bda_in_the_srv_chg_clt_list(p_tcb->peer_bda)) != NULL) { - GATT_TRACE_DEBUG0("NV update set srv chg = FALSE"); + GATT_TRACE_DEBUG("NV update set srv chg = FALSE"); p_buf->srv_changed = FALSE; memcpy(&req.srv_chg, p_buf, sizeof(tGATTS_SRV_CHG)); if (gatt_cb.cb_info.p_srv_chg_callback) @@ -1365,7 +1365,7 @@ static void gatts_proc_srv_chg_ind_ack(tGATT_TCB *p_tcb ) static void gatts_chk_pending_ind(tGATT_TCB *p_tcb ) { tGATT_VALUE *p_buf = (tGATT_VALUE *)GKI_getfirst(&p_tcb->pending_ind_q); - GATT_TRACE_DEBUG0("gatts_chk_pending_ind"); + GATT_TRACE_DEBUG("gatts_chk_pending_ind"); if (p_buf ) { @@ -1391,7 +1391,7 @@ static BOOLEAN gatts_proc_ind_ack(tGATT_TCB *p_tcb, UINT16 ack_handle) { BOOLEAN continue_processing = TRUE; - GATT_TRACE_DEBUG1 ("gatts_proc_ind_ack ack handle=%d", ack_handle); + GATT_TRACE_DEBUG ("gatts_proc_ind_ack ack handle=%d", ack_handle); if (ack_handle == gatt_cb.handle_of_h_r) { @@ -1444,7 +1444,7 @@ void gatts_process_value_conf(tGATT_TCB *p_tcb, UINT8 op_code) } else { - GATT_TRACE_ERROR0("unexpected handle value confirmation"); + GATT_TRACE_ERROR("unexpected handle value confirmation"); } } @@ -1470,7 +1470,7 @@ void gatt_server_handle_client_req (tGATT_TCB *p_tcb, UINT8 op_code, /* The message has to be smaller than the agreed MTU, len does not include op code */ if (len >= p_tcb->payload_size) { - GATT_TRACE_ERROR2("server receive invalid PDU size:%d pdu size:%d", len + 1, p_tcb->payload_size ); + GATT_TRACE_ERROR("server receive invalid PDU size:%d pdu size:%d", len + 1, p_tcb->payload_size ); /* for invalid request expecting response, send it now */ if (op_code != GATT_CMD_WRITE && op_code != GATT_SIGN_CMD_WRITE && diff --git a/stack/gatt/gatt_utils.c b/stack/gatt/gatt_utils.c index d3d4c924d..0e841a92c 100644 --- a/stack/gatt/gatt_utils.c +++ b/stack/gatt/gatt_utils.c @@ -91,7 +91,7 @@ static const UINT8 base_uuid[LEN_UUID_128] = {0xFB, 0x34, 0x9B, 0x5F, 0x80, 0x0 *******************************************************************************/ void gatt_free_pending_ind(tGATT_TCB *p_tcb) { - GATT_TRACE_DEBUG0("gatt_free_pending_ind"); + GATT_TRACE_DEBUG("gatt_free_pending_ind"); /* release all queued indications */ while (p_tcb->pending_ind_q.p_first) GKI_freebuf (GKI_dequeue (&p_tcb->pending_ind_q)); @@ -108,7 +108,7 @@ void gatt_free_pending_ind(tGATT_TCB *p_tcb) *******************************************************************************/ void gatt_free_pending_enc_queue(tGATT_TCB *p_tcb) { - GATT_TRACE_DEBUG0("gatt_free_pending_enc_queue"); + GATT_TRACE_DEBUG("gatt_free_pending_enc_queue"); /* release all queued indications */ while (p_tcb->pending_enc_clcb.p_first) GKI_freebuf (GKI_dequeue (&p_tcb->pending_enc_clcb)); @@ -128,7 +128,7 @@ void gatt_delete_dev_from_srv_chg_clt_list(BD_ADDR bd_addr) tGATTS_SRV_CHG *p_buf; tGATTS_SRV_CHG_REQ req; - GATT_TRACE_DEBUG0 ("gatt_delete_dev_from_srv_chg_clt_list"); + GATT_TRACE_DEBUG ("gatt_delete_dev_from_srv_chg_clt_list"); if ((p_buf = gatt_is_bda_in_the_srv_chg_clt_list(bd_addr)) != NULL) { if (gatt_cb.cb_info.p_srv_chg_callback) @@ -156,13 +156,13 @@ void gatt_set_srv_chg(void) tGATTS_SRV_CHG *p_buf = (tGATTS_SRV_CHG *)GKI_getfirst(&gatt_cb.srv_chg_clt_q); tGATTS_SRV_CHG_REQ req; - GATT_TRACE_DEBUG0 ("gatt_set_srv_chg"); + GATT_TRACE_DEBUG ("gatt_set_srv_chg"); while (p_buf) { - GATT_TRACE_DEBUG0 ("found a srv_chg clt"); + GATT_TRACE_DEBUG ("found a srv_chg clt"); if (!p_buf->srv_changed) { - GATT_TRACE_DEBUG0 ("set srv_changed to TRUE"); + GATT_TRACE_DEBUG ("set srv_changed to TRUE"); p_buf->srv_changed= TRUE; memcpy(&req.srv_chg, p_buf, sizeof(tGATTS_SRV_CHG)); if (gatt_cb.cb_info.p_srv_chg_callback) @@ -193,7 +193,7 @@ tGATTS_PENDING_NEW_SRV_START *gatt_sr_is_new_srv_chg(tBT_UUID *p_app_uuid128, tB && gatt_uuid_compare (*p_svc_uuid, p->svc_uuid) && (svc_inst == p->svc_inst) ) { - GATT_TRACE_DEBUG0 ("gatt_sr_is_new_srv_chg: Yes"); + GATT_TRACE_DEBUG ("gatt_sr_is_new_srv_chg: Yes"); break; } p_buf = (tGATTS_PENDING_NEW_SRV_START *)GKI_getnext(p_buf); @@ -215,10 +215,10 @@ tGATTS_PENDING_NEW_SRV_START *gatt_sr_is_new_srv_chg(tBT_UUID *p_app_uuid128, tB tGATT_VALUE *gatt_add_pending_ind(tGATT_TCB *p_tcb, tGATT_VALUE *p_ind) { tGATT_VALUE *p_buf; - GATT_TRACE_DEBUG0 ("gatt_add_pending_ind"); + GATT_TRACE_DEBUG ("gatt_add_pending_ind"); if ((p_buf = (tGATT_VALUE *)GKI_getbuf((UINT16)sizeof(tGATT_VALUE))) != NULL) { - GATT_TRACE_DEBUG0 ("enqueue a pending indication"); + GATT_TRACE_DEBUG ("enqueue a pending indication"); memcpy(p_buf, p_ind, sizeof(tGATT_VALUE)); GKI_enqueue (&p_tcb->pending_ind_q, p_buf); } @@ -239,10 +239,10 @@ tGATTS_PENDING_NEW_SRV_START *gatt_add_pending_new_srv_start(tGATTS_HNDL_RANGE * { tGATTS_PENDING_NEW_SRV_START *p_buf; - GATT_TRACE_DEBUG0 ("gatt_add_pending_new_srv_start"); + GATT_TRACE_DEBUG ("gatt_add_pending_new_srv_start"); if ((p_buf = (tGATTS_PENDING_NEW_SRV_START *)GKI_getbuf((UINT16)sizeof(tGATTS_PENDING_NEW_SRV_START))) != NULL) { - GATT_TRACE_DEBUG0 ("enqueue a new pending new srv start"); + GATT_TRACE_DEBUG ("enqueue a new pending new srv start"); p_buf->p_new_srv_start = p_new_srv_start; GKI_enqueue (&gatt_cb.pending_new_srv_start_q, p_buf); } @@ -262,10 +262,10 @@ tGATTS_PENDING_NEW_SRV_START *gatt_add_pending_new_srv_start(tGATTS_HNDL_RANGE * tGATTS_SRV_CHG *gatt_add_srv_chg_clt(tGATTS_SRV_CHG *p_srv_chg) { tGATTS_SRV_CHG *p_buf; - GATT_TRACE_DEBUG0 ("gatt_add_srv_chg_clt"); + GATT_TRACE_DEBUG ("gatt_add_srv_chg_clt"); if ((p_buf = (tGATTS_SRV_CHG *)GKI_getbuf((UINT16)sizeof(tGATTS_SRV_CHG))) != NULL) { - GATT_TRACE_DEBUG0 ("enqueue a srv chg client"); + GATT_TRACE_DEBUG ("enqueue a srv chg client"); memcpy(p_buf, p_srv_chg, sizeof(tGATTS_SRV_CHG)); GKI_enqueue (&gatt_cb.srv_chg_clt_q, p_buf); } @@ -352,7 +352,7 @@ tGATT_HDL_LIST_ELEM *gatt_find_hdl_buffer_by_app_id (tBT_UUID *p_app_uuid128, && gatt_uuid_compare (*p_svc_uuid, p_list->asgn_range.svc_uuid) && (svc_inst == p_list->asgn_range.svc_inst) ) { - GATT_TRACE_DEBUG0 ("Already allocated handles for this service before!!"); + GATT_TRACE_DEBUG ("Already allocated handles for this service before!!"); return(p_list); } p_list = p_list->p_next; @@ -503,7 +503,7 @@ BOOLEAN gatt_add_a_srv_to_list(tGATT_SRV_LIST_INFO *p_list, tGATT_SRV_LIST_ELEM if (!p_new) { - GATT_TRACE_DEBUG0("p_new==NULL"); + GATT_TRACE_DEBUG("p_new==NULL"); return FALSE; } @@ -567,7 +567,7 @@ BOOLEAN gatt_remove_a_srv_from_list(tGATT_SRV_LIST_INFO *p_list, tGATT_SRV_LIST_ { if (!p_remove || !p_list->p_first) { - GATT_TRACE_DEBUG0("p_remove==NULL || p_list->p_first==NULL"); + GATT_TRACE_DEBUG("p_remove==NULL || p_list->p_first==NULL"); return FALSE; } @@ -608,7 +608,7 @@ BOOLEAN gatt_add_an_item_to_list(tGATT_HDL_LIST_INFO *p_list, tGATT_HDL_LIST_ELE tGATT_HDL_LIST_ELEM *p_old; if (!p_new) { - GATT_TRACE_DEBUG0("p_new==NULL"); + GATT_TRACE_DEBUG("p_new==NULL"); return FALSE; } @@ -671,7 +671,7 @@ BOOLEAN gatt_remove_an_item_from_list(tGATT_HDL_LIST_INFO *p_list, tGATT_HDL_LIS { if (!p_remove || !p_list->p_first) { - GATT_TRACE_DEBUG0("p_remove==NULL || p_list->p_first==NULL"); + GATT_TRACE_DEBUG("p_remove==NULL || p_list->p_first==NULL"); return FALSE; } @@ -710,7 +710,7 @@ BOOLEAN gatt_find_the_connected_bda(UINT8 start_idx, BD_ADDR bda, UINT8 *p_found { UINT8 i; BOOLEAN found = FALSE; - GATT_TRACE_DEBUG1("gatt_find_the_connected_bda start_idx=%d",start_idx); + GATT_TRACE_DEBUG("gatt_find_the_connected_bda start_idx=%d",start_idx); for (i = start_idx ; i < GATT_MAX_PHY_CHANNEL; i ++) { @@ -720,12 +720,12 @@ BOOLEAN gatt_find_the_connected_bda(UINT8 start_idx, BD_ADDR bda, UINT8 *p_found *p_found_idx = i; *p_transport = gatt_cb.tcb[i].transport; found = TRUE; - GATT_TRACE_DEBUG6("gatt_find_the_connected_bda bda :%02x-%02x-%02x-%02x-%02x-%02x", + GATT_TRACE_DEBUG("gatt_find_the_connected_bda bda :%02x-%02x-%02x-%02x-%02x-%02x", bda[0], bda[1], bda[2], bda[3], bda[4], bda[5]); break; } } - GATT_TRACE_DEBUG2("gatt_find_the_connected_bda found=%d found_idx=%d", found, i); + GATT_TRACE_DEBUG("gatt_find_the_connected_bda found=%d found_idx=%d", found, i); return found; } @@ -746,7 +746,7 @@ BOOLEAN gatt_is_srv_chg_ind_pending (tGATT_TCB *p_tcb) tGATT_VALUE *p_buf = (tGATT_VALUE *)GKI_getfirst(&p_tcb->pending_ind_q); BOOLEAN srv_chg_ind_pending = FALSE; - GATT_TRACE_DEBUG1("gatt_is_srv_chg_ind_pending is_queue_empty=%d", GKI_queue_is_empty(&p_tcb->pending_ind_q) ); + GATT_TRACE_DEBUG("gatt_is_srv_chg_ind_pending is_queue_empty=%d", GKI_queue_is_empty(&p_tcb->pending_ind_q) ); if (p_tcb->indicate_handle == gatt_cb.handle_of_h_r) { @@ -765,7 +765,7 @@ BOOLEAN gatt_is_srv_chg_ind_pending (tGATT_TCB *p_tcb) } } - GATT_TRACE_DEBUG1("srv_chg_ind_pending = %d", srv_chg_ind_pending); + GATT_TRACE_DEBUG("srv_chg_ind_pending = %d", srv_chg_ind_pending); return srv_chg_ind_pending; } @@ -783,14 +783,14 @@ tGATTS_SRV_CHG *gatt_is_bda_in_the_srv_chg_clt_list (BD_ADDR bda) { tGATTS_SRV_CHG *p_buf = (tGATTS_SRV_CHG *)GKI_getfirst(&gatt_cb.srv_chg_clt_q); - GATT_TRACE_DEBUG6("gatt_is_bda_in_the_srv_chg_clt_list :%02x-%02x-%02x-%02x-%02x-%02x", + GATT_TRACE_DEBUG("gatt_is_bda_in_the_srv_chg_clt_list :%02x-%02x-%02x-%02x-%02x-%02x", bda[0], bda[1], bda[2], bda[3], bda[4], bda[5]); while (p_buf != NULL) { if (!memcmp( bda, p_buf->bda, BD_ADDR_LEN)) { - GATT_TRACE_DEBUG0("bda is in the srv chg clt list"); + GATT_TRACE_DEBUG("bda is in the srv chg clt list"); break; } p_buf = (tGATTS_SRV_CHG *)GKI_getnext(p_buf); @@ -1149,11 +1149,11 @@ BOOLEAN gatt_parse_uuid_from_cmd(tBT_UUID *p_uuid_rec, UINT16 uuid_size, UINT8 * /* do not allow 32 bits UUID in ATT PDU now */ case LEN_UUID_32: - GATT_TRACE_ERROR0("DO NOT ALLOW 32 BITS UUID IN ATT PDU"); + GATT_TRACE_ERROR("DO NOT ALLOW 32 BITS UUID IN ATT PDU"); case 0: default: if (uuid_size != 0) ret = FALSE; - GATT_TRACE_WARNING0("gatt_parse_uuid_from_cmd invalid uuid size"); + GATT_TRACE_WARNING("gatt_parse_uuid_from_cmd invalid uuid size"); break; } @@ -1228,7 +1228,7 @@ void gatt_rsp_timeout(TIMER_LIST_ENT *p_tle) tGATT_CLCB *p_clcb = (tGATT_CLCB *)p_tle->param; if (p_clcb == NULL || p_clcb->p_tcb == NULL) { - GATT_TRACE_WARNING0("gatt_rsp_timeout clcb is already deleted"); + GATT_TRACE_WARNING("gatt_rsp_timeout clcb is already deleted"); return; } if (p_clcb->operation == GATTC_OPTYPE_DISCOVERY && @@ -1236,10 +1236,10 @@ void gatt_rsp_timeout(TIMER_LIST_ENT *p_tle) p_clcb->retry_count < GATT_REQ_RETRY_LIMIT) { UINT8 rsp_code; - GATT_TRACE_WARNING0("gatt_rsp_timeout retry discovery primary service"); + GATT_TRACE_WARNING("gatt_rsp_timeout retry discovery primary service"); if (p_clcb != gatt_cmd_dequeue(p_clcb->p_tcb, &rsp_code)) { - GATT_TRACE_ERROR0("gatt_rsp_timeout command queue out of sync, disconnect"); + GATT_TRACE_ERROR("gatt_rsp_timeout command queue out of sync, disconnect"); } else { @@ -1249,7 +1249,7 @@ void gatt_rsp_timeout(TIMER_LIST_ENT *p_tle) } } - GATT_TRACE_WARNING0("gatt_rsp_timeout disconnecting..."); + GATT_TRACE_WARNING("gatt_rsp_timeout disconnecting..."); gatt_disconnect (p_clcb->p_tcb); } @@ -1266,7 +1266,7 @@ void gatt_ind_ack_timeout(TIMER_LIST_ENT *p_tle) { tGATT_TCB * p_tcb = (tGATT_TCB *)p_tle->param; - GATT_TRACE_WARNING0("gatt_ind_ack_timeout send ack now"); + GATT_TRACE_WARNING("gatt_ind_ack_timeout send ack now"); if (p_tcb != NULL) p_tcb->ind_count = 0; @@ -1324,7 +1324,7 @@ UINT8 gatt_sr_find_i_rcb_by_app_id(tBT_UUID *p_app_uuid128, tBT_UUID *p_svc_uuid gatt_uuid_compare (*p_svc_uuid, *p_this_uuid) && (svc_inst == p_sreg->service_instance)) { - GATT_TRACE_ERROR0 ("Active Service Found "); + GATT_TRACE_ERROR ("Active Service Found "); gatt_dbg_display_uuid(*p_svc_uuid); break; @@ -1363,7 +1363,7 @@ UINT8 gatt_sr_alloc_rcb(tGATT_HDL_LIST_ELEM *p_list ) p_sreg->e_hdl = p_list->asgn_range.e_handle; p_sreg->p_db = &p_list->svc_db; - GATT_TRACE_DEBUG1 ("total GKI buffer in db [%d]",p_sreg->p_db->svc_buffer.count); + GATT_TRACE_DEBUG ("total GKI buffer in db [%d]",p_sreg->p_db->svc_buffer.count); break; } } @@ -1410,7 +1410,7 @@ void gatt_sr_send_req_callback(UINT16 conn_id, if (!p_reg ) { - GATT_TRACE_ERROR0 ("p_reg not found discard request"); + GATT_TRACE_ERROR ("p_reg not found discard request"); return; } @@ -1421,7 +1421,7 @@ void gatt_sr_send_req_callback(UINT16 conn_id, } else { - GATT_TRACE_WARNING1("Call back not found for application conn_id=%d", conn_id); + GATT_TRACE_WARNING("Call back not found for application conn_id=%d", conn_id); } } @@ -1477,7 +1477,7 @@ UINT32 gatt_add_sdp_record (tBT_UUID *p_uuid, UINT16 start_hdl, UINT16 end_hdl) UINT8 buff[60]; UINT8 *p = buff; - GATT_TRACE_DEBUG2("gatt_add_sdp_record s_hdl=0x%x s_hdl=0x%x",start_hdl, end_hdl); + GATT_TRACE_DEBUG("gatt_add_sdp_record s_hdl=0x%x s_hdl=0x%x",start_hdl, end_hdl); if ((sdp_handle = SDP_CreateRecord()) == 0) return 0; @@ -1503,7 +1503,7 @@ UINT32 gatt_add_sdp_record (tBT_UUID *p_uuid, UINT16 start_hdl, UINT16 end_hdl) break; default: - GATT_TRACE_ERROR1("inavlid UUID len=%d", p_uuid->len); + GATT_TRACE_ERROR("inavlid UUID len=%d", p_uuid->len); SDP_DeleteRecord(sdp_handle); return 0; break; @@ -1539,7 +1539,7 @@ UINT32 gatt_add_sdp_record (tBT_UUID *p_uuid, UINT16 start_hdl, UINT16 end_hdl) *******************************************************************************/ void gatt_set_err_rsp(BOOLEAN enable, UINT8 req_op_code, UINT8 err_status) { - GATT_TRACE_DEBUG3("gatt_set_err_rsp enable=%d op_code=%d, err_status=%d", enable, req_op_code, err_status); + GATT_TRACE_DEBUG("gatt_set_err_rsp enable=%d op_code=%d, err_status=%d", enable, req_op_code, err_status); gatt_cb.enable_err_rsp = enable; gatt_cb.req_op_code = req_op_code; gatt_cb.err_status = err_status; @@ -1701,7 +1701,7 @@ UINT8 gatt_num_apps_hold_link(tGATT_TCB *p_tcb) num ++; } - GATT_TRACE_DEBUG1("gatt_num_apps_hold_link num=%d", num); + GATT_TRACE_DEBUG("gatt_num_apps_hold_link num=%d", num); return num; } @@ -1910,7 +1910,7 @@ void gatt_sr_update_prep_cnt(tGATT_TCB *p_tcb, tGATT_IF gatt_if, BOOLEAN is_inc, { UINT8 idx = ((UINT8) gatt_if) - 1 ; - GATT_TRACE_DEBUG4("gatt_sr_update_prep_cnt tcb idx=%d gatt_if=%d is_inc=%d is_reset_first=%d", + GATT_TRACE_DEBUG("gatt_sr_update_prep_cnt tcb idx=%d gatt_if=%d is_inc=%d is_reset_first=%d", p_tcb->tcb_idx, gatt_if, is_inc, is_reset_first); if (p_tcb) @@ -1952,7 +1952,7 @@ BOOLEAN gatt_cancel_open(tGATT_IF gatt_if, BD_ADDR bda) { if (gatt_get_ch_state(p_tcb) == GATT_CH_OPEN) { - GATT_TRACE_ERROR0("GATT_CancelConnect - link connected Too late to cancel"); + GATT_TRACE_ERROR("GATT_CancelConnect - link connected Too late to cancel"); status = FALSE; } else @@ -2118,7 +2118,7 @@ void gatt_end_operation(tGATT_CLCB *p_clcb, tGATT_STATUS status, void *p_data) UINT16 conn_id; UINT8 operation; - GATT_TRACE_DEBUG3 ("gatt_end_operation status=%d op=%d subtype=%d", + GATT_TRACE_DEBUG ("gatt_end_operation status=%d op=%d subtype=%d", status, p_clcb->operation, p_clcb->op_subtype); if (p_cmpl_cb != NULL && p_clcb->operation != 0) @@ -2145,7 +2145,7 @@ void gatt_end_operation(tGATT_CLCB *p_clcb, tGATT_STATUS status, void *p_data) } else { - GATT_TRACE_DEBUG0("Rcv Prepare write rsp but no data"); + GATT_TRACE_DEBUG("Rcv Prepare write rsp but no data"); } } } @@ -2175,7 +2175,7 @@ void gatt_end_operation(tGATT_CLCB *p_clcb, tGATT_STATUS status, void *p_data) else if (p_cmpl_cb && op) (*p_cmpl_cb)(conn_id, op, status, &cb_data); else - GATT_TRACE_WARNING3 ("gatt_end_operation not sent out op=%d p_disc_cmpl_cb:%p p_cmpl_cb:%p", + GATT_TRACE_WARNING ("gatt_end_operation not sent out op=%d p_disc_cmpl_cb:%p p_cmpl_cb:%p", operation, p_disc_cmpl_cb, p_cmpl_cb); } @@ -2198,11 +2198,11 @@ void gatt_cleanup_upon_disc(BD_ADDR bda, UINT16 reason, tBT_TRANSPORT transport) tGATT_REG *p_reg=NULL; - GATT_TRACE_DEBUG0 ("gatt_cleanup_upon_disc "); + GATT_TRACE_DEBUG ("gatt_cleanup_upon_disc "); if ((p_tcb = gatt_find_tcb_by_addr(bda, transport)) != NULL) { - GATT_TRACE_DEBUG0 ("found p_tcb "); + GATT_TRACE_DEBUG ("found p_tcb "); gatt_set_ch_state(p_tcb, GATT_CH_CLOSE); for (i = 0; i < GATT_CL_MAX_LCB; i ++) { @@ -2210,7 +2210,7 @@ void gatt_cleanup_upon_disc(BD_ADDR bda, UINT16 reason, tBT_TRANSPORT transport) if (p_clcb->in_use && p_clcb->p_tcb == p_tcb) { btu_stop_timer(&p_clcb->rsp_timer_ent); - GATT_TRACE_DEBUG2 ("found p_clcb conn_id=%d clcb_idx=%d", p_clcb->conn_id, p_clcb->clcb_idx); + GATT_TRACE_DEBUG ("found p_clcb conn_id=%d clcb_idx=%d", p_clcb->conn_id, p_clcb->clcb_idx); if (p_clcb->operation != GATTC_OPTYPE_NONE) gatt_end_operation(p_clcb, GATT_ERROR, NULL); @@ -2230,14 +2230,14 @@ void gatt_cleanup_upon_disc(BD_ADDR bda, UINT16 reason, tBT_TRANSPORT transport) if (p_reg->in_use && p_reg->app_cb.p_conn_cb) { conn_id = GATT_CREATE_CONN_ID(p_tcb->tcb_idx, p_reg->gatt_if); - GATT_TRACE_DEBUG3 ("found p_reg tcb_idx=%d gatt_if=%d conn_id=0x%x", p_tcb->tcb_idx, p_reg->gatt_if, conn_id); + GATT_TRACE_DEBUG ("found p_reg tcb_idx=%d gatt_if=%d conn_id=0x%x", p_tcb->tcb_idx, p_reg->gatt_if, conn_id); (*p_reg->app_cb.p_conn_cb)(p_reg->gatt_if, bda, conn_id, FALSE, reason, transport); } } memset(p_tcb, 0, sizeof(tGATT_TCB)); } - GATT_TRACE_DEBUG0 ("exit gatt_cleanup_upon_disc "); + GATT_TRACE_DEBUG ("exit gatt_cleanup_upon_disc "); } /******************************************************************************* ** @@ -2307,7 +2307,7 @@ void gatt_dbg_display_uuid(tBT_UUID bt_uuid) else BCM_STRNCPY_S(str_buf, sizeof(str_buf), "Unknown UUID 0", 15); - GATT_TRACE_DEBUG1 ("UUID=[%s]", str_buf); + GATT_TRACE_DEBUG ("UUID=[%s]", str_buf); } @@ -2413,7 +2413,7 @@ BOOLEAN gatt_add_bg_dev_list(tGATT_REG *p_reg, BD_ADDR bd_addr, BOOLEAN is_init { if (p_dev->gatt_if[i] == gatt_if) { - GATT_TRACE_ERROR0("device already in iniator white list"); + GATT_TRACE_ERROR("device already in iniator white list"); return TRUE; } else if (p_dev->gatt_if[i] == 0) @@ -2430,7 +2430,7 @@ BOOLEAN gatt_add_bg_dev_list(tGATT_REG *p_reg, BD_ADDR bd_addr, BOOLEAN is_init { if (p_dev->listen_gif[i] == gatt_if) { - GATT_TRACE_ERROR0("device already in adv white list"); + GATT_TRACE_ERROR("device already in adv white list"); return TRUE; } else if (p_dev->listen_gif[i] == 0) @@ -2452,7 +2452,7 @@ BOOLEAN gatt_add_bg_dev_list(tGATT_REG *p_reg, BD_ADDR bd_addr, BOOLEAN is_init } else { - GATT_TRACE_ERROR0("no device record available"); + GATT_TRACE_ERROR("no device record available"); } return ret; @@ -2693,11 +2693,11 @@ BOOLEAN gatt_update_auto_connect_dev (tGATT_IF gatt_if, BOOLEAN add, BD_ADDR bd_ tGATT_REG *p_reg; tGATT_TCB *p_tcb = gatt_find_tcb_by_addr(bd_addr, BT_TRANSPORT_LE); - GATT_TRACE_API0 ("gatt_update_auto_connect_dev "); + GATT_TRACE_API ("gatt_update_auto_connect_dev "); /* Make sure app is registered */ if ((p_reg = gatt_get_regcb(gatt_if)) == NULL) { - GATT_TRACE_ERROR1("gatt_update_auto_connect_dev - gatt_if is not registered", gatt_if); + GATT_TRACE_ERROR("gatt_update_auto_connect_dev - gatt_if is not registered", gatt_if); return(FALSE); } @@ -2733,10 +2733,10 @@ tGATT_PENDING_ENC_CLCB* gatt_add_pending_enc_channel_clcb(tGATT_TCB *p_tcb, tGAT { tGATT_PENDING_ENC_CLCB *p_buf; - GATT_TRACE_DEBUG0 ("gatt_add_pending_new_srv_start"); + GATT_TRACE_DEBUG ("gatt_add_pending_new_srv_start"); if ((p_buf = (tGATT_PENDING_ENC_CLCB *)GKI_getbuf((UINT16)sizeof(tGATT_PENDING_ENC_CLCB))) != NULL) { - GATT_TRACE_DEBUG0 ("enqueue a new pending encryption channel clcb"); + GATT_TRACE_DEBUG ("enqueue a new pending encryption channel clcb"); p_buf->p_clcb = p_clcb; GKI_enqueue (&p_tcb->pending_enc_clcb, p_buf); } diff --git a/stack/mcap/mca_api.c b/stack/mcap/mca_api.c index 1792f8cce..2a2ff8ca1 100644 --- a/stack/mcap/mca_api.c +++ b/stack/mcap/mca_api.c @@ -128,7 +128,7 @@ tMCA_HANDLE MCA_Register(tMCA_REG *p_reg, tMCA_CTRL_CBACK *p_cback) WC_ASSERT(p_reg != NULL ); WC_ASSERT(p_cback != NULL ); - MCA_TRACE_API2 ("MCA_Register: ctrl_psm:0x%x, data_psm:0x%x", p_reg->ctrl_psm, p_reg->data_psm); + MCA_TRACE_API ("MCA_Register: ctrl_psm:0x%x, data_psm:0x%x", p_reg->ctrl_psm, p_reg->data_psm); if ( (p_rcb = mca_rcb_alloc (p_reg)) != NULL) { @@ -136,7 +136,7 @@ tMCA_HANDLE MCA_Register(tMCA_REG *p_reg, tMCA_CTRL_CBACK *p_cback) { if (L2C_INVALID_PSM(p_reg->ctrl_psm) || L2C_INVALID_PSM(p_reg->data_psm)) { - MCA_TRACE_ERROR0 ("INVALID_PSM"); + MCA_TRACE_ERROR ("INVALID_PSM"); return 0; } @@ -161,7 +161,7 @@ tMCA_HANDLE MCA_Register(tMCA_REG *p_reg, tMCA_CTRL_CBACK *p_cback) } else { - MCA_TRACE_ERROR0 ("Failed to register to L2CAP"); + MCA_TRACE_ERROR ("Failed to register to L2CAP"); return 0; } } @@ -190,7 +190,7 @@ void MCA_Deregister(tMCA_HANDLE handle) { tMCA_RCB *p_rcb = mca_rcb_by_handle(handle); - MCA_TRACE_API1 ("MCA_Deregister: %d", handle); + MCA_TRACE_API ("MCA_Deregister: %d", handle); if (p_rcb && p_rcb->reg.ctrl_psm) { L2CA_Deregister(p_rcb->reg.ctrl_psm); @@ -225,12 +225,12 @@ tMCA_RESULT MCA_CreateDep(tMCA_HANDLE handle, tMCA_DEP *p_dep, tMCA_CS *p_cs) WC_ASSERT(p_cs != NULL ); WC_ASSERT(p_cs->p_data_cback != NULL ); - MCA_TRACE_API1 ("MCA_CreateDep: %d", handle); + MCA_TRACE_API ("MCA_CreateDep: %d", handle); if (p_rcb) { if (p_cs->max_mdl > MCA_NUM_MDLS) { - MCA_TRACE_ERROR1 ("max_mdl: %d is too big", p_cs->max_mdl ); + MCA_TRACE_ERROR ("max_mdl: %d is too big", p_cs->max_mdl ); result = MCA_BAD_PARAMS; } else @@ -240,7 +240,7 @@ tMCA_RESULT MCA_CreateDep(tMCA_HANDLE handle, tMCA_DEP *p_dep, tMCA_CS *p_cs) { if (p_depcs->p_data_cback) { - MCA_TRACE_ERROR0 ("Already has ECHO MDEP"); + MCA_TRACE_ERROR ("Already has ECHO MDEP"); return MCA_NO_RESOURCES; } memcpy (p_depcs, p_cs, sizeof (tMCA_CS)); @@ -292,7 +292,7 @@ tMCA_RESULT MCA_DeleteDep(tMCA_HANDLE handle, tMCA_DEP dep) int i, max; tMCA_CS *p_depcs; - MCA_TRACE_API2 ("MCA_DeleteDep: %d dep:%d", handle, dep); + MCA_TRACE_API ("MCA_DeleteDep: %d dep:%d", handle, dep); if (p_rcb) { if (dep < MCA_NUM_DEPS && p_rcb->dep[dep].p_data_cback) @@ -339,12 +339,12 @@ tMCA_RESULT MCA_ConnectReq(tMCA_HANDLE handle, BD_ADDR bd_addr, tMCA_CCB *p_ccb; tMCA_TC_TBL *p_tbl; - MCA_TRACE_API2 ("MCA_ConnectReq: %d psm:0x%x", handle, ctrl_psm); + MCA_TRACE_API ("MCA_ConnectReq: %d psm:0x%x", handle, ctrl_psm); if ((p_ccb = mca_ccb_by_bd(handle, bd_addr)) == NULL) p_ccb = mca_ccb_alloc(handle, bd_addr); else { - MCA_TRACE_ERROR0 ("control channel already exists"); + MCA_TRACE_ERROR ("control channel already exists"); return MCA_BUSY; } @@ -393,7 +393,7 @@ tMCA_RESULT MCA_DisconnectReq(tMCA_CL mcl) tMCA_RESULT result = MCA_BAD_HANDLE; tMCA_CCB *p_ccb = mca_ccb_by_hdl(mcl); - MCA_TRACE_API1 ("MCA_DisconnectReq: %d ", mcl); + MCA_TRACE_API ("MCA_DisconnectReq: %d ", mcl); if (p_ccb) { result = MCA_SUCCESS; @@ -429,24 +429,24 @@ tMCA_RESULT MCA_CreateMdl(tMCA_CL mcl, tMCA_DEP dep, UINT16 data_psm, tMCA_CCB_MSG *p_evt_data; tMCA_DCB *p_dcb; - MCA_TRACE_API4 ("MCA_CreateMdl: %d dep=%d mdl_id=%d peer_dep_id=%d", mcl, dep, mdl_id, peer_dep_id); + MCA_TRACE_API ("MCA_CreateMdl: %d dep=%d mdl_id=%d peer_dep_id=%d", mcl, dep, mdl_id, peer_dep_id); if (p_ccb) { if (p_ccb->p_tx_req || p_ccb->p_rx_msg || p_ccb->cong) { - MCA_TRACE_ERROR0 ("pending req"); + MCA_TRACE_ERROR ("pending req"); return MCA_BUSY; } if ((peer_dep_id > MCA_MAX_MDEP_ID) || (!MCA_IS_VALID_MDL_ID(mdl_id))) { - MCA_TRACE_ERROR2 ("bad peer dep id:%d or bad mdl id: %d ", peer_dep_id, mdl_id); + MCA_TRACE_ERROR ("bad peer dep id:%d or bad mdl id: %d ", peer_dep_id, mdl_id); return MCA_BAD_PARAMS; } if (mca_ccb_uses_mdl_id(p_ccb, mdl_id)) { - MCA_TRACE_ERROR1 ("mdl id: %d is used in the control link", mdl_id); + MCA_TRACE_ERROR ("mdl id: %d is used in the control link", mdl_id); return MCA_BAD_MDL_ID; } @@ -507,13 +507,13 @@ tMCA_RESULT MCA_CreateMdlRsp(tMCA_CL mcl, tMCA_DEP dep, tMCA_CCB_MSG evt_data; tMCA_DCB *p_dcb; - MCA_TRACE_API5 ("MCA_CreateMdlRsp: %d dep=%d mdl_id=%d cfg=%d rsp_code=%d", mcl, dep, mdl_id, cfg, rsp_code); + MCA_TRACE_API ("MCA_CreateMdlRsp: %d dep=%d mdl_id=%d cfg=%d rsp_code=%d", mcl, dep, mdl_id, cfg, rsp_code); WC_ASSERT(p_chnl_cfg != NULL ); if (p_ccb) { if (p_ccb->cong) { - MCA_TRACE_ERROR0 ("congested"); + MCA_TRACE_ERROR ("congested"); return MCA_BUSY; } if (p_ccb->p_rx_msg && (p_ccb->p_rx_msg->mdep_id == dep ) @@ -548,7 +548,7 @@ tMCA_RESULT MCA_CreateMdlRsp(tMCA_CL mcl, tMCA_DEP dep, } else { - MCA_TRACE_ERROR0 ("The given MCL is not expecting a MCA_CreateMdlRsp with the given parameters" ); + MCA_TRACE_ERROR ("The given MCL is not expecting a MCA_CreateMdlRsp with the given parameters" ); result = MCA_BAD_PARAMS; } } @@ -571,7 +571,7 @@ tMCA_RESULT MCA_CloseReq(tMCA_DL mdl) tMCA_RESULT result = MCA_BAD_HANDLE; tMCA_DCB *p_dcb = mca_dcb_by_hdl(mdl); - MCA_TRACE_API1 ("MCA_CloseReq: %d ", mdl); + MCA_TRACE_API ("MCA_CloseReq: %d ", mdl); if (p_dcb) { result = MCA_SUCCESS; @@ -604,25 +604,25 @@ tMCA_RESULT MCA_ReconnectMdl(tMCA_CL mcl, tMCA_DEP dep, UINT16 data_psm, tMCA_CCB_MSG *p_evt_data; tMCA_DCB *p_dcb; - MCA_TRACE_API1 ("MCA_ReconnectMdl: %d ", mcl); + MCA_TRACE_API ("MCA_ReconnectMdl: %d ", mcl); WC_ASSERT(p_chnl_cfg != NULL ); if (p_ccb) { if (p_ccb->p_tx_req || p_ccb->p_rx_msg || p_ccb->cong) { - MCA_TRACE_ERROR0 ("pending req"); + MCA_TRACE_ERROR ("pending req"); return MCA_BUSY; } if (!MCA_IS_VALID_MDL_ID(mdl_id)) { - MCA_TRACE_ERROR1 ("bad mdl id: %d ", mdl_id); + MCA_TRACE_ERROR ("bad mdl id: %d ", mdl_id); return MCA_BAD_PARAMS; } if (mca_ccb_uses_mdl_id(p_ccb, mdl_id)) { - MCA_TRACE_ERROR1 ("mdl id: %d is used in the control link", mdl_id); + MCA_TRACE_ERROR ("mdl id: %d is used in the control link", mdl_id); return MCA_BAD_MDL_ID; } @@ -673,13 +673,13 @@ tMCA_RESULT MCA_ReconnectMdlRsp(tMCA_CL mcl, tMCA_DEP dep, tMCA_CCB_MSG evt_data; tMCA_DCB *p_dcb; - MCA_TRACE_API1 ("MCA_ReconnectMdlRsp: %d ", mcl); + MCA_TRACE_API ("MCA_ReconnectMdlRsp: %d ", mcl); WC_ASSERT(p_chnl_cfg != NULL ); if (p_ccb) { if (p_ccb->cong) { - MCA_TRACE_ERROR0 ("congested"); + MCA_TRACE_ERROR ("congested"); return MCA_BUSY; } if (p_ccb->p_rx_msg && (p_ccb->p_rx_msg->mdl_id == mdl_id) && @@ -698,7 +698,7 @@ tMCA_RESULT MCA_ReconnectMdlRsp(tMCA_CL mcl, tMCA_DEP dep, } else { - MCA_TRACE_ERROR0 ("Out of MDL for this MDEP"); + MCA_TRACE_ERROR ("Out of MDL for this MDEP"); rsp_code = MCA_RSP_MDEP_BUSY; result = MCA_NO_RESOURCES; } @@ -711,7 +711,7 @@ tMCA_RESULT MCA_ReconnectMdlRsp(tMCA_CL mcl, tMCA_DEP dep, } else { - MCA_TRACE_ERROR0 ("The given MCL is not expecting a MCA_ReconnectMdlRsp with the given parameters" ); + MCA_TRACE_ERROR ("The given MCL is not expecting a MCA_ReconnectMdlRsp with the given parameters" ); result = MCA_BAD_PARAMS; } } @@ -738,7 +738,7 @@ tMCA_RESULT MCA_DataChnlCfg(tMCA_CL mcl, const tMCA_CHNL_CFG *p_chnl_cfg) tMCA_DCB *p_dcb; tMCA_TC_TBL *p_tbl; - MCA_TRACE_API1 ("MCA_DataChnlCfg: %d ", mcl); + MCA_TRACE_API ("MCA_DataChnlCfg: %d ", mcl); WC_ASSERT(p_chnl_cfg != NULL ); if (p_ccb) { @@ -746,7 +746,7 @@ tMCA_RESULT MCA_DataChnlCfg(tMCA_CL mcl, const tMCA_CHNL_CFG *p_chnl_cfg) if ((p_ccb->p_tx_req == NULL) || (p_ccb->status != MCA_CCB_STAT_PENDING) || ((p_dcb = mca_dcb_by_hdl(p_ccb->p_tx_req->dcb_idx)) == NULL)) { - MCA_TRACE_ERROR1 ("The given MCL is not expecting this API:%d", p_ccb->status); + MCA_TRACE_ERROR ("The given MCL is not expecting this API:%d", p_ccb->status); return result; } @@ -785,7 +785,7 @@ tMCA_RESULT MCA_Abort(tMCA_CL mcl) tMCA_CCB_MSG *p_evt_data; tMCA_DCB *p_dcb; - MCA_TRACE_API1 ("MCA_Abort: %d", mcl); + MCA_TRACE_API ("MCA_Abort: %d", mcl); if (p_ccb) { result = MCA_NO_RESOURCES; @@ -793,13 +793,13 @@ tMCA_RESULT MCA_Abort(tMCA_CL mcl) if ((p_ccb->p_tx_req == NULL) || (p_ccb->status != MCA_CCB_STAT_PENDING) || ((p_dcb = mca_dcb_by_hdl(p_ccb->p_tx_req->dcb_idx)) == NULL)) { - MCA_TRACE_ERROR1 ("The given MCL is not expecting this API:%d", p_ccb->status); + MCA_TRACE_ERROR ("The given MCL is not expecting this API:%d", p_ccb->status); return result; } if (p_ccb->cong) { - MCA_TRACE_ERROR0 ("congested"); + MCA_TRACE_ERROR ("congested"); return MCA_BUSY; } @@ -834,17 +834,17 @@ tMCA_RESULT MCA_Delete(tMCA_CL mcl, UINT16 mdl_id) tMCA_CCB *p_ccb = mca_ccb_by_hdl(mcl); tMCA_CCB_MSG *p_evt_data; - MCA_TRACE_API1 ("MCA_Delete: %d ", mcl); + MCA_TRACE_API ("MCA_Delete: %d ", mcl); if (p_ccb) { if (p_ccb->cong) { - MCA_TRACE_ERROR0 ("congested"); + MCA_TRACE_ERROR ("congested"); return MCA_BUSY; } if (!MCA_IS_VALID_MDL_ID(mdl_id) && (mdl_id != MCA_ALL_MDL_ID)) { - MCA_TRACE_ERROR1 ("bad mdl id: %d ", mdl_id); + MCA_TRACE_ERROR ("bad mdl id: %d ", mdl_id); return MCA_BAD_PARAMS; } p_evt_data = (tMCA_CCB_MSG *)GKI_getbuf (sizeof(tMCA_CCB_MSG)); @@ -886,7 +886,7 @@ tMCA_RESULT MCA_WriteReq(tMCA_DL mdl, BT_HDR *p_pkt) tMCA_DCB *p_dcb = mca_dcb_by_hdl(mdl); tMCA_DCB_EVT evt_data; - MCA_TRACE_API1 ("MCA_WriteReq: %d ", mdl); + MCA_TRACE_API ("MCA_WriteReq: %d ", mdl); if (p_dcb) { if (p_dcb->cong) @@ -917,7 +917,7 @@ UINT16 MCA_GetL2CapChannel (tMCA_DL mdl) UINT16 lcid = 0; tMCA_DCB *p_dcb = mca_dcb_by_hdl(mdl); - MCA_TRACE_API1 ("MCA_GetL2CapChannel: %d ", mdl); + MCA_TRACE_API ("MCA_GetL2CapChannel: %d ", mdl); if (p_dcb) lcid = p_dcb->lcid; return lcid; diff --git a/stack/mcap/mca_cact.c b/stack/mcap/mca_cact.c index 16a8cecdb..bab3c76db 100644 --- a/stack/mcap/mca_cact.c +++ b/stack/mcap/mca_cact.c @@ -101,7 +101,7 @@ void mca_ccb_snd_req(tMCA_CCB *p_ccb, tMCA_CCB_EVT *p_data) BOOLEAN is_abort = FALSE; tMCA_DCB *p_dcb; - MCA_TRACE_DEBUG2 ("mca_ccb_snd_req cong=%d req=%d", p_ccb->cong, p_msg->op_code); + MCA_TRACE_DEBUG ("mca_ccb_snd_req cong=%d req=%d", p_ccb->cong, p_msg->op_code); /* check for abort request */ if ((p_ccb->status == MCA_CCB_STAT_PENDING) && (p_msg->op_code == MCA_OP_MDL_ABORT_REQ)) { @@ -144,7 +144,7 @@ void mca_ccb_snd_req(tMCA_CCB *p_ccb, tMCA_CCB_EVT *p_data) } else { - MCA_TRACE_WARNING0 ("dropping api req"); + MCA_TRACE_WARNING ("dropping api req"); GKI_freebuf (p_data); } } @@ -167,7 +167,7 @@ void mca_ccb_snd_rsp(tMCA_CCB *p_ccb, tMCA_CCB_EVT *p_data) BOOLEAN chk_mdl = FALSE; tMCA_DCB *p_dcb; - MCA_TRACE_DEBUG2 ("mca_ccb_snd_rsp cong=%d req=%d", p_ccb->cong, p_msg->op_code); + MCA_TRACE_DEBUG ("mca_ccb_snd_rsp cong=%d req=%d", p_ccb->cong, p_msg->op_code); /* assume that API functions verified the parameters */ p_pkt = (BT_HDR *)GKI_getbuf (MCA_CTRL_MTU); if (p_pkt) @@ -232,7 +232,7 @@ void mca_ccb_do_disconn (tMCA_CCB *p_ccb, tMCA_CCB_EVT *p_data) *******************************************************************************/ void mca_ccb_cong(tMCA_CCB *p_ccb, tMCA_CCB_EVT *p_data) { - MCA_TRACE_DEBUG2 ("mca_ccb_cong cong=%d/%d", p_ccb->cong, p_data->llcong); + MCA_TRACE_DEBUG ("mca_ccb_cong cong=%d/%d", p_ccb->cong, p_data->llcong); p_ccb->cong = p_data->llcong; if (!p_ccb->cong) { @@ -270,17 +270,17 @@ void mca_ccb_hdl_req(tMCA_CCB *p_ccb, tMCA_CCB_EVT *p_data) BOOLEAN check_req = FALSE; UINT8 reject_opcode; - MCA_TRACE_DEBUG1 ("mca_ccb_hdl_req status:%d", p_ccb->status); + MCA_TRACE_DEBUG ("mca_ccb_hdl_req status:%d", p_ccb->status); p_rx_msg = (tMCA_CCB_MSG *)p_pkt; p = (UINT8 *)(p_pkt + 1) + p_pkt->offset; evt_data.hdr.op_code = *p++; BE_STREAM_TO_UINT16 (evt_data.hdr.mdl_id, p); reject_opcode = evt_data.hdr.op_code+1; - MCA_TRACE_DEBUG1 ("received mdl id: %d ", evt_data.hdr.mdl_id); + MCA_TRACE_DEBUG ("received mdl id: %d ", evt_data.hdr.mdl_id); if (p_ccb->status == MCA_CCB_STAT_PENDING) { - MCA_TRACE_DEBUG0 ("received req inpending state"); + MCA_TRACE_DEBUG ("received req inpending state"); /* allow abort in pending state */ if ((p_ccb->status == MCA_CCB_STAT_PENDING) && (evt_data.hdr.op_code == MCA_OP_MDL_ABORT_REQ)) { @@ -299,17 +299,17 @@ void mca_ccb_hdl_req(tMCA_CCB *p_ccb, tMCA_CCB_EVT *p_data) } else if (p_ccb->p_rx_msg) { - MCA_TRACE_DEBUG0 ("still handling prev req"); + MCA_TRACE_DEBUG ("still handling prev req"); /* still holding previous message, reject this new one ?? */ } else if (p_ccb->p_tx_req) { - MCA_TRACE_DEBUG1 ("still waiting for a response ctrl_vpsm:0x%x", p_ccb->ctrl_vpsm); + MCA_TRACE_DEBUG ("still waiting for a response ctrl_vpsm:0x%x", p_ccb->ctrl_vpsm); /* sent a request; waiting for response */ if (p_ccb->ctrl_vpsm == 0) { - MCA_TRACE_DEBUG0 ("local is ACP. accept the cmd from INT"); + MCA_TRACE_DEBUG ("local is ACP. accept the cmd from INT"); /* local is acceptor, need to handle the request */ check_req = TRUE; reject_code = MCA_RSP_SUCCESS; @@ -366,12 +366,12 @@ void mca_ccb_hdl_req(tMCA_CCB *p_ccb, tMCA_CCB_EVT *p_data) p_rx_msg->mdep_id = evt_data.create_ind.dep_id; if (!mca_is_valid_dep_id(p_ccb->p_rcb, p_rx_msg->mdep_id)) { - MCA_TRACE_ERROR0 ("not a valid local mdep id"); + MCA_TRACE_ERROR ("not a valid local mdep id"); reject_code = MCA_RSP_BAD_MDEP; } else if (mca_ccb_uses_mdl_id(p_ccb, evt_data.hdr.mdl_id)) { - MCA_TRACE_DEBUG0 ("the mdl_id is currently used in the CL(create)"); + MCA_TRACE_DEBUG ("the mdl_id is currently used in the CL(create)"); mca_dcb_close_by_mdl_id(p_ccb, evt_data.hdr.mdl_id); } else @@ -379,7 +379,7 @@ void mca_ccb_hdl_req(tMCA_CCB *p_ccb, tMCA_CCB_EVT *p_data) /* check if this dep still have MDL available */ if (mca_dep_free_mdl(p_ccb, evt_data.create_ind.dep_id) == 0) { - MCA_TRACE_ERROR0 ("the mdep is currently using max_mdl"); + MCA_TRACE_ERROR ("the mdep is currently using max_mdl"); reject_code = MCA_RSP_MDEP_BUSY; } } @@ -388,7 +388,7 @@ void mca_ccb_hdl_req(tMCA_CCB *p_ccb, tMCA_CCB_EVT *p_data) case MCA_OP_MDL_RECONNECT_REQ: if (mca_ccb_uses_mdl_id(p_ccb, evt_data.hdr.mdl_id)) { - MCA_TRACE_ERROR0 ("the mdl_id is currently used in the CL(reconn)"); + MCA_TRACE_ERROR ("the mdl_id is currently used in the CL(reconn)"); reject_code = MCA_RSP_MDL_BUSY; } break; @@ -494,7 +494,7 @@ void mca_ccb_hdl_rsp(tMCA_CCB *p_ccb, tMCA_CCB_EVT *p_data) { if (evt_data.hdr.mdl_id != p_dcb->mdl_id) { - MCA_TRACE_ERROR2 ("peer's mdl_id=%d != our mdl_id=%d", evt_data.hdr.mdl_id, p_dcb->mdl_id); + MCA_TRACE_ERROR ("peer's mdl_id=%d != our mdl_id=%d", evt_data.hdr.mdl_id, p_dcb->mdl_id); /* change the response code to be an error */ if (evt_data.rsp.rsp_code == MCA_RSP_SUCCESS) { @@ -544,7 +544,7 @@ void mca_ccb_hdl_rsp(tMCA_CCB *p_ccb, tMCA_CCB_EVT *p_data) else { /* not expecting any response. drop it */ - MCA_TRACE_WARNING0 ("dropping received rsp (not expecting a response)"); + MCA_TRACE_WARNING ("dropping received rsp (not expecting a response)"); } GKI_freebuf (p_data); } diff --git a/stack/mcap/mca_csm.c b/stack/mcap/mca_csm.c index af43bef9d..0077f350d 100644 --- a/stack/mcap/mca_csm.c +++ b/stack/mcap/mca_csm.c @@ -190,9 +190,9 @@ void mca_ccb_event(tMCA_CCB *p_ccb, UINT8 event, tMCA_CCB_EVT *p_data) UINT8 action; #if (BT_TRACE_VERBOSE == TRUE) - MCA_TRACE_EVENT3("CCB ccb=%d event=%s state=%s", mca_ccb_to_hdl(p_ccb), mca_ccb_evt_str[event], mca_ccb_st_str[p_ccb->state]); + MCA_TRACE_EVENT("CCB ccb=%d event=%s state=%s", mca_ccb_to_hdl(p_ccb), mca_ccb_evt_str[event], mca_ccb_st_str[p_ccb->state]); #else - MCA_TRACE_EVENT3("CCB ccb=%d event=%d state=%d", mca_ccb_to_hdl(p_ccb), event, p_ccb->state); + MCA_TRACE_EVENT("CCB ccb=%d event=%d state=%d", mca_ccb_to_hdl(p_ccb), event, p_ccb->state); #endif /* look up the state table for the current state */ @@ -260,7 +260,7 @@ tMCA_CCB *mca_ccb_alloc(tMCA_HANDLE handle, BD_ADDR bd_addr) tMCA_CCB *p_ccb_tmp; int i; - MCA_TRACE_DEBUG1("mca_ccb_alloc handle:0x%x", handle); + MCA_TRACE_DEBUG("mca_ccb_alloc handle:0x%x", handle); if (p_rcb) { i = handle-1; @@ -295,7 +295,7 @@ void mca_ccb_dealloc(tMCA_CCB *p_ccb, tMCA_CCB_EVT *p_data) { tMCA_CTRL evt_data; - MCA_TRACE_DEBUG1("mca_ccb_dealloc ctrl_vpsm:0x%x", p_ccb->ctrl_vpsm); + MCA_TRACE_DEBUG("mca_ccb_dealloc ctrl_vpsm:0x%x", p_ccb->ctrl_vpsm); mca_dcb_close_by_mdl_id (p_ccb, MCA_ALL_MDL_ID); if (p_ccb->ctrl_vpsm) { diff --git a/stack/mcap/mca_dsm.c b/stack/mcap/mca_dsm.c index 255b5d4c3..8b57a695f 100644 --- a/stack/mcap/mca_dsm.c +++ b/stack/mcap/mca_dsm.c @@ -142,9 +142,9 @@ void mca_dcb_event(tMCA_DCB *p_dcb, UINT8 event, tMCA_DCB_EVT *p_data) if (p_dcb == NULL) return; #if (BT_TRACE_VERBOSE == TRUE) - MCA_TRACE_EVENT3("DCB dcb=%d event=%s state=%s", mca_dcb_to_hdl(p_dcb), mca_dcb_evt_str[event], mca_dcb_st_str[p_dcb->state]); + MCA_TRACE_EVENT("DCB dcb=%d event=%s state=%s", mca_dcb_to_hdl(p_dcb), mca_dcb_evt_str[event], mca_dcb_st_str[p_dcb->state]); #else - MCA_TRACE_EVENT3("DCB dcb=%d event=%d state=%d", mca_dcb_to_hdl(p_dcb), event, p_dcb->state); + MCA_TRACE_EVENT("DCB dcb=%d event=%d state=%d", mca_dcb_to_hdl(p_dcb), event, p_dcb->state); #endif /* look up the state table for the current state */ @@ -238,7 +238,7 @@ UINT8 mca_dep_free_mdl(tMCA_CCB *p_ccb, tMCA_DEP dep) else { max = 0; - MCA_TRACE_WARNING0("Invalid Dep ID"); + MCA_TRACE_WARNING("Invalid Dep ID"); } left = max - count; return left; @@ -259,7 +259,7 @@ void mca_dcb_dealloc(tMCA_DCB *p_dcb, tMCA_DCB_EVT *p_data) UINT8 event = MCA_CLOSE_IND_EVT; tMCA_CTRL evt_data; - MCA_TRACE_DEBUG0("mca_dcb_dealloc"); + MCA_TRACE_DEBUG("mca_dcb_dealloc"); mca_free_buf ((void **)&p_dcb->p_data); if (p_data) { @@ -325,7 +325,7 @@ void mca_dcb_close_by_mdl_id(tMCA_CCB*p_ccb, UINT16 mdl_id) tMCA_DCB *p_dcb; int i; - MCA_TRACE_DEBUG1("mca_dcb_close_by_mdl_id mdl_id=%d", mdl_id); + MCA_TRACE_DEBUG("mca_dcb_close_by_mdl_id mdl_id=%d", mdl_id); i = mca_ccb_to_hdl(p_ccb)-1; p_dcb = &mca_cb.dcb[i*MCA_NUM_MDLS]; for (i=0; i<MCA_NUM_MDLS; i++, p_dcb++) diff --git a/stack/mcap/mca_l2c.c b/stack/mcap/mca_l2c.c index d792bfcfc..fdd9d0936 100644 --- a/stack/mcap/mca_l2c.c +++ b/stack/mcap/mca_l2c.c @@ -78,11 +78,11 @@ static void mca_sec_check_complete_term (BD_ADDR bd_addr, tBT_TRANSPORT transpor UNUSED(transport); - MCA_TRACE_DEBUG1("mca_sec_check_complete_term res: %d", res); + MCA_TRACE_DEBUG("mca_sec_check_complete_term res: %d", res); if ( res == BTM_SUCCESS ) { - MCA_TRACE_DEBUG2 ("lcid:x%x id:x%x", p_tbl->lcid, p_tbl->id); + MCA_TRACE_DEBUG ("lcid:x%x id:x%x", p_tbl->lcid, p_tbl->id); /* Set the FCR options: control channel mandates ERTM */ ertm_info.preferred_mode = mca_l2c_fcr_opts_def.mode; ertm_info.allowed_modes = L2CAP_FCR_CHAN_OPT_ERTM; @@ -124,7 +124,7 @@ static void mca_sec_check_complete_orig (BD_ADDR bd_addr, tBT_TRANSPORT transpor UNUSED(bd_addr); UNUSED(transport); - MCA_TRACE_DEBUG1("mca_sec_check_complete_orig res: %d", res); + MCA_TRACE_DEBUG("mca_sec_check_complete_orig res: %d", res); if ( res == BTM_SUCCESS ) { @@ -160,7 +160,7 @@ void mca_l2c_cconn_ind_cback(BD_ADDR bd_addr, UINT16 lcid, UINT16 psm, UINT8 id) tL2CAP_ERTM_INFO ertm_info, *p_ertm_info = NULL; tL2CAP_CFG_INFO cfg; - MCA_TRACE_EVENT3 ("mca_l2c_cconn_ind_cback: lcid:x%x psm:x%x id:x%x", lcid, psm, id); + MCA_TRACE_EVENT ("mca_l2c_cconn_ind_cback: lcid:x%x psm:x%x id:x%x", lcid, psm, id); /* do we already have a control channel for this peer? */ if ((p_ccb = mca_ccb_by_bd(handle, bd_addr)) == NULL) @@ -237,7 +237,7 @@ void mca_l2c_dconn_ind_cback(BD_ADDR bd_addr, UINT16 lcid, UINT16 psm, UINT8 id) tL2CAP_ERTM_INFO *p_ertm_info = NULL, ertm_info; const tMCA_CHNL_CFG *p_chnl_cfg; - MCA_TRACE_EVENT2 ("mca_l2c_dconn_ind_cback: lcid:x%x psm:x%x ", lcid, psm); + MCA_TRACE_EVENT ("mca_l2c_dconn_ind_cback: lcid:x%x psm:x%x ", lcid, psm); if (((p_ccb = mca_ccb_by_bd(handle, bd_addr)) != NULL) && /* find the CCB */ (p_ccb->status == MCA_CCB_STAT_PENDING) && /* this CCB is expecting a MDL */ @@ -299,12 +299,12 @@ void mca_l2c_connect_cfm_cback(UINT16 lcid, UINT16 result) tL2CAP_CFG_INFO cfg; tMCA_CCB *p_ccb; - MCA_TRACE_DEBUG2("mca_l2c_connect_cfm_cback lcid: x%x, result: %d", + MCA_TRACE_DEBUG("mca_l2c_connect_cfm_cback lcid: x%x, result: %d", lcid, result); /* look up info for this channel */ if ((p_tbl = mca_tc_tbl_by_lcid(lcid)) != NULL) { - MCA_TRACE_DEBUG2("p_tbl state: %d, tcid: %d", p_tbl->state, p_tbl->tcid); + MCA_TRACE_DEBUG("p_tbl state: %d, tcid: %d", p_tbl->state, p_tbl->tcid); /* if in correct state */ if (p_tbl->state == MCA_TC_ST_CONN) { @@ -426,7 +426,7 @@ void mca_l2c_config_ind_cback(UINT16 lcid, tL2CAP_CFG_INFO *p_cfg) { p_tbl->peer_mtu = L2CAP_DEFAULT_MTU; } - MCA_TRACE_DEBUG3("peer_mtu: %d, lcid: x%x mtu_present:%d",p_tbl->peer_mtu, lcid, p_cfg->mtu_present); + MCA_TRACE_DEBUG("peer_mtu: %d, lcid: x%x mtu_present:%d",p_tbl->peer_mtu, lcid, p_cfg->mtu_present); /* send L2CAP configure response */ memset(p_cfg, 0, sizeof(tL2CAP_CFG_INFO)); @@ -463,7 +463,7 @@ void mca_l2c_disconnect_ind_cback(UINT16 lcid, BOOLEAN ack_needed) tMCA_TC_TBL *p_tbl; UINT16 reason = L2CAP_DISC_TIMEOUT; - MCA_TRACE_DEBUG2("mca_l2c_disconnect_ind_cback lcid: %d, ack_needed: %d", + MCA_TRACE_DEBUG("mca_l2c_disconnect_ind_cback lcid: %d, ack_needed: %d", lcid, ack_needed); /* look up info for this channel */ if ((p_tbl = mca_tc_tbl_by_lcid(lcid)) != NULL) @@ -495,7 +495,7 @@ void mca_l2c_disconnect_cfm_cback(UINT16 lcid, UINT16 result) { tMCA_TC_TBL *p_tbl; - MCA_TRACE_DEBUG2("mca_l2c_disconnect_cfm_cback lcid: x%x, result: %d", + MCA_TRACE_DEBUG("mca_l2c_disconnect_cfm_cback lcid: x%x, result: %d", lcid, result); /* look up info for this channel */ if ((p_tbl = mca_tc_tbl_by_lcid(lcid)) != NULL) diff --git a/stack/mcap/mca_main.c b/stack/mcap/mca_main.c index d09319df5..60b99d9da 100644 --- a/stack/mcap/mca_main.c +++ b/stack/mcap/mca_main.c @@ -145,7 +145,7 @@ tMCA_TC_TBL * mca_tc_tbl_calloc(tMCA_CCB *p_ccb) p_tbl->state = MCA_TC_ST_IDLE; p_tbl->lcid = p_ccb->lcid; mca_cb.tc.lcid_tbl[p_ccb->lcid - L2CAP_BASE_APPL_CID] = i; - MCA_TRACE_DEBUG1("mca_tc_tbl_calloc cb_idx: %d", p_tbl->cb_idx); + MCA_TRACE_DEBUG("mca_tc_tbl_calloc cb_idx: %d", p_tbl->cb_idx); return p_tbl; } @@ -186,7 +186,7 @@ tMCA_TC_TBL * mca_tc_tbl_dalloc(tMCA_DCB *p_dcb) p_tbl->state = MCA_TC_ST_IDLE; p_tbl->lcid = p_dcb->lcid; mca_cb.tc.lcid_tbl[p_dcb->lcid - L2CAP_BASE_APPL_CID] = i; - MCA_TRACE_DEBUG2("mca_tc_tbl_dalloc tcid: %d, cb_idx: %d", p_tbl->tcid, p_tbl->cb_idx); + MCA_TRACE_DEBUG("mca_tc_tbl_dalloc tcid: %d, cb_idx: %d", p_tbl->tcid, p_tbl->cb_idx); return p_tbl; } @@ -303,7 +303,7 @@ void mca_tc_close_ind(tMCA_TC_TBL *p_tbl, UINT16 reason) close.reason = reason; close.lcid = p_tbl->lcid; - MCA_TRACE_DEBUG3("mca_tc_close_ind tcid: %d, cb_idx:%d, old: %d", + MCA_TRACE_DEBUG("mca_tc_close_ind tcid: %d, cb_idx:%d, old: %d", p_tbl->tcid, p_tbl->cb_idx, p_tbl->state); /* Check if the transport channel is in use */ @@ -352,7 +352,7 @@ void mca_tc_open_ind(tMCA_TC_TBL *p_tbl) tMCA_DCB *p_dcb; tMCA_OPEN open; - MCA_TRACE_DEBUG2("mca_tc_open_ind tcid: %d, cb_idx: %d", p_tbl->tcid, p_tbl->cb_idx); + MCA_TRACE_DEBUG("mca_tc_open_ind tcid: %d, cb_idx: %d", p_tbl->tcid, p_tbl->cb_idx); p_tbl->state = MCA_TC_ST_OPEN; open.peer_mtu = p_tbl->peer_mtu; @@ -406,7 +406,7 @@ void mca_tc_cong_ind(tMCA_TC_TBL *p_tbl, BOOLEAN is_congested) tMCA_CCB *p_ccb; tMCA_DCB *p_dcb; - MCA_TRACE_DEBUG2("mca_tc_cong_ind tcid: %d, cb_idx: %d", p_tbl->tcid, p_tbl->cb_idx); + MCA_TRACE_DEBUG("mca_tc_cong_ind tcid: %d, cb_idx: %d", p_tbl->tcid, p_tbl->cb_idx); /* if control channel, notify ccb of congestion */ if (p_tbl->tcid == MCA_CTRL_TCID) { @@ -445,7 +445,7 @@ void mca_tc_data_ind(tMCA_TC_TBL *p_tbl, BT_HDR *p_buf) UINT8 *p; UINT8 rej_rsp_code = MCA_RSP_SUCCESS; - MCA_TRACE_DEBUG2("mca_tc_data_ind tcid: %d, cb_idx: %d", p_tbl->tcid, p_tbl->cb_idx); + MCA_TRACE_DEBUG("mca_tc_data_ind tcid: %d, cb_idx: %d", p_tbl->tcid, p_tbl->cb_idx); /* if control channel, handle control message */ @@ -463,19 +463,19 @@ void mca_tc_data_ind(tMCA_TC_TBL *p_tbl, BT_HDR *p_buf) { if (p_buf->len != mca_std_msg_len[*p]) { - MCA_TRACE_ERROR3 ("opcode: %d required len:%d, got len:%d", *p, mca_std_msg_len[*p], p_buf->len); + MCA_TRACE_ERROR ("opcode: %d required len:%d, got len:%d", *p, mca_std_msg_len[*p], p_buf->len); rej_rsp_code = MCA_RSP_BAD_PARAM; } } else if ((*p >= MCA_FIRST_SYNC_OP) && (*p <= MCA_LAST_SYNC_OP)) { - MCA_TRACE_ERROR2 ("unsupported SYNC opcode: %d len:%d", *p, p_buf->len); + MCA_TRACE_ERROR ("unsupported SYNC opcode: %d len:%d", *p, p_buf->len); /* reject unsupported request */ rej_rsp_code = MCA_RSP_NO_SUPPORT; } else { - MCA_TRACE_ERROR2 ("bad opcode: %d len:%d", *p, p_buf->len); + MCA_TRACE_ERROR ("bad opcode: %d len:%d", *p, p_buf->len); /* reject unsupported request */ rej_rsp_code = MCA_RSP_BAD_OPCODE; } @@ -563,7 +563,7 @@ void mca_rcb_dealloc(tMCA_HANDLE handle) if (done) { memset (p_rcb, 0, sizeof(tMCA_RCB)); - MCA_TRACE_DEBUG1("Reset MCA_RCB index=%d",handle); + MCA_TRACE_DEBUG("Reset MCA_RCB index=%d",handle); } } } diff --git a/stack/smp/smp_act.c b/stack/smp/smp_act.c index 7543eb7c6..1f1eb6e61 100644 --- a/stack/smp/smp_act.c +++ b/stack/smp/smp_act.c @@ -58,8 +58,8 @@ const tSMP_ACT smp_distribute_act [] = *******************************************************************************/ static void smp_update_key_mask (tSMP_CB *p_cb, UINT8 key_type, BOOLEAN recv) { - SMP_TRACE_DEBUG0 ("smp_update_key_mask "); - SMP_TRACE_DEBUG4("before update role=%d recv=%d loc_i_key = %02x, loc_r_key = %02x", p_cb->role, recv, p_cb->loc_i_key, p_cb->loc_r_key); + SMP_TRACE_DEBUG ("smp_update_key_mask "); + SMP_TRACE_DEBUG("before update role=%d recv=%d loc_i_key = %02x, loc_r_key = %02x", p_cb->role, recv, p_cb->loc_i_key, p_cb->loc_r_key); if (p_cb->role == HCI_ROLE_SLAVE) { if (recv) @@ -75,7 +75,7 @@ static void smp_update_key_mask (tSMP_CB *p_cb, UINT8 key_type, BOOLEAN recv) p_cb->loc_i_key &= ~key_type; } - SMP_TRACE_DEBUG2("updated loc_i_key = %02x, loc_r_key = %02x", p_cb->loc_i_key, p_cb->loc_r_key); + SMP_TRACE_DEBUG("updated loc_i_key = %02x, loc_r_key = %02x", p_cb->loc_i_key, p_cb->loc_r_key); } /******************************************************************************* ** Function smp_io_cap_req @@ -87,7 +87,7 @@ void smp_send_app_cback(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) tSMP_STATUS callback_rc; UNUSED(p_data); - SMP_TRACE_DEBUG1 ("smp_send_app_cback p_cb->cb_evt=%d", p_cb->cb_evt ); + SMP_TRACE_DEBUG ("smp_send_app_cback p_cb->cb_evt=%d", p_cb->cb_evt ); if (p_cb->p_callback && p_cb->cb_evt != 0) { if (p_cb->cb_evt == SMP_IO_CAP_REQ_EVT) @@ -99,11 +99,11 @@ void smp_send_app_cback(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) cb_data.io_req.init_keys = p_cb->loc_i_key ; cb_data.io_req.resp_keys = p_cb->loc_r_key ; - SMP_TRACE_WARNING1( "io_cap = %d",cb_data.io_req.io_cap); + SMP_TRACE_WARNING( "io_cap = %d",cb_data.io_req.io_cap); } callback_rc = (*p_cb->p_callback)(p_cb->cb_evt, p_cb->pairing_bda, &cb_data); - SMP_TRACE_DEBUG2 ("callback_rc=%d p_cb->cb_evt=%d",callback_rc, p_cb->cb_evt ); + SMP_TRACE_DEBUG ("callback_rc=%d p_cb->cb_evt=%d",callback_rc, p_cb->cb_evt ); if (callback_rc == SMP_SUCCESS && p_cb->cb_evt == SMP_IO_CAP_REQ_EVT) { @@ -121,7 +121,7 @@ void smp_send_app_cback(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) p_cb->loc_i_key = cb_data.io_req.init_keys; p_cb->loc_r_key = cb_data.io_req.resp_keys; - SMP_TRACE_WARNING2( "new io_cap = %d p_cb->loc_enc_size = %d",p_cb->loc_io_caps, p_cb->loc_enc_size); + SMP_TRACE_WARNING( "new io_cap = %d p_cb->loc_enc_size = %d",p_cb->loc_io_caps, p_cb->loc_enc_size); smp_sm_event(p_cb, SMP_IO_RSP_EVT, NULL); } @@ -132,7 +132,7 @@ void smp_send_app_cback(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) p_cb->discard_sec_req = FALSE; smp_sm_event(p_cb, SMP_DISCARD_SEC_REQ_EVT, NULL); } - SMP_TRACE_DEBUG0 ("smp_send_app_cback return"); + SMP_TRACE_DEBUG ("smp_send_app_cback return"); } /******************************************************************************* ** Function smp_send_pair_fail @@ -143,7 +143,7 @@ void smp_send_pair_fail(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) p_cb->status = *(UINT8 *)p_data; p_cb->failure = *(UINT8 *)p_data; - SMP_TRACE_DEBUG2 ("smp_send_pair_fail status=%d failure=%d ",p_cb->status, p_cb->failure); + SMP_TRACE_DEBUG ("smp_send_pair_fail status=%d failure=%d ",p_cb->status, p_cb->failure); if (p_cb->status <= SMP_REPEATED_ATTEMPTS && p_cb->status != SMP_SUCCESS) { @@ -160,7 +160,7 @@ void smp_send_pair_req(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) tBTM_SEC_DEV_REC *p_dev_rec = btm_find_dev (p_cb->pairing_bda); UNUSED(p_data); - SMP_TRACE_DEBUG0 ("smp_send_pair_req "); + SMP_TRACE_DEBUG ("smp_send_pair_req "); #if BLE_INCLUDED == TRUE /* Disable L2CAP connection parameter updates while bonding since @@ -169,7 +169,7 @@ void smp_send_pair_req(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) get enabled again once service discovery completes. */ if (L2CA_EnableUpdateBleConnParams(p_cb->pairing_bda, FALSE) == FALSE) { - SMP_TRACE_ERROR0 ("smp pair failed...!"); + SMP_TRACE_ERROR ("smp pair failed...!"); return; } #endif @@ -189,7 +189,7 @@ void smp_send_pair_rsp(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) { UNUSED(p_data); - SMP_TRACE_DEBUG0 ("smp_send_pair_rsp "); + SMP_TRACE_DEBUG ("smp_send_pair_rsp "); p_cb->loc_i_key &= p_cb->peer_i_key; p_cb->loc_r_key &= p_cb->peer_r_key; @@ -208,7 +208,7 @@ void smp_send_confirm(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) { UNUSED(p_data); - SMP_TRACE_DEBUG0 ("smp_send_confirm "); + SMP_TRACE_DEBUG ("smp_send_confirm "); smp_send_cmd(SMP_OPCODE_CONFIRM, p_cb); } /******************************************************************************* @@ -219,12 +219,12 @@ void smp_send_init(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) { UNUSED(p_data); - SMP_TRACE_DEBUG0 ("smp_send_init "); + SMP_TRACE_DEBUG ("smp_send_init "); #if SMP_CONFORMANCE_TESTING == TRUE if (p_cb->enable_test_rand_val) { - SMP_TRACE_DEBUG0 ("Use rand value from script"); + SMP_TRACE_DEBUG ("Use rand value from script"); memcpy(p_cb->rand, p_cb->test_rand, BT_OCTET16_LEN); } #endif @@ -240,7 +240,7 @@ void smp_send_enc_info(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) tBTM_LE_LENC_KEYS le_key; UNUSED(p_data); - SMP_TRACE_DEBUG1 ("smp_send_enc_info p_cb->loc_enc_size = %d", p_cb->loc_enc_size); + SMP_TRACE_DEBUG ("smp_send_enc_info p_cb->loc_enc_size = %d", p_cb->loc_enc_size); smp_update_key_mask (p_cb, SMP_SEC_KEY_TYPE_ENC, FALSE); smp_send_cmd(SMP_OPCODE_ENCRYPT_INFO, p_cb); @@ -252,7 +252,7 @@ void smp_send_enc_info(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) le_key.sec_level = p_cb->sec_level; btm_sec_save_le_key(p_cb->pairing_bda, BTM_LE_KEY_LENC, (tBTM_LE_KEY_VALUE *)&le_key, TRUE); - SMP_TRACE_WARNING0( "smp_send_enc_info"); + SMP_TRACE_WARNING( "smp_send_enc_info"); smp_key_distribution(p_cb, NULL); } @@ -264,13 +264,13 @@ void smp_send_id_info(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) { UNUSED(p_data); - SMP_TRACE_DEBUG0 ("smp_send_id_info "); + SMP_TRACE_DEBUG ("smp_send_id_info "); smp_update_key_mask (p_cb, SMP_SEC_KEY_TYPE_ID, FALSE); smp_send_cmd(SMP_OPCODE_IDENTITY_INFO, p_cb); smp_send_cmd(SMP_OPCODE_ID_ADDR, p_cb); - SMP_TRACE_WARNING0( "smp_send_id_info"); + SMP_TRACE_WARNING( "smp_send_id_info"); smp_key_distribution(p_cb, NULL); } @@ -283,7 +283,7 @@ void smp_send_csrk_info(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) tBTM_LE_KEY_VALUE key; UNUSED(p_data); - SMP_TRACE_DEBUG0 ("smp_send_csrk_info "); + SMP_TRACE_DEBUG ("smp_send_csrk_info "); smp_update_key_mask (p_cb, SMP_SEC_KEY_TYPE_CSRK, FALSE); if (smp_send_cmd(SMP_OPCODE_SIGN_INFO, p_cb)) @@ -303,7 +303,7 @@ void smp_send_csrk_info(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) *******************************************************************************/ void smp_send_ltk_reply(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) { - SMP_TRACE_DEBUG0 ("smp_send_ltk_reply "); + SMP_TRACE_DEBUG ("smp_send_ltk_reply "); /* send stk as LTK response */ btm_ble_ltk_request_reply(p_cb->pairing_bda, TRUE, p_data->key.p_data); } @@ -317,24 +317,24 @@ void smp_proc_sec_req(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) tBTM_BLE_SEC_REQ_ACT sec_req_act; - SMP_TRACE_DEBUG1 ("smp_proc_sec_req auth_req=0x%x",auth_req); + SMP_TRACE_DEBUG ("smp_proc_sec_req auth_req=0x%x",auth_req); p_cb->cb_evt = 0; btm_ble_link_sec_check(p_cb->pairing_bda, auth_req, &sec_req_act); - SMP_TRACE_DEBUG1 ("smp_proc_sec_req sec_req_act=0x%x",sec_req_act); + SMP_TRACE_DEBUG ("smp_proc_sec_req sec_req_act=0x%x",sec_req_act); switch (sec_req_act) { case BTM_BLE_SEC_REQ_ACT_ENCRYPT: - SMP_TRACE_DEBUG0 ("smp_proc_sec_req BTM_BLE_SEC_REQ_ACT_ENCRYPT"); + SMP_TRACE_DEBUG ("smp_proc_sec_req BTM_BLE_SEC_REQ_ACT_ENCRYPT"); smp_sm_event(p_cb, SMP_ENC_REQ_EVT, NULL); break; case BTM_BLE_SEC_REQ_ACT_PAIR: /* initialize local i/r key to be default keys */ - SMP_TRACE_DEBUG0 ("smp_proc_sec_req BTM_BLE_SEC_REQ_ACT_PAIR"); + SMP_TRACE_DEBUG ("smp_proc_sec_req BTM_BLE_SEC_REQ_ACT_PAIR"); p_cb->peer_auth_req = auth_req; p_cb->loc_r_key = p_cb->loc_i_key = SMP_SEC_DEFAULT_KEY ; p_cb->cb_evt = SMP_SEC_REQUEST_EVT; @@ -356,7 +356,7 @@ void smp_proc_sec_req(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) void smp_proc_sec_grant(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) { UINT8 res= *(UINT8 *)p_data; - SMP_TRACE_DEBUG0 ("smp_proc_sec_grant "); + SMP_TRACE_DEBUG ("smp_proc_sec_grant "); if (res != SMP_SUCCESS) { smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, p_data); @@ -373,7 +373,7 @@ void smp_proc_sec_grant(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) *******************************************************************************/ void smp_proc_pair_fail(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) { - SMP_TRACE_DEBUG0 ("smp_proc_pair_fail "); + SMP_TRACE_DEBUG ("smp_proc_pair_fail "); p_cb->status = *(UINT8 *)p_data; } /******************************************************************************* @@ -386,7 +386,7 @@ void smp_proc_pair_cmd(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) UINT8 reason = SMP_ENC_KEY_SIZE; tBTM_SEC_DEV_REC *p_dev_rec = btm_find_dev (p_cb->pairing_bda); - SMP_TRACE_DEBUG0 ("smp_proc_pair_cmd "); + SMP_TRACE_DEBUG ("smp_proc_pair_cmd "); /* erase all keys if it is slave proc pairing req*/ if (p_dev_rec && (p_cb->role == HCI_ROLE_SLAVE)) btm_sec_clear_ble_keys(p_dev_rec); @@ -403,7 +403,7 @@ void smp_proc_pair_cmd(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) #if SMP_CONFORMANCE_TESTING == TRUE if (p_cb->enable_test_pair_fail) { - SMP_TRACE_DEBUG0 ("Forced pair fair"); + SMP_TRACE_DEBUG ("Forced pair fair"); if (p_cb->peer_enc_size < SMP_MIN_ENC_KEY_SIZE) { smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &reason); @@ -445,7 +445,7 @@ void smp_proc_confirm(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) { UINT8 *p = (UINT8 *)p_data; - SMP_TRACE_DEBUG0 ("smp_proc_confirm "); + SMP_TRACE_DEBUG ("smp_proc_confirm "); if (p != NULL) { /* save the SConfirm for comparison later */ @@ -462,7 +462,7 @@ void smp_proc_confirm(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) void smp_proc_init(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) { UINT8 *p = (UINT8 *)p_data; - SMP_TRACE_DEBUG0 ("smp_proc_init "); + SMP_TRACE_DEBUG ("smp_proc_init "); /* save the SRand for comparison */ STREAM_TO_ARRAY(p_cb->rrand, p, BT_OCTET16_LEN); @@ -475,7 +475,7 @@ void smp_proc_enc_info(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) { UINT8 *p = (UINT8 *)p_data; - SMP_TRACE_DEBUG0 ("smp_proc_enc_info "); + SMP_TRACE_DEBUG ("smp_proc_enc_info "); STREAM_TO_ARRAY(p_cb->ltk, p, BT_OCTET16_LEN); smp_key_distribution(p_cb, NULL); @@ -489,7 +489,7 @@ void smp_proc_master_id(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) UINT8 *p = (UINT8 *)p_data; tBTM_LE_PENC_KEYS le_key; - SMP_TRACE_DEBUG0 (" smp_proc_master_id"); + SMP_TRACE_DEBUG (" smp_proc_master_id"); smp_update_key_mask (p_cb, SMP_SEC_KEY_TYPE_ENC, TRUE); STREAM_TO_UINT16(le_key.ediv, p); @@ -511,7 +511,7 @@ void smp_proc_id_info(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) { UINT8 *p = (UINT8 *)p_data; - SMP_TRACE_DEBUG0 ("smp_proc_id_info "); + SMP_TRACE_DEBUG ("smp_proc_id_info "); STREAM_TO_ARRAY (p_cb->tk, p, BT_OCTET16_LEN); /* reuse TK for IRK */ smp_key_distribution(p_cb, NULL); @@ -525,7 +525,7 @@ void smp_proc_id_addr(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) UINT8 *p = (UINT8 *)p_data; tBTM_LE_PID_KEYS pid_key; - SMP_TRACE_DEBUG0 ("smp_proc_id_addr "); + SMP_TRACE_DEBUG ("smp_proc_id_addr "); smp_update_key_mask (p_cb, SMP_SEC_KEY_TYPE_ID, TRUE); STREAM_TO_UINT8(pid_key.addr_type, p); @@ -545,7 +545,7 @@ void smp_proc_srk_info(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) { tBTM_LE_PCSRK_KEYS le_key; - SMP_TRACE_DEBUG0 ("smp_proc_srk_info "); + SMP_TRACE_DEBUG ("smp_proc_srk_info "); smp_update_key_mask (p_cb, SMP_SEC_KEY_TYPE_CSRK, TRUE); /* save CSRK to security record */ @@ -565,7 +565,7 @@ void smp_proc_compare(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) { UINT8 reason; - SMP_TRACE_DEBUG0 ("smp_proc_compare "); + SMP_TRACE_DEBUG ("smp_proc_compare "); if ( #if SMP_CONFORMANCE_TESTING == TRUE p_cb->skip_test_compare_check || @@ -602,7 +602,7 @@ void smp_proc_sl_key(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) { UINT8 key_type = p_data->key.key_type; - SMP_TRACE_DEBUG0 ("smp_proc_sl_keysmp_proc_sl_key "); + SMP_TRACE_DEBUG ("smp_proc_sl_keysmp_proc_sl_key "); if (key_type == SMP_KEY_TYPE_TK) { smp_generate_confirm(p_cb, NULL); @@ -625,7 +625,7 @@ void smp_start_enc(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) tBTM_STATUS cmd; UINT8 reason = SMP_ENC_FAIL; - SMP_TRACE_DEBUG0 ("smp_start_enc "); + SMP_TRACE_DEBUG ("smp_start_enc "); if (p_data != NULL) cmd = btm_ble_start_encrypt(p_cb->pairing_bda, TRUE, p_data->key.p_data); else @@ -644,7 +644,7 @@ void smp_proc_discard(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) { UNUSED(p_data); - SMP_TRACE_DEBUG0 ("smp_proc_discard "); + SMP_TRACE_DEBUG ("smp_proc_discard "); smp_reset_control_value(p_cb); } /******************************************************************************* @@ -655,7 +655,7 @@ void smp_proc_release_delay(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) { UNUSED(p_data); - SMP_TRACE_DEBUG0 ("smp_proc_release_delay "); + SMP_TRACE_DEBUG ("smp_proc_release_delay "); btu_stop_timer (&p_cb->rsp_timer_ent); btu_start_timer (&p_cb->rsp_timer_ent, BTU_TTYPE_SMP_PAIRING_CMD, SMP_WAIT_FOR_REL_DELAY_TOUT); @@ -669,7 +669,7 @@ void smp_proc_release_delay_tout(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) { UNUSED(p_data); - SMP_TRACE_DEBUG0 ("smp_proc_release_delay_tout "); + SMP_TRACE_DEBUG ("smp_proc_release_delay_tout "); btu_stop_timer (&p_cb->rsp_timer_ent); smp_proc_pairing_cmpl(p_cb); } @@ -684,7 +684,7 @@ void smp_enc_cmpl(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) UINT8 enc_enable = *(UINT8 *)p_data; UINT8 reason = enc_enable ? SMP_SUCCESS : SMP_ENC_FAIL; - SMP_TRACE_DEBUG0 ("smp_enc_cmpl "); + SMP_TRACE_DEBUG ("smp_enc_cmpl "); smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &reason); } @@ -698,7 +698,7 @@ void smp_check_auth_req(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) UINT8 enc_enable = *(UINT8 *)p_data; UINT8 reason = enc_enable ? SMP_SUCCESS : SMP_ENC_FAIL; - SMP_TRACE_DEBUG3 ("smp_check_auth_req enc_enable=%d i_keys=0x%x r_keys=0x%x (i-initiator r-responder)", + SMP_TRACE_DEBUG ("smp_check_auth_req enc_enable=%d i_keys=0x%x r_keys=0x%x (i-initiator r-responder)", enc_enable, p_cb->loc_i_key, p_cb->loc_r_key); if (enc_enable == 1) { @@ -734,14 +734,14 @@ void smp_key_pick_key(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) UINT8 key_to_dist = (p_cb->role == HCI_ROLE_SLAVE) ? p_cb->loc_r_key : p_cb->loc_i_key; UINT8 i = 0; - SMP_TRACE_DEBUG1 ("smp_key_pick_key key_to_dist=0x%x", key_to_dist); + SMP_TRACE_DEBUG ("smp_key_pick_key key_to_dist=0x%x", key_to_dist); while (i < MAX_KEY_DISTRIBUTION_TYPES) { - SMP_TRACE_DEBUG2("key to send = %02x, i = %d", key_to_dist, i); + SMP_TRACE_DEBUG("key to send = %02x, i = %d", key_to_dist, i); if (key_to_dist & (1 << i)) { - SMP_TRACE_DEBUG1 ("smp_distribute_act[%d]", i); + SMP_TRACE_DEBUG ("smp_distribute_act[%d]", i); (* smp_distribute_act[i])(p_cb, p_data); break; } @@ -755,7 +755,7 @@ void smp_key_pick_key(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) void smp_key_distribution(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) { UINT8 reason = SMP_SUCCESS; - SMP_TRACE_DEBUG3 ("smp_key_distribution role=%d (0-master) r_keys=0x%x i_keys=0x%x", + SMP_TRACE_DEBUG ("smp_key_distribution role=%d (0-master) r_keys=0x%x i_keys=0x%x", p_cb->role, p_cb->loc_r_key, p_cb->loc_i_key); if (p_cb->role == HCI_ROLE_SLAVE|| @@ -786,7 +786,7 @@ void smp_decide_asso_model(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) tSMP_INT_DATA *p = NULL; UNUSED(p_data); - SMP_TRACE_DEBUG3 ("smp_decide_asso_model p_cb->peer_io_caps = %d p_cb->loc_io_caps = %d \ + SMP_TRACE_DEBUG ("smp_decide_asso_model p_cb->peer_io_caps = %d p_cb->loc_io_caps = %d \ p_cb->peer_auth_req = %02x", p_cb->peer_io_caps, p_cb->loc_io_caps, p_cb->peer_auth_req); @@ -812,13 +812,13 @@ void smp_decide_asso_model(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) } } - SMP_TRACE_DEBUG1("Association Model = %d", model); + SMP_TRACE_DEBUG("Association Model = %d", model); if (model == SMP_MODEL_OOB) { - SMP_TRACE_ERROR0("Association Model = SMP_MODEL_OOB"); + SMP_TRACE_ERROR("Association Model = SMP_MODEL_OOB"); p_cb->sec_level = SMP_SEC_AUTHENTICATED; - SMP_TRACE_EVENT1 ("p_cb->sec_level =%d (SMP_SEC_AUTHENTICATED) ", p_cb->sec_level ); + SMP_TRACE_EVENT ("p_cb->sec_level =%d (SMP_SEC_AUTHENTICATED) ", p_cb->sec_level ); p_cb->cb_evt = SMP_OOB_REQ_EVT; int_evt = SMP_TK_REQ_EVT; @@ -826,7 +826,7 @@ void smp_decide_asso_model(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) else if (model == SMP_MODEL_PASSKEY) { p_cb->sec_level = SMP_SEC_AUTHENTICATED; - SMP_TRACE_EVENT1 ("p_cb->sec_level =%d (SMP_SEC_AUTHENTICATED) ", p_cb->sec_level ); + SMP_TRACE_EVENT ("p_cb->sec_level =%d (SMP_SEC_AUTHENTICATED) ", p_cb->sec_level ); p_cb->cb_evt = SMP_PASSKEY_REQ_EVT; int_evt = SMP_TK_REQ_EVT; @@ -835,7 +835,7 @@ void smp_decide_asso_model(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) { p_cb->sec_level = SMP_SEC_AUTHENTICATED; - SMP_TRACE_DEBUG0("Need to generate Passkey"); + SMP_TRACE_DEBUG("Need to generate Passkey"); /* generate passkey and notify application */ smp_generate_passkey(p_cb, NULL); } @@ -845,7 +845,7 @@ void smp_decide_asso_model(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) ((p_cb->peer_auth_req & SMP_AUTH_YN_BIT) != 0) && ((p_cb->loc_auth_req & SMP_AUTH_YN_BIT) == 0)) { - SMP_TRACE_ERROR0("IO capability does not meet authentication requirement"); + SMP_TRACE_ERROR("IO capability does not meet authentication requirement"); failure = SMP_PAIR_AUTH_FAIL; p = (tSMP_INT_DATA *)&failure; int_evt = SMP_AUTH_CMPL_EVT; @@ -853,7 +853,7 @@ void smp_decide_asso_model(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) else { p_cb->sec_level = SMP_SEC_UNAUTHENTICATE; - SMP_TRACE_EVENT1 ("p_cb->sec_level =%d (SMP_SEC_UNAUTHENTICATE) ", p_cb->sec_level ); + SMP_TRACE_EVENT ("p_cb->sec_level =%d (SMP_SEC_UNAUTHENTICATE) ", p_cb->sec_level ); key.key_type = SMP_KEY_TYPE_TK; key.p_data = p_cb->tk; @@ -866,12 +866,12 @@ void smp_decide_asso_model(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) } else if (model == SMP_MODEL_MAX) { - SMP_TRACE_ERROR0("Association Model = SMP_MODEL_MAX (failed)"); + SMP_TRACE_ERROR("Association Model = SMP_MODEL_MAX (failed)"); p = (tSMP_INT_DATA *)&failure; int_evt = SMP_AUTH_CMPL_EVT; } - SMP_TRACE_EVENT1 ("sec_level=%d ", p_cb->sec_level ); + SMP_TRACE_EVENT ("sec_level=%d ", p_cb->sec_level ); if (int_evt) smp_sm_event(p_cb, int_evt, p); } @@ -884,7 +884,7 @@ void smp_proc_io_rsp(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) { UNUSED(p_data); - SMP_TRACE_DEBUG0 ("smp_proc_io_rsp "); + SMP_TRACE_DEBUG ("smp_proc_io_rsp "); if (p_cb->flags & SMP_PAIR_FLAGS_WE_STARTED_DD) { smp_set_state(SMP_ST_SEC_REQ_PENDING); @@ -903,7 +903,7 @@ void smp_proc_io_rsp(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) void smp_pairing_cmpl(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) { - SMP_TRACE_DEBUG0 ("smp_pairing_cmpl "); + SMP_TRACE_DEBUG ("smp_pairing_cmpl "); (void)L2CA_EnableUpdateBleConnParams(p_cb->pairing_bda, TRUE); if ((p_cb->status == SMP_SUCCESS) || @@ -927,7 +927,7 @@ void smp_pair_terminate(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) { UNUSED(p_data); - SMP_TRACE_DEBUG0 ("smp_pair_terminate "); + SMP_TRACE_DEBUG ("smp_pair_terminate "); p_cb->status = SMP_CONN_TOUT; @@ -941,7 +941,7 @@ void smp_pair_terminate(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) *******************************************************************************/ void smp_delay_terminate(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) { - SMP_TRACE_DEBUG0 ("smp_delay_terminate "); + SMP_TRACE_DEBUG ("smp_delay_terminate "); btu_stop_timer (&p_cb->rsp_timer_ent); @@ -962,7 +962,7 @@ void smp_idle_terminate(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) UNUSED(p_data); if (p_cb->flags & SMP_PAIR_FLAGS_WE_STARTED_DD) { - SMP_TRACE_DEBUG0("Pairing terminated at IDLE state."); + SMP_TRACE_DEBUG("Pairing terminated at IDLE state."); p_cb->status = SMP_FAIL; smp_proc_pairing_cmpl(p_cb); } @@ -995,7 +995,7 @@ void smp_link_encrypted(BD_ADDR bda, UINT8 encr_enable) { tSMP_CB *p_cb = &smp_cb; - SMP_TRACE_DEBUG1 ("smp_link_encrypted encr_enable=%d",encr_enable); + SMP_TRACE_DEBUG ("smp_link_encrypted encr_enable=%d",encr_enable); if (memcmp(&smp_cb.pairing_bda[0], bda, BD_ADDR_LEN) == 0) { @@ -1022,7 +1022,7 @@ void smp_link_encrypted(BD_ADDR bda, UINT8 encr_enable) *******************************************************************************/ BOOLEAN smp_proc_ltk_request(BD_ADDR bda) { - SMP_TRACE_DEBUG1 ("smp_proc_ltk_request state = %d", smp_cb.state); + SMP_TRACE_DEBUG ("smp_proc_ltk_request state = %d", smp_cb.state); if ( smp_cb.state == SMP_ST_ENC_PENDING && !memcmp(bda, smp_cb.pairing_bda, BD_ADDR_LEN)) { diff --git a/stack/smp/smp_api.c b/stack/smp/smp_api.c index 3149b09f7..85d1054f4 100644 --- a/stack/smp/smp_api.c +++ b/stack/smp/smp_api.c @@ -49,7 +49,7 @@ void SMP_Init(void) { - SMP_TRACE_EVENT0 ("SMP_Init"); + SMP_TRACE_EVENT ("SMP_Init"); memset(&smp_cb, 0, sizeof(tSMP_CB)); #if defined(SMP_INITIAL_TRACE_LEVEL) @@ -102,11 +102,11 @@ SMP_API extern UINT8 SMP_SetTraceLevel (UINT8 new_level) *******************************************************************************/ BOOLEAN SMP_Register (tSMP_CALLBACK *p_cback) { - SMP_TRACE_EVENT1 ("SMP_Register state=%d", smp_cb.state); + SMP_TRACE_EVENT ("SMP_Register state=%d", smp_cb.state); if (smp_cb.p_callback != NULL) { - SMP_TRACE_ERROR0 ("SMP_Register: duplicate registration, overwrite it"); + SMP_TRACE_ERROR ("SMP_Register: duplicate registration, overwrite it"); } smp_cb.p_callback = p_cback; @@ -145,7 +145,7 @@ tSMP_STATUS SMP_Pair (BD_ADDR bd_addr) if (!L2CA_ConnectFixedChnl (L2CAP_SMP_CID, bd_addr)) { - SMP_TRACE_ERROR0("SMP_Pair: L2C connect fixed channel failed."); + SMP_TRACE_ERROR("SMP_Pair: L2C connect fixed channel failed."); smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &status); return status; } @@ -177,7 +177,7 @@ BOOLEAN SMP_PairCancel (BD_ADDR bd_addr) (!memcmp (p_cb->pairing_bda, bd_addr, BD_ADDR_LEN)) ) { p_cb->is_pair_cancel = TRUE; - SMP_TRACE_DEBUG0("Cancel Pairing: set fail reason Unknown"); + SMP_TRACE_DEBUG("Cancel Pairing: set fail reason Unknown"); smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &err_code); status = TRUE; } @@ -199,7 +199,7 @@ BOOLEAN SMP_PairCancel (BD_ADDR bd_addr) *******************************************************************************/ void SMP_SecurityGrant(BD_ADDR bd_addr, UINT8 res) { - SMP_TRACE_EVENT0 ("SMP_SecurityGrant "); + SMP_TRACE_EVENT ("SMP_SecurityGrant "); if (smp_cb.state != SMP_ST_WAIT_APP_RSP || smp_cb.cb_evt != SMP_SEC_REQUEST_EVT || memcmp (smp_cb.pairing_bda, bd_addr, BD_ADDR_LEN)) @@ -230,32 +230,32 @@ void SMP_PasskeyReply (BD_ADDR bd_addr, UINT8 res, UINT32 passkey) UINT8 failure = SMP_PASSKEY_ENTRY_FAIL; tBTM_SEC_DEV_REC *p_dev_rec; - SMP_TRACE_EVENT2 ("SMP_PasskeyReply: Key: %d Result:%d", + SMP_TRACE_EVENT ("SMP_PasskeyReply: Key: %d Result:%d", passkey, res); /* If timeout already expired or has been canceled, ignore the reply */ if (p_cb->cb_evt != SMP_PASSKEY_REQ_EVT) { - SMP_TRACE_WARNING1 ("SMP_PasskeyReply() - Wrong State: %d", p_cb->state); + SMP_TRACE_WARNING ("SMP_PasskeyReply() - Wrong State: %d", p_cb->state); return; } if (memcmp (bd_addr, p_cb->pairing_bda, BD_ADDR_LEN) != 0) { - SMP_TRACE_ERROR0 ("SMP_PasskeyReply() - Wrong BD Addr"); + SMP_TRACE_ERROR ("SMP_PasskeyReply() - Wrong BD Addr"); return; } if ((p_dev_rec = btm_find_dev (bd_addr)) == NULL) { - SMP_TRACE_ERROR0 ("SMP_PasskeyReply() - no dev CB"); + SMP_TRACE_ERROR ("SMP_PasskeyReply() - no dev CB"); return; } if (passkey > BTM_MAX_PASSKEY_VAL || res != SMP_SUCCESS) { - SMP_TRACE_WARNING1 ("SMP_PasskeyReply() - Wrong key len: %d or passkey entry fail", passkey); + SMP_TRACE_WARNING ("SMP_PasskeyReply() - Wrong key len: %d or passkey entry fail", passkey); /* send pairing failure */ smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &failure); @@ -287,7 +287,7 @@ void SMP_OobDataReply(BD_ADDR bd_addr, tSMP_STATUS res, UINT8 len, UINT8 *p_data tSMP_KEY key; UNUSED(bd_addr); - SMP_TRACE_EVENT2 ("SMP_OobDataReply State: %d res:%d", + SMP_TRACE_EVENT ("SMP_OobDataReply State: %d res:%d", smp_cb.state, res); /* If timeout already expired or has been canceled, ignore the reply */ diff --git a/stack/smp/smp_cmac.c b/stack/smp/smp_cmac.c index 44e776e26..138c6f1df 100644 --- a/stack/smp/smp_cmac.c +++ b/stack/smp/smp_cmac.c @@ -53,11 +53,11 @@ void print128(BT_OCTET16 x, const UINT8 *key_name) UINT8 *p = (UINT8 *)x; UINT8 i; - SMP_TRACE_WARNING1("%s(MSB ~ LSB) = ", key_name); + SMP_TRACE_WARNING("%s(MSB ~ LSB) = ", key_name); for (i = 0; i < 4; i ++) { - SMP_TRACE_WARNING4("%02x %02x %02x %02x", + SMP_TRACE_WARNING("%02x %02x %02x %02x", p[BT_OCTET16_LEN - i*4 -1], p[BT_OCTET16_LEN - i*4 -2], p[BT_OCTET16_LEN - i*4 -3], p[BT_OCTET16_LEN - i*4 -4]); } @@ -95,7 +95,7 @@ static void padding ( BT_OCTET16 dest, UINT8 length ) static void leftshift_onebit(UINT8 *input, UINT8 *output) { UINT8 i, overflow = 0 , next_overflow = 0; - SMP_TRACE_EVENT0 ("leftshift_onebit "); + SMP_TRACE_EVENT ("leftshift_onebit "); /* input[0] is LSB */ for ( i = 0; i < BT_OCTET16_LEN ; i ++ ) { @@ -139,7 +139,7 @@ static BOOLEAN cmac_aes_k_calculate(BT_OCTET16 key, UINT8 *p_signature, UINT16 t UINT8 x[16] = {0}; UINT8 *p_mac; - SMP_TRACE_EVENT0 ("cmac_aes_k_calculate "); + SMP_TRACE_EVENT ("cmac_aes_k_calculate "); while (i <= cmac_cb.round) { @@ -160,10 +160,10 @@ static BOOLEAN cmac_aes_k_calculate(BT_OCTET16 key, UINT8 *p_signature, UINT16 t p_mac = output.param_buf + (BT_OCTET16_LEN - tlen); memcpy(p_signature, p_mac, tlen); - SMP_TRACE_DEBUG2("tlen = %d p_mac = %d", tlen, p_mac); - SMP_TRACE_DEBUG4("p_mac[0] = 0x%02x p_mac[1] = 0x%02x p_mac[2] = 0x%02x p_mac[3] = 0x%02x", + SMP_TRACE_DEBUG("tlen = %d p_mac = %d", tlen, p_mac); + SMP_TRACE_DEBUG("p_mac[0] = 0x%02x p_mac[1] = 0x%02x p_mac[2] = 0x%02x p_mac[3] = 0x%02x", *p_mac, *(p_mac + 1), *(p_mac + 2), *(p_mac + 3)); - SMP_TRACE_DEBUG4("p_mac[4] = 0x%02x p_mac[5] = 0x%02x p_mac[6] = 0x%02x p_mac[7] = 0x%02x", + SMP_TRACE_DEBUG("p_mac[4] = 0x%02x p_mac[5] = 0x%02x p_mac[6] = 0x%02x p_mac[7] = 0x%02x", *(p_mac + 4), *(p_mac + 5), *(p_mac + 6), *(p_mac + 7)); return TRUE; @@ -187,11 +187,11 @@ static void cmac_prepare_last_block (BT_OCTET16 k1, BT_OCTET16 k2) // UINT8 x[16] = {0}; BOOLEAN flag; - SMP_TRACE_EVENT0 ("cmac_prepare_last_block "); + SMP_TRACE_EVENT ("cmac_prepare_last_block "); /* last block is a complete block set flag to 1 */ flag = ((cmac_cb.len % BT_OCTET16_LEN) == 0 && cmac_cb.len != 0) ? TRUE : FALSE; - SMP_TRACE_WARNING2("flag = %d round = %d", flag, cmac_cb.round); + SMP_TRACE_WARNING("flag = %d round = %d", flag, cmac_cb.round); if ( flag ) { /* last block is complete block */ @@ -217,7 +217,7 @@ static void cmac_subkey_cont(tSMP_ENC *p) { UINT8 k1[BT_OCTET16_LEN], k2[BT_OCTET16_LEN]; UINT8 *pp = p->param_buf; - SMP_TRACE_EVENT0 ("cmac_subkey_cont "); + SMP_TRACE_EVENT ("cmac_subkey_cont "); print128(pp, (const UINT8 *)"K1 before shift"); /* If MSB(L) = 0, then K1 = L << 1 */ @@ -265,7 +265,7 @@ static BOOLEAN cmac_generate_subkey(BT_OCTET16 key) BT_OCTET16 z = {0}; BOOLEAN ret = TRUE; tSMP_ENC output; - SMP_TRACE_EVENT0 (" cmac_generate_subkey"); + SMP_TRACE_EVENT (" cmac_generate_subkey"); if (SMP_Encrypt(key, BT_OCTET16_LEN, z, BT_OCTET16_LEN, &output)) { @@ -298,12 +298,12 @@ BOOLEAN AES_CMAC ( BT_OCTET16 key, UINT8 *input, UINT16 length, UINT16 n = (length + BT_OCTET16_LEN - 1) / BT_OCTET16_LEN; /* n is number of rounds */ BOOLEAN ret = FALSE; - SMP_TRACE_EVENT0 ("AES_CMAC "); + SMP_TRACE_EVENT ("AES_CMAC "); if (n == 0) n = 1; len = n * BT_OCTET16_LEN; - SMP_TRACE_WARNING1("AES128_CMAC started, allocate buffer size = %d", len); + SMP_TRACE_WARNING("AES128_CMAC started, allocate buffer size = %d", len); /* allocate a memory space of multiple of 16 bytes to hold text */ if ((cmac_cb.text = (UINT8 *)GKI_getbuf(len)) != NULL) { @@ -332,7 +332,7 @@ BOOLEAN AES_CMAC ( BT_OCTET16 key, UINT8 *input, UINT16 length, else { ret = FALSE; - SMP_TRACE_ERROR0("No resources"); + SMP_TRACE_ERROR("No resources"); } return ret; @@ -341,13 +341,13 @@ BOOLEAN AES_CMAC ( BT_OCTET16 key, UINT8 *input, UINT16 length, #if 0 /* testing code, sample data from spec */ void test_cmac_cback(UINT8 *p_mac, UINT16 tlen) { - SMP_TRACE_EVENT0 ("test_cmac_cback "); - SMP_TRACE_ERROR0("test_cmac_cback"); + SMP_TRACE_EVENT ("test_cmac_cback "); + SMP_TRACE_ERROR("test_cmac_cback"); } void test_cmac(void) { - SMP_TRACE_EVENT0 ("test_cmac "); + SMP_TRACE_EVENT ("test_cmac "); UINT8 M[64] = { 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a, @@ -378,7 +378,7 @@ void test_cmac(void) memset(&cmac_cb, 0, sizeof(tCMAC_CB)); - SMP_TRACE_WARNING1("\n Example 1: len = %d\n", len); + SMP_TRACE_WARNING("\n Example 1: len = %d\n", len); AES_CMAC(key, M, len, 128, test_cmac_cback, 0); diff --git a/stack/smp/smp_keys.c b/stack/smp/smp_keys.c index 5bf6c2e3c..891d7f868 100644 --- a/stack/smp/smp_keys.c +++ b/stack/smp/smp_keys.c @@ -81,7 +81,7 @@ static void smp_debug_print_nbyte_little_endian (UINT8 *p, const UINT8 *key_name { x += sprintf ((char *)&p_buf[x], "%02x ", p[i]); } - SMP_TRACE_WARNING2("%s(LSB ~ MSB) = %s", key_name, p_buf); + SMP_TRACE_WARNING("%s(LSB ~ MSB) = %s", key_name, p_buf); } #else #define smp_debug_print_nbyte_little_endian(p, key_name, len) @@ -107,7 +107,7 @@ BOOLEAN smp_encrypt_data (UINT8 *key, UINT8 key_len, UINT8 *p_rev_key = NULL; /* input key in big endilan format */ UINT8 *p_rev_output = NULL; /* encrypted output in big endilan format */ - SMP_TRACE_DEBUG0 ("smp_encrypt_data"); + SMP_TRACE_DEBUG ("smp_encrypt_data"); if ( (p_out == NULL ) || (key_len != SMP_ENCRYT_KEY_SIZE) ) { BTM_TRACE_ERROR ("smp_encrypt_data Failed"); @@ -164,7 +164,7 @@ void smp_generate_passkey(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) { UNUSED(p_data); - SMP_TRACE_DEBUG0 ("smp_generate_passkey"); + SMP_TRACE_DEBUG ("smp_generate_passkey"); p_cb->rand_enc_proc = SMP_GEN_TK; /* generate MRand or SRand */ @@ -187,14 +187,14 @@ void smp_proc_passkey(tSMP_CB *p_cb , tBTM_RAND_ENC *p) UINT32 passkey; /* 19655 test number; */ UINT8 *pp = p->param_buf; - SMP_TRACE_DEBUG0 ("smp_proc_passkey "); + SMP_TRACE_DEBUG ("smp_proc_passkey "); STREAM_TO_UINT32(passkey, pp); passkey &= ~SMP_PASSKEY_MASK; /* truncate by maximum value */ while (passkey > BTM_MAX_PASSKEY_VAL) passkey >>= 1; - SMP_TRACE_ERROR1("Passkey generated = %d", passkey); + SMP_TRACE_ERROR("Passkey generated = %d", passkey); /* save the TK */ memset(p_cb->tk, 0, BT_OCTET16_LEN); @@ -231,7 +231,7 @@ void smp_generate_stk (tSMP_CB *p_cb, tSMP_INT_DATA *p_data) tSMP_STATUS status = SMP_PAIR_FAIL_UNKNOWN; UNUSED(p_data); - SMP_TRACE_DEBUG0 ("smp_generate_stk "); + SMP_TRACE_DEBUG ("smp_generate_stk "); memset(p, 0, BT_OCTET16_LEN); if (p_cb->role == HCI_ROLE_MASTER) @@ -248,7 +248,7 @@ void smp_generate_stk (tSMP_CB *p_cb, tSMP_INT_DATA *p_data) /* generate STK = Etk(rand|rrand)*/ if (!SMP_Encrypt( p_cb->tk, BT_OCTET16_LEN, ptext, BT_OCTET16_LEN, &output)) { - SMP_TRACE_ERROR0("smp_generate_stk failed"); + SMP_TRACE_ERROR("smp_generate_stk failed"); smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &status); } else @@ -272,7 +272,7 @@ void smp_generate_confirm (tSMP_CB *p_cb, tSMP_INT_DATA *p_data) { UNUSED(p_data); - SMP_TRACE_DEBUG0 ("smp_generate_confirm"); + SMP_TRACE_DEBUG ("smp_generate_confirm"); p_cb->rand_enc_proc = SMP_GEN_SRAND_MRAND; /* generate MRand or SRand */ if (!btsnd_hcic_ble_rand((void *)smp_rand_back)) @@ -292,7 +292,7 @@ void smp_genenrate_rand_cont(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) { UNUSED(p_data); - SMP_TRACE_DEBUG0 ("smp_genenrate_rand_cont "); + SMP_TRACE_DEBUG ("smp_genenrate_rand_cont "); p_cb->rand_enc_proc = SMP_GEN_SRAND_MRAND_CONT; /* generate 64 MSB of MRand or SRand */ @@ -315,7 +315,7 @@ void smp_generate_ltk(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) BOOLEAN div_status; UNUSED(p_data); - SMP_TRACE_DEBUG0 ("smp_generate_ltk "); + SMP_TRACE_DEBUG ("smp_generate_ltk "); div_status = btm_get_local_div(p_cb->pairing_bda, &p_cb->div); @@ -325,7 +325,7 @@ void smp_generate_ltk(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) } else { - SMP_TRACE_DEBUG0 ("Generate DIV for LTK"); + SMP_TRACE_DEBUG ("Generate DIV for LTK"); p_cb->rand_enc_proc = SMP_GEN_DIV_LTK; /* generate MRand or SRand */ if (!btsnd_hcic_ble_rand((void *)smp_rand_back)) @@ -354,7 +354,7 @@ void smp_compute_csrk(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) tSMP_STATUS status = SMP_PAIR_FAIL_UNKNOWN; UNUSED(p_data); - SMP_TRACE_DEBUG1 ("smp_compute_csrk div=%x", p_cb->div); + SMP_TRACE_DEBUG ("smp_compute_csrk div=%x", p_cb->div); BTM_GetDeviceEncRoot(er); /* CSRK = d1(ER, DIV, 1) */ UINT16_TO_STREAM(p, p_cb->div); @@ -362,7 +362,7 @@ void smp_compute_csrk(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) if (!SMP_Encrypt(er, BT_OCTET16_LEN, buffer, 4, &output)) { - SMP_TRACE_ERROR0("smp_generate_csrk failed"); + SMP_TRACE_ERROR("smp_generate_csrk failed"); smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &status); } else @@ -388,7 +388,7 @@ void smp_generate_csrk(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) BOOLEAN div_status; UNUSED(p_data); - SMP_TRACE_DEBUG0 ("smp_generate_csrk"); + SMP_TRACE_DEBUG ("smp_generate_csrk"); div_status = btm_get_local_div(p_cb->pairing_bda, &p_cb->div); if (div_status) @@ -397,7 +397,7 @@ void smp_generate_csrk(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) } else { - SMP_TRACE_DEBUG0 ("Generate DIV for CSRK"); + SMP_TRACE_DEBUG ("Generate DIV for CSRK"); p_cb->rand_enc_proc = SMP_GEN_DIV_CSRK; if (!btsnd_hcic_ble_rand((void *)smp_rand_back)) smp_rand_back(NULL); @@ -413,7 +413,7 @@ void smp_concatenate_local( tSMP_CB *p_cb, UINT8 **p_data, UINT8 op_code) { UINT8 *p = *p_data; - SMP_TRACE_DEBUG0 ("smp_concatenate_local "); + SMP_TRACE_DEBUG ("smp_concatenate_local "); UINT8_TO_STREAM(p, op_code); UINT8_TO_STREAM(p, p_cb->loc_io_caps); UINT8_TO_STREAM(p, p_cb->loc_oob_flag); @@ -432,7 +432,7 @@ void smp_concatenate_peer( tSMP_CB *p_cb, UINT8 **p_data, UINT8 op_code) { UINT8 *p = *p_data; - SMP_TRACE_DEBUG0 ("smp_concatenate_peer "); + SMP_TRACE_DEBUG ("smp_concatenate_peer "); UINT8_TO_STREAM(p, op_code); UINT8_TO_STREAM(p, p_cb->peer_io_caps); UINT8_TO_STREAM(p, p_cb->peer_oob_flag); @@ -459,11 +459,11 @@ void smp_gen_p1_4_confirm( tSMP_CB *p_cb, BT_OCTET16 p1) tBLE_ADDR_TYPE addr_type = 0; BD_ADDR remote_bda; - SMP_TRACE_DEBUG0 ("smp_gen_p1_4_confirm"); + SMP_TRACE_DEBUG ("smp_gen_p1_4_confirm"); if (!BTM_ReadRemoteConnectionAddr(p_cb->pairing_bda, remote_bda, &addr_type)) { - SMP_TRACE_ERROR0("can not generate confirm for unknown device"); + SMP_TRACE_ERROR("can not generate confirm for unknown device"); return; } @@ -492,7 +492,7 @@ void smp_gen_p1_4_confirm( tSMP_CB *p_cb, BT_OCTET16 p1) smp_concatenate_local(p_cb, &p, SMP_OPCODE_PAIRING_RSP); } #if SMP_DEBUG == TRUE - SMP_TRACE_DEBUG0("p1 = pres || preq || rat' || iat'"); + SMP_TRACE_DEBUG("p1 = pres || preq || rat' || iat'"); smp_debug_print_nbyte_little_endian ((UINT8 *)p1, (const UINT8 *)"P1", 16); #endif } @@ -514,11 +514,11 @@ void smp_gen_p2_4_confirm( tSMP_CB *p_cb, BT_OCTET16 p2) if (!BTM_ReadRemoteConnectionAddr(p_cb->pairing_bda, remote_bda, &addr_type)) { - SMP_TRACE_ERROR0("can not generate confirm p2 for unknown device"); + SMP_TRACE_ERROR("can not generate confirm p2 for unknown device"); return; } - SMP_TRACE_DEBUG0 ("smp_gen_p2_4_confirm"); + SMP_TRACE_DEBUG ("smp_gen_p2_4_confirm"); memset(p, 0, sizeof(BT_OCTET16)); @@ -537,7 +537,7 @@ void smp_gen_p2_4_confirm( tSMP_CB *p_cb, BT_OCTET16 p2) BDADDR_TO_STREAM(p, remote_bda); } #if SMP_DEBUG == TRUE - SMP_TRACE_DEBUG0("p2 = padding || ia || ra"); + SMP_TRACE_DEBUG("p2 = padding || ia || ra"); smp_debug_print_nbyte_little_endian(p2, (const UINT8 *)"p2", 16); #endif } @@ -557,7 +557,7 @@ void smp_calculate_comfirm (tSMP_CB *p_cb, BT_OCTET16 rand, BD_ADDR bda) tSMP_STATUS status = SMP_PAIR_FAIL_UNKNOWN; UNUSED(bda); - SMP_TRACE_DEBUG0 ("smp_calculate_comfirm "); + SMP_TRACE_DEBUG ("smp_calculate_comfirm "); /* generate p1 = pres || preq || rat' || iat' */ smp_gen_p1_4_confirm(p_cb, p1); @@ -569,7 +569,7 @@ void smp_calculate_comfirm (tSMP_CB *p_cb, BT_OCTET16 rand, BD_ADDR bda) /* calculate e(k, r XOR p1), where k = TK */ if (!SMP_Encrypt(p_cb->tk, BT_OCTET16_LEN, p1, BT_OCTET16_LEN, &output)) { - SMP_TRACE_ERROR0("smp_generate_csrk failed"); + SMP_TRACE_ERROR("smp_generate_csrk failed"); smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &status); } else @@ -593,9 +593,9 @@ static void smp_calculate_comfirm_cont(tSMP_CB *p_cb, tSMP_ENC *p) tSMP_ENC output; tSMP_STATUS status = SMP_PAIR_FAIL_UNKNOWN; - SMP_TRACE_DEBUG0 ("smp_calculate_comfirm_cont "); + SMP_TRACE_DEBUG ("smp_calculate_comfirm_cont "); #if SMP_DEBUG == TRUE - SMP_TRACE_DEBUG0("Confirm step 1 p1' = e(k, r XOR p1) Generated"); + SMP_TRACE_DEBUG("Confirm step 1 p1' = e(k, r XOR p1) Generated"); smp_debug_print_nbyte_little_endian (p->param_buf, (const UINT8 *)"C1", 16); #endif @@ -608,7 +608,7 @@ static void smp_calculate_comfirm_cont(tSMP_CB *p_cb, tSMP_ENC *p) /* calculate: Confirm = E(k, p1' XOR p2) */ if (!SMP_Encrypt(p_cb->tk, BT_OCTET16_LEN, p2, BT_OCTET16_LEN, &output)) { - SMP_TRACE_ERROR0("smp_calculate_comfirm_cont failed"); + SMP_TRACE_ERROR("smp_calculate_comfirm_cont failed"); smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &status); } else @@ -639,7 +639,7 @@ static void smp_genenrate_confirm(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) { UNUSED(p_data); - SMP_TRACE_DEBUG0 ("smp_genenrate_confirm "); + SMP_TRACE_DEBUG ("smp_genenrate_confirm "); p_cb->rand_enc_proc = SMP_GEN_CONFIRM; smp_debug_print_nbyte_little_endian ((UINT8 *)p_cb->rand, (const UINT8 *)"local rand", 16); @@ -661,7 +661,7 @@ void smp_generate_compare (tSMP_CB *p_cb, tSMP_INT_DATA *p_data) { UNUSED(p_data); - SMP_TRACE_DEBUG0 ("smp_generate_compare "); + SMP_TRACE_DEBUG ("smp_generate_compare "); p_cb->rand_enc_proc = SMP_GEN_COMPARE; smp_debug_print_nbyte_little_endian ((UINT8 *)p_cb->rrand, (const UINT8 *)"peer rand", 16); @@ -682,7 +682,7 @@ static void smp_process_confirm(tSMP_CB *p_cb, tSMP_ENC *p) { tSMP_KEY key; - SMP_TRACE_DEBUG0 ("smp_process_confirm "); + SMP_TRACE_DEBUG ("smp_process_confirm "); #if SMP_CONFORMANCE_TESTING == TRUE if (p_cb->enable_test_confirm_val) { @@ -697,7 +697,7 @@ static void smp_process_confirm(tSMP_CB *p_cb, tSMP_ENC *p) #if (SMP_DEBUG == TRUE) - SMP_TRACE_DEBUG0("Confirm Generated"); + SMP_TRACE_DEBUG("Confirm Generated"); smp_debug_print_nbyte_little_endian ((UINT8 *)p_cb->confirm, (const UINT8 *)"Confirm", 16); #endif @@ -720,9 +720,9 @@ static void smp_process_compare(tSMP_CB *p_cb, tSMP_ENC *p) { tSMP_KEY key; - SMP_TRACE_DEBUG0 ("smp_process_compare "); + SMP_TRACE_DEBUG ("smp_process_compare "); #if (SMP_DEBUG == TRUE) - SMP_TRACE_DEBUG0("Compare Generated"); + SMP_TRACE_DEBUG("Compare Generated"); smp_debug_print_nbyte_little_endian (p->param_buf, (const UINT8 *)"Compare", 16); #endif key.key_type = SMP_KEY_TYPE_CMP; @@ -745,9 +745,9 @@ static void smp_process_stk(tSMP_CB *p_cb, tSMP_ENC *p) { tSMP_KEY key; - SMP_TRACE_DEBUG0 ("smp_process_stk "); + SMP_TRACE_DEBUG ("smp_process_stk "); #if (SMP_DEBUG == TRUE) - SMP_TRACE_ERROR0("STK Generated"); + SMP_TRACE_ERROR("STK Generated"); #endif smp_mask_enc_key(p_cb->loc_enc_size, p->param_buf); @@ -773,14 +773,14 @@ static void smp_genenrate_ltk_cont(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) tSMP_STATUS status = SMP_PAIR_FAIL_UNKNOWN; UNUSED(p_data); - SMP_TRACE_DEBUG0 ("smp_genenrate_ltk_cont "); + SMP_TRACE_DEBUG ("smp_genenrate_ltk_cont "); BTM_GetDeviceEncRoot(er); /* LTK = d1(ER, DIV, 0)= e(ER, DIV)*/ if (!SMP_Encrypt(er, BT_OCTET16_LEN, (UINT8 *)&p_cb->div, sizeof(UINT16), &output)) { - SMP_TRACE_ERROR0("smp_genenrate_ltk_cont failed"); + SMP_TRACE_ERROR("smp_genenrate_ltk_cont failed"); smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &status); } else @@ -809,13 +809,13 @@ static void smp_generate_y(tSMP_CB *p_cb, tSMP_INT_DATA *p) tSMP_STATUS status = SMP_PAIR_FAIL_UNKNOWN; UNUSED(p); - SMP_TRACE_DEBUG0 ("smp_generate_y "); + SMP_TRACE_DEBUG ("smp_generate_y "); BTM_GetDeviceDHK(dhk); if (!SMP_Encrypt(dhk, BT_OCTET16_LEN, p_cb->enc_rand, BT_OCTET8_LEN, &output)) { - SMP_TRACE_ERROR0("smp_generate_y failed"); + SMP_TRACE_ERROR("smp_generate_y failed"); smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &status); } else @@ -839,7 +839,7 @@ static void smp_generate_rand_vector (tSMP_CB *p_cb, tSMP_INT_DATA *p) /* generate EDIV and rand now */ /* generate random vector */ - SMP_TRACE_DEBUG0 ("smp_generate_rand_vector "); + SMP_TRACE_DEBUG ("smp_generate_rand_vector "); p_cb->rand_enc_proc = SMP_GEN_RAND_V; if (!btsnd_hcic_ble_rand((void *)smp_rand_back)) smp_rand_back(NULL); @@ -860,13 +860,13 @@ static void smp_process_ediv(tSMP_CB *p_cb, tSMP_ENC *p) UINT8 *pp= p->param_buf; UINT16 y; - SMP_TRACE_DEBUG0 ("smp_process_ediv "); + SMP_TRACE_DEBUG ("smp_process_ediv "); STREAM_TO_UINT16(y, pp); /* EDIV = Y xor DIV */ p_cb->ediv = p_cb->div ^ y; /* send LTK ready */ - SMP_TRACE_ERROR0("LTK ready"); + SMP_TRACE_ERROR("LTK ready"); key.key_type = SMP_KEY_TYPE_LTK; key.p_data = p->param_buf; @@ -890,7 +890,7 @@ static void smp_rand_back(tBTM_RAND_ENC *p) UINT8 failure = SMP_PAIR_FAIL_UNKNOWN; UINT8 state = p_cb->rand_enc_proc & ~0x80; - SMP_TRACE_DEBUG1 ("smp_rand_back state=0x%x", state); + SMP_TRACE_DEBUG ("smp_rand_back state=0x%x", state); if (p && p->status == HCI_SUCCESS) { switch (state) @@ -930,7 +930,7 @@ static void smp_rand_back(tBTM_RAND_ENC *p) return; } - SMP_TRACE_ERROR1("smp_rand_back Key generation failed: (%d)", p_cb->rand_enc_proc); + SMP_TRACE_ERROR("smp_rand_back Key generation failed: (%d)", p_cb->rand_enc_proc); smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &failure); diff --git a/stack/smp/smp_l2c.c b/stack/smp/smp_l2c.c index 02ec38eb6..078009bb6 100644 --- a/stack/smp/smp_l2c.c +++ b/stack/smp/smp_l2c.c @@ -48,7 +48,7 @@ static void smp_data_ind (BD_ADDR bd_addr, BT_HDR *p_buf); void smp_l2cap_if_init (void) { tL2CAP_FIXED_CHNL_REG fixed_reg; - SMP_TRACE_EVENT0 ("SMDBG l2c smp_l2cap_if_init"); + SMP_TRACE_EVENT ("SMDBG l2c smp_l2cap_if_init"); fixed_reg.fixed_chnl_opts.mode = L2CAP_FCR_BASIC_MODE; fixed_reg.fixed_chnl_opts.max_transmit = 0; fixed_reg.fixed_chnl_opts.rtrans_tout = 0; @@ -79,17 +79,17 @@ static void smp_connect_cback (BD_ADDR bd_addr, BOOLEAN connected, UINT16 reason tSMP_CB *p_cb = &smp_cb; tSMP_INT_DATA int_data; - SMP_TRACE_EVENT0 ("SMDBG l2c smp_connect_cback "); + SMP_TRACE_EVENT ("SMDBG l2c smp_connect_cback "); if (transport == BT_TRANSPORT_BR_EDR) { - SMP_TRACE_ERROR0 ("smp_connect_cback : Wrong transport"); + SMP_TRACE_ERROR ("smp_connect_cback : Wrong transport"); return; } if (memcmp(bd_addr, p_cb->pairing_bda, BD_ADDR_LEN) == 0) { - SMP_TRACE_EVENT3 ("smp_connect_cback() for pairing BDA: %08x%04x Event: %s", + SMP_TRACE_EVENT ("smp_connect_cback() for pairing BDA: %08x%04x Event: %s", (bd_addr[0]<<24)+(bd_addr[1]<<16)+(bd_addr[2]<<8) + bd_addr[3], (bd_addr[4]<<8)+bd_addr[5], (connected) ? "connected" : "disconnected"); @@ -133,16 +133,16 @@ static void smp_data_ind (BD_ADDR bd_addr, BT_HDR *p_buf) tSMP_CB *p_cb = &smp_cb; UINT8 *p = (UINT8 *)(p_buf + 1) + p_buf->offset; UINT8 cmd ; - SMP_TRACE_EVENT0 ("SMDBG l2c smp_data_ind"); + SMP_TRACE_EVENT ("SMDBG l2c smp_data_ind"); - SMP_TRACE_EVENT0 ("Got smp_data_ind"); + SMP_TRACE_EVENT ("Got smp_data_ind"); STREAM_TO_UINT8(cmd, p); /* sanity check */ if ((SMP_OPCODE_MAX <= cmd) || (cmd == 0)) { - SMP_TRACE_WARNING1( "Ignore received command with RESERVED code 0x%02x", cmd); + SMP_TRACE_WARNING( "Ignore received command with RESERVED code 0x%02x", cmd); GKI_freebuf (p_buf); return; } diff --git a/stack/smp/smp_main.c b/stack/smp/smp_main.c index dd40a7126..aee15dad1 100644 --- a/stack/smp/smp_main.c +++ b/stack/smp/smp_main.c @@ -395,14 +395,14 @@ void smp_set_state(tSMP_STATE state) { if (state < SMP_ST_MAX) { - SMP_TRACE_DEBUG4( "State change: %s(%d) ==> %s(%d)", + SMP_TRACE_DEBUG( "State change: %s(%d) ==> %s(%d)", smp_get_state_name(smp_cb.state), smp_cb.state, smp_get_state_name(state), state ); smp_cb.state = state; } else { - SMP_TRACE_DEBUG1("smp_set_state invalid state =%d", state ); + SMP_TRACE_DEBUG("smp_set_state invalid state =%d", state ); } } @@ -438,14 +438,14 @@ void smp_sm_event(tSMP_CB *p_cb, tSMP_EVENT event, void *p_data) UINT8 action, entry, i; tSMP_ENTRY_TBL entry_table = smp_entry_table[p_cb->role]; - SMP_TRACE_EVENT0("main smp_sm_event"); + SMP_TRACE_EVENT("main smp_sm_event"); if (curr_state >= SMP_ST_MAX) { - SMP_TRACE_DEBUG1( "Invalid state: %d", curr_state) ; + SMP_TRACE_DEBUG( "Invalid state: %d", curr_state) ; return; } - SMP_TRACE_DEBUG5( "SMP Role: %s State: [%s (%d)], Event: [%s (%d)]",\ + SMP_TRACE_DEBUG( "SMP Role: %s State: [%s (%d)], Event: [%s (%d)]",\ (p_cb->role == 0x01) ?"Slave" : "Master", smp_get_state_name( p_cb->state), p_cb->state, smp_get_event_name(event), event) ; @@ -465,7 +465,7 @@ void smp_sm_event(tSMP_CB *p_cb, tSMP_EVENT event, void *p_data) } else { - SMP_TRACE_DEBUG4( "Ignore event [%s (%d)] in state [%s (%d)]", + SMP_TRACE_DEBUG( "Ignore event [%s (%d)] in state [%s (%d)]", smp_get_event_name(event), event, smp_get_state_name(curr_state), curr_state); return; } @@ -490,7 +490,7 @@ void smp_sm_event(tSMP_CB *p_cb, tSMP_EVENT event, void *p_data) break; } } - SMP_TRACE_DEBUG1( "result state = %s", smp_get_state_name( p_cb->state ) ) ; + SMP_TRACE_DEBUG( "result state = %s", smp_get_state_name( p_cb->state ) ) ; } diff --git a/stack/smp/smp_utils.c b/stack/smp/smp_utils.c index 38b2be860..21d93f889 100644 --- a/stack/smp/smp_utils.c +++ b/stack/smp/smp_utils.c @@ -87,11 +87,11 @@ BOOLEAN smp_send_msg_to_L2CAP(BD_ADDR rem_bda, BT_HDR *p_toL2CAP) { UINT16 l2cap_ret; - SMP_TRACE_EVENT0("smp_send_msg_to_L2CAP"); + SMP_TRACE_EVENT("smp_send_msg_to_L2CAP"); if ((l2cap_ret = L2CA_SendFixedChnlData (L2CAP_SMP_CID, rem_bda, p_toL2CAP)) == L2CAP_DW_FAILED) { - SMP_TRACE_ERROR1("SMP failed to pass msg:0x%0x to L2CAP", + SMP_TRACE_ERROR("SMP failed to pass msg:0x%0x to L2CAP", *((UINT8 *)(p_toL2CAP + 1) + p_toL2CAP->offset)); GKI_freebuf(p_toL2CAP); return FALSE; @@ -113,7 +113,7 @@ BOOLEAN smp_send_cmd(UINT8 cmd_code, tSMP_CB *p_cb) BT_HDR *p_buf; BOOLEAN sent = FALSE; UINT8 failure = SMP_PAIR_INTERNAL_ERR; - SMP_TRACE_EVENT1("smp_send_cmd on l2cap cmd_code=0x%x", cmd_code); + SMP_TRACE_EVENT("smp_send_cmd on l2cap cmd_code=0x%x", cmd_code); if ( cmd_code < SMP_OPCODE_MAX && smp_cmd_build_act[cmd_code] != NULL) { @@ -154,7 +154,7 @@ void smp_rsp_timeout(TIMER_LIST_ENT *p_tle) UINT8 failure = SMP_RSP_TIMEOUT; UNUSED(p_tle); - SMP_TRACE_EVENT1("smp_rsp_timeout state:%d", p_cb->state); + SMP_TRACE_EVENT("smp_rsp_timeout state:%d", p_cb->state); if (smp_get_state() == SMP_ST_RELEASE_DELAY) { @@ -177,7 +177,7 @@ BT_HDR * smp_build_pairing_cmd(UINT8 cmd_code, tSMP_CB *p_cb) { BT_HDR *p_buf = NULL ; UINT8 *p; - SMP_TRACE_EVENT0("smp_build_pairing_cmd"); + SMP_TRACE_EVENT("smp_build_pairing_cmd"); if ((p_buf = (BT_HDR *)GKI_getbuf(sizeof(BT_HDR) + SMP_PAIRING_REQ_SIZE + L2CAP_MIN_OFFSET)) != NULL) { p = (UINT8 *)(p_buf + 1) + L2CAP_MIN_OFFSET; @@ -211,7 +211,7 @@ static BT_HDR * smp_build_confirm_cmd(UINT8 cmd_code, tSMP_CB *p_cb) UINT8 *p; UNUSED(cmd_code); - SMP_TRACE_EVENT0("smp_build_confirm_cmd"); + SMP_TRACE_EVENT("smp_build_confirm_cmd"); if ((p_buf = (BT_HDR *)GKI_getbuf(sizeof(BT_HDR) + SMP_CONFIRM_CMD_SIZE + L2CAP_MIN_OFFSET)) != NULL) { p = (UINT8 *)(p_buf + 1) + L2CAP_MIN_OFFSET; @@ -238,7 +238,7 @@ static BT_HDR * smp_build_rand_cmd(UINT8 cmd_code, tSMP_CB *p_cb) UINT8 *p; UNUSED(cmd_code); - SMP_TRACE_EVENT0("smp_build_rand_cmd"); + SMP_TRACE_EVENT("smp_build_rand_cmd"); if ((p_buf = (BT_HDR *)GKI_getbuf(sizeof(BT_HDR) + SMP_INIT_CMD_SIZE + L2CAP_MIN_OFFSET)) != NULL) { p = (UINT8 *)(p_buf + 1) + L2CAP_MIN_OFFSET; @@ -265,7 +265,7 @@ static BT_HDR * smp_build_encrypt_info_cmd(UINT8 cmd_code, tSMP_CB *p_cb) UINT8 *p; UNUSED(cmd_code); - SMP_TRACE_EVENT0("smp_build_encrypt_info_cmd"); + SMP_TRACE_EVENT("smp_build_encrypt_info_cmd"); if ((p_buf = (BT_HDR *)GKI_getbuf(sizeof(BT_HDR) + SMP_ENC_INFO_SIZE + L2CAP_MIN_OFFSET)) != NULL) { p = (UINT8 *)(p_buf + 1) + L2CAP_MIN_OFFSET; @@ -292,7 +292,7 @@ static BT_HDR * smp_build_master_id_cmd(UINT8 cmd_code, tSMP_CB *p_cb) UINT8 *p; UNUSED(cmd_code); - SMP_TRACE_EVENT0("smp_build_master_id_cmd "); + SMP_TRACE_EVENT("smp_build_master_id_cmd "); if ((p_buf = (BT_HDR *)GKI_getbuf(sizeof(BT_HDR) + SMP_MASTER_ID_SIZE + L2CAP_MIN_OFFSET)) != NULL) { p = (UINT8 *)(p_buf + 1) + L2CAP_MIN_OFFSET; @@ -322,7 +322,7 @@ static BT_HDR * smp_build_identity_info_cmd(UINT8 cmd_code, tSMP_CB *p_cb) UNUSED(cmd_code); UNUSED(p_cb); - SMP_TRACE_EVENT0("smp_build_identity_info_cmd"); + SMP_TRACE_EVENT("smp_build_identity_info_cmd"); if ((p_buf = (BT_HDR *)GKI_getbuf(sizeof(BT_HDR) + SMP_ID_INFO_SIZE + L2CAP_MIN_OFFSET)) != NULL) { p = (UINT8 *)(p_buf + 1) + L2CAP_MIN_OFFSET; @@ -353,7 +353,7 @@ static BT_HDR * smp_build_id_addr_cmd(UINT8 cmd_code, tSMP_CB *p_cb) UNUSED(cmd_code); UNUSED(p_cb); - SMP_TRACE_EVENT0("smp_build_id_addr_cmd"); + SMP_TRACE_EVENT("smp_build_id_addr_cmd"); if ((p_buf = (BT_HDR *)GKI_getbuf(sizeof(BT_HDR) + SMP_ID_ADDR_SIZE + L2CAP_MIN_OFFSET)) != NULL) { p = (UINT8 *)(p_buf + 1) + L2CAP_MIN_OFFSET; @@ -383,7 +383,7 @@ static BT_HDR * smp_build_signing_info_cmd(UINT8 cmd_code, tSMP_CB *p_cb) UINT8 *p; UNUSED(cmd_code); - SMP_TRACE_EVENT0("smp_build_signing_info_cmd"); + SMP_TRACE_EVENT("smp_build_signing_info_cmd"); if ((p_buf = (BT_HDR *)GKI_getbuf(sizeof(BT_HDR) + SMP_SIGN_INFO_SIZE + L2CAP_MIN_OFFSET)) != NULL) { p = (UINT8 *)(p_buf + 1) + L2CAP_MIN_OFFSET; @@ -410,7 +410,7 @@ static BT_HDR * smp_build_pairing_fail(UINT8 cmd_code, tSMP_CB *p_cb) UINT8 *p; UNUSED(cmd_code); - SMP_TRACE_EVENT0("smp_build_pairing_fail"); + SMP_TRACE_EVENT("smp_build_pairing_fail"); if ((p_buf = (BT_HDR *)GKI_getbuf(sizeof(BT_HDR) + SMP_PAIR_FAIL_SIZE + L2CAP_MIN_OFFSET)) != NULL) { p = (UINT8 *)(p_buf + 1) + L2CAP_MIN_OFFSET; @@ -437,7 +437,7 @@ static BT_HDR * smp_build_security_request(UINT8 cmd_code, tSMP_CB *p_cb) UINT8 *p; UNUSED(cmd_code); - SMP_TRACE_EVENT0("smp_build_security_request"); + SMP_TRACE_EVENT("smp_build_security_request"); if ((p_buf = (BT_HDR *)GKI_getbuf(sizeof(BT_HDR) + 2 + L2CAP_MIN_OFFSET)) != NULL) { @@ -449,7 +449,7 @@ static BT_HDR * smp_build_security_request(UINT8 cmd_code, tSMP_CB *p_cb) p_buf->offset = L2CAP_MIN_OFFSET; p_buf->len = 2; - SMP_TRACE_EVENT2("opcode=%d auth_req=0x%x",SMP_OPCODE_SEC_REQ, p_cb->loc_auth_req ); + SMP_TRACE_EVENT("opcode=%d auth_req=0x%x",SMP_OPCODE_SEC_REQ, p_cb->loc_auth_req ); } return p_buf; @@ -471,7 +471,7 @@ void smp_convert_string_to_tk(BT_OCTET16 tk, UINT32 passkey) { UINT8 *p = tk; tSMP_KEY key; - SMP_TRACE_EVENT0("smp_convert_string_to_tk"); + SMP_TRACE_EVENT("smp_convert_string_to_tk"); UINT32_TO_STREAM(p, passkey); key.key_type = SMP_KEY_TYPE_TK; @@ -493,7 +493,7 @@ void smp_convert_string_to_tk(BT_OCTET16 tk, UINT32 passkey) *******************************************************************************/ void smp_mask_enc_key(UINT8 loc_enc_size, UINT8 * p_data) { - SMP_TRACE_EVENT0("smp_mask_enc_key"); + SMP_TRACE_EVENT("smp_mask_enc_key"); if (loc_enc_size < BT_OCTET16_LEN) { for (; loc_enc_size < BT_OCTET16_LEN; loc_enc_size ++) @@ -515,7 +515,7 @@ void smp_xor_128(BT_OCTET16 a, BT_OCTET16 b) { UINT8 i, *aa = a, *bb = b; - SMP_TRACE_EVENT0("smp_xor_128"); + SMP_TRACE_EVENT("smp_xor_128"); for (i = 0; i < BT_OCTET16_LEN; i++) { aa[i] = aa[i] ^ bb[i]; @@ -537,7 +537,7 @@ void smp_cb_cleanup(tSMP_CB *p_cb) tSMP_CALLBACK *p_callback = p_cb->p_callback; UINT8 trace_level = p_cb->trace_level; - SMP_TRACE_EVENT0("smp_cb_cleanup"); + SMP_TRACE_EVENT("smp_cb_cleanup"); memset(p_cb, 0, sizeof(tSMP_CB)); p_cb->p_callback = p_callback; p_cb->trace_level = trace_level; @@ -555,18 +555,18 @@ void smp_cb_cleanup(tSMP_CB *p_cb) *******************************************************************************/ void smp_reset_control_value(tSMP_CB *p_cb) { - SMP_TRACE_EVENT0("smp_reset_control_value"); + SMP_TRACE_EVENT("smp_reset_control_value"); btu_stop_timer (&p_cb->rsp_timer_ent); #if SMP_CONFORMANCE_TESTING == TRUE - SMP_TRACE_EVENT1("smp_cb.remove_fixed_channel_disable=%d", smp_cb.remove_fixed_channel_disable); + SMP_TRACE_EVENT("smp_cb.remove_fixed_channel_disable=%d", smp_cb.remove_fixed_channel_disable); if (!smp_cb.remove_fixed_channel_disable) { L2CA_RemoveFixedChnl (L2CAP_SMP_CID, p_cb->pairing_bda); } else { - SMP_TRACE_EVENT0("disable the removal of the fixed channel"); + SMP_TRACE_EVENT("disable the removal of the fixed channel"); } @@ -592,7 +592,7 @@ void smp_proc_pairing_cmpl(tSMP_CB *p_cb) { tSMP_EVT_DATA evt_data = {0}; - SMP_TRACE_DEBUG0 ("smp_proc_pairing_cmpl "); + SMP_TRACE_DEBUG ("smp_proc_pairing_cmpl "); evt_data.cmplt.reason = p_cb->status; @@ -605,7 +605,7 @@ void smp_proc_pairing_cmpl(tSMP_CB *p_cb) evt_data.cmplt.is_pair_cancel = TRUE; - SMP_TRACE_DEBUG2 ("send SMP_COMPLT_EVT reason=0x%0x sec_level=0x%0x", + SMP_TRACE_DEBUG ("send SMP_COMPLT_EVT reason=0x%0x sec_level=0x%0x", evt_data.cmplt.reason, evt_data.cmplt.sec_level ); if (p_cb->p_callback) @@ -662,7 +662,7 @@ void smp_reject_unexp_pair_req(BD_ADDR bd_addr) *******************************************************************************/ void smp_set_test_confirm_value(BOOLEAN enable, UINT8 *p_c_val) { - SMP_TRACE_DEBUG1("smp_set_test_confirm_value enable=%d", enable); + SMP_TRACE_DEBUG("smp_set_test_confirm_value enable=%d", enable); smp_cb.enable_test_confirm_val = enable; memcpy(smp_cb.test_confirm, p_c_val, BT_OCTET16_LEN); } @@ -679,7 +679,7 @@ void smp_set_test_confirm_value(BOOLEAN enable, UINT8 *p_c_val) *******************************************************************************/ void smp_set_test_rand_value(BOOLEAN enable, UINT8 *p_c_val) { - SMP_TRACE_DEBUG1("smp_set_test_rand_value enable=%d", enable); + SMP_TRACE_DEBUG("smp_set_test_rand_value enable=%d", enable); smp_cb.enable_test_rand_val = enable; memcpy(smp_cb.test_rand, p_c_val, BT_OCTET16_LEN); } @@ -696,7 +696,7 @@ void smp_set_test_rand_value(BOOLEAN enable, UINT8 *p_c_val) *******************************************************************************/ void smp_set_test_pair_fail_status (BOOLEAN enable, UINT8 status) { - SMP_TRACE_DEBUG1("smp_set_test_confirm_value enable=%d", enable); + SMP_TRACE_DEBUG("smp_set_test_confirm_value enable=%d", enable); smp_cb.enable_test_pair_fail = enable; smp_cb.pair_fail_status = status; } @@ -712,7 +712,7 @@ void smp_set_test_pair_fail_status (BOOLEAN enable, UINT8 status) *******************************************************************************/ void smp_remove_fixed_channel_disable (BOOLEAN disable) { - SMP_TRACE_DEBUG1("smp_remove_fixed_channel_disable disable =%d", disable); + SMP_TRACE_DEBUG("smp_remove_fixed_channel_disable disable =%d", disable); smp_cb.remove_fixed_channel_disable = disable; } /******************************************************************************* @@ -726,7 +726,7 @@ void smp_remove_fixed_channel_disable (BOOLEAN disable) *******************************************************************************/ void smp_skip_compare_check(BOOLEAN enable) { - SMP_TRACE_DEBUG1("smp_skip_compare_check enable=%d", enable); + SMP_TRACE_DEBUG("smp_skip_compare_check enable=%d", enable); smp_cb.skip_test_compare_check = enable; } diff --git a/stack/srvc/srvc_battery.c b/stack/srvc/srvc_battery.c index 0606fd2f8..90632dfad 100644 --- a/stack/srvc/srvc_battery.c +++ b/stack/srvc/srvc_battery.c @@ -205,7 +205,7 @@ UINT16 Battery_Instantiate (UINT8 app_id, tBA_REG_INFO *p_reg_info) if (battery_cb.inst_id == BA_MAX_INT_NUM) { - GATT_TRACE_ERROR0("MAX battery service has been reached"); + GATT_TRACE_ERROR("MAX battery service has been reached"); return 0; } @@ -219,7 +219,7 @@ UINT16 Battery_Instantiate (UINT8 app_id, tBA_REG_INFO *p_reg_info) if (srvc_hdl == 0) { - GATT_TRACE_ERROR0("Can not create service, Battery_Instantiate() failed!"); + GATT_TRACE_ERROR("Can not create service, Battery_Instantiate() failed!"); return 0; } @@ -240,7 +240,7 @@ UINT16 Battery_Instantiate (UINT8 app_id, tBA_REG_INFO *p_reg_info) BATTER_LEVEL_PERM, prop)) == 0) { - GATT_TRACE_ERROR0("Can not add Battery Level, Battery_Instantiate() failed!"); + GATT_TRACE_ERROR("Can not add Battery Level, Battery_Instantiate() failed!"); status = GATT_ERROR; } else @@ -253,7 +253,7 @@ UINT16 Battery_Instantiate (UINT8 app_id, tBA_REG_INFO *p_reg_info) &uuid); if (p_inst->clt_cfg_hdl == 0) { - GATT_TRACE_ERROR0("Add battery level client notification FAILED!"); + GATT_TRACE_ERROR("Add battery level client notification FAILED!"); } } /* need presentation format descriptor? */ @@ -265,7 +265,7 @@ UINT16 Battery_Instantiate (UINT8 app_id, tBA_REG_INFO *p_reg_info) &uuid)) == 0) { - GATT_TRACE_ERROR0("Add battery level presentation format descriptor FAILED!"); + GATT_TRACE_ERROR("Add battery level presentation format descriptor FAILED!"); } } @@ -278,7 +278,7 @@ UINT16 Battery_Instantiate (UINT8 app_id, tBA_REG_INFO *p_reg_info) &uuid)) == 0) { - GATT_TRACE_ERROR0("Add battery level report reference descriptor FAILED!"); + GATT_TRACE_ERROR("Add battery level report reference descriptor FAILED!"); } } diff --git a/stack/srvc/srvc_dis.c b/stack/srvc/srvc_dis.c index 7c4df0d83..9eba4c7ff 100644 --- a/stack/srvc/srvc_dis.c +++ b/stack/srvc/srvc_dis.c @@ -136,7 +136,7 @@ UINT8 dis_read_attr_value (UINT8 clcb_idx, UINT16 handle, tGATT_VALUE *p_value, p_value->len -= offset; pp += offset; ARRAY_TO_STREAM(p, pp, p_value->len); - GATT_TRACE_EVENT1("GATT_UUID_MANU_NAME len=0x%04x", p_value->len); + GATT_TRACE_EVENT("GATT_UUID_MANU_NAME len=0x%04x", p_value->len); } break; @@ -181,8 +181,8 @@ void dis_gatt_c_read_dis_value_cmpl(UINT16 conn_id) if (dis_cb.p_read_dis_cback && p_clcb) { - GATT_TRACE_ERROR1("dis_gatt_c_read_dis_value_cmpl: attr_mask = 0x%04x", p_clcb->dis_value.attr_mask); - GATT_TRACE_EVENT0("calling p_read_dis_cbackd"); + GATT_TRACE_ERROR("dis_gatt_c_read_dis_value_cmpl: attr_mask = 0x%04x", p_clcb->dis_value.attr_mask); + GATT_TRACE_EVENT("calling p_read_dis_cbackd"); (*dis_cb.p_read_dis_cback)(p_clcb->bda, &p_clcb->dis_value); dis_cb.p_read_dis_cback=NULL; @@ -220,7 +220,7 @@ BOOLEAN dis_gatt_c_read_dis_req(UINT16 conn_id) } else { - GATT_TRACE_ERROR1 ("Read DISInfo: 0x%04x GATT_Read Failed", param.service.uuid.uu.uuid16); + GATT_TRACE_ERROR ("Read DISInfo: 0x%04x GATT_Read Failed", param.service.uuid.uu.uuid16); dis_cb.dis_read_uuid_idx ++; } } @@ -246,7 +246,7 @@ void dis_c_cmpl_cback (tSRVC_CLCB *p_clcb, tGATTC_OPTYPE op, UINT8 *pp = NULL, *p_str; UINT16 conn_id = p_clcb->conn_id; - GATT_TRACE_EVENT3 ("dis_c_cmpl_cback() - op_code: 0x%02x status: 0x%02x \ + GATT_TRACE_EVENT ("dis_c_cmpl_cback() - op_code: 0x%02x status: 0x%02x \ read_type: 0x%04x", op, status, read_type); if (op != GATTC_OPTYPE_READ) @@ -259,7 +259,7 @@ void dis_c_cmpl_cback (tSRVC_CLCB *p_clcb, tGATTC_OPTYPE op, switch (read_type) { case GATT_UUID_SYSTEM_ID: - GATT_TRACE_EVENT0 ("DIS_ATTR_SYS_ID_BIT"); + GATT_TRACE_EVENT ("DIS_ATTR_SYS_ID_BIT"); if (p_data->att_value.len == DIS_SYSTEM_ID_SIZE) { p_clcb->dis_value.attr_mask |= DIS_ATTR_SYS_ID_BIT; @@ -326,7 +326,7 @@ tDIS_STATUS DIS_SrInit (tDIS_ATTR_MASK dis_attr_mask) if (dis_cb.enabled) { - GATT_TRACE_ERROR0("DIS already initalized"); + GATT_TRACE_ERROR("DIS already initalized"); return DIS_SUCCESS; } @@ -336,7 +336,7 @@ tDIS_STATUS DIS_SrInit (tDIS_ATTR_MASK dis_attr_mask) if (dis_cb.service_handle == 0) { - GATT_TRACE_ERROR0("Can not create service, DIS_Init failed!"); + GATT_TRACE_ERROR("Can not create service, DIS_Init failed!"); return GATT_ERROR; } dis_cb.max_handle = dis_cb.service_handle + DIS_MAX_ATTR_NUM; @@ -347,7 +347,7 @@ tDIS_STATUS DIS_SrInit (tDIS_ATTR_MASK dis_attr_mask) */ uuid.uu.uuid16 = p_db_attr->uuid = dis_attr_uuid[i]; p_db_attr->handle = GATTS_AddCharacteristic(dis_cb.service_handle, &uuid, GATT_PERM_READ, GATT_CHAR_PROP_BIT_READ); - GATT_TRACE_DEBUG2 ("DIS_SrInit: handle of new attribute 0x%04 = x%d", uuid.uu.uuid16, p_db_attr->handle ); + GATT_TRACE_DEBUG ("DIS_SrInit: handle of new attribute 0x%04 = x%d", uuid.uu.uuid16, p_db_attr->handle ); p_db_attr ++; i ++; dis_attr_mask >>= 1; @@ -438,7 +438,7 @@ BOOLEAN DIS_ReadDISInfo(BD_ADDR peer_bda, tDIS_READ_CBACK *p_cback) /* Mark currently active operation */ dis_cb.dis_read_uuid_idx = 0; - GATT_TRACE_EVENT3 ("DIS_ReadDISInfo() - BDA: %08x%04x cl_read_uuid: 0x%04x", + GATT_TRACE_EVENT ("DIS_ReadDISInfo() - BDA: %08x%04x cl_read_uuid: 0x%04x", (peer_bda[0]<<24)+(peer_bda[1]<<16)+(peer_bda[2]<<8)+peer_bda[3], (peer_bda[4]<<8)+peer_bda[5], dis_attr_uuid[dis_cb.dis_read_uuid_idx]); diff --git a/stack/srvc/srvc_eng.c b/stack/srvc/srvc_eng.c index bf730aa7d..9768a41d0 100644 --- a/stack/srvc/srvc_eng.c +++ b/stack/srvc/srvc_eng.c @@ -264,7 +264,7 @@ static void srvc_eng_s_request_cback (UINT16 conn_id, UINT32 trans_id, tGATTS_RE UINT8 act = SRVC_ACT_IGNORE; UINT8 clcb_idx = srvc_eng_find_clcb_idx_by_conn_id(conn_id); - GATT_TRACE_EVENT1("srvc_eng_s_request_cback : recv type (0x%02x)", type); + GATT_TRACE_EVENT("srvc_eng_s_request_cback : recv type (0x%02x)", type); memset(&rsp_msg, 0, sizeof(tGATTS_RSP)); @@ -283,15 +283,15 @@ static void srvc_eng_s_request_cback (UINT16 conn_id, UINT32 trans_id, tGATTS_RE break; case GATTS_REQ_TYPE_WRITE_EXEC: - GATT_TRACE_EVENT0("Ignore GATT_REQ_EXEC_WRITE/WRITE_CMD" ); + GATT_TRACE_EVENT("Ignore GATT_REQ_EXEC_WRITE/WRITE_CMD" ); break; case GATTS_REQ_TYPE_MTU: - GATT_TRACE_EVENT1("Get MTU exchange new mtu size: %d", p_data->mtu); + GATT_TRACE_EVENT("Get MTU exchange new mtu size: %d", p_data->mtu); break; default: - GATT_TRACE_EVENT1("Unknown/unexpected LE GAP ATT request: 0x%02x", type); + GATT_TRACE_EVENT("Unknown/unexpected LE GAP ATT request: 0x%02x", type); break; } @@ -318,11 +318,11 @@ static void srvc_eng_c_cmpl_cback (UINT16 conn_id, tGATTC_OPTYPE op, tGATT_STATU { tSRVC_CLCB *p_clcb = srvc_eng_find_clcb_by_conn_id(conn_id); - GATT_TRACE_EVENT2 ("srvc_eng_c_cmpl_cback() - op_code: 0x%02x status: 0x%02x ", op, status); + GATT_TRACE_EVENT ("srvc_eng_c_cmpl_cback() - op_code: 0x%02x status: 0x%02x ", op, status); if (p_clcb == NULL) { - GATT_TRACE_ERROR0("srvc_eng_c_cmpl_cback received for unknown connection"); + GATT_TRACE_ERROR("srvc_eng_c_cmpl_cback received for unknown connection"); return; } @@ -347,7 +347,7 @@ static void srvc_eng_connect_cback (tGATT_IF gatt_if, BD_ADDR bda, UINT16 conn_i UNUSED(gatt_if); UNUSED (transport); - GATT_TRACE_EVENT5 ("srvc_eng_connect_cback: from %08x%04x connected:%d conn_id=%d reason = 0x%04x", + GATT_TRACE_EVENT ("srvc_eng_connect_cback: from %08x%04x connected:%d conn_id=%d reason = 0x%04x", (bda[0]<<24)+(bda[1]<<16)+(bda[2]<<8)+bda[3], (bda[4]<<8)+bda[5], connected, conn_id, reason); @@ -355,7 +355,7 @@ static void srvc_eng_connect_cback (tGATT_IF gatt_if, BD_ADDR bda, UINT16 conn_i { if (srvc_eng_clcb_alloc(conn_id, bda) == NULL) { - GATT_TRACE_ERROR0 ("srvc_eng_connect_cback: no_resource"); + GATT_TRACE_ERROR ("srvc_eng_connect_cback: no_resource"); return; } } @@ -421,7 +421,7 @@ tGATT_STATUS srvc_eng_init (void) if (srvc_eng_cb.enabled) { - GATT_TRACE_ERROR0("DIS already initalized"); + GATT_TRACE_ERROR("DIS already initalized"); } else { @@ -431,7 +431,7 @@ tGATT_STATUS srvc_eng_init (void) srvc_eng_cb.gatt_if = GATT_Register(&app_uuid, &srvc_gatt_cback); GATT_StartIf(srvc_eng_cb.gatt_if); - GATT_TRACE_DEBUG1 ("Srvc_Init: gatt_if=%d ", srvc_eng_cb.gatt_if); + GATT_TRACE_DEBUG ("Srvc_Init: gatt_if=%d ", srvc_eng_cb.gatt_if); srvc_eng_cb.enabled = TRUE; //#if DIS_INCLUDED == TRUE |