21
21
#include " BLEPeripheralHelper.h"
22
22
#include " internal/ble_client.h"
23
23
24
- uint8_t profile_notify_process (struct bt_conn *conn,
25
- struct bt_gatt_subscribe_params *params,
26
- const void *data, uint16_t length);
27
- uint8_t profile_read_rsp_process (struct bt_conn *conn, int err,
28
- struct bt_gatt_read_params *params,
24
+ uint8_t profile_notify_process (bt_conn_t *conn,
25
+ bt_gatt_subscribe_params_t *params,
26
+ const void *data, uint16_t length);
27
+ uint8_t profile_read_rsp_process (bt_conn_t *conn, int err,
28
+ bt_gatt_read_params_t *params,
29
29
const void *data,
30
30
uint16_t length);
31
31
32
32
unsigned char BLECharacteristic::_numNotifyAttributes = 0 ;
33
33
34
- struct bt_uuid_16 BLECharacteristic::_gatt_chrc_uuid = {BT_UUID_TYPE_16, BT_UUID_GATT_CHRC_VAL};
35
- struct bt_uuid_16 BLECharacteristic::_gatt_ccc_uuid = {BT_UUID_TYPE_16, BT_UUID_GATT_CCC_VAL};
34
+ bt_uuid_16_t BLECharacteristic::_gatt_chrc_uuid = {BT_UUID_TYPE_16, BT_UUID_GATT_CHRC_VAL};
35
+ bt_uuid_16_t BLECharacteristic::_gatt_ccc_uuid = {BT_UUID_TYPE_16, BT_UUID_GATT_CCC_VAL};
36
36
37
37
BLECharacteristic::BLECharacteristic (const char * uuid,
38
38
const unsigned char properties,
@@ -246,12 +246,12 @@ BLECharacteristic::numNotifyAttributes(void) {
246
246
return _numNotifyAttributes;
247
247
}
248
248
249
- struct _bt_gatt_ccc * BLECharacteristic::getCccCfg (void )
249
+ _bt_gatt_ccc_t * BLECharacteristic::getCccCfg (void )
250
250
{
251
251
return &_ccc_value;
252
252
}
253
253
254
- struct bt_gatt_chrc * BLECharacteristic::getCharacteristicAttValue (void )
254
+ bt_gatt_chrc_t * BLECharacteristic::getCharacteristicAttValue (void )
255
255
{
256
256
return &_gatt_chrc;
257
257
}
@@ -270,32 +270,32 @@ uint8_t BLECharacteristic::getPermission(void)
270
270
return perm;
271
271
}
272
272
273
- struct bt_uuid * BLECharacteristic::getCharacteristicAttributeUuid (void )
273
+ bt_uuid_t * BLECharacteristic::getCharacteristicAttributeUuid (void )
274
274
{
275
- return (struct bt_uuid *) &_gatt_chrc_uuid;
275
+ return (bt_uuid_t *) &_gatt_chrc_uuid;
276
276
}
277
- struct bt_uuid * BLECharacteristic::getClientCharacteristicConfigUuid (void )
277
+ bt_uuid_t * BLECharacteristic::getClientCharacteristicConfigUuid (void )
278
278
{
279
- return (struct bt_uuid *) &_gatt_ccc_uuid;
279
+ return (bt_uuid_t *) &_gatt_ccc_uuid;
280
280
}
281
281
282
282
283
- void BLECharacteristic::addCharacteristicDeclaration (struct bt_gatt_attr *gatt_attr)
283
+ void BLECharacteristic::addCharacteristicDeclaration (bt_gatt_attr_t *gatt_attr)
284
284
{
285
285
_attr_chrc_declaration = gatt_attr;
286
286
}
287
287
288
- void BLECharacteristic::addCharacteristicValue (struct bt_gatt_attr *gatt_attr)
288
+ void BLECharacteristic::addCharacteristicValue (bt_gatt_attr_t *gatt_attr)
289
289
{
290
290
_attr_chrc_value = gatt_attr;
291
291
}
292
292
293
- void BLECharacteristic::addCharacteristicConfigDescriptor (struct bt_gatt_attr *gatt_attr)
293
+ void BLECharacteristic::addCharacteristicConfigDescriptor (bt_gatt_attr_t *gatt_attr)
294
294
{
295
295
_attr_cccd = gatt_attr;
296
296
}
297
297
298
- void BLECharacteristic::discover (struct bt_gatt_discover_params *params)
298
+ void BLECharacteristic::discover (bt_gatt_discover_params_t *params)
299
299
{
300
300
params->type = BT_GATT_DISCOVER_CHARACTERISTIC;
301
301
params->uuid = this ->uuid ();
@@ -306,8 +306,8 @@ void BLECharacteristic::discover(struct bt_gatt_discover_params *params)
306
306
}
307
307
308
308
309
- void BLECharacteristic::discover (const struct bt_gatt_attr *attr,
310
- struct bt_gatt_discover_params *params)
309
+ void BLECharacteristic::discover (const bt_gatt_attr_t *attr,
310
+ bt_gatt_discover_params_t *params)
311
311
{
312
312
if (!attr)
313
313
{
@@ -340,15 +340,15 @@ void BLECharacteristic::discover(const struct bt_gatt_attr *attr,
340
340
}
341
341
}
342
342
343
- struct bt_gatt_subscribe_params *BLECharacteristic::getSubscribeParams ()
343
+ bt_gatt_subscribe_params_t *BLECharacteristic::getSubscribeParams ()
344
344
{
345
345
return &_sub_params;
346
346
}
347
347
348
348
bool BLECharacteristic::read (BLEPeripheralHelper &peripheral)
349
349
{
350
350
int retval = 0 ;
351
- struct bt_conn * conn = NULL ;
351
+ bt_conn_t * conn = NULL ;
352
352
if (_reading)
353
353
{
354
354
// Already in reading state
@@ -387,7 +387,7 @@ bool BLECharacteristic::write(BLEPeripheralHelper &peripheral,
387
387
uint16_t length)
388
388
{
389
389
int retval = 0 ;
390
- struct bt_conn * conn = NULL ;
390
+ bt_conn_t * conn = NULL ;
391
391
392
392
conn = bt_conn_lookup_addr_le (peripheral.bt_le_address ());
393
393
if (NULL == conn)
0 commit comments