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.

difference between deviceName[] and attDeviceName?

Hey guys,

Sorry, this is a little embarrassing, but we're still a little confused as to why there are two ways of setting the deviceName; deviceName[]  and attDeviceName, below.  Any help clearing it up for us?   Thank you in advance... sorry, it's probably simple, but having a hard time finding the answer.

Also, any pointers to how we get our own VendorID (other than TI) for an actual released product?

Thanks,
Brian


// GAP - SCAN RSP data (max size = 31 bytes)
static uint8 deviceName[] =
{
  // complete name
  0x0b,   // length of first data structure (11 bytes excluding length byte)
  0x09,   // AD Type = Complete local name
  0x4b,   // 'K'
  0x65,   // 'e'
  0x79,   // 'y'
  0x66,   // 'f'
  0x6f,   // 'o'
  0x62,   // 'b'
  0x64,   // 'd'
  0x65,   // 'e'
  0x6d,   // 'm'
  0x6f,   // 'o'
};


// GAP GATT Attributes
static uint8 attDeviceName[GAP_DEVICE_NAME_LEN] = "TI BLE Keyfob";

  • Hey guys, anyone out there have a quick thought on this?

    The reason we ask, is that we believe that on the iPhone app (example provided by TI) (in TIBLECBKeyfob.m -- code below) sometimes ends up doing a compare against deviceName instead of attDeviceName.   In the Keyfob app, it makes no difference since is a compare the string including "Keyfob," and works, but we're confused as to what's going on here.  Why are there two stings -- and on the iOS side of things, which one should the app be comparing against?    Or does it change?

    if ([peripheral.name rangeOfString:@"Keyfob"].location != NSNotFound) {
            [self connectPeripheral:peripheral];
            printf("Found a keyfob, connecting..\n");

    Thanks!
    Brian

  • Hi,

    I'm not really into iOS, but I seem to remember that iOS would use AD_LocalName first, and then change to attDeviceName when this had been discovered, and use this from then on.

    This is probably something you need to experiment with. This behavior was with iOS 5 and 6.early.

    Best regards,
    Aslak 

  • Thanks Aslak!

    Thanks.  That's what we're seeing too.  We just didn't understand why there were provisions for both, but we'll go with it.  Things are working well.

    For a released product do we need to change the company ID?  I believe Texas Instruments is still in there 0x0d -- or something like that in the advertising message.   If so, where do we go for that?

    Thanks,

    Brian