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

The basic Problem - directed broadcast

image description

case BLE_ADV_EVT_PEER_ADDR_REQUEST:
{
    ble_gap_addr_t  peer_address;
    peer_address.addr_type  =   BLE_GAP_ADDR_TYPE_RANDOM_STATIC;            
    peer_address.addr[5] = 0xf0;
    peer_address.addr[4] = 0x1b;
    peer_address.addr[3] = 0x6c;
    peer_address.addr[2] = 0x56;
    peer_address.addr[1] = 0xbe;
    peer_address.addr[0] = 0x01;
    err_code = ble_advertising_peer_addr_reply(&peer_address);
    APP_ERROR_CHECK(err_code);
}
break;

options.ble_adv_directed_enabled =  BLE_ADV_DIRECTED_ENABLED;
options.ble_adv_directed_slow_enabled    = BLE_ADV_DIRECTED_SLOW_ENABLED;
options.ble_adv_directed_slow_interval = APP_ADV_DIRECTED_INTERVAL;
options.ble_adv_directed_slow_timeout  =    APP_ADV_DIRECTED_TIMEOUT_IN_SECONDS;

err_code = ble_advertising_start(BLE_ADV_MODE_DIRECTED);

I am so configured, why don't mobile search to the device?

image description

Parents
  • Hi,

    You should check two things.

    First, check that the byte ordering of the address is correct. addr[0] should be the least significant byte, and addr[5] should be the most significant byte. Is the address you see in the InitA field of the log correct? (Byte ordering is confusing, so it may be wrong byte ordering.)

    Second, check that the address type is correct. You have chosen BLE_GAP_ADDR_TYPE_RANDOM_STATIC but the correct type may be another type. See GAP Address types.

    If the phone is made by Pulsate Mobile Ltd. (company ID 0x01BE) then the address should probably be reversed and be of type BLE_GAP_ADDR_TYPE_PUBLIC. Public addresses uses the registered company ID for the two most significant bytes, see bluetooth.org for a list of company IDs.

    Regards, Terje

  • Sorry. There are some language difficulties. Helping with directed advertising can be difficult, since it depends on the particular phone because of address etc.

    If the address that you use is correct, then the code should also be OK. In order to find out what stages works and what stages does not work:

    Does everything work when you do normal advertising?

    What kind of nRF device is it, is it a Development Kit? If so, does the HID Mouse example work? The HID Mouse example uses directed advertising to reconnect to the last central when the link is lost. To see that this existing example works would be a first step to getting a custom application work using the same feature.

Reply
  • Sorry. There are some language difficulties. Helping with directed advertising can be difficult, since it depends on the particular phone because of address etc.

    If the address that you use is correct, then the code should also be OK. In order to find out what stages works and what stages does not work:

    Does everything work when you do normal advertising?

    What kind of nRF device is it, is it a Development Kit? If so, does the HID Mouse example work? The HID Mouse example uses directed advertising to reconnect to the last central when the link is lost. To see that this existing example works would be a first step to getting a custom application work using the same feature.

Children
No Data
Related