Skip to content

Commit

Permalink
msgbuf: rename GPSReceive and GPSTransmit
Browse files Browse the repository at this point in the history
o GPSReceive  -> MsgReceive
o GPSTransmit -> MsgTransmit
  • Loading branch information
cire831 committed Apr 20, 2020
1 parent 19a6700 commit 8add4c3
Show file tree
Hide file tree
Showing 15 changed files with 53 additions and 51 deletions.
7 changes: 4 additions & 3 deletions apps/tagmon/TagnetMonitorC.nc
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion doc/03_Ports
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions tos/chips/gsd4e_v4/GPSmonitorC.nc
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ configuration GPSmonitorC {
}
uses {
interface GPSControl;
interface GPSTransmit;
interface GPSReceive;
interface MsgTransmit;
interface MsgReceive;
interface TagnetRadio;
interface PwrReg as GPSPwr;
}
Expand All @@ -41,8 +41,8 @@ implementation {
InfoSensGpsCmd = GPSmonitorP;

GPSControl = GPSmonitorP;
GPSTransmit = GPSmonitorP;
GPSReceive = GPSmonitorP;
MsgTransmit = GPSmonitorP;
MsgReceive = GPSmonitorP;
TagnetRadio = GPSmonitorP;
GPSPwr = GPSmonitorP;

Expand Down
12 changes: 6 additions & 6 deletions tos/chips/gsd4e_v4/GPSmonitorP.nc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}


Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down
15 changes: 8 additions & 7 deletions tos/chips/gsd4e_v4/Gsd4eUP.nc
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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;

Expand All @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions tos/chips/gsd4e_v4/tests/TestGPS/testGPSC.nc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tos/chips/gsd4e_v4/tests/testMsgBuf/testMsgBufC.nc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ implementation {
MsgBufP.Panic -> PanicC;
MsgBufP.Rtc -> PlatformC;

testMsgBufP.GPSReceive -> MsgBufP;
testMsgBufP.MsgReceive -> MsgBufP;
testMsgBufP.MsgBuf -> MsgBufP;
testMsgBufP.Platform -> PlatformC;
}
4 changes: 2 additions & 2 deletions tos/chips/gsd4e_v4/tests/testMsgBuf/testMsgBufP.nc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ uint16_t last_size;
module testMsgBufP {
uses {
interface Boot;
interface GPSReceive;
interface MsgReceive;
interface MsgBuf;
interface Platform;
}
Expand Down Expand Up @@ -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++;
Expand Down
6 changes: 3 additions & 3 deletions tos/interfaces/GPSReceive.nc → tos/interfaces/MsgReceive.nc
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -20,7 +20,7 @@
*/

/*
* GPSReceive.msg_available
* MsgReceive.msg_available
*
* signals to a receiver that a new message is available from the GPS
* subsystem.
Expand All @@ -41,7 +41,7 @@

#include <rtctime.h>

interface GPSReceive {
interface MsgReceive {
/*
* msg_available
*
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -19,7 +19,7 @@
* Contact: Eric B. Decker <[email protected]>
*/

interface GPSTransmit {
interface MsgTransmit {
command error_t send(uint8_t *ptr, uint16_t len);
command void send_stop();
event void send_done();
Expand Down
8 changes: 4 additions & 4 deletions tos/platforms/dev6a/hardware/gps/GPS0C.nc
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -84,8 +84,8 @@ implementation {
MsgBufP.Rtc -> PlatformC;
MsgBufP.Panic -> PanicC;

GPSReceive = MsgBufP;
GPSTransmit = Gsd4eUP;
MsgReceive = MsgBufP;
MsgTransmit = Gsd4eUP;

#ifdef notdef
components TraceC;
Expand Down
8 changes: 4 additions & 4 deletions tos/platforms/dev7/hardware/gps/GPS0C.nc
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -84,8 +84,8 @@ implementation {
MsgBufP.Rtc -> PlatformC;
MsgBufP.Panic -> PanicC;

GPSReceive = MsgBufP;
GPSTransmit = Gsd4eUP;
MsgReceive = MsgBufP;
MsgTransmit = Gsd4eUP;

#ifdef notdef
components TraceC;
Expand Down
8 changes: 4 additions & 4 deletions tos/platforms/mm6a/hardware/gps/GPS0C.nc
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -84,8 +84,8 @@ implementation {
MsgBufP.Rtc -> PlatformC;
MsgBufP.Panic -> PanicC;

GPSReceive = MsgBufP;
GPSTransmit = Gsd4eUP;
MsgReceive = MsgBufP;
MsgTransmit = Gsd4eUP;

#ifdef notdef
components TraceC;
Expand Down
8 changes: 4 additions & 4 deletions tos/platforms/mm6b/hardware/gps/GPS0C.nc
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -84,8 +84,8 @@ implementation {
MsgBufP.Rtc -> PlatformC;
MsgBufP.Panic -> PanicC;

GPSReceive = MsgBufP;
GPSTransmit = Gsd4eUP;
MsgReceive = MsgBufP;
MsgTransmit = Gsd4eUP;

#ifdef notdef
components TraceC;
Expand Down
8 changes: 4 additions & 4 deletions tos/system/MsgBufP.nc
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ module MsgBufP {
provides {
interface Init @exactlyonce();
interface MsgBuf;
interface GPSReceive;
interface MsgReceive;
}
uses {
interface Rtc;
Expand Down Expand Up @@ -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.
*
Expand All @@ -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();
}
}
Expand Down Expand Up @@ -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() { }
Expand Down

0 comments on commit 8add4c3

Please sign in to comment.