@@ -134,14 +134,14 @@ uint8_t attsCsfIsClientChangeAware(dmConnId_t connId, uint16_t handle)
134
134
/*!
135
135
* \brief Update client change-aware state based on protocol event.
136
136
*
137
- * \param connId Connection handle .
137
+ * \param connId Connection ID .
138
138
* \param opcode ATT PDU type.
139
139
* \param pPacket Data packet from L2CAP.
140
140
*
141
141
* \return \ref ATT_SUCCESS if client is change-aware, else \ref ATT_ERR_DATABASE_OUT_OF_SYNC.
142
142
*/
143
143
/*************************************************************************************************/
144
- uint8_t attsCsfActClientState (uint16_t handle , uint8_t opcode , uint8_t * pPacket )
144
+ uint8_t attsCsfActClientState (dmConnId_t connId , uint8_t opcode , uint8_t * pPacket )
145
145
{
146
146
uint8_t err = ATT_SUCCESS ;
147
147
attsCsfRec_t * pRec ;
@@ -152,7 +152,7 @@ uint8_t attsCsfActClientState(uint16_t handle, uint8_t opcode, uint8_t *pPacket)
152
152
return err ;
153
153
}
154
154
155
- pRec = & attsCsfCb .attsCsfTable [handle ];
155
+ pRec = & attsCsfCb .attsCsfTable [connId - 1 ];
156
156
157
157
/* If the client is change-unaware */
158
158
if (pRec -> changeAwareState == ATTS_CLIENT_CHANGE_UNAWARE )
@@ -167,7 +167,7 @@ uint8_t attsCsfActClientState(uint16_t handle, uint8_t opcode, uint8_t *pPacket)
167
167
/* Move client change-aware state to pending */
168
168
pRec -> changeAwareState = ATTS_CLIENT_CHANGE_PENDING_AWARE ;
169
169
170
- ATT_TRACE_INFO2 ("ConnId %d change aware state is %d" , handle + 1 ,
170
+ ATT_TRACE_INFO2 ("ConnId %d change aware state is %d" , connId ,
171
171
ATTS_CLIENT_CHANGE_PENDING_AWARE );
172
172
}
173
173
@@ -189,12 +189,12 @@ uint8_t attsCsfActClientState(uint16_t handle, uint8_t opcode, uint8_t *pPacket)
189
189
/* Move client change-aware state to aware */
190
190
pRec -> changeAwareState = ATTS_CLIENT_CHANGE_AWARE ;
191
191
192
- ATT_TRACE_INFO2 ("ConnId %d change aware state is %d" , handle + 1 , ATTS_CLIENT_CHANGE_AWARE );
192
+ ATT_TRACE_INFO2 ("ConnId %d change aware state is %d" , connId , ATTS_CLIENT_CHANGE_AWARE );
193
193
194
194
/* Callback to application to store updated awareness, if bonded. */
195
195
if (attsCsfCb .writeCback != NULL )
196
196
{
197
- attsCsfCb .writeCback (handle + 1 , pRec -> changeAwareState , & pRec -> csf );
197
+ attsCsfCb .writeCback (connId , pRec -> changeAwareState , & pRec -> csf );
198
198
}
199
199
}
200
200
else
@@ -227,15 +227,15 @@ uint8_t attsCsfActClientState(uint16_t handle, uint8_t opcode, uint8_t *pPacket)
227
227
*/
228
228
pRec -> changeAwareState = ATTS_CLIENT_CHANGE_AWARE_DB_READ_PENDING ;
229
229
230
- ATT_TRACE_INFO2 ("ConnId %d change aware state is %d" , handle + 1 ,
230
+ ATT_TRACE_INFO2 ("ConnId %d change aware state is %d" , connId ,
231
231
ATTS_CLIENT_CHANGE_AWARE_DB_READ_PENDING );
232
232
}
233
233
}
234
234
}
235
235
236
236
if (err == ATT_ERR_DATABASE_OUT_OF_SYNC )
237
237
{
238
- ATT_TRACE_INFO2 ("ConnId %d out of sync, PDU with opcode 0x%02x ignored!" , handle + 1 , opcode );
238
+ ATT_TRACE_INFO2 ("ConnId %d out of sync, PDU with opcode 0x%02x ignored!" , connId , opcode );
239
239
}
240
240
241
241
return err ;
0 commit comments