Interface: tos.lib.serial.SerialFrameComm
interface SerialFrameComm
This interface sits between a serial byte encoding component and a
framing/packetizing component. It is to be used with framing protocols
that place delimiters between frames. This interface separates the tasks
of interpreting and coding delimiters and escape bytes from the rest of
the wire protocol.
- Author:
-
Philip Levis
-
Ben Greenstein
- Date:
-
August 7 2005
Commands
command error_t putData(uint8_t data)
command error_t putDelimiter()
command void resetReceive()
command void resetSend()
Events
event void dataReceived(uint8_t data)
event void delimiterReceived()
event void putDone()
Commands - Details
putData
command error_t putData(uint8_t data)
- Parameters:
-
data - The byte to be sent
- Returns:
-
Returns an error_t code that indicates if the lower layer
has accepted the byte for sending (SUCCESS) or not (FAIL).
putDelimiter
command error_t putDelimiter()
- Returns:
-
Returns a error_t code that indicates if the lower layer
was able to put an interframe delimiter to serial (SUCCESS) or
not (FAIL).
resetReceive
command void resetReceive()
resetSend
command void resetSend()
Events - Details
dataReceived
event void dataReceived(uint8_t data)
- Parameters:
-
data - The byte of data that has been received
from the serial connection
delimiterReceived
event void delimiterReceived()
putDone
event void putDone()