1 //! This represents the TX end of an ATT Transport, to be either mocked (in
2 //! test) or linked to FFI (in production).
3 
4 use crate::packets::att;
5 use pdl_runtime::EncodeError;
6 
7 use super::ids::TransportIndex;
8 
9 /// An instance of this trait will be provided to the GattModule on
10 /// initialization.
11 pub trait AttTransport {
12     /// Serializes and sends a packet to the device associated with the
13     /// specified transport. Note that the packet may be dropped if the link
14     /// is disconnected, but the result will still be Ok(()).
15     ///
16     /// The tcb_idx is an identifier for this transport supplied from the
17     /// native stack, and represents an underlying ACL-LE connection.
send_packet(&self, tcb_idx: TransportIndex, packet: att::Att) -> Result<(), EncodeError>18     fn send_packet(&self, tcb_idx: TransportIndex, packet: att::Att) -> Result<(), EncodeError>;
19 }
20