Mario Bambagini / ssWi

Dependents:   rover_car rover_pc supervisor watering_unit ... more

Embed: (wiki syntax)

« Back to documentation index

ssWi.cpp File Reference

ssWi.cpp File Reference

implementation of the internal functions for mananing the protocol More...

Go to the source code of this file.

Functions

bool ssWi_init (ssWiChannel *c, int rateTX, int rateRX)
 Initialize the ssWi protocol.
bool ssWi_isActive (PortID port)
 check if the communication port is open
bool ssWi_setPort (PortID port)
 open the specified port
bool ssWi_unsetPort (PortID port)
 free the specified port

Variables

ssWiChannelchannel = NULL
 channel abstraction
Mutex mutexChannel
 serialize read and write operations
std::map< int, ssWiPortports
 set of registered communication ports
int TXRate
 transmission rate
int RXRate
 reading rate

Detailed Description

implementation of the internal functions for mananing the protocol

Definition in file ssWi.cpp.


Function Documentation

bool ssWi_init ( ssWiChannel c,
int  rateTX,
int  rateRX 
)

Initialize the ssWi protocol.

It is not possible to have two instances of this protocol at the same time.

Parameters:
cchannel to be used for sending/receving data
rateTXtransmission rate (how many time every second)
rateRXreceiving rate (how many time every second)
Returns:
true if the network has been correctly initialized, false otherwise
Warning:
rx should be at least twice more frequent than tx (rateRX >= 2*rateTX)

Definition at line 66 of file ssWi.cpp.

bool ssWi_isActive ( PortID  port )

check if the communication port is open

Parameters:
portport identified to check
Returns:
true if the port is open, false otherwise

Definition at line 159 of file ssWi.cpp.

bool ssWi_setPort ( PortID  port )

open the specified port

Parameters:
portport identified to open
Returns:
true if the port has been opened, false otherwise

Definition at line 165 of file ssWi.cpp.

bool ssWi_unsetPort ( PortID  port )

free the specified port

Parameters:
portport identified to close
Returns:
true if the port has been closed, false otherwise

Definition at line 176 of file ssWi.cpp.


Variable Documentation

channel abstraction

This object represent the communication channel. It can be different means

Definition at line 36 of file ssWi.cpp.

Mutex mutexChannel

serialize read and write operations

simultaneous multiple accesses to the mean are avoided

Definition at line 42 of file ssWi.cpp.

std::map<int, ssWiPort> ports

set of registered communication ports

Definition at line 47 of file ssWi.cpp.

int RXRate

reading rate

Definition at line 57 of file ssWi.cpp.

int TXRate

transmission rate

Definition at line 52 of file ssWi.cpp.