Page 189 - PDA Robotics Using Your Personal Digital Assistant to Control Your Robot
P. 189
PDA 08 5/27/03 8:47 AM Page 165
Chapter 8 / PDA Robot Palm OS Software Using Code Warrior 8.0
// Display the range in the Range Label if we are in autonomous mode
//
if( autonomous == true )
{
FrmCopyLabel (frm, MainRangeLabel, (char*)&range_data);
}
range_aquired = true;
FrmDrawForm(FrmGetActiveForm());
break;
case LEVENT_STATUS_IND:
switch (parms->status)
{
case IR_STATUS_NO_PROGRESS:
event = "S_NO_PROGRESS"; break;
case IR_STATUS_LINK_OK:
event = "S_LINK_OK"; break;
case IR_STATUS_MEDIA_NOT_BUSY:
event = "S_MEDIA_NOT_BUSY"; break;
default:
event = "S_UNKNOWN";
}
break;
case LEVENT_TEST_CNF:
switch (parms->status)
{
case IR_STATUS_SUCCESS:
event = "TEST_SUCCESS"; break;
case IR_STATUS_FAILED:
event = "TEST_FAILED"; break;
}
break;
case LEVENT_TEST_IND:
event = "TEST_IND"; break;
default: event = "UNKNOWN";
}
}
//
// StoreDiscovery goes through the devices list returned when we
// sent out a Discovery request to all IrDA devices in the vicinity.
// It throws away all devices except PDA Robot and set the connection
// information returned to us by it.
//
void StoreDiscovery(IrDeviceList* deviceList)
{
UInt8 i;
165