[Firebug-cvs] mts400/sensors/gps GpsPacket.nc,1.1,1.2 UARTGpsPacket.nc,1.1,1.2
Brought to you by:
doolin
From: <do...@us...> - 2003-11-12 00:11:51
|
Update of /cvsroot/firebug/mts400/sensors/gps In directory sc8-pr-cvs1:/tmp/cvs-serv7855/sensors/gps Modified Files: GpsPacket.nc UARTGpsPacket.nc Log Message: GPS code appears to running by itself now. Index: GpsPacket.nc =================================================================== RCS file: /cvsroot/firebug/mts400/sensors/gps/GpsPacket.nc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GpsPacket.nc 11 Nov 2003 01:59:40 -0000 1.1 --- GpsPacket.nc 12 Nov 2003 00:11:47 -0000 1.2 *************** *** 72,75 **** --- 72,76 ---- module GpsPacket { + provides { interface StdControl as Control; *************** *** 93,102 **** interface StdControl as SwitchControl; ! interface Switch as Switch1; ! interface Switch as SwitchI2W; } } implementation { --- 94,104 ---- interface StdControl as SwitchControl; ! interface Switch as PowerSwitch; ! interface Switch as IOSwitch; } } + implementation { *************** *** 180,183 **** --- 182,188 ---- } + /** FIXME: Explain why we would want to transmit bytes, instead + * of just reading bytes. + */ command result_t txBytes(uint8_t *bytes, uint8_t numBytes) { *************** *** 331,335 **** uint16_t strength) { ! //SODbg(DBG_USR2, "PACKET: byte arrived: %x, COUNT: %i\n", data, rxCount); if (error) { --- 336,341 ---- uint16_t strength) { ! ! //SODbg(DBG_USR2, "PACKET: byte arrived: %x, COUNT: %i\n", data, rxCount); if (error) { *************** *** 391,403 **** if (state_gps == GPS_SWITCH_IDLE){ - power_gps = PowerState; if (power_gps){ ! if (call Switch1.set(MICAWB_GPS_POWER,0) == SUCCESS) { state_gps = GPS_PWR_SWITCH_WAIT; } } else { ! if (call Switch1.set(MICAWB_GPS_POWER,1) == SUCCESS) { state_gps = GPS_PWR_SWITCH_WAIT; } --- 397,408 ---- if (state_gps == GPS_SWITCH_IDLE){ power_gps = PowerState; if (power_gps){ ! if (call PowerSwitch.set(MICAWB_GPS_POWER,0) == SUCCESS) { state_gps = GPS_PWR_SWITCH_WAIT; } } else { ! if (call PowerSwitch.set(MICAWB_GPS_POWER,1) == SUCCESS) { state_gps = GPS_PWR_SWITCH_WAIT; } *************** *** 409,429 **** ! /** Power or Enabled switch set */ ! event result_t Switch1.setDone(bool local_result) { ! if (state_gps == GPS_PWR_SWITCH_WAIT) { ! if (call Switch1.set(MICAWB_GPS_ENABLE ,power_gps) == SUCCESS) { ! state_gps = GPS_EN_SWITCH_WAIT; ! } ! } else if (state_gps == GPS_EN_SWITCH_WAIT) { ! if (call SwitchI2W.set( MICAWB_GPS_TX_SELECT ,power_gps) == SUCCESS) { ! state_gps = GPS_TX_SWITCH_WAIT; ! } ! } ! return SUCCESS; } ! event result_t Switch1.getDone(char value) { return SUCCESS; } --- 414,435 ---- ! /** Power or Enabled switch set */ ! event result_t PowerSwitch.setDone(bool local_result) { ! ! if (state_gps == GPS_PWR_SWITCH_WAIT) { ! if (call PowerSwitch.set(MICAWB_GPS_ENABLE ,power_gps) == SUCCESS) { ! state_gps = GPS_EN_SWITCH_WAIT; ! } ! } else if (state_gps == GPS_EN_SWITCH_WAIT) { ! if (call IOSwitch.set( MICAWB_GPS_TX_SELECT ,power_gps) == SUCCESS) { ! state_gps = GPS_TX_SWITCH_WAIT; ! } ! } ! return SUCCESS; } ! event result_t PowerSwitch.getDone(char value) { return SUCCESS; } *************** *** 431,438 **** // Tx or Rx switch set ! event result_t SwitchI2W.setDone(bool local_result) { if (state_gps == GPS_TX_SWITCH_WAIT) { ! if (call SwitchI2W.set( MICAWB_GPS_RX_SELECT ,power_gps) == SUCCESS) { state_gps = GPS_RX_SWITCH_WAIT; } --- 437,444 ---- // Tx or Rx switch set ! event result_t IOSwitch.setDone(bool local_result) { if (state_gps == GPS_TX_SWITCH_WAIT) { ! if (call IOSwitch.set( MICAWB_GPS_RX_SELECT ,power_gps) == SUCCESS) { state_gps = GPS_RX_SWITCH_WAIT; } *************** *** 447,460 **** } ! event result_t SwitchI2W.setAllDone(bool local_result) { return SUCCESS; } ! event result_t Switch1.setAllDone(bool local_result) { return SUCCESS; } ! event result_t SwitchI2W.getDone(char value) { return SUCCESS; } --- 453,466 ---- } ! event result_t IOSwitch.setAllDone(bool local_result) { return SUCCESS; } ! event result_t PowerSwitch.setAllDone(bool local_result) { return SUCCESS; } ! event result_t IOSwitch.getDone(char value) { return SUCCESS; } Index: UARTGpsPacket.nc =================================================================== RCS file: /cvsroot/firebug/mts400/sensors/gps/UARTGpsPacket.nc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** UARTGpsPacket.nc 11 Nov 2003 01:59:40 -0000 1.1 --- UARTGpsPacket.nc 12 Nov 2003 00:11:47 -0000 1.2 *************** *** 97,101 **** Packet.SwitchControl -> MicaWbSwitch.StdControl; ! Packet.Switch1 -> MicaWbSwitch.Switch[0]; ! Packet.SwitchI2W -> MicaWbSwitch.Switch[1]; } --- 97,101 ---- Packet.SwitchControl -> MicaWbSwitch.StdControl; ! Packet.PowerSwitch -> MicaWbSwitch.Switch[0]; ! Packet.IOSwitch -> MicaWbSwitch.Switch[1]; } |