17#ifndef MESHINTERFACENANOSTACK_H
18#define MESHINTERFACENANOSTACK_H
21#include "MeshInterface.h"
22#include "NanostackRfPhy.h"
24#include "mesh_interface_types.h"
43 int8_t get_interface_id()
const
47 int8_t get_driver_id()
const
61 int8_t interface_id = -1;
62 int8_t _device_id = -1;
66 mbed::Callback<void(nsapi_event_t, intptr_t)> _connection_status_cb;
69 bool _blocking =
true;
147 return _interface->get_interface_id();
162 char mac_addr_str[24] {};
163 mbed::Callback<void(nsapi_event_t, intptr_t)> _connection_status_cb;
164 bool _blocking =
true;
165 bool _configured =
false;
nsapi_error_t disconnect() override
Stop the interface.
nsapi_error_t set_mac_address(uint8_t *mac_addr, nsapi_size_t addr_len) override
Set the MAC address to the interface.
const char * get_mac_address() override
Get the internally stored MAC address /return MAC address of the interface.
nsapi_connection_status_t get_connection_status() const override
Get the connection status.
nsapi_error_t connect() override
Start the interface.
nsapi_error_t get_ip_address(SocketAddress *address) override
Get the local IP address.
int8_t get_interface_id() const
Get the interface ID.
void attach(mbed::Callback< void(nsapi_event_t, intptr_t)> status_cb) override
Register callback for status reporting.
nsapi_error_t set_blocking(bool blocking) override
Set blocking status of connect() which by default should be blocking.
nsapi_error_t set_file_system_root_path(const char *root_path)
Set file system root path.
Common interface that is shared between mesh hardware.
nsapi_error_t initialize(NanostackRfPhy *phy)
Attach phy and initialize the mesh.
void network_handler(mesh_connection_status_t status)
Callback from C-layer.
nsapi_error_t get_gateway(SocketAddress *address) override
Writes the gateway address of the network interface into a user-supplied SocketAddress.
nsapi_error_t get_ip_address(SocketAddress *address) final
Get the local IP address.
char * get_mac_address(char *buf, nsapi_size_t buflen) override
Return MAC address of the network interface.
nsapi_connection_status_t get_connection_status() const final
Get the connection status.
void attach(mbed::Callback< void(nsapi_event_t, intptr_t)> status_cb) final
Register callback for status reporting.
nsapi_error_t get_netmask(SocketAddress *address) final
Writes the netmask of the network interface into a user-supplied SocketAddress.
char * get_interface_name(char *buf)
Returns interface name.
PHY driver class for Nanostack.
Radio PHY driver class for Nanostack.
Common interface that is shared between network devices.
Representation of a stack's view of an interface.
Callback class based on template specialization.
Prevents generation of copy constructor and copy assignment operator in derived classes.
The Semaphore class is used to manage and protect access to a set of shared resources.
signed int nsapi_error_t
Type used to represent error codes.
unsigned int nsapi_size_t
Type used to represent the size of data passed through sockets.
@ NSAPI_STATUS_DISCONNECTED