2024-10-18 05:25 AM
Hallo,
So I have this ADV_IND advertisement mode, which works just fine:
// Advertising definitions
ret = aci_gap_set_discoverable(ADV_IND, // Connectable undirected advertising
(ADV_INTERVAL_MIN_MS * 1000)/625, // Minimum advertising interval
(ADV_INTERVAL_MAX_MS * 1000)/625, // Maximum advertising interval
STATIC_RANDOM_ADDR, // Random device address
NO_WHITE_LIST_USE, // Advertising filter policy
sizeof(local_name), // Length of the local_name field in octets
local_name, // Local name of the device
0, // Length of the Service Uuid List in octets
NULL, // List of the UUIDs
0, // Minimum value for slave connection interval (NaN)
0); // Maximum value for slave connection interval (NaN)
if (ret != BLE_STATUS_SUCCESS)
{
ActiveState = BLEState_ERROR;
TargetState = BLEState_ERROR;
BLE_DRIVER_TRACE("Device set discoverable not accepted. Error = 0x%02x", ret);
return;
}
I would like to understand how to take a paired device and attempt to directly advertise to that using the ADV_DIRECT_IND mode, but I cannot find any examples of that and just exchanging ADV_IND above to ADV_DIRECT_IND results in an BLE_STATUS_INVALID_PARAMS error, which I guess makes sense as I have not defined what device I want to target my advertisement at.
Sooo, is there an example of how to setup the ADV_DIRECT_IND advertisement mode?
Also, what does this mean in practice? I assume other devices scanning for BLE advertisements will not "see" this advertisement at all then? Technically there will be an advertisement sent out, but in practice I assume it is filtered by any device for which it is not targeted?