diff --git a/apps/tagmon/TagnetMonitorC.nc b/apps/tagmon/TagnetMonitorC.nc index 625b3595b..21e29d624 100644 --- a/apps/tagmon/TagnetMonitorC.nc +++ b/apps/tagmon/TagnetMonitorC.nc @@ -1,6 +1,7 @@ /* - * Copyright (c) 2015 Eric B. Decker + * Copyright (c) 2020 Eric B. Decker * Copyright (c) 2017-2019 Eric B. Decker, Daniel J. Maltbie + * Copyright (c) 2015 Eric B. Decker * All rights reserved. * * This program is free software: you can redistribute it and/or modify @@ -43,8 +44,8 @@ implementation { components GPS0C as GpsPort; GPSmonitorC.GPSControl -> GpsPort; - GPSmonitorC.GPSTransmit -> GpsPort; - GPSmonitorC.GPSReceive -> GpsPort; + GPSmonitorC.MsgTransmit -> GpsPort; + GPSmonitorC.MsgReceive -> GpsPort; GPSmonitorC.GPSPwr -> GpsPort; components TagnetSysExecC; diff --git a/doc/03_Ports b/doc/03_Ports index 44afca9c9..765606953 100644 --- a/doc/03_Ports +++ b/doc/03_Ports @@ -73,7 +73,7 @@ A singleton GPS port provided as GPS0. GPS0C: top level of GPS driver stack. GPSControl provides a mechanism for turning GPS on off, control state gps requests, gps power management requests - GPSReceive mechanism for passing received gps messages to upper layers + MsgReceive mechanism for passing received gps messages to upper layers of the system. instantiates the driver Gsd4eUP (tos/chips/gsd4e_v4) diff --git a/tos/chips/gsd4e_v4/GPSmonitorC.nc b/tos/chips/gsd4e_v4/GPSmonitorC.nc index de4325ef6..3902f3bad 100644 --- a/tos/chips/gsd4e_v4/GPSmonitorC.nc +++ b/tos/chips/gsd4e_v4/GPSmonitorC.nc @@ -28,8 +28,8 @@ configuration GPSmonitorC { } uses { interface GPSControl; - interface GPSTransmit; - interface GPSReceive; + interface MsgTransmit; + interface MsgReceive; interface TagnetRadio; interface PwrReg as GPSPwr; } @@ -41,8 +41,8 @@ implementation { InfoSensGpsCmd = GPSmonitorP; GPSControl = GPSmonitorP; - GPSTransmit = GPSmonitorP; - GPSReceive = GPSmonitorP; + MsgTransmit = GPSmonitorP; + MsgReceive = GPSmonitorP; TagnetRadio = GPSmonitorP; GPSPwr = GPSmonitorP; diff --git a/tos/chips/gsd4e_v4/GPSmonitorP.nc b/tos/chips/gsd4e_v4/GPSmonitorP.nc index df8b09fc2..6583eda5a 100644 --- a/tos/chips/gsd4e_v4/GPSmonitorP.nc +++ b/tos/chips/gsd4e_v4/GPSmonitorP.nc @@ -251,8 +251,8 @@ module GPSmonitorP { } uses { interface Boot; /* in boot */ interface GPSControl; - interface GPSTransmit; - interface GPSReceive; + interface MsgTransmit; + interface MsgReceive; interface PwrReg as GPSPwr; interface Collect; @@ -356,7 +356,7 @@ norace bool no_deep_sleep; /* true if we don't want deep sleep */ gps_panic(-1, gps_msg[0] << 8 | gps_msg[1], gps_len); gps_len += SIRFBIN_OVERHEAD; /* add in overhead */ gmcb.txq_state = GPSM_TXQ_SENDING; - return call GPSTransmit.send(gps_msg, gps_len); + return call MsgTransmit.send(gps_msg, gps_len); } @@ -401,7 +401,7 @@ norace bool no_deep_sleep; /* true if we don't want deep sleep */ case GPSM_TXQ_SENDING: gmcb.txq_state = GPSM_TXQ_DRAIN; - call GPSTransmit.send_stop(); + call MsgTransmit.send_stop(); break; case GPSM_TXQ_IDLE: @@ -905,7 +905,7 @@ norace bool no_deep_sleep; /* true if we don't want deep sleep */ } - event void GPSTransmit.send_done() { + event void MsgTransmit.send_done() { uint8_t mid; uint8_t *gps_msg; @@ -1866,7 +1866,7 @@ norace bool no_deep_sleep; /* true if we don't want deep sleep */ } - event void GPSReceive.msg_available(uint8_t *msg, uint16_t len, + event void MsgReceive.msg_available(uint8_t *msg, uint16_t len, rtctime_t *arrival_rtp, uint32_t mark_j) { sb_header_t *sbp; dt_gps_t hdr; diff --git a/tos/chips/gsd4e_v4/Gsd4eUP.nc b/tos/chips/gsd4e_v4/Gsd4eUP.nc index bb23e6cac..3c60ad978 100644 --- a/tos/chips/gsd4e_v4/Gsd4eUP.nc +++ b/tos/chips/gsd4e_v4/Gsd4eUP.nc @@ -1,4 +1,5 @@ /* + * Copyright (c) 2020, Eric B. Decker * Copyright (c) 2008-2010 Eric B. Decker * Copyright (c) 2017-2018 Eric B. Decker, Daniel J. Maltbie * All rights reserved. @@ -419,7 +420,7 @@ norace uint32_t gps_chk_trys; // remaining chk_msgs to try CHK_MSG_WA module Gsd4eUP { provides { interface GPSControl; - interface GPSTransmit; + interface MsgTransmit; } uses { interface Gsd4eUHardware as HW; @@ -732,7 +733,7 @@ implementation { uint16_t m_tx_len; - command error_t GPSTransmit.send(uint8_t *ptr, uint16_t len) { + command error_t MsgTransmit.send(uint8_t *ptr, uint16_t len) { gpsc_state_t next_state; error_t err; uint32_t time_out; @@ -773,12 +774,12 @@ implementation { } - default event void GPSTransmit.send_done() { } + default event void MsgTransmit.send_done() { } task void send_block_task(); - command void GPSTransmit.send_stop() { + command void MsgTransmit.send_stop() { call HW.gps_send_block_stop(); m_tx_len = 0; atomic { @@ -830,10 +831,10 @@ implementation { call GPSTxTimer.stop(); gpsc_change_state(GPSC_ON, GPSW_SEND_BLOCK_TASK); - /* signal out to the caller that started up the GPSTransmit.send */ + /* signal out to the caller that started up the MsgTransmit.send */ if (m_tx_len) { m_tx_len = 0; - signal GPSTransmit.send_done(); + signal MsgTransmit.send_done(); } return; @@ -844,7 +845,7 @@ implementation { /* signal out to the caller that started up the GPSSend.send */ if (m_tx_len) { m_tx_len = 0; - signal GPSTransmit.send_done(); + signal MsgTransmit.send_done(); } return; } diff --git a/tos/chips/gsd4e_v4/tests/TestGPS/testGPSC.nc b/tos/chips/gsd4e_v4/tests/TestGPS/testGPSC.nc index 55fe8488a..a4b0eed13 100644 --- a/tos/chips/gsd4e_v4/tests/TestGPS/testGPSC.nc +++ b/tos/chips/gsd4e_v4/tests/TestGPS/testGPSC.nc @@ -23,8 +23,8 @@ implementation { GPSmonitorC.TagnetRadio -> testGPSP; GPSmonitorC.GPSControl -> GpsPort; - GPSmonitorC.GPSReceive -> GpsPort; - GPSmonitorC.GPSTransmit -> GpsPort; + GPSmonitorC.MsgReceive -> GpsPort; + GPSmonitorC.MsgTransmit -> GpsPort; GPSmonitorC.GPSPwr -> GpsPort; InfoSensGpsXyz = GPSmonitorC; diff --git a/tos/chips/gsd4e_v4/tests/testMsgBuf/testMsgBufC.nc b/tos/chips/gsd4e_v4/tests/testMsgBuf/testMsgBufC.nc index be6c2df80..6e0536da9 100644 --- a/tos/chips/gsd4e_v4/tests/testMsgBuf/testMsgBufC.nc +++ b/tos/chips/gsd4e_v4/tests/testMsgBuf/testMsgBufC.nc @@ -9,7 +9,7 @@ implementation { MsgBufP.Panic -> PanicC; MsgBufP.Rtc -> PlatformC; - testMsgBufP.GPSReceive -> MsgBufP; + testMsgBufP.MsgReceive -> MsgBufP; testMsgBufP.MsgBuf -> MsgBufP; testMsgBufP.Platform -> PlatformC; } diff --git a/tos/chips/gsd4e_v4/tests/testMsgBuf/testMsgBufP.nc b/tos/chips/gsd4e_v4/tests/testMsgBuf/testMsgBufP.nc index cd4b76a4c..beb9613e0 100644 --- a/tos/chips/gsd4e_v4/tests/testMsgBuf/testMsgBufP.nc +++ b/tos/chips/gsd4e_v4/tests/testMsgBuf/testMsgBufP.nc @@ -8,7 +8,7 @@ uint16_t last_size; module testMsgBufP { uses { interface Boot; - interface GPSReceive; + interface MsgReceive; interface MsgBuf; interface Platform; } @@ -47,7 +47,7 @@ implementation { } - event void GPSReceive.msg_available(uint8_t *msg, uint16_t len, + event void MsgReceive.msg_available(uint8_t *msg, uint16_t len, rtctime_t *rtp, uint32_t mark) { nop(); recv_count++; diff --git a/tos/interfaces/GPSReceive.nc b/tos/interfaces/MsgReceive.nc similarity index 94% rename from tos/interfaces/GPSReceive.nc rename to tos/interfaces/MsgReceive.nc index 01500ffb7..ce39981f5 100644 --- a/tos/interfaces/GPSReceive.nc +++ b/tos/interfaces/MsgReceive.nc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Eric B. Decker + * Copyright (c) 2017, 2020 Eric B. Decker * All rights reserved. * * This program is free software: you can redistribute it and/or modify @@ -20,7 +20,7 @@ */ /* - * GPSReceive.msg_available + * MsgReceive.msg_available * * signals to a receiver that a new message is available from the GPS * subsystem. @@ -41,7 +41,7 @@ #include -interface GPSReceive { +interface MsgReceive { /* * msg_available * diff --git a/tos/interfaces/GPSTransmit.nc b/tos/interfaces/MsgTransmit.nc similarity index 93% rename from tos/interfaces/GPSTransmit.nc rename to tos/interfaces/MsgTransmit.nc index ec428886b..650ad8d53 100644 --- a/tos/interfaces/GPSTransmit.nc +++ b/tos/interfaces/MsgTransmit.nc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Eric B. Decker + * Copyright (c) 2017, 2020 Eric B. Decker * All rights reserved. * * This program is free software: you can redistribute it and/or modify @@ -19,7 +19,7 @@ * Contact: Eric B. Decker */ -interface GPSTransmit { +interface MsgTransmit { command error_t send(uint8_t *ptr, uint16_t len); command void send_stop(); event void send_done(); diff --git a/tos/platforms/dev6a/hardware/gps/GPS0C.nc b/tos/platforms/dev6a/hardware/gps/GPS0C.nc index d23222a0d..e3f1981cf 100644 --- a/tos/platforms/dev6a/hardware/gps/GPS0C.nc +++ b/tos/platforms/dev6a/hardware/gps/GPS0C.nc @@ -24,8 +24,8 @@ configuration GPS0C { provides { interface GPSControl; - interface GPSReceive; - interface GPSTransmit; + interface MsgReceive; + interface MsgTransmit; interface PwrReg as GPSPwr; /* for debugging only, be careful */ @@ -84,8 +84,8 @@ implementation { MsgBufP.Rtc -> PlatformC; MsgBufP.Panic -> PanicC; - GPSReceive = MsgBufP; - GPSTransmit = Gsd4eUP; + MsgReceive = MsgBufP; + MsgTransmit = Gsd4eUP; #ifdef notdef components TraceC; diff --git a/tos/platforms/dev7/hardware/gps/GPS0C.nc b/tos/platforms/dev7/hardware/gps/GPS0C.nc index d23222a0d..e3f1981cf 100644 --- a/tos/platforms/dev7/hardware/gps/GPS0C.nc +++ b/tos/platforms/dev7/hardware/gps/GPS0C.nc @@ -24,8 +24,8 @@ configuration GPS0C { provides { interface GPSControl; - interface GPSReceive; - interface GPSTransmit; + interface MsgReceive; + interface MsgTransmit; interface PwrReg as GPSPwr; /* for debugging only, be careful */ @@ -84,8 +84,8 @@ implementation { MsgBufP.Rtc -> PlatformC; MsgBufP.Panic -> PanicC; - GPSReceive = MsgBufP; - GPSTransmit = Gsd4eUP; + MsgReceive = MsgBufP; + MsgTransmit = Gsd4eUP; #ifdef notdef components TraceC; diff --git a/tos/platforms/mm6a/hardware/gps/GPS0C.nc b/tos/platforms/mm6a/hardware/gps/GPS0C.nc index bca7c7ec9..eb25e486b 100644 --- a/tos/platforms/mm6a/hardware/gps/GPS0C.nc +++ b/tos/platforms/mm6a/hardware/gps/GPS0C.nc @@ -24,8 +24,8 @@ configuration GPS0C { provides { interface GPSControl; - interface GPSReceive; - interface GPSTransmit; + interface MsgReceive; + interface MsgTransmit; interface PwrReg as GPSPwr; /* for debugging only, be careful */ @@ -84,8 +84,8 @@ implementation { MsgBufP.Rtc -> PlatformC; MsgBufP.Panic -> PanicC; - GPSReceive = MsgBufP; - GPSTransmit = Gsd4eUP; + MsgReceive = MsgBufP; + MsgTransmit = Gsd4eUP; #ifdef notdef components TraceC; diff --git a/tos/platforms/mm6b/hardware/gps/GPS0C.nc b/tos/platforms/mm6b/hardware/gps/GPS0C.nc index e4c4a5501..24f403093 100644 --- a/tos/platforms/mm6b/hardware/gps/GPS0C.nc +++ b/tos/platforms/mm6b/hardware/gps/GPS0C.nc @@ -24,8 +24,8 @@ configuration GPS0C { provides { interface GPSControl; - interface GPSReceive; - interface GPSTransmit; + interface MsgReceive; + interface MsgTransmit; interface PwrReg as GPSPwr; /* for debugging only, be careful */ @@ -84,8 +84,8 @@ implementation { MsgBufP.Rtc -> PlatformC; MsgBufP.Panic -> PanicC; - GPSReceive = MsgBufP; - GPSTransmit = Gsd4eUP; + MsgReceive = MsgBufP; + MsgTransmit = Gsd4eUP; #ifdef notdef components TraceC; diff --git a/tos/system/MsgBufP.nc b/tos/system/MsgBufP.nc index f84ef0696..b723f26fb 100644 --- a/tos/system/MsgBufP.nc +++ b/tos/system/MsgBufP.nc @@ -247,7 +247,7 @@ module MsgBufP { provides { interface Init @exactlyonce(); interface MsgBuf; - interface GPSReceive; + interface MsgReceive; } uses { interface Rtc; @@ -290,7 +290,7 @@ implementation { * following: * * o grab the next data pointer from the HEAD via msg_next - * o pass the msg to any receive handler via GPSReceive.msg_available + * o pass the msg to any receive handler via MsgReceive.msg_available * o on return, kill the current message, msg_release * o repeat, until msg_next returns NULL. * @@ -309,7 +309,7 @@ implementation { msg = call MsgBuf.msg_next(&len, &arrival_rtp, &mark); if (!msg) break; - signal GPSReceive.msg_available(msg, len, arrival_rtp, mark); + signal MsgReceive.msg_available(msg, len, arrival_rtp, mark); call MsgBuf.msg_release(); } } @@ -701,7 +701,7 @@ implementation { } - default event void GPSReceive.msg_available(uint8_t *msg, uint16_t len, + default event void MsgReceive.msg_available(uint8_t *msg, uint16_t len, rtctime_t *arrival_rtp, uint32_t mark_j) { } async event void Panic.hook() { }