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.

CC2640R2F: Can't change advertised named in Project 0

Part Number: CC2640R2F

I was playing around with the project 0 for the CC2640R2F launchpad. I modifed all the device info strings in devinfoservice.c and saw those take effect. 

I tried editing the name from Project Zero R2 to My Project and then Project Zero R3 and neither took. I saw it was defined in project_zero.c and project_zero_soln.c. I changed it in both locations. I also cleared all cache and data for bluetooth and bluetooth scanner (on android / google pixel). I don't know why there is both a project_zero and project_zero_soln or what one is for vs. the other. But I'm confused as to why a simple string update would not take and want to get that resolved before I keep hacking away trying to get what I need to work.

  • Hello Michael,

    Specifically, which string did you modify? Some handsets look at the GAP Device Name and only update the name in the "found devices" list after they form a connection. After a connection has been formed, they ignore the name in the Scan Response, even if you clear the BT cache.

    One trick is to set a 2nd BDADDR using SmartRF Flash Programmer 2. This will "trick" the phone into thinking it's a new device that it has never seen before.

    Best wishes
  • Thanks for the response. I set this line.

    ```
    / GAP GATT Attributes
    static uint8_t attDeviceName[GAP_DEVICE_NAME_LEN] = "Project Zero R3";
    ```

    I'll look into the SmartRF Flash Programmer 2 option. I don't know what that is.
  • Hi Michael,

    When I just tried this on my Project Zero, I actually changed the string in a different location and it seemed to work well. What I changed was in the project_zero.c where there is declared static uint8_t advertData[]. I changed the string and, if necessary, also changed the length, for example:

    // GAP - Advertisement data (max size = 31 bytes, though this is
    // best kept short to conserve power while advertisting)
    static uint8_t advertData[] =
    {
      // Flags; this sets the device to use limited discoverable
      // mode (advertises for 30 seconds at a time) or general
      // discoverable mode (advertises indefinitely), depending
      // on the DEFAULT_DISCOVERY_MODE define.
      0x02,   // length of this data
      GAP_ADTYPE_FLAGS,
      DEFAULT_DISCOVERABLE_MODE | GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED,
    
      // complete name
      14,   //changed from 16
      GAP_ADTYPE_LOCAL_NAME_COMPLETE,
      'K', 'a', 't', 'i', 'e', ' ', 'Z', 'e', 'r', 'o', ' ','R','2', // my new advert name
    
    };

    Looking at the code, I believe that later on in your code this value actually overwrites the array that you changed (there's a memcopy), and so if this was still at the default value I think this is why your change wasn't sticking.

    Hope this helps!

    Regards,

    Katie