Set or get the BLE device's MAC address.
A MAC address is required by BLE specifications. Use this attribute to uniquely identify the BLE device.
Set or get the BLE device's name for included in advertisements.
Setting a BLE device name will occupy more bytes from the
18 available bytes in advertisements. The exact number of bytes occupied
is the length of the given name string plus 2.
The maximum supported name length is 10 bytes. So, up to 12 bytes (10 + 2) will be used in the advertising payload.
Enable or disable the inclusion of the radio's PA level in advertisements.
Enabling this feature occupies 3 bytes of the 18 available bytes in advertised payloads.
Hop the radio's current channel to the next BLE compliant frequency.
Use this function after FakeBle.send to comply with BLE specifications. This is not required, but it is recommended to avoid bandwidth pollution.
This function should not be called in RX mode. To ensure proper radio behavior, the caller must ensure that the radio is in TX mode.
How many bytes are available in an advertisement payload?
The hypothetical parameter shall be the same value passed to FakeBle.send.
In addition to the given hypothetical payload length, this function also
accounts for the current state of FakeBle.name and
FakeBle.showPaLevel.
If the returned value is less than 0, then the hypothetical payload will not
be broadcasted.
Read the first available payload from the radio's RX FIFO and decode it into a BlePayload.
The payload must be decoded while the radio is on the same channel that it received the data. Otherwise, the decoding process will fail.
Use RF24.available to check if there is data in the radio's RX FIFO.
If the payload was somehow malformed or incomplete,
then this function returns an undefined value.
Send a BLE advertisement
The buf parameter takes a buffer that has been already formatted for
BLE specifications.
See our convenient API to
For a custom/proprietary BLE service, the given buf must adopt compliance with BLE specifications.
For example, a buffer of n bytes shall be formed as follows:
| index | value |
|---|---|
0 |
n - 1 |
1 |
0xFF |
2 ... n - 1 |
custom data |
A class to use the nRF24L01 as a Fake BLE beacon.
This implementation is subject to Limitations.
Use bleConfig to properly configure the radio for BLE compatibility.