[Tinyos-contrib-commits]
CVS: tinyos-1.x/contrib/handhelds/tos/lib/RovingNetworks
RovingNetworksM.nc, 1.5, 1.6
steve ayer
ayer1 at users.sourceforge.net
Mon Nov 19 10:59:27 PST 2007
Update of /cvsroot/tinyos/tinyos-1.x/contrib/handhelds/tos/lib/RovingNetworks
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv6384/tos/lib/RovingNetworks
Modified Files:
RovingNetworksM.nc
Log Message:
added utility to change baudrate to bt module
added utility to turn off remote configuration of bt module (and back on, too).
Index: RovingNetworksM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/handhelds/tos/lib/RovingNetworks/RovingNetworksM.nc,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** RovingNetworksM.nc 13 Sep 2007 17:57:32 -0000 1.5
--- RovingNetworksM.nc 19 Nov 2007 18:59:22 -0000 1.6
***************
*** 57,63 ****
uint8_t radioMode, charsSent, setupStep;
bool discoverable, authenticate, encrypt, setNameRequest, setPINRequest, runDiscoveryRequest, resetDefaultsRequest,
! setSvcClassRequest, setDevClassRequest, setSvcNameRequest, newMode;
norace bool transmissionOverflow, messageInProgress;
! char expectedCommandResponse[8], newName[17], newPIN[17], newSvcClass[5], newDevClass[5], newSvcName[17];
norace struct Message * outgoingMsg;
--- 57,63 ----
uint8_t radioMode, charsSent, setupStep;
bool discoverable, authenticate, encrypt, setNameRequest, setPINRequest, runDiscoveryRequest, resetDefaultsRequest,
! setSvcClassRequest, setDevClassRequest, setSvcNameRequest, setCustomBaudrate, disableRemoteConfig, newMode;
norace bool transmissionOverflow, messageInProgress;
! char expectedCommandResponse[8], newName[17], newPIN[17], newSvcClass[5], newDevClass[5], newSvcName[17], newBaudrate[5];
norace struct Message * outgoingMsg;
***************
*** 158,161 ****
--- 158,165 ----
}
+ command void Bluetooth.disableRemoteConfig(bool disableConfig){
+ disableRemoteConfig = disableConfig;
+ }
+
command void Bluetooth.resetDefaults(){
resetDefaultsRequest = TRUE;
***************
*** 182,185 ****
--- 186,199 ----
}
+ /*
+ * this one makes sense only to roving networks
+ * the supplied "rate_factor" is the baudrate * 0.004096
+ * this factor must be an integer value...
+ */
+ command void Bluetooth.setBaudrate(char * rate_factor){
+ setCustomBaudrate = TRUE;
+ snprintf(newBaudrate, 5, "%s", rate_factor);
+ }
+
command void Bluetooth.setPIN(char * PIN){
setPINRequest = TRUE;
***************
*** 280,283 ****
--- 294,316 ----
case 11:
setupStep++;
+ if(setCustomBaudrate){
+ // set the baudrate to suit the MSP430 running at 8Mhz
+ sprintf(commandbuf, "SZ,%s\r", newBaudrate);
+ writeCommand(commandbuf, "AOK");
+ break;
+ }
+ case 12:
+ setupStep++;
+ if(disableRemoteConfig){
+ // disable remote configuration to enhance throughput
+ writeCommand("ST,0\r", "AOK");
+ }
+ else{
+ // disable remote configuration to enhance throughput
+ writeCommand("ST,60\r", "AOK");
+ }
+ break;
+ case 13:
+ setupStep++;
// exit command mode
writeCommand("---\r", "END");
***************
*** 307,310 ****
--- 340,345 ----
setSvcNameRequest = FALSE;
setDevClassRequest = FALSE;
+ setCustomBaudrate = FALSE;
+ disableRemoteConfig = FALSE;
setupStep = 0;
More information about the Tinyos-contrib-commits
mailing list