@@ -72,6 +72,7 @@ GattServer &GattServer::getInstance()
72
72
73
73
void GattServer::initialize ()
74
74
{
75
+ tr_info (" Initialize GattServer" );
75
76
#if BLE_FEATURE_SECURITY
76
77
AttsAuthorRegister (atts_auth_cb);
77
78
#endif
@@ -1043,6 +1044,7 @@ GapAdvertisingData::Appearance GattServer::getAppearance()
1043
1044
1044
1045
ble_error_t GattServer::reset (ble::GattServer* server)
1045
1046
{
1047
+ tr_info (" Reset GattServer" );
1046
1048
/* Notify that the instance is about to shutdown */
1047
1049
if (eventHandler) {
1048
1050
eventHandler->onShutdown (*server);
@@ -1105,6 +1107,7 @@ void GattServer::att_cb(const attEvt_t *evt)
1105
1107
{
1106
1108
if (evt->hdr .status == ATT_SUCCESS && evt->hdr .event == ATT_MTU_UPDATE_IND) {
1107
1109
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 );
1108
1111
if (handler) {
1109
1112
handler->onAttMtuChange (evt->hdr .param , evt->mtu );
1110
1113
}
@@ -1135,7 +1138,7 @@ uint8_t GattServer::atts_read_cb(
1135
1138
auth_cb->read_cb .call (&read_auth_params);
1136
1139
1137
1140
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" ,
1139
1142
handle,
1140
1143
connId,
1141
1144
to_string (read_auth_params.authorizationReply & 0xFF ));
@@ -1147,7 +1150,7 @@ uint8_t GattServer::atts_read_cb(
1147
1150
*pAttr->pLen = read_auth_params.len ;
1148
1151
}
1149
1152
1150
- tr_info (" Read attribute %d on connection %d - value=%s" ,
1153
+ tr_debug (" Read attribute %d on connection %d - value=%s" ,
1151
1154
handle,
1152
1155
connId,
1153
1156
mbed_trace_array (pAttr->pValue , *pAttr->pLen ));
@@ -1175,10 +1178,8 @@ uint8_t GattServer::atts_write_cb(
1175
1178
attsAttr_t *pAttr
1176
1179
)
1177
1180
{
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));
1182
1183
1183
1184
char_auth_callback* auth_cb = getInstance ().get_auth_callback (handle);
1184
1185
if (auth_cb && auth_cb->write_cb ) {
@@ -1194,7 +1195,7 @@ uint8_t GattServer::atts_write_cb(
1194
1195
auth_cb->write_cb .call (&write_auth_params);
1195
1196
1196
1197
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" ,
1198
1199
handle,
1199
1200
connId,
1200
1201
to_string (write_auth_params.authorizationReply & 0xFF ));
@@ -1270,7 +1271,7 @@ uint8_t GattServer::atts_write_cb(
1270
1271
1271
1272
uint8_t GattServer::atts_auth_cb (dmConnId_t connId, uint8_t permit, uint16_t handle)
1272
1273
{
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);
1274
1275
1275
1276
#if BLE_FEATURE_SECURITY
1276
1277
// this CB is triggered when read or write of an attribute (either a value
@@ -1751,7 +1752,7 @@ void GattServer::handleEvent(
1751
1752
}
1752
1753
break ;
1753
1754
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);
1755
1756
if (eventHandler) {
1756
1757
GattConfirmationReceivedCallbackParams params ({
1757
1758
.connHandle = connHandle,
@@ -1767,7 +1768,7 @@ void GattServer::handleEvent(
1767
1768
break ;
1768
1769
1769
1770
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);
1771
1772
if (eventHandler) {
1772
1773
GattDataSentCallbackParams params ({
1773
1774
.connHandle = connHandle,
0 commit comments