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

  • 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?

Related