[Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/serial HdlcTranslateC.nc, 1.1.2.3, 1.1.2.4 SerialDispatcherC.nc, 1.1.2.12, 1.1.2.13

Jonathan Hui jwhui at users.sourceforge.net
Tue Oct 10 12:18:44 PDT 2006


Update of /cvsroot/tinyos/tinyos-2.x/tos/lib/serial
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv7771/lib/serial

Modified Files:
      Tag: tinyos-2_0_devel-BRANCH
	HdlcTranslateC.nc SerialDispatcherC.nc 
Log Message:

Match interfaces proposed in tep117.



Index: HdlcTranslateC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/serial/HdlcTranslateC.nc,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -C2 -d -r1.1.2.3 -r1.1.2.4
*** HdlcTranslateC.nc	14 Feb 2006 17:01:44 -0000	1.1.2.3
--- HdlcTranslateC.nc	10 Oct 2006 19:18:42 -0000	1.1.2.4
***************
*** 36,40 ****
    provides interface SerialFrameComm;
    uses {
!     interface SerialByteComm;
      interface Leds;
    }
--- 36,40 ----
    provides interface SerialFrameComm;
    uses {
!     interface UartStream;
      interface Leds;
    }
***************
*** 50,54 ****
    norace HdlcState state = {0,0};
    norace uint8_t txTemp;
! 
    
    // TODO: add reset for when SerialM goes no-sync.
--- 50,54 ----
    norace HdlcState state = {0,0};
    norace uint8_t txTemp;
!   norace uint8_t m_data;
    
    // TODO: add reset for when SerialM goes no-sync.
***************
*** 59,63 ****
      state.sendEscape = 0;
    }
!   async event void SerialByteComm.get(uint8_t data) {
      //debugCnt++;
      // 7E 41 0E 05 04 03 02 01 00 01 8F 7E
--- 59,63 ----
      state.sendEscape = 0;
    }
!   async event void UartStream.receivedByte(uint8_t data) {
      //debugCnt++;
      // 7E 41 0E 05 04 03 02 01 00 01 8F 7E
***************
*** 86,90 ****
    async command error_t SerialFrameComm.putDelimiter() {
      state.sendEscape = 0;
!     return call SerialByteComm.put(HDLC_FLAG_BYTE);
    }
    
--- 86,91 ----
    async command error_t SerialFrameComm.putDelimiter() {
      state.sendEscape = 0;
!     m_data = HDLC_FLAG_BYTE;
!     return call UartStream.send(&m_data, 1);
    }
    
***************
*** 93,107 ****
        state.sendEscape = 1;
        txTemp = data ^ 0x20;
!       return call SerialByteComm.put(HDLC_CTLESC_BYTE);
      }
      else {
!       return call SerialByteComm.put(data);
      }
    }
  
!   async event void SerialByteComm.putDone() {
      if (state.sendEscape) {
        state.sendEscape = 0;
!       call SerialByteComm.put(txTemp);
      }
      else {
--- 94,111 ----
        state.sendEscape = 1;
        txTemp = data ^ 0x20;
!       m_data = HDLC_CTLESC_BYTE;
      }
      else {
!       m_data = data;
      }
+     return call UartStream.send(&m_data, 1);
    }
  
!   async event void UartStream.sendDone( uint8_t* buf, uint16_t len, 
! 					error_t error ) {
      if (state.sendEscape) {
        state.sendEscape = 0;
!       m_data = txTemp;
!       call UartStream.send(&m_data, 1);
      }
      else {
***************
*** 109,111 ****
--- 113,117 ----
      }
    }
+ 
+   async event void UartStream.receiveDone( uint8_t* buf, uint16_t len, error_t error ) {}
  }

Index: SerialDispatcherC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/serial/SerialDispatcherC.nc,v
retrieving revision 1.1.2.12
retrieving revision 1.1.2.13
diff -C2 -d -r1.1.2.12 -r1.1.2.13
*** SerialDispatcherC.nc	6 Sep 2006 17:05:15 -0000	1.1.2.12
--- SerialDispatcherC.nc	10 Oct 2006 19:18:42 -0000	1.1.2.13
***************
*** 67,71 ****
    SerialP.SerialControl -> PlatformSerialC;
  
!   HdlcTranslateC.SerialByteComm -> PlatformSerialC;
  
  }
--- 67,71 ----
    SerialP.SerialControl -> PlatformSerialC;
  
!   HdlcTranslateC.UartStream -> PlatformSerialC;
  
  }



More information about the Tinyos-2-commits mailing list