@@ -130,9 +130,10 @@ void BLEHidGeneric::setOutputReportCallback(uint8_t reportID, BLECharacteristic:
130
130
/* ------------------------------------------------------------------*/
131
131
/* Callbacks
132
132
*------------------------------------------------------------------*/
133
- void blehid_generic_protocol_mode_cb (uint16_t conn_hdl, BLECharacteristic* chr, uint8_t * data, uint16_t len)
133
+ void BLEHidGeneric:: blehid_generic_protocol_mode_cb (uint16_t conn_hdl, BLECharacteristic* chr, uint8_t * data, uint16_t len)
134
134
{
135
135
(void ) conn_hdl;
136
+
136
137
BLEHidGeneric& svc = (BLEHidGeneric&) chr->parentService ();
137
138
svc._protocol_mode = *data;
138
139
@@ -157,7 +158,7 @@ err_t BLEHidGeneric::begin(void)
157
158
158
159
_chr_protocol->setProperties (CHR_PROPS_READ | CHR_PROPS_WRITE_WO_RESP);
159
160
_chr_protocol->setFixedLen (1 );
160
- _chr_protocol->setWriteCallback (blehid_generic_protocol_mode_cb);
161
+ _chr_protocol->setWriteCallback (BLEHidGeneric:: blehid_generic_protocol_mode_cb);
161
162
VERIFY_STATUS ( _chr_protocol->begin () );
162
163
_chr_protocol->write8 (_protocol_mode);
163
164
}
@@ -250,22 +251,21 @@ err_t BLEHidGeneric::begin(void)
250
251
/* ------------------------------------------------------------------*/
251
252
/* Input Report
252
253
*------------------------------------------------------------------*/
253
- bool BLEHidGeneric::inputReport (uint8_t reportID, void const * data, int len)
254
+ bool BLEHidGeneric::inputReport (uint8_t reportID, void const * data, int len, uint16_t conn_hdl )
254
255
{
255
256
// index is ID-1
256
257
uint8_t const idx = ( reportID ? (reportID-1 ) : 0 );
257
-
258
- return _chr_inputs[idx].notify ( (uint8_t const *) data, len);
258
+ return _chr_inputs[idx].notify ( (uint8_t const *) data, len, conn_hdl);
259
259
}
260
260
261
- bool BLEHidGeneric::bootKeyboardReport (void const * data, int len)
261
+ bool BLEHidGeneric::bootKeyboardReport (void const * data, int len, uint16_t conn_hdl )
262
262
{
263
- return _chr_boot_keyboard_input->notify (data, len);
263
+ return _chr_boot_keyboard_input->notify (data, len, conn_hdl );
264
264
}
265
265
266
- bool BLEHidGeneric::bootMouseReport (void const * data, int len)
266
+ bool BLEHidGeneric::bootMouseReport (void const * data, int len, uint16_t conn_hdl )
267
267
{
268
- return _chr_boot_mouse_input->notify (data, len);
268
+ return _chr_boot_mouse_input->notify (data, len, conn_hdl );
269
269
}
270
270
271
271
/* ------------------------------------------------------------------*/
0 commit comments