capsules_extra::net::thread::driver

Struct ThreadNetworkDriver

Source
pub struct ThreadNetworkDriver<'a, A: Alarm<'a>> { /* private fields */ }

Implementations§

Source§

impl<'a, A: Alarm<'a>> ThreadNetworkDriver<'a, A>

Source

pub fn new( sender: &'a dyn UDPSender<'a>, aes_crypto: &'a dyn AES128CCM<'a>, alarm: &'a A, grant: Grant<App, UpcallCount<1>, AllowRoCount<{ ro_allow::COUNT }>, AllowRwCount<0>>, src_mac_addr: [u8; 8], max_tx_pyld_len: usize, port_table: &'static UdpPortManager, send_buffer: SubSliceMut<'static, u8>, recv_buffer: SubSliceMut<'static, u8>, driver_send_cap: &'static dyn UdpDriverCapability, net_cap: &'static NetworkCapability, ) -> ThreadNetworkDriver<'a, A>

Source

pub fn set_networkkey(&self, mle_key: [u8; 16], mac_key: [u8; 16])

Takes the MLE and MAC keys and replaces the networkkey

Trait Implementations§

Source§

impl<'a, A: Alarm<'a>> AlarmClient for ThreadNetworkDriver<'a, A>

Source§

fn alarm(&self)

Callback indicating the alarm time has been reached. The alarm MUST be disabled when this is called. If a new alarm is needed, the client can call Alarm::set_alarm.
Source§

impl<'a, A: Alarm<'a>> CCMClient for ThreadNetworkDriver<'a, A>

Source§

fn crypt_done( &self, buf: &'static mut [u8], _res: Result<(), ErrorCode>, _tag_is_valid: bool, )

res is Ok(()) if the encryption/decryption process succeeded. This does not mean that the message has been verified in the case of decryption. If we are encrypting: tag_is_valid is true iff res is Ok(()). If we are decrypting: tag_is_valid is true iff res is Ok(()) and the message authentication tag is valid.
Source§

impl<'a, A: Alarm<'a>> DeviceProcedure for ThreadNetworkDriver<'a, A>

Source§

fn lookup_addr_long(&self, _addr: MacAddress) -> Option<[u8; 8]>

Gets the key corresponding to the key that matches the given security level level and key ID key_id. If no such key matches, returns None.

Source§

impl<'a, A: Alarm<'a>> KeyProcedure for ThreadNetworkDriver<'a, A>

Source§

fn lookup_key(&self, _level: SecurityLevel, _key_id: KeyId) -> Option<[u8; 16]>

Gets the key corresponding to the key that matches the given security level level and key ID key_id. If no such key matches, returns None.

Source§

impl<'a, A: Alarm<'a>> SyscallDriver for ThreadNetworkDriver<'a, A>

Source§

fn command( &self, command_num: usize, _arg1: usize, _: usize, processid: ProcessId, ) -> CommandReturn

§command_num
  • 0: Driver Check
  • 1: Add a new mle/mac networkkey and initiate a parent request.
Source§

fn allocate_grant(&self, processid: ProcessId) -> Result<(), Error>

Request to allocate a capsule’s grant for a specific process. Read more
Source§

fn allow_userspace_readable( &self, app: ProcessId, which: usize, slice: ReadWriteProcessBuffer, ) -> Result<ReadWriteProcessBuffer, (ReadWriteProcessBuffer, ErrorCode)>

System call for a process to pass a buffer (a UserspaceReadableProcessBuffer) to the kernel that the kernel can either read or write. The kernel calls this method only after it checks that the entire buffer is within memory the process can both read and write. Read more
Source§

impl<'a, A: Alarm<'a>> UDPRecvClient for ThreadNetworkDriver<'a, A>

Source§

fn receive( &self, src_addr: IPAddr, dst_addr: IPAddr, _src_port: u16, _dst_port: u16, payload: &[u8], )

Source§

impl<'a, A: Alarm<'a>> UDPSendClient for ThreadNetworkDriver<'a, A>

Source§

fn send_done( &self, _result: Result<(), ErrorCode>, dgram: SubSliceMut<'static, u8>, )

Auto Trait Implementations§

§

impl<'a, A> !Freeze for ThreadNetworkDriver<'a, A>

§

impl<'a, A> !RefUnwindSafe for ThreadNetworkDriver<'a, A>

§

impl<'a, A> !Send for ThreadNetworkDriver<'a, A>

§

impl<'a, A> !Sync for ThreadNetworkDriver<'a, A>

§

impl<'a, A> Unpin for ThreadNetworkDriver<'a, A>

§

impl<'a, A> !UnwindSafe for ThreadNetworkDriver<'a, A>

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.