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

Advertising on 2 different MAC adresses (iBeacon and Eddystone)

Hi,

i'am using nRF52840 (S140 v 5.0.2-alpha) DK and SDK 14.2.

i'am trying to create an application for Beacon which can advertise on 2 different MAC adresses, is it possible for nRF52 ? 

if yes, i want to advertise ibeacon format on the first MAC adress and eddystone format on the second one.

So, Someone have an idea how to do it ? something like using TIMESLOT API and Softdevice API at the same time.....

thanks, 

regards

Parents
  • Hi,

    I believe you are on the right track here already, so can only confirm what you write. Using for instance the softdevice for the connectable advertisement (eddystone) and timeslot for the non-connectable advertisment (ibeacon) seems like a good idea. There is a blog post and and SDK example in nRF5 SDK v10 that you may find useful to get started:

    https://devzone.nordicsemi.com/tutorials/b/software-development-kit/posts/setting-up-the-timeslot-api 

    and in SDKv10 see: \examples\ble_peripheral\experimental_ble_app_multiactivity_beacon\hrs_advertiser
    (don't use SDKv11)

    Unfortunately there is no such example for the latest nRF5 SDK releases.

  • Hi, thanks for reply, now i secceeded to migrate  the  \nRF5_SDK_11.0.0_89a8197\examples\ble_peripheral\experimental_ble_app_multiactivity_beacon\hrs_advertiser example to nrf52 and i can advertise ibeacon  format (with Timeslot) after being connected eddystone (with sofdevice), but when i try to start advertising  both format, it seems like eddystone only advertise (check it with nrf connect), is it possible to advertise both format at the same time ? 

    thanks,

    
    
  • I have updated my previous answer, please use SDKv10 as reference. It seems SDKv11 use the softdevice to setup a second advertisement only when there is a connection, second advertisment is stopped when there is no connection. While in SDKv10 the timeslot and radio is used directly to setup the second advertisment, thereby you can have two advertisments at the same time. Also make sure that beacon_init.beacon_addr is different from first advertisment (e.g. by beacon_init.beacon_addr[3]++).

  • i have just verified the example in SDKv10, and it seems to be the same example, SDKv10 and SDKv11 both use timeslot ( advertiser_beacon_timeslot.c) to build the example (i have verified the Makefile), and the the second advertisement is in the connection. 

    here is a snippest code for the beacon_init function  

    static void beacon_advertiser_error_handler(uint32_t nrf_error)
     {
         APP_ERROR_HANDLER(nrf_error);
     }
    
    
    /**@brief Function for initializing Beacon timeslot advertiser.
      */
     static void beacon_adv_init(void)
     {
         /* example of MAC adress */
         beacon_init.addr_type  = BLE_GAP_ADDR_TYPE_RANDOM_STATIC;
    	 beacon_init.beacon_addr.addr[0] = 0xfe;
    	 beacon_init.beacon_addr.addr[1] = 0x52;
    	 beacon_init.beacon_addr.addr[2] = 0x48;
    	 beacon_init.beacon_addr.addr[3] = 0x96;
    	 beacon_init.beacon_addr.addr[4] = 0x42;
    	 beacon_init.beacon_addr.addr[5] = 0xC3; //2msb are 11
    
    	 static uint8_t beacon_uuid[] = {BEACON_UUID};
    
         memcpy(beacon_init.uuid.uuid128, beacon_uuid, sizeof(beacon_uuid));
         beacon_init.adv_interval  = BEACON_ADV_INTERVAL;
         beacon_init.major         = BEACON_MAJOR;
         beacon_init.minor         = BEACON_MINOR;
         beacon_init.manuf_id      = COMPANY_IDENTIFIER;
         beacon_init.rssi          = BEACON_RSSI;
         beacon_init.error_handler = beacon_advertiser_error_handler;
    
         uint32_t err_code = sd_ble_gap_addr_set(&beacon_init.beacon_addr);
         APP_ERROR_CHECK(err_code);
    
    
         app_beacon_init(&beacon_init);
     }
     
     int main {
     
     .
     .
     .
     ble_stack_init();
     beacon_adv_init();
     .
     .
     .
     .
     nrf_ble_es_init(on_es_evt);    //start eddystone advertisement
     app_beacon_start();            //start ibeacon timeslot advertisement.
     .
     .
     .
     .
     for (;;) {
    		if (NRF_LOG_PROCESS() == false) {
    			power_manage();
    		}
    }
     
     
     
     
     
     
     }
     
     

    then there is only eddystone advertisment.

    could you tell me where is the problem ?

  • Ok i found the solution, in order to manipulate multiple advertisements, it should be multiple MAC adresses (one for each adv) then set privacy mode ( BLE_GAP_PRIVACY_MODE_DEVICE_PRIVACY) and sd_ble-gap_privacy_set(), then it's done.

    thank you Kenneth for your assist.

  • Hi KEOPS,

    I'm facing the same issue as you were facing, but I could not understand the suggested answer. Could you please highlight the changes to be done? or post a snippet?

Reply Children
No Data
Related