BlueToe
an alternative GATT/BLE implementation
|
link layer implementation More...
#include <bluetoe/link_layer/include/bluetoe/link_layer.hpp>
Public Member Functions | |
void | run () |
this function passes the CPU to the link layer implementation | |
void | adv_received (const read_buffer &receive) |
call back that will be called when the central responds to an advertising PDU | |
void | adv_timeout () |
call back that will be called when the central does not respond to an advertising PDU | |
void | timeout () |
call back that will be called when connect event times out | |
void | end_event (connection_event_events evts) |
call back that will be called after a connect event was closed. | |
void | user_timer (bool anchor_moved) |
call back that will be called on expired user timer. | |
void | try_event_cancelation () |
call back that will try to reschedule the connection event | |
bool | connection_parameter_update_request (std::uint16_t interval_min, std::uint16_t interval_max, std::uint16_t latency, std::uint16_t timeout) |
initiating the change of communication parameters of an established connection | |
bool | phy_update_request_to_2mbit () |
initiates a PHY Update Procedure to request to upgrade the PHY to 2MBit. | |
void | disconnect () |
terminates the give connection | |
std::size_t | fill_l2cap_advertising_data (std::uint8_t *buffer, std::size_t buffer_size) const |
fills the given buffer with l2cap advertising payload | |
std::size_t | fill_l2cap_scan_response_data (std::uint8_t *buffer, std::size_t buffer_size) const |
fills the given buffer with l2cap scan response payload | |
bool | l2cap_adverting_data_or_scan_response_data_changed () |
returns true, if advertising or scan response data might have changed. | |
std::uint64_t | supported_link_layer_features () const |
returns the feature mask of supported link layer features | |
std::uint8_t | supported_link_layer_version () const |
returns the Version field of the LL_VERSION_IND PDU | |
std::uint16_t | link_layer_company_identifier () const |
returns the Company_Identifier field of the LL_VERSION_IND PDU | |
const device_address & | local_address () const |
returns the own local device address | |
void | local_address (const device_address &new_address) |
set the local address | |
Public Member Functions inherited from bluetoe::link_layer::ll_l2cap_sdu_buffer< ScheduledRadio< details::buffer_sizes< Options... >::tx_size, details::buffer_sizes< Options... >::rx_size, link_layer< Server, ScheduledRadio, Options... > >, details::l2cap_layer< Server, ScheduledRadio, Options... >::required_minimum_l2cap_buffer_size > | |
read_buffer | allocate_l2cap_transmit_buffer (std::size_t payload_size) |
allocate a L2CAP buffer that is ready to be filled by the L2CAP layer | |
read_buffer | allocate_ll_transmit_buffer (std::size_t payload_size) |
allocates a LL buffer that is suitable for the given payload size | |
void | commit_l2cap_transmit_buffer (read_buffer buffer) |
schedules the given buffer to be send by the radio | |
void | commit_ll_transmit_buffer (read_buffer buffer) |
schedules the given buffer to be send by the radio | |
write_buffer | next_ll_l2cap_received () |
returns the oldest link layer PDU or L2CAP SDU out of the receive buffer. | |
void | free_ll_l2cap_received () |
removes the oldest PDU from the receive buffer. | |
Additional Inherited Members | |
Public Types inherited from bluetoe::link_layer::ll_l2cap_sdu_buffer< ScheduledRadio< details::buffer_sizes< Options... >::tx_size, details::buffer_sizes< Options... >::rx_size, link_layer< Server, ScheduledRadio, Options... > >, details::l2cap_layer< Server, ScheduledRadio, Options... >::required_minimum_l2cap_buffer_size > | |
using | layout = typename BufferedRadio::layout |
radio layout assumed by the buffer | |
link layer implementation
Implements a binding to a server by implementing a link layer on top of a ScheduleRadio device.
void bluetoe::link_layer::link_layer< Server, ScheduledRadio, Options >::adv_received | ( | const read_buffer & | receive | ) |
call back that will be called when the central responds to an advertising PDU
void bluetoe::link_layer::link_layer< Server, ScheduledRadio, Options >::adv_timeout | ( | ) |
call back that will be called when the central does not respond to an advertising PDU
bool bluetoe::link_layer::link_layer< Server, ScheduledRadio, Options >::connection_parameter_update_request | ( | std::uint16_t | interval_min, |
std::uint16_t | interval_max, | ||
std::uint16_t | latency, | ||
std::uint16_t | timeout | ||
) |
initiating the change of communication parameters of an established connection
If it was not possible to initiate the connection parameter update, the function returns false.
void bluetoe::link_layer::link_layer< Server, ScheduledRadio, Options >::disconnect | ( | ) |
terminates the give connection
void bluetoe::link_layer::link_layer< Server, ScheduledRadio, Options >::end_event | ( | connection_event_events | evts | ) |
call back that will be called after a connect event was closed.
void bluetoe::link_layer::link_layer< Server, ScheduledRadio, Options >::local_address | ( | const device_address & | new_address | ) |
set the local address
The prefered method to define the address of the device is still through the use of bluetoe::link_layer::static_address. This function is intendet to be used, if the device has to change it's address at runtime.
bool bluetoe::link_layer::link_layer< Server, ScheduledRadio, Options >::phy_update_request_to_2mbit | ( | ) |
initiates a PHY Update Procedure to request to upgrade the PHY to 2MBit.
The update procedure is started as soon as possible.
void bluetoe::link_layer::link_layer< Server, ScheduledRadio, Options >::run | ( | ) |
this function passes the CPU to the link layer implementation
This function should return on certain events to alow user code to do usefull things. Details depend on the ScheduleRadio implemention.
void bluetoe::link_layer::link_layer< Server, ScheduledRadio, Options >::timeout | ( | ) |
call back that will be called when connect event times out