BlueToe
an alternative GATT/BLE implementation
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
bluetoe::link_layer::link_layer< Server, ScheduledRadio, Options > Class Template Reference

link layer implementation More...

#include <bluetoe/link_layer/include/bluetoe/link_layer.hpp>

Inheritance diagram for bluetoe::link_layer::link_layer< Server, ScheduledRadio, Options >:
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 >

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_addresslocal_address () const
 returns the own local device address
 
void local_address (const device_address &new_address)
 set the local address
 

Additional Inherited Members

Detailed Description

template<class Server, template< std::size_t TransmitSize, std::size_t ReceiveSize, class CallBack > class ScheduledRadio, typename ... Options>
class bluetoe::link_layer::link_layer< Server, ScheduledRadio, Options >

link layer implementation

Implements a binding to a server by implementing a link layer on top of a ScheduleRadio device.

See also
connectable_undirected_advertising
connectable_directed_advertising
scannable_undirected_advertising
non_connectable_undirected_advertising
auto_start_advertising
no_auto_start_advertising

Member Function Documentation

◆ adv_received()

template<class Server , template< std::size_t TransmitSize, std::size_t ReceiveSize, class CallBack > class ScheduledRadio, typename ... Options>
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

See also
scheduled_radio::schedule_advertisment_and_receive

◆ adv_timeout()

template<class Server , template< std::size_t TransmitSize, std::size_t ReceiveSize, class CallBack > class ScheduledRadio, typename ... Options>
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

See also
scheduled_radio::schedule_advertisment_and_receive

◆ connection_parameter_update_request()

template<class Server , template< std::size_t TransmitSize, std::size_t ReceiveSize, class CallBack > class ScheduledRadio, typename ... Options>
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.

Todo:
Add parameter that identifies the connection.

◆ disconnect()

template<class Server , template< std::size_t TransmitSize, std::size_t ReceiveSize, class CallBack > class ScheduledRadio, typename ... Options>
void bluetoe::link_layer::link_layer< Server, ScheduledRadio, Options >::disconnect ( )

terminates the give connection

Todo:
Add parameter that identifies the connection.

◆ end_event()

template<class Server , template< std::size_t TransmitSize, std::size_t ReceiveSize, class CallBack > class ScheduledRadio, typename ... Options>
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.

See also
scheduled_radio::schedule_connection_event

◆ local_address()

template<class Server , template< std::size_t TransmitSize, std::size_t ReceiveSize, class CallBack > class ScheduledRadio, typename ... Options>
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.

◆ phy_update_request_to_2mbit()

template<class Server , template< std::size_t TransmitSize, std::size_t ReceiveSize, class CallBack > class ScheduledRadio, typename ... Options>
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.

◆ run()

template<class Server , template< std::size_t TransmitSize, std::size_t ReceiveSize, class CallBack > class ScheduledRadio, typename ... Options>
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.

◆ timeout()

template<class Server , template< std::size_t TransmitSize, std::size_t ReceiveSize, class CallBack > class ScheduledRadio, typename ... Options>
void bluetoe::link_layer::link_layer< Server, ScheduledRadio, Options >::timeout ( )

call back that will be called when connect event times out

See also
scheduled_radio::schedule_connection_event

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