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 option for reading the device default values. #292

Merged
merged 1 commit into from
Jan 20, 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
1 change: 1 addition & 0 deletions python/fusion_engine_client/messages/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
class ConfigurationSource(IntEnum):
ACTIVE = 0
SAVED = 1
DEFAULT = 2


class ConfigType(IntEnum):
Expand Down
8 changes: 8 additions & 0 deletions src/point_one/fusion_engine/messages/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,11 @@ inline p1_ostream& operator<<(p1_ostream& stream, InterfaceConfigType type) {
enum class ConfigurationSource : uint8_t {
ACTIVE = 0, ///< Active configuration currently in use by the device.
SAVED = 1, ///< Settings currently saved to persistent storage.
/**
* Read only device defaults. Attempting to write to this source will fail
* with a @ref Response::VALUE_ERROR.
*/
DEFAULT = 2,
};

/**
Expand All @@ -475,6 +480,9 @@ P1_CONSTEXPR_FUNC const char* to_string(ConfigurationSource source) {
case ConfigurationSource::SAVED:
return "Saved";

case ConfigurationSource::DEFAULT:
return "Default";

default:
return "Unrecognized Source";
}
Expand Down
Loading