BlueToe
an alternative GATT/BLE implementation
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
bluetoe::link_layer::white_list< Size > Class Template Reference

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.
 

Detailed Description

template<std::size_t Size = 8>
class bluetoe::link_layer::white_list< Size >

adds a white list to the link layer with white list related functions.

Template Parameters
Sizethe maximum number of device addresses, the white list will contain.
Note
the functions is_connection_request_in_filter() and is_scan_request_in_filter() might return always true, for a hardware implementation and the hardware would then not call the receive callback for devices that are not within the white list.

Member Function Documentation

◆ add_to_white_list()

template<std::size_t Size = 8>
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.

◆ connection_request_filter()

template<std::size_t Size = 8>
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.

Postcondition
connection_request_filter() == b
See also
connection_request_filter()

◆ remove_from_white_list()

template<std::size_t Size = 8>
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.

Postcondition
addr is not in the white list.

◆ scan_request_filter()

template<std::size_t Size = 8>
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.

Postcondition
scan_request_filter() == b
See also
scan_request_filter()

The documentation for this class was generated from the following file: