]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
added SerialFlush interface to SerialP.
authorbengreenstein <bengreenstein>
Wed, 24 Jan 2007 17:17:01 +0000 (17:17 +0000)
committerbengreenstein <bengreenstein>
Wed, 24 Jan 2007 17:17:01 +0000 (17:17 +0000)
tos/lib/serial/HdlcTranslateC.nc
tos/lib/serial/SerialDispatcherC.nc
tos/lib/serial/SerialP.nc

index 40cc401a95a3c8689e5893fc73335a39deddd2be..959e99ed28856bcedcce683190df6263f09ad3ae 100644 (file)
@@ -114,4 +114,5 @@ implementation {
   }
 
   async event void UartStream.receiveDone( uint8_t* buf, uint16_t len, error_t error ) {}
+
 }
index a8786e6a19791783085fd4c36a8ea7ee083a9799..8c2f892ab03ffd2278a6f234c2c36c1658303611 100644 (file)
@@ -65,7 +65,8 @@ implementation {
 
   SerialP.SerialFrameComm -> HdlcTranslateC;
   SerialP.SerialControl -> PlatformSerialC;
-
+  //  SerialP.SerialFlush -> PlatformSerialC;
   HdlcTranslateC.UartStream -> PlatformSerialC;
+  
 
 }
index f2c4f28d0f312e69e1d89d943c09eb41a5d05e20..eb5398e32ebc8e4e8659274caba7eb8e1c339210 100644 (file)
@@ -70,6 +70,7 @@ module SerialP {
     interface SerialFrameComm;
     interface Leds;
     interface StdControl as SerialControl;
+    interface SerialFlush;
   }
 }
 implementation {
@@ -321,11 +322,23 @@ implementation {
     signal SplitControl.startDone(SUCCESS);
   }
 
+
   task void stopDoneTask() {
+    call SerialFlush.flush();
+  }
+
+  event void SerialFlush.flushDone(){
     call SerialControl.stop();
     signal SplitControl.stopDone(SUCCESS);
   }
-  
+
+  task void defaultSerialFlushTask(){
+    signal SerialFlush.flushDone();
+  }
+  default command void SerialFlush.flush(){
+    post defaultSerialFlushTask();
+  }
+
   command error_t SplitControl.start() {
     post startDoneTask();
     return SUCCESS;