#ifndef FACT_HeadersLid #define FACT_HeadersLid namespace Lid { // this describes the single dim service this server is emitting. struct dim_service_t{ float inner_current_mean; float outer_current_mean; float inner_position_mean; float outer_position_mean; int32_t inner_speed; int32_t outer_speed; } __attribute__((__packed__)); // The following two structures describe the message as it is sent // from the arduino via USB to the PC. struct mean_var_samples_t { uint32_t mean; uint32_t var; uint16_t samples; }__attribute__((packed)); struct message_t { mean_var_samples_t inner_motor_current; mean_var_samples_t outer_motor_current; mean_var_samples_t inner_motor_position; mean_var_samples_t outer_motor_position; int16_t inner_motor_speed; int16_t outer_motor_speed; char current_cmd; uint8_t system_state; }__attribute__((packed)); struct complete_message_t { char start_flag[6]; // the string "start:" message_t msg; uint16_t checksum; }__attribute__((packed)); namespace State { enum states_t { kClosed = 1, kUpperOpening, kHalfOpen, kLowerOpening, kOpen, kLowerClosing, kUpperClosing, kUnknown, }; } } #endif