Reply
Posts: 16
Registered: ‎11-04-2015

Creating BLE112 USB Dongle Custom Manufacturing Scan Response

I have a small C++ app controlling the BLE112 USB Dongle from Linux and the GATT server works great. 

 

Currently, I am advertising a custom Device Name as a scan response with the following code:

 

        // build custom scan response data (i.e. the Device Name value)
        uint8 sr_data[] = {
            0x1A, // field length
            9, // field type
            'C', 'U', 'S', 'T', 'O', 'M', 'D', 'E', 'V', 'I', 'C', 'E', 'N', 'A', 'M', 'E', 'O', 'F', 'M', 'Y', 'D','E','V','I','C'
        };

        // Setup the scan response data
        ble_cmd_gap_set_adv_data(1, 0x1B, sr_data);

My iPhone successfully sees this device name as shown in the following picture:

 

device_name.png

 

Now I want to replace the Device Name with a custom Scan Response representing Manufacturing data. I tried to do that with the following code:

         build custom scan response data
        uint8 sr_data[] = {
            0xFF, // field type
            0x01, // BLE Manufacturer ID 1
            0x5D, // BLE Manufacturer ID 2
            0x03, // Bytes to Follow
            0x02, // Our Group
            0x01, // Legacy Product Family
            0x01, // Platform Family
        };

        // Setup the scan response data
        ble_cmd_gap_set_adv_data(1, 0x08, sr_data);

When I make only this one change and run, my iPhone does not see any additional advertising data:

 

no_data.png

 

What do I need to do to broadcast my custom manufacturing data?

Highlighted
Posts: 2,826
Registered: ‎08-25-2015

Re: Creating BLE112 USB Dongle Custom Manufacturing Scan Response

Hi,

 

That could be some restriction with the iPhone, it's not something we can help you with. Can you just verify with a second BLED112+BLE-GUI that the data is being sent correctly in the advertisement packet?

 

Keep in mind that if you change the advertisement data you should stop and re-start advertising for the new data to be taken into effect.

 

Regards,

Tiago

Posts: 2,676
Registered: ‎09-01-2015

Re: Creating BLE112 USB Dongle Custom Manufacturing Scan Response

@PhilBot in your second code example, you are missing the length byte before the 0xFF AD type indicator. The length of your custom AD element is 8 bytes and therefore the first byte should be 0x07.