A simple wireless protocol to let my examples communicate each other. ssWi stands for Shared Slotted Wireless protocol

Dependents:   rover_car rover_pc supervisor watering_unit ... more

This library aims at implementing a simple communication protocol among nodes, abstracting from the hardware. The name ssWi stands for Shared Slotted Wireless. Wireless is part of the name, even though the library abstracts from the hardware, as the first version was entirely focused on the XBee modules and then the name has not been changed.

The communication channel is represented by ssWiChannel, an abstract class which models the channel that the transceivers access to. The concrete classes must implement the functions: init, read and write. The protocol automatically sends and receives data through the selected channel, exploiting the operting system timers. Addresses are not considered as the communication lays on broadcast transmissions.

The protocol provides the ssWiPort abstraction which is like memory areas shared among all the connected nodes. Reading from one port lets the node retrieve the last written value from the other nodes. Writing on one port means sending such value to other nodes.

Objects instantiated from ssWiSocket are the interface for allowing nodes to access the protocol ports.

/media/uploads/mariob/scheme.png

TODO:

  • improve the parsing of the received messages
  • communication tests with many nodes (so far, only 2 nodes have been tested)
Revision:
4:dbbf82c966c2
Parent:
3:1adc077d4906
Child:
13:69ff47a83260
--- a/ssWiPort.hpp	Thu Sep 06 12:11:52 2012 +0000
+++ b/ssWiPort.hpp	Fri Sep 07 23:02:04 2012 +0000
@@ -1,9 +1,14 @@
+/** \file ssWiPort.hpp
+ *  \brief Header for introducing the dual head port
+ *
+ */
+
 #ifndef __SHARED_SLOTTED_WIRELESS_PORT_HPP__
 #define __SHARED_SLOTTED_WIRELESS_PORT_HPP__
 
-#include "ssWiTypes.hpp"
+#include "rtos.h"
 
-#include "rtos.h"
+#include "ssWiTypes.hpp"
 
 
 /** \brief Internal type which represents a logical flow
@@ -15,33 +20,46 @@
  */
 class ssWiPort
 {
-    /** receiving buffer */
+    /** \brief receiving buffer */
     PortValue valueRX;
+    /** \brief receiving mutex */
     Mutex mutexRX;
-    
-    /** transmission buffer */
+
+    /** \brief transmission buffer */
     PortValue valueTX;
+    /** \brief transmission mutex */
     Mutex mutexTX;
 
-    /** modification flag (true: someone has write a new value to be sent */    
+    /** \brief modification flag (if true a new value has to be sent) */
     bool modified;
 
-
 public:
 
+    /** \brief constructor */
     ssWiPort () {
         modified = false;
         valueTX = 0;
         valueRX = 0;
     }
 
-    //transmission
+    /** \brief get the value to be sent
+     */
     PortValue getTXValue();
+    
+    /** \brief write a value to be sent
+     */
     void setTXValue(PortValue tmp);
+    
+    /** \brief true if there is a value to be sent
+     */
     bool isModified();
 
-    //reception
+    /** \brief Read the last received value
+     */
     PortValue getRXValue();
+    
+    /** \brief Write the last received value
+     */
     void setRXValue(PortValue tmp);
 
 };