Skip to content

Commit

Permalink
Add explicit log start/stop flags.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Diamond committed Jan 20, 2024
1 parent b2ab9fd commit 2c1a186
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 2 deletions.
10 changes: 10 additions & 0 deletions python/fusion_engine_client/messages/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,11 @@ class ShutdownRequest(MessagePayload):
MESSAGE_TYPE = MessageType.SHUTDOWN_REQUEST
MESSAGE_VERSION = 0

## Stop navigation engine if running and flush calibration to non-volatile storage.
STOP_ENGINE = 0x0000000000000001
## If a log is being generated, end that log.
STOP_CURRENT_LOG = 0x0000000000000002

ShutdownRequestConstruct = Struct(
"shutdown_flags" / Int64ul,
Padding(8),
Expand Down Expand Up @@ -678,6 +683,11 @@ class StartupRequest(MessagePayload):
MESSAGE_TYPE = MessageType.STARTUP_REQUEST
MESSAGE_VERSION = 0

## Start navigation engine if not running.
START_ENGINE = 0x0000000000000001
## If a log is not being generated, start a new log.
START_NEW_LOG = 0x0000000000000002

StartupRequestConstruct = Struct(
"startup_flags" / Int64ul,
Padding(8),
Expand Down
35 changes: 33 additions & 2 deletions src/point_one/fusion_engine/messages/control.h
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,23 @@ struct P1_ALIGNAS(4) EventNotificationMessage : public MessagePayload {
struct P1_ALIGNAS(4) ShutdownRequest : public MessagePayload {
static constexpr MessageType MESSAGE_TYPE = MessageType::SHUTDOWN_REQUEST;
static constexpr uint8_t MESSAGE_VERSION = 0;
/** A bitmask of flags associated with the event. */

/**
* Stop navigation engine if running and flush calibration to non-volatile
* storage.
*/
static constexpr uint64_t STOP_ENGINE = 0x0000000000000001;
/**
* If a log is being generated, end that log.
*/
static constexpr uint64_t STOP_CURRENT_LOG = 0x0000000000000002;

/**
* A bitmask of flags associated with the event.
*
* @note For backwards compatibility, a value of `0` is treated as if the
* STOP_ENGINE bit is set (`0x0000000000000001`).
*/
uint64_t shutdown_flags = 0;
uint8_t reserved1[8] = {0};
};
Expand All @@ -587,7 +603,22 @@ struct P1_ALIGNAS(4) ShutdownRequest : public MessagePayload {
struct P1_ALIGNAS(4) StartupRequest : public MessagePayload {
static constexpr MessageType MESSAGE_TYPE = MessageType::STARTUP_REQUEST;
static constexpr uint8_t MESSAGE_VERSION = 0;
/** A bitmask of flags associated with the event. */

/**
* Start navigation engine if not running.
*/
static constexpr uint64_t START_ENGINE = 0x0000000000000001;
/**
* If a log is not being generated, start a new log.
*/
static constexpr uint64_t START_NEW_LOG = 0x0000000000000002;

/**
* A bitmask of flags associated with the event.
*
* @note For backwards compatibility, a value of `0` is treated as if the
* STOP_ENGINE bit is set (`0x0000000000000001`).
*/
uint64_t startup_flags = 0;
uint8_t reserved1[8] = {0};
};
Expand Down

0 comments on commit 2c1a186

Please sign in to comment.