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.

ios7 device name (null)

Other Parts Discussed in Thread: CC2541

Hi,

I use a simple Sensor-tag application on ios and on my own cc2541 board with BLE stack 1.4.

I changed the device name on cc2541 but on ios7 app i see a 'null' name.

why it is happened ? i have a another device that i see its  name. both of them with same code

---- 

2014-04-28 15:41:58.146 TempDrom[176:60b] Found a BLE Device : <CBPeripheral: 0x16d44f40 identifier = AECA94D3-506D-4648-7BE3-AC8B2211CB9B, Name = "(null)", state = disconnected>

2014-04-28 15:41:58.148 TempDrom[176:60b] RSSI is -90.000000

2014-04-28 15:41:58.149 TempDrom[176:60b] ADVER {

    kCBAdvDataChannel = 37;

    kCBAdvDataIsConnectable = 1;

}

---

  • Hey Maxim,

    How are you setting the name within your CC2541 firmware?

    The Sensor Tag app includes a local name within the scan response data packet and there is also a device name attribute. Make sure you are setting both as the device name att defaults to 0 or null.

    What may be happening is one of your devices sees the name in the scan response packet and displays it while the other device looks for the device name attribute. To determine the device name att a connection will be made so the name can be read but some apps do this under the scenes.

    For instance on our multitool app, the device shows up as "TI BLE Sensor Tag" which is the attribute (meaning it formed a connection behind the scenes) but if I used the BLE Device Monitor it shows "SensorTag" which is the name given in the scan response packet because I haven't told it to connect yet. Hopefully that helps with debugging the differences between your two central devices.

    -Matt

  • Hi Matt,

    this is my name settings. I changed it to my device name:

    static uint8 scanRspData[] =
    {
    // complete name
    0x08, // length of this data /?0x0A
    GAP_ADTYPE_LOCAL_NAME_COMPLETE,
    0x53, // 'S'
    0x44, // 'D'
    0x53, // 'S'
    0x3e, // ' '
    0x54, // 'T'
    0x44, // 'D'
    0x50, // 'P'
    // 0x61, // 'a'
    // 0x67, // 'g'

    // connection interval range
    0x05, // length of this data
    GAP_ADTYPE_SLAVE_CONN_INTERVAL_RANGE,
    LO_UINT16( DEFAULT_DESIRED_MIN_CONN_INTERVAL ),
    HI_UINT16( DEFAULT_DESIRED_MIN_CONN_INTERVAL ),
    LO_UINT16( DEFAULT_DESIRED_MAX_CONN_INTERVAL ),
    HI_UINT16( DEFAULT_DESIRED_MAX_CONN_INTERVAL ),

    // Tx power level
    0x02, // length of this data
    GAP_ADTYPE_POWER_LEVEL,
    0 // 0dBm
    };

    static uint8 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,
    };

    static uint8 attDeviceName[] = "SDS TDP";

      GGS_SetParameter( GGS_DEVICE_NAME_ATT, sizeof(attDeviceName), attDeviceName );

    GAPRole_SetParameter( GAPROLE_SCAN_RSP_DATA, sizeof ( scanRspData ), scanRspData );
    GAPRole_SetParameter( GAPROLE_ADVERT_DATA, sizeof( advertData ), advertData );

    on one board i see on ios the "SDS TDP", but on on second board it is "null".

    how can i resolve this issue.

    Thanks

  • In your code you are setting the device name attribute and the name that is sent in the scan response to the exact same value: "SDS TDP". This means we can't tell if your central devices are reading the name off the scan response packet or making a connection and reading the attribute.

    Set the scan response name to something different than the attribute name and see which names your central devices report.

    Also another thought is are you scanning with both central devices simultaneously? Or are these independent scans where you have this SDS TDP device advertising and you scan with only one device at a time (the other central device remains idle for the entire duration)?

    -Matt

  • hi,

    thanks for help.

    1. I see on my ios app only attribute name.

    2. I scan only with one central for one peripheral , in future i will scan for more then one peripherals with same central.

    it is legal? or i nee to change something in the firmware?

  • Yeah that is legal. I've read back through this thread and realized that I'm not 100% sure what your test set up is. My current understanding is:

     You have one peripheral device (what is the HW? Sensor Tag?) that is running the SensorTag firmware with only modified name. You have an iOS central device that can see the advertisements but does not give you the correct name.

    You use another device (what is the HW?) that is running the SensorTag firmware with only modified name and you are able to see the name on the iOS device.

    Now to help narrow down which of the variables is causing issues.

    1. If you run the unmodified SensorTag firmware on both devices do you still see the name as null for one of the devices?

    2. What is the HW for each of the peripherals you are using? Specifically what are the differences if any with the device that doesn't properly show the name?

    3. You are running the SensorTag app on the iOS device and making no changes between trials, right?

    -Matt

  • Hi Matt,

    My setup is:

    one iPhone 4S device, 2 boards with CC2541 (ID1,ID2) chip that i want to connect them to the ios sensor tag APP.

    I use accelerometer profile to transmit and receive data from my boards that runs sensor tag application BLE stuck 1.4.

    The result is that when i try to connect  ID1 to ios i  can recognize its name "SDS TDP" (attDeviceName[] = "SDS TDP").

    But second device is not recognized on ios.

    P.S. i changed the names and it's still "nul" name.

     

    Thanks

  • Based on what you're saying the only difference between the two devices may be the board.

    What CC2541 boards are you using? Is it something from TI like the sensor tag or key fob or is it custom?

    -Matt

  • this is two custom boards, with same HW and SW. 

  • Is there a pattern for which device has the null name?

    For instance, is it always the second device you try to connect even if you change which board connects second, is it always a particular board ID regardless of what image you flash on to that board?

    -Matt

  • Hi,

    It looks like iOS doesn't get the scan response data, from your information.

    However, when you connect, iOS should be able to read the device name and show this instead. It seems from experience that iOS will use adv/scanrsp data for name first, and ATT device name when connected once.

    Are you sure you actually set the scan response data? How about putting the device name in the advertising data for more robustness? Also, having different names for localname and device name helps find out where iOS finds its values.

    A last note, you don't need 0xAB, // 'X', you can just do 'N', 'a', 'm', 'e', for the name array and the compiler will exchange the chars with actual data. Not sure why the original developer went with hexadecimals.

    BR,
    Aslak