Skip to content

Commit d1672aa

Browse files
pan-paul-szczepanek-arm
authored andcommitted
BLE: Update level of traces in GattServer
1 parent 957486e commit d1672aa

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

connectivity/FEATURE_BLE/source/cordio/source/GattServerImpl.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ GattServer &GattServer::getInstance()
7272

7373
void GattServer::initialize()
7474
{
75+
tr_info("Initialize GattServer");
7576
#if BLE_FEATURE_SECURITY
7677
AttsAuthorRegister(atts_auth_cb);
7778
#endif
@@ -1043,6 +1044,7 @@ GapAdvertisingData::Appearance GattServer::getAppearance()
10431044

10441045
ble_error_t GattServer::reset(ble::GattServer* server)
10451046
{
1047+
tr_info("Reset GattServer");
10461048
/* Notify that the instance is about to shutdown */
10471049
if (eventHandler) {
10481050
eventHandler->onShutdown(*server);
@@ -1105,6 +1107,7 @@ void GattServer::att_cb(const attEvt_t *evt)
11051107
{
11061108
if (evt->hdr.status == ATT_SUCCESS && evt->hdr.event == ATT_MTU_UPDATE_IND) {
11071109
ble::GattServer::EventHandler *handler = getInstance().getEventHandler();
1110+
tr_info("Connection %d: Att MTU changed, new MTU size is %d bytes", evt->hdr.param, evt->mtu);
11081111
if (handler) {
11091112
handler->onAttMtuChange(evt->hdr.param, evt->mtu);
11101113
}
@@ -1135,7 +1138,7 @@ uint8_t GattServer::atts_read_cb(
11351138
auth_cb->read_cb.call(&read_auth_params);
11361139

11371140
if (read_auth_params.authorizationReply != AUTH_CALLBACK_REPLY_SUCCESS) {
1138-
tr_error("Request to read attribute %d on connection %d declined with authorization reply %s",
1141+
tr_warning("Request to read attribute %d on connection %d declined with authorization reply %s",
11391142
handle,
11401143
connId,
11411144
to_string(read_auth_params.authorizationReply & 0xFF));
@@ -1147,7 +1150,7 @@ uint8_t GattServer::atts_read_cb(
11471150
*pAttr->pLen = read_auth_params.len;
11481151
}
11491152

1150-
tr_info("Read attribute %d on connection %d - value=%s",
1153+
tr_debug("Read attribute %d on connection %d - value=%s",
11511154
handle,
11521155
connId,
11531156
mbed_trace_array(pAttr->pValue, *pAttr->pLen));
@@ -1175,10 +1178,8 @@ uint8_t GattServer::atts_write_cb(
11751178
attsAttr_t *pAttr
11761179
)
11771180
{
1178-
tr_info("Write attribute %d on connection %d - value=%s",
1179-
handle,
1180-
connId,
1181-
mbed_trace_array(pValue, len));
1181+
tr_debug("Connection %d: Write attribute %d, operation=%d, offset=%d, value=%s",
1182+
connId, handle, operation, offset, mbed_trace_array(pValue, len));
11821183

11831184
char_auth_callback* auth_cb = getInstance().get_auth_callback(handle);
11841185
if (auth_cb && auth_cb->write_cb) {
@@ -1194,7 +1195,7 @@ uint8_t GattServer::atts_write_cb(
11941195
auth_cb->write_cb.call(&write_auth_params);
11951196

11961197
if (write_auth_params.authorizationReply != AUTH_CALLBACK_REPLY_SUCCESS) {
1197-
tr_error("Request to write attribute %d on connection %d declined with authorization reply %s",
1198+
tr_warning("Request to write attribute %d on connection %d declined with authorization reply %s",
11981199
handle,
11991200
connId,
12001201
to_string(write_auth_params.authorizationReply & 0xFF));
@@ -1270,7 +1271,7 @@ uint8_t GattServer::atts_write_cb(
12701271

12711272
uint8_t GattServer::atts_auth_cb(dmConnId_t connId, uint8_t permit, uint16_t handle)
12721273
{
1273-
tr_info("Authenticate R/W request for attribute %d on connection %d", handle, connId);
1274+
tr_debug("Authenticate R/W request for attribute %d on connection %d", handle, connId);
12741275

12751276
#if BLE_FEATURE_SECURITY
12761277
// this CB is triggered when read or write of an attribute (either a value
@@ -1751,7 +1752,7 @@ void GattServer::handleEvent(
17511752
}
17521753
break;
17531754
case GattServerEvents::GATT_EVENT_CONFIRMATION_RECEIVED:
1754-
tr_info("Confirmation received for attribute %d on connection %d", attributeHandle, connHandle);
1755+
tr_debug("Confirmation received for attribute %d on connection %d", attributeHandle, connHandle);
17551756
if(eventHandler) {
17561757
GattConfirmationReceivedCallbackParams params({
17571758
.connHandle = connHandle,
@@ -1767,7 +1768,7 @@ void GattServer::handleEvent(
17671768
break;
17681769

17691770
case GattServerEvents::GATT_EVENT_DATA_SENT:
1770-
tr_info("Data sent for attribute %d on connection %d", attributeHandle, connHandle);
1771+
tr_debug("Data sent for attribute %d on connection %d", attributeHandle, connHandle);
17711772
if(eventHandler) {
17721773
GattDataSentCallbackParams params({
17731774
.connHandle = connHandle,

0 commit comments

Comments
 (0)