Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add integrity status fault type #296

Merged
merged 2 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions python/fusion_engine_client/messages/fault_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class FaultType(IntEnum):
ENABLE_GNSS = 4
REGION_BLACKOUT = 5
QUECTEL_TEST = 6
INTEGRITY_STATUS = 7


class CoComType(IntEnum):
Expand Down Expand Up @@ -90,6 +91,15 @@ class CoComLimit(NamedTuple):
"value" / AutoEnum(Int8ul, CoComType),
)

class IntegrityStatus(NamedTuple):
"""!
@brief Integrity status specifier.
"""
value: Int8ul

IntegrityStatusConstruct = Struct(
"value" / Int8ul,
)

_class_gen = _FaultPayloadGenerator()

Expand Down Expand Up @@ -164,6 +174,13 @@ class QuectelTest(_class_gen.Bool):
"""
pass

@_class_gen.create_payload_class(FaultType.INTEGRITY_STATUS, _class_gen.IntegrityStatusConstruct)
class IntegrityStatus(_class_gen.IntegrityStatus):
"""!
@brief Simulate a specified integrity status failure (intended for factory test purposes only).
"""
pass

FaultControlMessageConstruct = Struct(
"fault_type" / AutoEnum(Int8ul, FaultType),
Padding(15),
Expand Down
10 changes: 10 additions & 0 deletions src/point_one/fusion_engine/messages/fault_control.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ enum class FaultType : uint8_t {
* Payload format: `uint8_t` (0=disable, 1=enable)
*/
QUECTEL_TEST = 6,
/**
* Simulate a specified integrity status failure (intended for factory test
* purposes only).
*
* Payload format: `uint8_t`
*/
INTEGRITY_STATUS = 7,
};

/**
Expand Down Expand Up @@ -135,6 +142,9 @@ P1_CONSTEXPR_FUNC const char* to_string(FaultType type) {
case FaultType::QUECTEL_TEST:
return "Quectel Test";

case FaultType::INTEGRITY_STATUS:
return "Integrity Status";

default:
return "Unrecognized";
}
Expand Down
Loading