This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF51822 ( S110 )- how can I change the device name?

Hi, I am trying to change the beacon data.

I changed Beacon UUID already, but I can not find where can I change device name.

I guess I need to change the gap_adv_data. However I can not find that part.

Would you help me to change the device name?

Thanks. Shin

Parents
  • Thanks John.

    I edited the main function

    int main(void) {

    #define DeviceName "MyBeacon"
    
    ble_gap_conn_sec_mode_t *my;
    
    my = (ble_gap_conn_sec_mode_t *)malloc(sizeof(ble_gap_conn_sec_mode_t));
    
    my->sm=1;
    my->lv=1;
    
    //sd_ble_gap_device_name_set(ble_gap_conn_sec_mode_t const * const p_write_perm, uint8_t const * const p_dev_name, uint16_t len));
    sd_ble_gap_device_name_set(my, (uint8_t *)DeviceName, strlen(DeviceName));
    
    // Initialize.
    leds_init();
    ble_stack_init();
    advertising_init();
    
    // Start execution.
    advertising_start();
    
    
    
    // Enter main loop.
    for (;;)
    {
        power_manage();
    }
    

    }

    But the device name is still unknown.

    Is there any problem in my code?

  • And I insert that

    advdata.name_type =BLE_ADVDATA_SHORT_NAME;

Reply Children
No Data
Related