root / trunk / code / projects / diagnostic_station / station / test_comm.c @ 1390
History | View | Annotate | Download (831 Bytes)
1 | 1152 | deffi | #include "test_comm.h" |
---|---|---|---|
2 | #include "global.h" |
||
3 | 1182 | deffi | #include "comm_robot.h" |
4 | 1303 | abuchan | #include <bom.h> |
5 | 1152 | deffi | |
6 | /** Returns whether we have communication **/
|
||
7 | bool test_comm ()
|
||
8 | { |
||
9 | 1166 | deffi | usb_puts("# Testing communications" NL);
|
10 | 1152 | deffi | |
11 | // FIXME implement
|
||
12 | 1303 | abuchan | uint8_t id,bom_type; |
13 | |||
14 | bool success = robot_read_eeprom(&id, &bom_type);
|
||
15 | 1152 | deffi | |
16 | if (success)
|
||
17 | 1303 | abuchan | { |
18 | usb_puts("# Testing communication finished (communication succeeded)" NL);
|
||
19 | usb_puts("# Robot ID:");
|
||
20 | usb_puti(id); |
||
21 | usb_puts(" BOM type:");
|
||
22 | switch (bom_type)
|
||
23 | { |
||
24 | case BOM10: usb_puts("1.0" NL); break; |
||
25 | case BOM15: usb_puts("1.5" NL); break; |
||
26 | case RBOM: usb_puts("RBOM" NL); break; |
||
27 | default: usb_puti(bom_type); usb_puts("(invalid)" NL); |
||
28 | } |
||
29 | } |
||
30 | 1152 | deffi | else
|
31 | 1166 | deffi | usb_puts("# Testing communication finished (communication failed)" NL);
|
32 | 1152 | deffi | |
33 | return success;
|
||
34 | } |