Updated FreeRTOS Osal
CommandingServiceBase is no longer a template
This commit is contained in:
@ -10,6 +10,7 @@
|
||||
#include <framework/subsystem/SubsystemBase.h>
|
||||
#include <framework/thermal/ThermalComponentIF.h>
|
||||
#include <framework/ipc/QueueFactory.h>
|
||||
#include <framework/serviceinterface/ServiceInterfaceStream.h>
|
||||
|
||||
object_id_t DeviceHandlerBase::powerSwitcherId = 0;
|
||||
object_id_t DeviceHandlerBase::rawDataReceiverId = 0;
|
||||
@ -372,7 +373,7 @@ void DeviceHandlerBase::setMode(Mode_t newMode) {
|
||||
|
||||
void DeviceHandlerBase::replyReturnvalueToCommand(ReturnValue_t status,
|
||||
uint32_t parameter) {
|
||||
//This is actually the reply protocol for raw and misc dh commands.
|
||||
//This is actually the reply protocol for raw and misc DH commands.
|
||||
if (status == RETURN_OK) {
|
||||
CommandMessage reply(CommandMessage::REPLY_COMMAND_OK, 0, parameter);
|
||||
commandQueue->reply(&reply);
|
||||
@ -672,7 +673,7 @@ void DeviceHandlerBase::replyRawData(const uint8_t *data, size_t len,
|
||||
|
||||
CommandMessage message;
|
||||
|
||||
DeviceHandlerMessage::setDeviceHandlerRawReplayMessage(&message,
|
||||
DeviceHandlerMessage::setDeviceHandlerRawReplyMessage(&message,
|
||||
getObjectId(), address, isCommand);
|
||||
|
||||
// this->DeviceHandlerCommand = CommandMessage::CMD_NONE;
|
||||
|
@ -29,7 +29,15 @@ void setStaticFrameworkObjectIds();
|
||||
class StorageManagerIF;
|
||||
|
||||
/**
|
||||
* This is the abstract base class for device handlers.
|
||||
* \defgroup devices Devices
|
||||
* Contains all devices and the DeviceHandlerBase class.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \brief This is the abstract base class for device handlers.
|
||||
*
|
||||
* Documentation: Dissertation Baetz p.138,139, p.141-149
|
||||
* SpaceWire Remote Memory Access Protocol (RMAP)
|
||||
*
|
||||
* It features handling of @link DeviceHandlerIF::Mode_t Modes @endlink, the RMAP communication and the
|
||||
* communication with commanding objects.
|
||||
@ -41,6 +49,9 @@ class StorageManagerIF;
|
||||
* a default implementation is provided.
|
||||
*
|
||||
* Device handler instances should extend this class and implement the abstract functions.
|
||||
* Components and drivers can send so called cookies which are used for communication
|
||||
*
|
||||
* \ingroup devices
|
||||
*/
|
||||
class DeviceHandlerBase: public DeviceHandlerIF,
|
||||
public HasReturnvaluesIF,
|
||||
@ -68,6 +79,32 @@ public:
|
||||
|
||||
virtual MessageQueueId_t getCommandQueue(void) const;
|
||||
|
||||
|
||||
/**
|
||||
* This function is a core component and is called periodically.
|
||||
* General sequence:
|
||||
* If the State is SEND_WRITE:
|
||||
* 1. Set the cookie state to COOKIE_UNUSED and read the command queue
|
||||
* 2. Handles Device State Modes by calling doStateMachine().
|
||||
* This function calls callChildStatemachine() which calls the abstract functions
|
||||
* doStartUp() and doShutDown()
|
||||
* 3. Check switch states by calling checkSwitchStates()
|
||||
* 4. Decrements counter for timeout of replies by calling decrementDeviceReplyMap()
|
||||
* 5. Performs FDIR check for failures
|
||||
* 6. Calls hkSwitcher.performOperation()
|
||||
* 7. If the device mode is MODE_OFF, return RETURN_OK. Otherwise, perform the Action property
|
||||
* and performs depending on value specified
|
||||
* by input value counter. The child class tells base class what to do by setting this value.
|
||||
* - SEND_WRITE: Send data or commands to device by calling doSendWrite()
|
||||
* Calls abstract funtions buildNomalDeviceCommand()
|
||||
* or buildTransitionDeviceCommand()
|
||||
* - GET_WRITE: Get ackknowledgement for sending by calling doGetWrite().
|
||||
* Calls abstract functions scanForReply() and interpretDeviceReply().
|
||||
* - SEND_READ: Request reading data from device by calling doSendRead()
|
||||
* - GET_READ: Access requested reading data by calling doGetRead()
|
||||
* @param counter Specifies which Action to perform
|
||||
* @return RETURN_OK for successful execution
|
||||
*/
|
||||
virtual ReturnValue_t performOperation(uint8_t counter);
|
||||
|
||||
virtual ReturnValue_t initialize();
|
||||
|
@ -56,7 +56,7 @@ object_id_t DeviceHandlerMessage::getDeviceObjectId(
|
||||
return message->getParameter();
|
||||
}
|
||||
|
||||
void DeviceHandlerMessage::setDeviceHandlerRawReplayMessage(
|
||||
void DeviceHandlerMessage::setDeviceHandlerRawReplyMessage(
|
||||
CommandMessage* message, object_id_t deviceObjectid,
|
||||
store_address_t rawPacketStoreId, bool isCommand) {
|
||||
if (isCommand) {
|
||||
|
@ -71,7 +71,7 @@ public:
|
||||
static void setDeviceHandlerRawCommandMessage(CommandMessage* message,
|
||||
store_address_t rawPacketStoreId);
|
||||
|
||||
static void setDeviceHandlerRawReplayMessage(CommandMessage* message,
|
||||
static void setDeviceHandlerRawReplyMessage(CommandMessage* message,
|
||||
object_id_t deviceObjectid, store_address_t rawPacketStoreId,
|
||||
bool isCommand);
|
||||
|
||||
|
Reference in New Issue
Block a user