OPENRAPI.cc File Reference

#include <OPENR/OPENRAPI.h>
#include <OPENR/OPENRMessages.h>
#include <iostream>
#include <fstream>
#include <map>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <pthread.h>
#include <boot.h>
#include <utils.h>
#include <Platform.h>
#include <Primitives.h>
#include <MemoryMapAgent.h>
#include <ModuleData.h>
#include <opensdkAPI.h>

Go to the source code of this file.

Defines

#define LOCK(m)   pthread_mutex_lock(&m ##_mutex)
#define UNLOCK(m)   pthread_mutex_unlock(&m ##_mutex)
#define sendPowerStatusNotifications(property, bitmask)

Variables

longword myRobotStatus = orsbBATTERY_CONNECTED | orsbBATTERY_CAPACITY_FULL
word myBatteryStatus = obsbFULLY_CHARGED
word myRemainingCapacity = 100
word myTemperature = 300
word myFullyChargedCapacity = 55555
word myVoltage = 5000
word myCurrent = 1000
OVolumeSwitch myVolume = ovolumeSW3
OPower motorPower = opowerOFF
word myBootCondition = 0
map< OServiceEntry, OPowerStatus > powerStatusObservers
pthread_mutex_t powerStatusObservers_mutex = PTHREAD_MUTEX_INITIALIZER


Define Documentation

#define LOCK  )     pthread_mutex_lock(&m ##_mutex)
 

Definition at line 41 of file OPENRAPI.cc.

#define sendPowerStatusNotifications property,
bitmask   ) 
 

Value:

{ \
        LOCK(powerStatusObservers); \
\
        for(map<OServiceEntry, OPowerStatus>::iterator it = powerStatusObservers.begin(); it != powerStatusObservers.end(); ++it) { \
                if (it->second.property & bitmask) { \
                        OPowerStatusMessage *status = new OPowerStatusMessage(myRobotStatus, myBatteryStatus, myRemainingCapacity, myTemperature, myFullyChargedCapacity, myVoltage, myCurrent, ::GetTimeDifference(), myVolume); \
                        _sendMessage(it->first, status); \
                } \
        } \
\
        UNLOCK(powerStatusObservers); \
}

Definition at line 60 of file OPENRAPI.cc.

#define UNLOCK  )     pthread_mutex_unlock(&m ##_mutex)
 

Definition at line 42 of file OPENRAPI.cc.


Variable Documentation

OPower motorPower = opowerOFF [static]
 

Definition at line 53 of file OPENRAPI.cc.

word myBatteryStatus = obsbFULLY_CHARGED [static]
 

Definition at line 46 of file OPENRAPI.cc.

word myBootCondition = 0 [static]
 

Definition at line 54 of file OPENRAPI.cc.

word myCurrent = 1000 [static]
 

Definition at line 51 of file OPENRAPI.cc.

word myFullyChargedCapacity = 55555 [static]
 

Definition at line 49 of file OPENRAPI.cc.

word myRemainingCapacity = 100 [static]
 

Definition at line 47 of file OPENRAPI.cc.

longword myRobotStatus = orsbBATTERY_CONNECTED | orsbBATTERY_CAPACITY_FULL [static]
 

Definition at line 45 of file OPENRAPI.cc.

word myTemperature = 300 [static]
 

Definition at line 48 of file OPENRAPI.cc.

word myVoltage = 5000 [static]
 

Definition at line 50 of file OPENRAPI.cc.

OVolumeSwitch myVolume = ovolumeSW3 [static]
 

Definition at line 52 of file OPENRAPI.cc.

map<OServiceEntry, OPowerStatus> powerStatusObservers [static]
 

Definition at line 57 of file OPENRAPI.cc.

pthread_mutex_t powerStatusObservers_mutex = PTHREAD_MUTEX_INITIALIZER [static]
 

Definition at line 58 of file OPENRAPI.cc.


Generated on Sun Dec 2 23:04:32 2007 for openSDK by  doxygen 1.3.9.1