Index: firmware/App/Modes/OperationModes.h =================================================================== diff -u -r7a7bf19d0cf16745566956f45cef57f8eb5df445 -rcd5be724d5a3ba7457e761191d82f278654d7f5c --- firmware/App/Modes/OperationModes.h (.../OperationModes.h) (revision 7a7bf19d0cf16745566956f45cef57f8eb5df445) +++ firmware/App/Modes/OperationModes.h (.../OperationModes.h) (revision cd5be724d5a3ba7457e761191d82f278654d7f5c) @@ -1,17 +1,17 @@ /************************************************************************** * -* Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. +* Copyright (c) 2019-2024 Diality Inc. - All Rights Reserved. * * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * -* @file OperationModes.h +* @file OperationModes.h * -* @author (last) Sean Nash -* @date (last) 29-May-2020 +* @author (last) Michael Garthwaite +* @date (last) 14-Jun-2023 * -* @author (original) Dara Navaei -* @date (original) 05-Nov-2019 +* @author (original) Dara Navaei +* @date (original) 05-Nov-2019 * ***************************************************************************/ @@ -31,14 +31,30 @@ // ********** public definitions ********** +#define NO_SUB_STATE 0xFF ///< value for when submode does not have specific substates and is not applicable. + +/// Payload record structure for op mode broadcast message +typedef struct +{ + U32 opMode; ///< Current operating mode + U32 subMode; ///< Current sub-mode of current operating mode +} OP_MODE_PAYLOAD_T; + // ********** public function prototypes ********** void initOperationModes( void ); // Initialize this module void execOperationModes( void ); // Execute the operation modes state machine (scheduled periodic call) void requestNewOperationMode( HD_OP_MODE_T newMode ); // Request a transition to a new operation mode HD_OP_MODE_T getCurrentOperationMode( void ); // Get the current operation mode HD_OP_MODE_T getPreviousOperationMode( void ); // Get the previous operation mode +U32 getCurrentSubMode( void ); // Get the current sub-mode void initiateAlarmAction( ALARM_ACTION_T action ); // Initiate an alarm or alarm recovery action according to current op mode +CONFIRMATION_REQUEST_STATUS_T getConfirmationRequestStatus( GENERIC_CONFIRM_ID_T requestID ); // Get the current confirmation request status +void setConfirmationRequestStatus( GENERIC_CONFIRM_ID_T requestID, CONFIRMATION_REQUEST_STATUS_T status ); // Set the confirmation request status +GENERIC_CONFIRM_ID_T addConfirmationRequest( GENERIC_CONFIRM_ID_T requestID, GENERIC_CONFIRM_COMMAND_T requestType, U32 rejectReason ); // Add a new confirmation request +void setCurrentSubState( U32 subState ); // Set the current substate. +void setCurrent4thLevelState( U32 state ); // Set the current 4th level state. +void sendOperationStatusEvent( void ); // Constructs and sends operation status event BOOL testSetOperationMode( HD_OP_MODE_T newMode ); // Force transition to a given mode (if allowed) BOOL testSetOpModePublishIntervalOverride( U32 ms );