BlueToe
an alternative GATT/BLE implementation
|
adds a white list to the link layer with white list related functions. More...
#include <bluetoe/link_layer/include/bluetoe/white_list.hpp>
Public Member Functions | |
bool | add_to_white_list (const device_address &addr) |
add the given address to the white list. | |
bool | remove_from_white_list (const device_address &addr) |
remove the given address from the white list | |
bool | is_in_white_list (const device_address &addr) const |
returns true, if the given address in within the white list | |
std::size_t | white_list_free_size () const |
returns the number of addresses that could be added to the white list before add_to_white_list() would return false. | |
void | clear_white_list () |
remove all entries from the white list | |
void | connection_request_filter (bool b) |
Accept connection requests only from devices within the white list. | |
bool | connection_request_filter () const |
current value of the property. | |
void | scan_request_filter (bool b) |
Accept scan requests only from devices within the white list. | |
bool | scan_request_filter () const |
current value of the property. | |
bool | is_connection_request_in_filter (const device_address &addr) const |
returns true, if a connection request from the given address should be answered. | |
bool | is_scan_request_in_filter (const device_address &addr) const |
returns true, if a scan request from the given address should be answered. | |
Static Public Attributes | |
static constexpr std::size_t | maximum_white_list_entries = Size |
The maximum number of device addresses, the white list can contain. | |
adds a white list to the link layer with white list related functions.
Size | the maximum number of device addresses, the white list will contain. |
bool bluetoe::link_layer::white_list< Size >::add_to_white_list | ( | const device_address & | addr | ) |
add the given address to the white list.
Function will return true, if it was possible to add the address to the white list or if the address was already in the white list. If there was not enough room to add the address to the white list, the function returns false.
void bluetoe::link_layer::white_list< Size >::connection_request_filter | ( | bool | b | ) |
Accept connection requests only from devices within the white list.
If the property is set to true, only connection requests from from devices that are in the white list, should be answered. If the property is set to false, all connection requests should be answered.
The default value of the is property is false.
bool bluetoe::link_layer::white_list< Size >::remove_from_white_list | ( | const device_address & | addr | ) |
remove the given address from the white list
The function returns true, if the address was in the list.
void bluetoe::link_layer::white_list< Size >::scan_request_filter | ( | bool | b | ) |
Accept scan requests only from devices within the white list.
If the property is set to true, only scan requests from from devices that are in the white list, should be answered. If the property is set to false, all scan requests should be answered.
The default value of the is property is false.