mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 14:27:37 +08:00
drivers/bluetooth: Extend device simulation. Now makes it all the way through initialization without error. wireless/bluetooth: Add support for IOCTL commangs to get BR/EDR and LE features.
This commit is contained in:
@@ -405,7 +405,7 @@ void bt_buf_release(FAR struct bt_buf_s *buf)
|
||||
* pool.
|
||||
*/
|
||||
|
||||
if (buf->frame == NULL)
|
||||
if (buf->frame != NULL)
|
||||
{
|
||||
iob_free(buf->frame);
|
||||
buf->frame = NULL;
|
||||
|
||||
@@ -305,6 +305,35 @@ int btnet_ioctl(FAR struct net_driver_s *dev, int cmd, unsigned long arg)
|
||||
}
|
||||
break;
|
||||
|
||||
/* SIOCGBTFEAT
|
||||
* Get Bluetooth BR/BDR device Features. This returns the cached
|
||||
* basic (page 0) and extended (page 1 & 2) features. Only page 0
|
||||
* is valid.
|
||||
* SIOCGBTLEFEAT
|
||||
* Get Bluetooth LE device Features. This returns the cached page
|
||||
* 0-2 features. Only page 0 is value.
|
||||
*/
|
||||
|
||||
case SIOCGBTFEAT:
|
||||
case SIOCGBTLEFEAT:
|
||||
{
|
||||
FAR const uint8_t *src;
|
||||
|
||||
memset(&btreq->btru.btrf, 0, sizeof(btreq->btru.btrf));
|
||||
if (cmd == SIOCGBTFEAT)
|
||||
{
|
||||
src = g_btdev.features;
|
||||
}
|
||||
else
|
||||
{
|
||||
src = g_btdev.le_features;
|
||||
}
|
||||
|
||||
memcpy(btreq->btr_features0, src, 8);
|
||||
ret = OK;
|
||||
}
|
||||
break;
|
||||
|
||||
/* SIOCBTADVSTART: Set advertisement data, scan response data,
|
||||
* advertisement parameters and start advertising.
|
||||
*/
|
||||
|
||||
@@ -1536,11 +1536,6 @@ static int smp_self_test(void)
|
||||
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
static inline int smp_self_test(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user