diff options
Diffstat (limited to 'src/server/main.c')
-rw-r--r-- | src/server/main.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/server/main.c b/src/server/main.c index 1b36c2f..ec096c1 100644 --- a/src/server/main.c +++ b/src/server/main.c @@ -41,9 +41,9 @@ static float digest_temp(const short int rawdata); int main(void) { struct netstate *state; - char data[8] = {0}; + char data[32] = {0}; int status; - struct timespec wait = {0, 500 * 1000 * 1000}; + struct timespec wait = {0, 100 * 1000 * 1000}; state = init(2191); @@ -93,7 +93,13 @@ static void draw_idle(void) mvprintw(1, 0, "thermistor temp: [waiting for ESP8266...]"); move(2, 0); clrtoeol(); - mvprintw(2, 0, "press 'q' to exit"); + mvprintw(2, 0, "thermistor resistance: [waiting for ESP8266...]"); + move(3, 0); + clrtoeol(); + mvprintw(3, 0, "tap voltage: [waiting for ESP8266...]"); + move(4, 0); + clrtoeol(); + mvprintw(4, 0, "press 'q' to exit"); refresh(); } @@ -101,11 +107,14 @@ static void draw_busy(const char * const data) { unsigned int sequence; short int thermistor_data; + short int voltage; float temp; memcpy(&sequence, data + 2, sizeof(sequence)); memcpy(&thermistor_data, data + 6, sizeof(thermistor_data)); temp = digest_temp(thermistor_data); + memcpy(&thermistor_data, data + 10, sizeof(thermistor_data)); + memcpy(&voltage, data + 12, sizeof(voltage)); move(0, 0); clrtoeol(); @@ -115,7 +124,13 @@ static void draw_busy(const char * const data) mvprintw(1, 0, "thermistor temp: %.1fC", temp); move(2, 0); clrtoeol(); - mvprintw(2, 0, "press 'q' to exit"); + mvprintw(2, 0, "thermistor resistance: %hd", thermistor_data); + move(3, 0); + clrtoeol(); + mvprintw(3, 0, "tap voltage: %hd", voltage); + move(4, 0); + clrtoeol(); + mvprintw(4, 0, "press 'q' to exit"); refresh(); } |