This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

  • TI Thinks Resolved

CC2650 adding unique id to advertising or identify a single sensortag

Prodigy 210 points

Replies: 3

Views: 1950

Hello together,

we are developing with the SensorTag as base a product to track movement of people, the sensor get's pinned under their seat and with the old SensorTag we had some success and the base features worked as planned.

Now we switched to the new CC2650, as it has an external flash memory, the movement sensor is already a combined sensor (on CC2541 we changed the accelerometer and gyroscope to a 6 axis mpu) and some other points. Hardware development is done by another company by our definitions, we only do the firmware changes.

With Android every BLE-Device will get identified by a unique identifier that won't change, think it's the device address.

On iOS the BLE CentralManager i use in my App creates a UDID for every Bluetooth Device when it discovers it first, but it wil not always stay the same after Bluetooth restarting, or phone shutdown.

So i wanted to add the device address to advertising data, like it is in the device information block. But my first try resulted in a bricked SensorTag, which i only could repair using the stock firmware with Flash Programmer.

So far i guessed i should have to use "GAP_ADTYPE_LE_BD_ADDR" and wanted to add it using the same code as for device info

uint8_t ownAddress[B_ADDR_LEN];

GAPRole_GetParameter(GAPROLE_BD_ADDR, ownAddress);

I'm a learned software programmer, this is now my first hardware programming project, mostly before i did websites and mobile apps.

  • Hi Stephan,

    You would indeed have to add something to the advertisement data, as iOS mangles the device address.

    One way is to add a couple of letters to the LocalName, or you could add a field for manufacturer specific data, for example,
    0x05, // Length of field
    GAP_ADTYPE_MANUFACTURER_SPECIFIC,
    LO_UINT16(0x000D), HI_UINT16(0x000D), // Vendor ID (Texas Instruments)
    0xAA,
    0xBB

    BR,
    Aslak

    --
    PS. Thank you for clicking  Verify Answer below if this answered your question!

  • In reply to Aslak N.:

    static uint8_t advertData[] =
    {
      // Flags; this sets the device to use limited discoverable
      // mode (advertises for 30 seconds at a time) instead of general
      // discoverable mode (advertises indefinitely)
      0x02,   // length of this data
      GAP_ADTYPE_FLAGS,
      DEFAULT_DISCOVERABLE_MODE | GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED,
    
      // service UUID, to notify central devices what services are included
      // in this peripheral
      0x03,   // length of this data
      GAP_ADTYPE_16BIT_MORE,      // some of the UUID's, but not all
    #ifdef FEATURE_LCD
      LO_UINT16(DISPLAY_SERV_UUID),
      HI_UINT16(DISPLAY_SERV_UUID),
    #else
      LO_UINT16(MOVEMENT_SERV_UUID),
      HI_UINT16(MOVEMENT_SERV_UUID),
    #endif
    
      // Manufacturer specific advertising data
      0x06,
      GAP_ADTYPE_MANUFACTURER_SPECIFIC,
      LO_UINT16(TI_COMPANY_ID),
      HI_UINT16(TI_COMPANY_ID),
      TI_ST_DEVICE_ID,
      TI_ST_KEY_DATA_ID,
      0x00                                    // Key state
    };

    This is the current Code for advertising data, we would not need something to keep our tags unique only, but every single tag should have its own unique id,
    that's why i thought of the device address.

    It can happen, that a customer has like 10 of our tags in the office and i want to add to the user settings in the app, what's the tag of the current person.
    For that i wanted to have a unique id in the advertising data.

    In the current SensorTag advertisement data is the manufacturer data as "0d000300 00"

  • In reply to Stephan Maier:

    Very good.

    You could use the last N bytes of the device address, and slap that onto the end of your current manuf data. You often see WiFi routers doing this kind of thing.

    The first 3 bytes of the address is just the Organizational Unique Identifier for a Texas Instruments controlled block of addresses.

    Best regards,
    Aslak

    --
    PS. Thank you for clicking  Verify Answer below if this answered your question!

This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.