root / trunk / code / projects / diagnostic_station / station / test_comm.c @ 1390
History | View | Annotate | Download (831 Bytes)
1 |
#include "test_comm.h" |
---|---|
2 |
#include "global.h" |
3 |
#include "comm_robot.h" |
4 |
#include <bom.h> |
5 |
|
6 |
/** Returns whether we have communication **/
|
7 |
bool test_comm ()
|
8 |
{ |
9 |
usb_puts("# Testing communications" NL);
|
10 |
|
11 |
// FIXME implement
|
12 |
uint8_t id,bom_type; |
13 |
|
14 |
bool success = robot_read_eeprom(&id, &bom_type);
|
15 |
|
16 |
if (success)
|
17 |
{ |
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 |
else
|
31 |
usb_puts("# Testing communication finished (communication failed)" NL);
|
32 |
|
33 |
return success;
|
34 |
} |