OSDN Git Service

emulator: Store LE advertising data length in btdev
authorJefferson Delfes <jefferson.delfes@openbossa.org>
Wed, 3 Jul 2013 20:54:51 +0000 (16:54 -0400)
committerJohan Hedberg <johan.hedberg@intel.com>
Fri, 5 Jul 2013 08:55:09 +0000 (11:55 +0300)
LE advertising data length will be used for emulating reports in other
virtual devices.

emulator/btdev.c

index a602c05..73174a5 100644 (file)
@@ -90,6 +90,7 @@ struct btdev {
        uint8_t  le_simultaneous;
        uint8_t  le_event_mask[8];
        uint8_t  le_adv_data[31];
+       uint8_t  le_adv_data_len;
 
        uint16_t sync_train_interval;
        uint32_t sync_train_timeout;
@@ -1487,6 +1488,7 @@ static void default_cmd(struct btdev *btdev, uint16_t opcode,
                if (btdev->type == BTDEV_TYPE_BREDR)
                        goto unsupported;
                lsad = data;
+               btdev->le_adv_data_len = lsad->len;
                memcpy(btdev->le_adv_data, lsad->data, 31);
                status = BT_HCI_ERR_SUCCESS;
                cmd_complete(btdev, opcode, &status, sizeof(status));