erkin yucel / mbed-os

Dependents:   BLE_file_test BLE_Blink ExternalEncoder

Embed: (wiki syntax)

« Back to documentation index

AbstractMesh Class Reference

AbstractMesh Class Reference

Abstract Mesh networking interface. More...

#include <AbstractMesh.h>

Inherits AbstractNetworkInterface.

Inherited by Mesh6LoWPAN_ND, and MeshThread.

Public Types

typedef FunctionPointer1< void,
mesh_connection_status_t > 
mesh_network_handler_t
 Typedef for network callback.

Public Member Functions

 AbstractMesh (mesh_network_type_t type)
 Constructor.
virtual mesh_error_t init (int8_t registered_device_id, mesh_network_handler_t callbackHandler)
 Initialization of the interface.
virtual mesh_error_t connect ()
 Connect interface to the mesh network.
virtual mesh_error_t disconnect ()
 Disconnect interface from the mesh network.
void callback (mesh_connection_status_t state)
 Callback from C-layer.
virtual bool getOwnIpAddress (char *address, int8_t len)=0
 Read own global IP address.

Detailed Description

Abstract Mesh networking interface.

This class can't be instantiated directly.

Definition at line 33 of file AbstractMesh.h.


Member Typedef Documentation

typedef FunctionPointer1<void, mesh_connection_status_t> mesh_network_handler_t

Typedef for network callback.

Definition at line 42 of file AbstractMesh.h.


Constructor & Destructor Documentation

AbstractMesh ( mesh_network_type_t  type )

Constructor.

Parameters:
typemesh network type

Definition at line 34 of file AbstractMesh.cpp.


Member Function Documentation

void callback ( mesh_connection_status_t  state )

Callback from C-layer.

Parameters:
statestate of the network

Definition at line 135 of file AbstractMesh.cpp.

mesh_error_t connect (  ) [virtual]

Connect interface to the mesh network.

Returns:
MESH_ERROR_NONE on success.
MESH_ERROR_PARAM in case of illegal parameters.
MESH_ERROR_MEMORY in case of memory error.
MESH_ERROR_STATE if interface is already connected to network.
MESH_ERROR_UNKNOWN in case of unspecified error.

Implements AbstractNetworkInterface.

Definition at line 80 of file AbstractMesh.cpp.

mesh_error_t DISABLE_GCC_OPT disconnect (  ) [virtual]

Disconnect interface from the mesh network.

Returns:
MESH_ERROR_NONE on success.
MESH_ERROR_UNKNOWN in case of error.

Implements AbstractNetworkInterface.

Definition at line 118 of file AbstractMesh.cpp.

virtual bool getOwnIpAddress ( char *  address,
int8_t  len 
) [pure virtual, inherited]

Read own global IP address.

Parameters:
addressis where the IP address will be copied
lenis the length of the address buffer, must be at least 40 bytes
Returns:
true if address is read successfully, false otherwise

Implemented in Mesh6LoWPAN_ND, and MeshThread.

mesh_error_t init ( int8_t  registered_device_id,
mesh_network_handler_t  callbackHandler 
) [virtual]

Initialization of the interface.

Parameters:
registereddevice is physical device registered
callbackHandleris callback that is called when network state changes
Returns:
MESH_ERROR_NONE on success.
MESH_ERROR_PARAM when input parameters are illegal (also in case when RF device is already associated to other interface)
MESH_ERROR_MEMORY in case of memory error
MESH_ERROR_UNKNOWN in other error cases

Reimplemented in MeshThread.

Definition at line 49 of file AbstractMesh.cpp.