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::{AttBuilder, SerializeError};
5 
6 use super::ids::TransportIndex;
7 
8 /// An instance of this trait will be provided to the GattModule on
9 /// initialization.
10 pub trait AttTransport {
11     /// Serializes and sends a packet to the device associated with the
12     /// specified transport. Note that the packet may be dropped if the link
13     /// is disconnected, but the result will still be Ok(()).
14     ///
15     /// The tcb_idx is an identifier for this transport supplied from the
16     /// native stack, and represents an underlying ACL-LE connection.
send_packet( &self, tcb_idx: TransportIndex, packet: AttBuilder, ) -> Result<(), SerializeError>17     fn send_packet(
18         &self,
19         tcb_idx: TransportIndex,
20         packet: AttBuilder,
21     ) -> Result<(), SerializeError>;
22 }
23