Mario Bambagini / ssWi

Dependents:   rover_car rover_pc supervisor watering_unit ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ssWi.hpp Source File

ssWi.hpp

Go to the documentation of this file.
00001 /** \file ssWi.hpp
00002  *
00003  *  \brief internal functions for mananing the protocol
00004  *
00005  */
00006 
00007 #ifndef __SHARED_SLOTTED_WIRELESS_HPP__
00008 #define __SHARED_SLOTTED_WIRELESS_HPP__
00009 
00010 #include "ssWiTypes.hpp"
00011 
00012 
00013 /** \brief max number of provided ports
00014  */
00015 #define N_PORTS 255
00016 
00017 
00018 class ssWiChannel;
00019 
00020 /** \brief Initialize the ssWi protocol
00021  *
00022  * It is not possible to have two instances of this protocol at the same time. 
00023  *
00024  * \param c channel to be used for sending/receving data
00025  * \param rateTX transmission rate (how many time every second)
00026  * \param rateRX receiving rate (how many time every second)
00027  * \return true if the network has been correctly initialized, false otherwise
00028  *
00029  * \warning rx should be at least twice more frequent than tx (rateRX >= 2*rateTX)
00030  */
00031 bool ssWi_init (ssWiChannel* c, int rateTX, int rateRX);
00032 
00033 /** \brief check if the communication port is open
00034  *
00035  * \param port port identified to check
00036  * \return true if the port is open, false otherwise
00037  */
00038 bool ssWi_isActive (PortID port);
00039 
00040 /** \brief open the specified port
00041  *
00042  * \param port port identified to open
00043  * \return true if the port has been opened, false otherwise
00044  */
00045 bool ssWi_setPort (PortID port);
00046 
00047 /** \brief free the specified port
00048  *
00049  * \param port port identified to close
00050  * \return true if the port has been closed, false otherwise
00051  */
00052 bool ssWi_unsetPort (PortID port);
00053 
00054 
00055 #endif //__SHARED_SLOTTED_WIRELESS_HPP__