slight formatting
This commit is contained in:
parent
d44428f49c
commit
aed2d7fc93
@ -8,6 +8,12 @@
|
|||||||
#include "../modes/HasModesIF.h"
|
#include "../modes/HasModesIF.h"
|
||||||
#include "../ipc/MessageQueueSenderIF.h"
|
#include "../ipc/MessageQueueSenderIF.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is used to uniquely identify commands that are sent to a device
|
||||||
|
* The values are defined in the device-specific implementations
|
||||||
|
*/
|
||||||
|
using DeviceCommandId_t = uint32_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This is the Interface used to communicate with a device handler.
|
* @brief This is the Interface used to communicate with a device handler.
|
||||||
* @details Includes all expected return values, events and modes.
|
* @details Includes all expected return values, events and modes.
|
||||||
@ -15,11 +21,7 @@
|
|||||||
*/
|
*/
|
||||||
class DeviceHandlerIF {
|
class DeviceHandlerIF {
|
||||||
public:
|
public:
|
||||||
/**
|
|
||||||
* This is used to uniquely identify commands that are sent to a device
|
|
||||||
* The values are defined in the device-specific implementations
|
|
||||||
*/
|
|
||||||
typedef uint32_t DeviceCommandId_t;
|
|
||||||
|
|
||||||
static const uint8_t TRANSITION_MODE_CHILD_ACTION_MASK = 0x20;
|
static const uint8_t TRANSITION_MODE_CHILD_ACTION_MASK = 0x20;
|
||||||
static const uint8_t TRANSITION_MODE_BASE_ACTION_MASK = 0x10;
|
static const uint8_t TRANSITION_MODE_BASE_ACTION_MASK = 0x10;
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
|
#include "DeviceHandlerMessage.h"
|
||||||
#include "../objectmanager/ObjectManagerIF.h"
|
#include "../objectmanager/ObjectManagerIF.h"
|
||||||
#include "../devicehandlers/DeviceHandlerMessage.h"
|
|
||||||
#include "../objectmanager/ObjectManagerIF.h"
|
|
||||||
|
|
||||||
DeviceHandlerMessage::DeviceHandlerMessage() {
|
|
||||||
}
|
|
||||||
|
|
||||||
store_address_t DeviceHandlerMessage::getStoreAddress(
|
store_address_t DeviceHandlerMessage::getStoreAddress(
|
||||||
const CommandMessage* message) {
|
const CommandMessage* message) {
|
||||||
@ -25,14 +21,6 @@ uint8_t DeviceHandlerMessage::getWiretappingMode(
|
|||||||
return message->getParameter();
|
return message->getParameter();
|
||||||
}
|
}
|
||||||
|
|
||||||
//void DeviceHandlerMessage::setDeviceHandlerDirectCommandMessage(
|
|
||||||
// CommandMessage* message, DeviceCommandId_t deviceCommand,
|
|
||||||
// store_address_t commandParametersStoreId) {
|
|
||||||
// message->setCommand(CMD_DIRECT);
|
|
||||||
// message->setParameter(deviceCommand);
|
|
||||||
// message->setParameter2(commandParametersStoreId.raw);
|
|
||||||
//}
|
|
||||||
|
|
||||||
void DeviceHandlerMessage::setDeviceHandlerRawCommandMessage(
|
void DeviceHandlerMessage::setDeviceHandlerRawCommandMessage(
|
||||||
CommandMessage* message, store_address_t rawPacketStoreId) {
|
CommandMessage* message, store_address_t rawPacketStoreId) {
|
||||||
message->setCommand(CMD_RAW);
|
message->setCommand(CMD_RAW);
|
||||||
@ -79,13 +67,12 @@ void DeviceHandlerMessage::setDeviceHandlerDirectCommandReply(
|
|||||||
void DeviceHandlerMessage::clear(CommandMessage* message) {
|
void DeviceHandlerMessage::clear(CommandMessage* message) {
|
||||||
switch (message->getCommand()) {
|
switch (message->getCommand()) {
|
||||||
case CMD_RAW:
|
case CMD_RAW:
|
||||||
// case CMD_DIRECT:
|
|
||||||
case REPLY_RAW_COMMAND:
|
case REPLY_RAW_COMMAND:
|
||||||
case REPLY_RAW_REPLY:
|
case REPLY_RAW_REPLY:
|
||||||
case REPLY_DIRECT_COMMAND_DATA: {
|
case REPLY_DIRECT_COMMAND_DATA: {
|
||||||
StorageManagerIF *ipcStore = objectManager->get<StorageManagerIF>(
|
StorageManagerIF *ipcStore = objectManager->get<StorageManagerIF>(
|
||||||
objects::IPC_STORE);
|
objects::IPC_STORE);
|
||||||
if (ipcStore != NULL) {
|
if (ipcStore != nullptr) {
|
||||||
ipcStore->deleteData(getStoreAddress(message));
|
ipcStore->deleteData(getStoreAddress(message));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,10 @@
|
|||||||
*/
|
*/
|
||||||
class DeviceHandlerMessage {
|
class DeviceHandlerMessage {
|
||||||
public:
|
public:
|
||||||
// Instantiation forbidden.
|
/**
|
||||||
|
* Instantiation forbidden. Instead, use static functions to operate
|
||||||
|
* on messages.
|
||||||
|
*/
|
||||||
DeviceHandlerMessage() = delete;
|
DeviceHandlerMessage() = delete;
|
||||||
virtual ~DeviceHandlerMessage() {}
|
virtual ~DeviceHandlerMessage() {}
|
||||||
|
|
||||||
@ -25,21 +28,21 @@ public:
|
|||||||
static const uint8_t MESSAGE_ID = messagetypes::DEVICE_HANDLER_COMMAND;
|
static const uint8_t MESSAGE_ID = messagetypes::DEVICE_HANDLER_COMMAND;
|
||||||
//! Sends a raw command, setParameter is a storeId containing the
|
//! Sends a raw command, setParameter is a storeId containing the
|
||||||
//! raw packet to send
|
//! raw packet to send
|
||||||
static const Command_t CMD_RAW = MAKE_COMMAND_ID( 1 );
|
static const Command_t CMD_RAW = MAKE_COMMAND_ID(1);
|
||||||
//! Requests a IO-Board switch, setParameter() is the IO-Board identifier
|
//! Requests a IO-Board switch, setParameter() is the IO-Board identifier
|
||||||
static const Command_t CMD_SWITCH_ADDRESS = MAKE_COMMAND_ID( 3 );
|
static const Command_t CMD_SWITCH_ADDRESS = MAKE_COMMAND_ID(3);
|
||||||
//! (De)Activates the monitoring of all raw traffic in DeviceHandlers,
|
//! (De)Activates the monitoring of all raw traffic in DeviceHandlers,
|
||||||
//! setParameter is 0 to deactivate, 1 to activate
|
//! setParameter is 0 to deactivate, 1 to activate
|
||||||
static const Command_t CMD_WIRETAPPING = MAKE_COMMAND_ID( 4 );
|
static const Command_t CMD_WIRETAPPING = MAKE_COMMAND_ID(4);
|
||||||
|
|
||||||
//! Signals that a direct command was sent
|
//! Signals that a direct command was sent
|
||||||
static const Command_t REPLY_DIRECT_COMMAND_SENT = ActionMessage::STEP_SUCCESS;
|
static const Command_t REPLY_DIRECT_COMMAND_SENT = ActionMessage::STEP_SUCCESS;
|
||||||
//! Contains a raw command sent to the Device
|
//! Contains a raw command sent to the Device
|
||||||
static const Command_t REPLY_RAW_COMMAND = MAKE_COMMAND_ID(0x11 );
|
static const Command_t REPLY_RAW_COMMAND = MAKE_COMMAND_ID(0x11);
|
||||||
//! Contains a raw reply from the Device, getParameter() is the ObjcetId
|
//! Contains a raw reply from the Device, getParameter() is the ObjcetId
|
||||||
//! of the sender, getParameter2() is a ::store_id_t containing the
|
//! of the sender, getParameter2() is a ::store_id_t containing the
|
||||||
//! raw packet received
|
//! raw packet received
|
||||||
static const Command_t REPLY_RAW_REPLY = MAKE_COMMAND_ID( 0x12);
|
static const Command_t REPLY_RAW_REPLY = MAKE_COMMAND_ID(0x12);
|
||||||
static const Command_t REPLY_DIRECT_COMMAND_DATA = ActionMessage::DATA_REPLY;
|
static const Command_t REPLY_DIRECT_COMMAND_DATA = ActionMessage::DATA_REPLY;
|
||||||
|
|
||||||
static store_address_t getStoreAddress(const CommandMessage* message);
|
static store_address_t getStoreAddress(const CommandMessage* message);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user