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

Change the major value

I'm using nRF51822 SoC , is it possible to change the major value when i push the button ? I tried simple assignment but it didn't work so i ask if i have to use the function for handling the writes to the configuration characteristics of the beacon configuration service (beacon_write_handler) or just i change it manually with instructions from the main code ? Is there any example ?

Parents
  • @Zainab: You can change the advertisng data (including the major value) when you are advertising using sd_ble_gap_adv_data_set() as mentioned by Ole Morten here.

    Please check and make sure all parameters are correct and you have success return code when calling.

Reply
  • @Zainab: You can change the advertisng data (including the major value) when you are advertising using sd_ble_gap_adv_data_set() as mentioned by Ole Morten here.

    Please check and make sure all parameters are correct and you have success return code when calling.

Children
  • But i want to change it after advertising.In code, the major value means the mode of the Beacon ( there is 3 modes : mode1(normal), mode3(search),mode4(reset)). I change manually the major_value from the Master Control Panel from 3 to 1 in order to stopping the buzzer but i want to use a function and android application must read the major value to display a message

  • @zainab: I am not quite sure I understand what you are telling. Could you let me know what you have now, and what you want to achieve.

    As mentioned, you can change the major value when you are advertising.

  • @Hung : What shall we put in the sd_ble_gap_adv_set() ? it's quite complicated :/ . We want to change the Major value ( the characteristic of the gatt service ) .

  • @Yasmine: Which SDK are you based your beacon firmware on ? If you are using nRF51 SDK You can have a look at the ble_app_beacon example and at the advertising_init() function in main.c, to know how to configure for sd_ble_gap_adv_set()