Unmarshal AMI info
This commit is contained in:
parent
0cd0ce6f3e
commit
938978f5d4
@ -35,6 +35,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void unmarshal_mission_select(uint8_t* data);
|
void unmarshal_mission_select(uint8_t* data);
|
||||||
|
void unmarshal_ami(uint8_t* data);
|
||||||
|
|
||||||
// This is optional so that we can still run the code on a PC without I2C
|
// This is optional so that we can still run the code on a PC without I2C
|
||||||
std::optional<int> i2c_dev_file;
|
std::optional<int> i2c_dev_file;
|
||||||
|
@ -92,6 +92,9 @@ void AppState::poll() {
|
|||||||
case AppView::MISSION_SELECT:
|
case AppView::MISSION_SELECT:
|
||||||
unmarshal_mission_select(data);
|
unmarshal_mission_select(data);
|
||||||
break;
|
break;
|
||||||
|
case AppView::AMI:
|
||||||
|
unmarshal_ami(data);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
throw std::runtime_error(fmt::format("Unknown view: {}", view));
|
throw std::runtime_error(fmt::format("Unknown view: {}", view));
|
||||||
}
|
}
|
||||||
@ -105,3 +108,8 @@ void AppState::unmarshal_mission_select(uint8_t* data) {
|
|||||||
mission = static_cast<Mission>(data[1]);
|
mission = static_cast<Mission>(data[1]);
|
||||||
spdlog::info("Mission after poll: {}", mission);
|
spdlog::info("Mission after poll: {}", mission);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AppState::unmarshal_ami(uint8_t* data) {
|
||||||
|
mission = static_cast<Mission>(data[1]);
|
||||||
|
spdlog::info("Mission after poll: {}", mission);
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user