diff --git a/src/main.c b/src/main.c index 8d00da1..1b03bdb 100644 --- a/src/main.c +++ b/src/main.c @@ -1,21 +1,36 @@ #include "states/state.h" #include "device.h" +#include +#include int main() { Device_t device; initDevice(&device); // sets the device to off on start up - setOffState(&device); + setDeviceStateToOff(&device); + if (strcmp(device.state.state_name, "off_state.c") != 0) return 0; // turn on the device device.methods.pressPwr(&device); + if (strcmp(device.state.state_name, "lock_state.c") != 0) return 0; // send the current string device.methods.pressStrInput(&device); + if (strcmp(device.state.state_name, "lock_state.c") != 0) return 0; // send in the right string device.entered_string = "pwd"; device.methods.pressStrInput(&device); + if (strcmp(device.state.state_name, "unlock_state.c") != 0) return 0; + + // try to enter debug mode + device.entered_string = "dbg"; + device.methods.pressStrInput(&device); + if (strcmp(device.state.state_name, "debug_state.c") != 0) return 0; + + // try to power down + device.methods.pressPwr(&device); + if (strcmp(device.state.state_name, "off_state.c") != 0) return 0; return 0; }