Struct rubble::link::LinkLayer[][src]

pub struct LinkLayer<C: Config> {
    dev_addr: DeviceAddress,
    state: State<C>,
    timer: C::Timer,
}
Expand description

Implementation of the real-time BLE Link-Layer logic.

Users of this struct must provide an interface to the platform’s hardware by implementing Config.

Fields

dev_addr: DeviceAddressstate: State<C>timer: C::Timer

Implementations

Creates a new Link-Layer.

Parameters

  • dev_addr: The device address to broadcast as.
  • timer: A Timer implementation.
  • tx: Input queue of packets to transmit when connected.
  • rx: Output queue of received packets when connected.

Returns a reference to the timer instance used by the Link-Layer.

Starts advertising this device, optionally sending data along with the advertising PDU.

Process an incoming packet from an advertising channel.

The access address of the packet must be ADVERTISING_ADDRESS.

Parameters

  • rx_end: A timestamp indicating when the packet was fully received.
  • tx: A packet transmitter.
  • header: The header of the received packet.
  • payload: The packet payload following the header.
  • crc_ok: Whether the packet’s CRC is correct.

Process an incoming data channel packet.

Update the Link-Layer state after the timer expires.

This should be called whenever the timer set by the last returned Cmd has expired.

Parameters

  • tx: A Transmitter for sending packets.

Returns a reference to the connection state.

If the Link Layer is not currently in a connection, returns None.

Returns whether the Link-Layer is currently broadcasting advertisement packets.

Returns whether the Link-Layer is currently connected.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.