lpid replaced by gpid
This commit is contained in:
parent
255d4a90a9
commit
1829d9cf0a
@ -24,12 +24,12 @@ public:
|
|||||||
size_t commandQueueDepth = 3);
|
size_t commandQueueDepth = 3);
|
||||||
virtual ~ExtendedControllerBase();
|
virtual ~ExtendedControllerBase();
|
||||||
|
|
||||||
/** SystemObjectIF overrides */
|
/* SystemObjectIF overrides */
|
||||||
virtual ReturnValue_t initialize() override;
|
virtual ReturnValue_t initialize() override;
|
||||||
|
|
||||||
virtual MessageQueueId_t getCommandQueue() const override;
|
virtual MessageQueueId_t getCommandQueue() const override;
|
||||||
|
|
||||||
/** ExecutableObjectIF overrides */
|
/* ExecutableObjectIF overrides */
|
||||||
virtual ReturnValue_t performOperation(uint8_t opCode) override;
|
virtual ReturnValue_t performOperation(uint8_t opCode) override;
|
||||||
virtual ReturnValue_t initializeAfterTaskCreation() override;
|
virtual ReturnValue_t initializeAfterTaskCreation() override;
|
||||||
|
|
||||||
@ -50,15 +50,15 @@ protected:
|
|||||||
*/
|
*/
|
||||||
virtual void performControlOperation() = 0;
|
virtual void performControlOperation() = 0;
|
||||||
|
|
||||||
/** Handle the four messages mentioned above */
|
/* Handle the four messages mentioned above */
|
||||||
void handleQueue() override;
|
void handleQueue() override;
|
||||||
|
|
||||||
/** HasActionsIF overrides */
|
/* HasActionsIF overrides */
|
||||||
virtual ReturnValue_t executeAction(ActionId_t actionId,
|
virtual ReturnValue_t executeAction(ActionId_t actionId,
|
||||||
MessageQueueId_t commandedBy, const uint8_t* data,
|
MessageQueueId_t commandedBy, const uint8_t* data,
|
||||||
size_t size) override;
|
size_t size) override;
|
||||||
|
|
||||||
/** HasLocalDatapoolIF overrides */
|
/* HasLocalDatapoolIF overrides */
|
||||||
virtual LocalDataPoolManager* getHkManagerHandle() override;
|
virtual LocalDataPoolManager* getHkManagerHandle() override;
|
||||||
virtual object_id_t getObjectId() const override;
|
virtual object_id_t getObjectId() const override;
|
||||||
virtual ReturnValue_t initializeLocalDataPool(
|
virtual ReturnValue_t initializeLocalDataPool(
|
||||||
|
@ -80,7 +80,7 @@ public:
|
|||||||
* @param storeId If a snapshot was requested, data will be located inside
|
* @param storeId If a snapshot was requested, data will be located inside
|
||||||
* the IPC store with this store ID.
|
* the IPC store with this store ID.
|
||||||
*/
|
*/
|
||||||
virtual void handleChangedPoolVariable(lp_id_t poolId,
|
virtual void handleChangedPoolVariable(gp_id_t globPoolId,
|
||||||
store_address_t storeId = storeId::INVALID_STORE_ADDRESS) {
|
store_address_t storeId = storeId::INVALID_STORE_ADDRESS) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -166,7 +166,7 @@ ReturnValue_t LocalDataPoolManager::handleNotificationUpdate(HkReceiver& receive
|
|||||||
// prepare and send update notification.
|
// prepare and send update notification.
|
||||||
CommandMessage notification;
|
CommandMessage notification;
|
||||||
HousekeepingMessage::setUpdateNotificationVariableCommand(¬ification,
|
HousekeepingMessage::setUpdateNotificationVariableCommand(¬ification,
|
||||||
receiver.dataId.localPoolId);
|
gp_id_t(owner->getObjectId(), receiver.dataId.localPoolId));
|
||||||
ReturnValue_t result = hkQueue->sendMessage(
|
ReturnValue_t result = hkQueue->sendMessage(
|
||||||
receiver.destinationQueue, ¬ification);
|
receiver.destinationQueue, ¬ification);
|
||||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
@ -238,7 +238,7 @@ ReturnValue_t LocalDataPoolManager::handleNotificationSnapshot(
|
|||||||
|
|
||||||
CommandMessage notification;
|
CommandMessage notification;
|
||||||
HousekeepingMessage::setUpdateSnapshotVariableCommand(¬ification,
|
HousekeepingMessage::setUpdateSnapshotVariableCommand(¬ification,
|
||||||
receiver.dataId.localPoolId, storeId);
|
gp_id_t(owner->getObjectId(), receiver.dataId.localPoolId), storeId);
|
||||||
result = hkQueue->sendMessage(receiver.destinationQueue,
|
result = hkQueue->sendMessage(receiver.destinationQueue,
|
||||||
¬ification);
|
¬ification);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
@ -563,9 +563,9 @@ ReturnValue_t LocalDataPoolManager::handleHousekeepingMessage(
|
|||||||
return HasReturnvaluesIF::RETURN_OK;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
}
|
}
|
||||||
case(HousekeepingMessage::UPDATE_NOTIFICATION_VARIABLE): {
|
case(HousekeepingMessage::UPDATE_NOTIFICATION_VARIABLE): {
|
||||||
lp_id_t locPoolId = HousekeepingMessage::
|
gp_id_t globPoolId = HousekeepingMessage::
|
||||||
getUpdateNotificationVariableCommand(message);
|
getUpdateNotificationVariableCommand(message);
|
||||||
owner->handleChangedPoolVariable(locPoolId);
|
owner->handleChangedPoolVariable(globPoolId);
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
}
|
}
|
||||||
case(HousekeepingMessage::UPDATE_SNAPSHOT_SET): {
|
case(HousekeepingMessage::UPDATE_SNAPSHOT_SET): {
|
||||||
@ -576,9 +576,9 @@ ReturnValue_t LocalDataPoolManager::handleHousekeepingMessage(
|
|||||||
}
|
}
|
||||||
case(HousekeepingMessage::UPDATE_SNAPSHOT_VARIABLE): {
|
case(HousekeepingMessage::UPDATE_SNAPSHOT_VARIABLE): {
|
||||||
store_address_t storeId;
|
store_address_t storeId;
|
||||||
lp_id_t localPoolId = HousekeepingMessage::
|
gp_id_t globPoolId = HousekeepingMessage::
|
||||||
getUpdateSnapshotVariableCommand(message, &storeId);
|
getUpdateSnapshotVariableCommand(message, &storeId);
|
||||||
owner->handleChangedPoolVariable(localPoolId, storeId);
|
owner->handleChangedPoolVariable(globPoolId, storeId);
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +38,6 @@ public:
|
|||||||
bool isDiagnostics,
|
bool isDiagnostics,
|
||||||
object_id_t packetDestination) = 0;
|
object_id_t packetDestination) = 0;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Subscribe for a notification message which will be sent
|
* @brief Subscribe for a notification message which will be sent
|
||||||
* if a dataset has changed.
|
* if a dataset has changed.
|
||||||
@ -54,8 +53,7 @@ public:
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
virtual ReturnValue_t subscribeForSetUpdateMessages(const uint32_t setId,
|
virtual ReturnValue_t subscribeForSetUpdateMessages(const uint32_t setId,
|
||||||
object_id_t destinationObject,
|
object_id_t destinationObject, MessageQueueId_t targetQueueId,
|
||||||
MessageQueueId_t targetQueueId,
|
|
||||||
bool generateSnapshot) = 0;
|
bool generateSnapshot) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -125,8 +125,10 @@ sid_t HousekeepingMessage::getSid(const CommandMessage* message) {
|
|||||||
return sid;
|
return sid;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HousekeepingMessage::setSid(CommandMessage *message, sid_t sid) {
|
gp_id_t HousekeepingMessage::getGpid(const CommandMessage* message) {
|
||||||
std::memcpy(message->getData(), &sid.raw, sizeof(sid.raw));
|
gp_id_t globalPoolId;
|
||||||
|
std::memcpy(&globalPoolId.raw, message->getData(), sizeof(globalPoolId.raw));
|
||||||
|
return globalPoolId;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HousekeepingMessage::setHkStuctureReportReply(CommandMessage *reply,
|
void HousekeepingMessage::setHkStuctureReportReply(CommandMessage *reply,
|
||||||
@ -169,9 +171,9 @@ void HousekeepingMessage::setUpdateNotificationSetCommand(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void HousekeepingMessage::setUpdateNotificationVariableCommand(
|
void HousekeepingMessage::setUpdateNotificationVariableCommand(
|
||||||
CommandMessage *command, lp_id_t localPoolId) {
|
CommandMessage *command, gp_id_t globalPoolId) {
|
||||||
command->setCommand(UPDATE_NOTIFICATION_VARIABLE);
|
command->setCommand(UPDATE_NOTIFICATION_VARIABLE);
|
||||||
command->setParameter(localPoolId);
|
setGpid(command, globalPoolId);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HousekeepingMessage::setUpdateSnapshotSetCommand(CommandMessage *command,
|
void HousekeepingMessage::setUpdateSnapshotSetCommand(CommandMessage *command,
|
||||||
@ -182,9 +184,9 @@ void HousekeepingMessage::setUpdateSnapshotSetCommand(CommandMessage *command,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void HousekeepingMessage::setUpdateSnapshotVariableCommand(
|
void HousekeepingMessage::setUpdateSnapshotVariableCommand(
|
||||||
CommandMessage *command, lp_id_t localPoolId, store_address_t storeId) {
|
CommandMessage *command, gp_id_t globalPoolId, store_address_t storeId) {
|
||||||
command->setCommand(UPDATE_SNAPSHOT_VARIABLE);
|
command->setCommand(UPDATE_SNAPSHOT_VARIABLE);
|
||||||
command->setParameter(localPoolId);
|
setGpid(command, globalPoolId);
|
||||||
command->setParameter3(storeId.raw);
|
command->setParameter3(storeId.raw);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -193,9 +195,9 @@ sid_t HousekeepingMessage::getUpdateNotificationSetCommand(
|
|||||||
return getSid(command);
|
return getSid(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
lp_id_t HousekeepingMessage::getUpdateNotificationVariableCommand(
|
gp_id_t HousekeepingMessage::getUpdateNotificationVariableCommand(
|
||||||
const CommandMessage *command) {
|
const CommandMessage *command) {
|
||||||
return command->getParameter();
|
return getGpid(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
sid_t HousekeepingMessage::getUpdateSnapshotSetCommand(
|
sid_t HousekeepingMessage::getUpdateSnapshotSetCommand(
|
||||||
@ -206,10 +208,18 @@ sid_t HousekeepingMessage::getUpdateSnapshotSetCommand(
|
|||||||
return getSid(command);
|
return getSid(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
lp_id_t HousekeepingMessage::getUpdateSnapshotVariableCommand(
|
gp_id_t HousekeepingMessage::getUpdateSnapshotVariableCommand(
|
||||||
const CommandMessage *command, store_address_t *storeId) {
|
const CommandMessage *command, store_address_t *storeId) {
|
||||||
if(storeId != nullptr) {
|
if(storeId != nullptr) {
|
||||||
*storeId = command->getParameter3();
|
*storeId = command->getParameter3();
|
||||||
}
|
}
|
||||||
return command->getParameter();
|
return getGpid(command);
|
||||||
|
}
|
||||||
|
|
||||||
|
void HousekeepingMessage::setSid(CommandMessage *message, sid_t sid) {
|
||||||
|
std::memcpy(message->getData(), &sid.raw, sizeof(sid.raw));
|
||||||
|
}
|
||||||
|
|
||||||
|
void HousekeepingMessage::setGpid(CommandMessage *message, gp_id_t globalPoolId) {
|
||||||
|
std::memcpy(message->getData(), &globalPoolId.raw, sizeof(globalPoolId.raw));
|
||||||
}
|
}
|
||||||
|
@ -75,6 +75,7 @@ public:
|
|||||||
//static constexpr Command_t UPDATE_HK_REPORT = MAKE_COMMAND_ID(134);
|
//static constexpr Command_t UPDATE_HK_REPORT = MAKE_COMMAND_ID(134);
|
||||||
|
|
||||||
static sid_t getSid(const CommandMessage* message);
|
static sid_t getSid(const CommandMessage* message);
|
||||||
|
static gp_id_t getGpid(const CommandMessage* message);
|
||||||
|
|
||||||
/* Housekeeping Interface Messages */
|
/* Housekeeping Interface Messages */
|
||||||
|
|
||||||
@ -123,26 +124,27 @@ public:
|
|||||||
static void setUpdateNotificationSetCommand(CommandMessage* command,
|
static void setUpdateNotificationSetCommand(CommandMessage* command,
|
||||||
sid_t sid);
|
sid_t sid);
|
||||||
static void setUpdateNotificationVariableCommand(CommandMessage* command,
|
static void setUpdateNotificationVariableCommand(CommandMessage* command,
|
||||||
lp_id_t localPoolId);
|
gp_id_t globalPoolId);
|
||||||
|
|
||||||
static void setUpdateSnapshotSetCommand(CommandMessage* command, sid_t sid,
|
static void setUpdateSnapshotSetCommand(CommandMessage* command, sid_t sid,
|
||||||
store_address_t storeId);
|
store_address_t storeId);
|
||||||
static void setUpdateSnapshotVariableCommand(CommandMessage* command,
|
static void setUpdateSnapshotVariableCommand(CommandMessage* command,
|
||||||
lp_id_t localPoolId, store_address_t storeId);
|
gp_id_t globalPoolId, store_address_t storeId);
|
||||||
|
|
||||||
static sid_t getUpdateNotificationSetCommand(const CommandMessage* command);
|
static sid_t getUpdateNotificationSetCommand(const CommandMessage* command);
|
||||||
static lp_id_t getUpdateNotificationVariableCommand(
|
static gp_id_t getUpdateNotificationVariableCommand(
|
||||||
const CommandMessage* command);
|
const CommandMessage* command);
|
||||||
|
|
||||||
static sid_t getUpdateSnapshotSetCommand(const CommandMessage* command,
|
static sid_t getUpdateSnapshotSetCommand(const CommandMessage* command,
|
||||||
store_address_t* storeId);
|
store_address_t* storeId);
|
||||||
static lp_id_t getUpdateSnapshotVariableCommand(const CommandMessage* command,
|
static gp_id_t getUpdateSnapshotVariableCommand(const CommandMessage* command,
|
||||||
store_address_t* storeId);
|
store_address_t* storeId);
|
||||||
|
|
||||||
/** Utility */
|
/** Utility */
|
||||||
static void clear(CommandMessage* message);
|
static void clear(CommandMessage* message);
|
||||||
private:
|
private:
|
||||||
static void setSid(CommandMessage* message, sid_t sid);
|
static void setSid(CommandMessage* message, sid_t sid);
|
||||||
|
static void setGpid(CommandMessage* message, gp_id_t globalPoolId);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user