Wiselib
Public Types | Public Member Functions | Public Attributes
concepts::ReliableRadio_concept Class Reference

Extension of Radio Concept. More...

Inherits concepts::Radio_concept.

List of all members.

Public Types

enum  SpecialNodeIds { BROADCAST_ADDRESS, NULL_NODE_ID }
enum  Restrictions { MAX_MESSAGE_LENGTH }

Public Member Functions

int enable_radio ()
 Turn on radio.
int disable_radio ()
 Turn off radio.
int send (node_id_t receiver, size_t len, block_data_t *data)
 Send message of len units beginning at *data to given receiver.
node_id_t id ()
 Return id of node for current radio.
template<class T , void(T::*)(node_id_t, size_t, block_data_t *) TMethod>
int reg_recv_callback (T *obj_pnt)
 Register message reception callback function.
int unreg_recv_callback (int idx)
 Unregister message reception callback function - use unique identifier returned by registration.

Public Attributes

typedef OsModel
 Type of Os Concept which has been set for the radio.
typedef self_pointer_t
 Defines type of pointer to this radio.
typedef node_id_t
 Type of node id - must be unique for a node in the network.
typedef block_data_t
 Data type used for raw data in message sending process.
typedef size_t
 Unsigned integer that represents length information.
typedef message_id_t
 Type of message Ids - should be common for all radios if heterogeneity should be supported.

Detailed Description

Extension of Radio Concept.


Member Enumeration Documentation

Enumerator:
MAX_MESSAGE_LENGTH 

Maximal size of a message in bytes.

Enumerator:
BROADCAST_ADDRESS 

Send a message to all nodes in communication range of the radio.

NULL_NODE_ID 

Used if node id is not known or not (yet) set.


Member Function Documentation

int concepts::Radio_concept::disable_radio ( ) [inherited]

Turn off radio.

Messages can
not be sent and received.

Returns:
Error (or success) value from Basic Return Values.

Reimplemented in concepts::Routing_concept.

int concepts::Radio_concept::enable_radio ( ) [inherited]

Turn on radio.

Messages can be sent and received.

Returns:
Error (or success) value from Basic Return Values.

Reimplemented in concepts::Routing_concept.

node_id_t concepts::Radio_concept::id ( ) [inherited]

Return id of node for current radio.

This can just be the id provided by the Os, but also any other one for special models. For example, a virtual radio model providing IPv6 addresses.

Returns:
Unique node identifier of type node_id_t.
template<class T , void(T::*)(node_id_t, size_t, block_data_t *) TMethod>
int concepts::Radio_concept::reg_recv_callback ( T *  obj_pnt) [inherited]

Register message reception callback function.

Returns:
Unique identifier for this registration. Value must be used when
un-registering a callback.

Reimplemented in concepts::Routing_concept, and concepts::ExtendedDataRadio_concept.

int concepts::Radio_concept::send ( node_id_t  receiver,
size_t  len,
block_data_t data 
) [inherited]

Send message of len units beginning at *data to given receiver.

Returns:
If message has successfully passed to radio.
Not if message has really been sent!

Reimplemented in concepts::Routing_concept.

int concepts::Radio_concept::unreg_recv_callback ( int  idx) [inherited]

Unregister message reception callback function - use unique identifier returned by registration.

Returns:
Error (or success) value from Basic Return Values.

Reimplemented in concepts::Routing_concept.


Member Data Documentation

Data type used for raw data in message sending process.

Usually an\ uint8_t.

Reimplemented in concepts::Routing_concept.

Type of message Ids - should be common for all radios if heterogeneity should be supported.

Standard is unit16_t.

Reimplemented in concepts::Routing_concept.

Type of node id - must be unique for a node in the network.

Reimplemented in concepts::Routing_concept.

typedef concepts::Radio_concept::OsModel [inherited]

Type of Os Concept which has been set for the radio.

Reimplemented in concepts::Routing_concept.

Defines type of pointer to this radio.

Reimplemented in concepts::Routing_concept.

typedef concepts::Radio_concept::size_t [inherited]

Unsigned integer that represents length information.

Reimplemented in concepts::Routing_concept.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines