Struct AttributeServer

Source
pub struct AttributeServer<'values, M: RawMutex, P: PacketPool, const ATT_MAX: usize, const CCCD_MAX: usize, const CONN_MAX: usize> { /* private fields */ }
Expand description

A GATT server capable of processing the GATT protocol using the provided table of attributes.

Implementations§

Source§

impl<'values, M: RawMutex, P: PacketPool, const ATT_MAX: usize, const CCCD_MAX: usize, const CONN_MAX: usize> AttributeServer<'values, M, P, ATT_MAX, CCCD_MAX, CONN_MAX>

Source

pub fn new( att_table: AttributeTable<'values, M, ATT_MAX>, ) -> AttributeServer<'values, M, P, ATT_MAX, CCCD_MAX, CONN_MAX>

Create a new instance of the AttributeServer

Source

pub fn process( &self, connection: &Connection<'_, P>, packet: &AttClient<'_>, rx: &mut [u8], ) -> Result<Option<usize>, Error>

Process an event and produce a response if necessary

Source

pub fn table(&self) -> &AttributeTable<'values, M, ATT_MAX>

Get a reference to the attribute table

Source

pub fn get_cccd_table( &self, connection: &Connection<'_, P>, ) -> Option<CccdTable<CCCD_MAX>>

Get the CCCD table for a connection

Source

pub fn set_cccd_table( &self, connection: &Connection<'_, P>, table: CccdTable<CCCD_MAX>, )

Set the CCCD table for a connection

Trait Implementations§

Source§

impl<M: RawMutex, P: PacketPool, const ATT_MAX: usize, const CCCD_MAX: usize, const CONN_MAX: usize> DynamicAttributeServer<P> for AttributeServer<'_, M, P, ATT_MAX, CCCD_MAX, CONN_MAX>

Auto Trait Implementations§

§

impl<'values, M, P, const ATT_MAX: usize, const CCCD_MAX: usize, const CONN_MAX: usize> !Freeze for AttributeServer<'values, M, P, ATT_MAX, CCCD_MAX, CONN_MAX>

§

impl<'values, M, P, const ATT_MAX: usize, const CCCD_MAX: usize, const CONN_MAX: usize> !RefUnwindSafe for AttributeServer<'values, M, P, ATT_MAX, CCCD_MAX, CONN_MAX>

§

impl<'values, M, P, const ATT_MAX: usize, const CCCD_MAX: usize, const CONN_MAX: usize> Send for AttributeServer<'values, M, P, ATT_MAX, CCCD_MAX, CONN_MAX>
where P: Send, M: Send,

§

impl<'values, M, P, const ATT_MAX: usize, const CCCD_MAX: usize, const CONN_MAX: usize> Sync for AttributeServer<'values, M, P, ATT_MAX, CCCD_MAX, CONN_MAX>
where P: Sync, M: Sync,

§

impl<'values, M, P, const ATT_MAX: usize, const CCCD_MAX: usize, const CONN_MAX: usize> Unpin for AttributeServer<'values, M, P, ATT_MAX, CCCD_MAX, CONN_MAX>
where P: Unpin, M: Unpin,

§

impl<'values, M, P, const ATT_MAX: usize, const CCCD_MAX: usize, const CONN_MAX: usize> !UnwindSafe for AttributeServer<'values, M, P, ATT_MAX, CCCD_MAX, CONN_MAX>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.