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:
Gregory Nutt
2018-04-06 16:22:49 -06:00
parent ea84215059
commit 4fd814982d
7 changed files with 108 additions and 63 deletions
+1 -1
View File
@@ -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;
+29
View File
@@ -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.
*/
-5
View File
@@ -1536,11 +1536,6 @@ static int smp_self_test(void)
return 0;
}
#else
static inline int smp_self_test(void)
{
return 0;
}
#endif
/****************************************************************************