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

Direct Advertising with Arduino IDE

Hello,

i would like to connect two Redbearlabs Nano v2 just with eachother. The central one connects just to the peripheral, but the peripheral is still open for every device. So i want to use direct advertising and give the peripheral the peer adress of the central. But how can i set the peer address in Arduino IDE and include it to the advertising? I tried to use something like this:

ble.setAdvertisingParams(GapAdvertisingParams::PEER_ADDR);

but the answer is, that peer_addr ist not included in AdvertisingParams. I tried different writings and searched a lot how to define it in the right way, but i'm still not succesfull. So maybe, someone can help me :)

Parents
  • Hi

    Looking at the libraries it appears that directed advertising is not supported:

    /**************************************************************************/
    ble_error_t nRF5xGap::startAdvertising(const GapAdvertisingParams &params)
    {
        /* Make sure we support the advertising type */
        if (params.getAdvertisingType() == GapAdvertisingParams::ADV_CONNECTABLE_DIRECTED) {
            /* ToDo: This requires a propery security implementation, etc. */
            return BLE_ERROR_NOT_IMPLEMENTED;
        }
    

    As an alternative you can use the white list feature, and only add the address of the device you want to connect to in the white list.

    For questions regarding the ReadBearLab libraries you can also use their own forum:
    http://discuss.redbear.cc/

    Best regards
    Torbjørn

Reply
  • Hi

    Looking at the libraries it appears that directed advertising is not supported:

    /**************************************************************************/
    ble_error_t nRF5xGap::startAdvertising(const GapAdvertisingParams &params)
    {
        /* Make sure we support the advertising type */
        if (params.getAdvertisingType() == GapAdvertisingParams::ADV_CONNECTABLE_DIRECTED) {
            /* ToDo: This requires a propery security implementation, etc. */
            return BLE_ERROR_NOT_IMPLEMENTED;
        }
    

    As an alternative you can use the white list feature, and only add the address of the device you want to connect to in the white list.

    For questions regarding the ReadBearLab libraries you can also use their own forum:
    http://discuss.redbear.cc/

    Best regards
    Torbjørn

Children
Related