[−][src]Crate nrfxlib
nrfxlib - a Rust library for the nRF9160 interface C library
This crate contains wrappers for functions and types defined in Nordic's libbsd, aka nrfxlib.
The nrfxlib_sys
crate is the auto-generated wrapper for bsd_os.h
and
nrf_socket.h
. This crate contains Rustic wrappers for those
auto-generated types.
To bring up the LTE stack you need to call bsd_init()
. Before that you
need to enable the EGU1 and EGU2 interrupts, and arrange for the relevant
functions (application_irq_handler
and trace_irq_handler
respectively) to be called when they occur. You also need to call
IPC_IRQHandler()
when an IPC interrupt occurs.
To talk to the LTE modem, use the send_at_command()
function. It will
call the callback with the response received from the modem.
To automatically send the AT commands which initialise the modem and wait
until it has registered on the network, call the wait_for_lte()
function. Once that is complete, you can create TCP or TLS sockets and
send/receive data.
Copyright (c) 42 Technology Ltd 2019
Dual-licensed under MIT and Apache 2.0. See the README for more details.
Re-exports
pub use api::*; |
Modules
api | libbsd.a API implementation |
at | AT Sockets for nrfxlib |
gnss | GNSS Module for nrfxlib |
modem | Modem helper functions for nrfxlib |
tcp | TCP Sockets for nrfxlib |
tls | Raw Sockets for nrfxlib |
Structs
NrfAddrInfo | Create a camel-case type name socket addresses. |
NrfSockAddrIn | Create a camel-case type name socket addresses. |
Enums
Error | The set of error codes we can get from this API. |
Functions
get_last_error | Return the last error stored by the nrfxlib C library. |
init | Start the BSD library |
shutdown | Stop the BSD library |