[Tinyos-contrib-commits] CVS: tinyos-1.x/contrib/handhelds/tos/lib/RovingNetworks RovingNetworksM.nc, 1.1, 1.2

steve ayer ayer1 at users.sourceforge.net
Mon Mar 19 12:21:52 PDT 2007


Update of /cvsroot/tinyos/tinyos-1.x/contrib/handhelds/tos/lib/RovingNetworks
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv23429

Modified Files:
	RovingNetworksM.nc 
Log Message:

added commands setServiceClass and setDeviceClass to support interface
updates (Bluetooth).


Index: RovingNetworksM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/handhelds/tos/lib/RovingNetworks/RovingNetworksM.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** RovingNetworksM.nc	9 Mar 2007 20:17:38 -0000	1.1
--- RovingNetworksM.nc	19 Mar 2007 19:21:50 -0000	1.2
***************
*** 59,65 ****
  
    uint8_t radioMode, charsSent, setupStep;
!   bool discoverable, authenticate, encrypt, setNameRequest, setPINRequest, runDiscoveryRequest, resetDefaultsRequest;
    norace bool transmissionOverflow, messageInProgress;
!   char expectedCommandResponse[8], newName[17], newPIN[17];
    
    norace struct Message * outgoingMsg;
--- 59,66 ----
  
    uint8_t radioMode, charsSent, setupStep;
!   bool discoverable, authenticate, encrypt, setNameRequest, setPINRequest, runDiscoveryRequest, resetDefaultsRequest,
!     setSvcClassRequest, setDevClassRequest;
    norace bool transmissionOverflow, messageInProgress;
!   char expectedCommandResponse[8], newName[17], newPIN[17], newSvcClass[5], newDevClass[5];
    
    norace struct Message * outgoingMsg;
***************
*** 187,190 ****
--- 188,201 ----
    }    
  
+   command void Bluetooth.setDeviceClass(char * class){
+     setDevClassRequest = TRUE;
+     snprintf(newDevClass, 5, "%s", class);
+   }    
+ 
+   command void Bluetooth.setServiceClass(char * class){
+     setSvcClassRequest = TRUE;
+     snprintf(newSvcClass, 5, "%s", class);
+   }    
+ 
    command void Bluetooth.setPIN(char * PIN){
      setPINRequest = TRUE;
***************
*** 274,277 ****
--- 285,302 ----
      case 8:
        setupStep++;
+       if(setSvcClassRequest){
+ 	sprintf(commandbuf, "SC,%s\r", newSvcClass);
+ 	writeCommand(commandbuf, "AOK");
+ 	break;
+       }
+     case 9:
+       setupStep++;
+       if(setDevClassRequest){
+ 	sprintf(commandbuf, "SD,%s\r", newDevClass);
+ 	writeCommand(commandbuf, "AOK");
+ 	break;
+       }
+     case 10:
+       setupStep++;
        // exit command mode
        writeCommand("---\r", "END");
***************
*** 290,293 ****
--- 315,320 ----
      setNameRequest = FALSE;
      setPINRequest = FALSE;
+     setSvcClassRequest = FALSE;
+     setDevClassRequest = FALSE;
  
      setupStep = 0;
***************
*** 301,305 ****
      incomingMsg = call MessagePool.alloc();
  
!     //    call Leds.init();
  
      initRN();
--- 328,332 ----
      incomingMsg = call MessagePool.alloc();
  
!     call Leds.init();
  
      initRN();
***************
*** 362,367 ****
       
    async event result_t UARTData.rxDone(uint8_t data) {        
!     if(!*expectedCommandResponse)
        signal Bluetooth.dataAvailable(data);
      else{
        if(isalpha(data)){
--- 389,395 ----
       
    async event result_t UARTData.rxDone(uint8_t data) {        
!     if(!*expectedCommandResponse){
        signal Bluetooth.dataAvailable(data);
+     }
      else{
        if(isalpha(data)){



More information about the Tinyos-contrib-commits mailing list