Interface: tos.lib.serial.ReceiveBytePacket
interface ReceiveBytePacket
This is the data interface that a serial protocol provides and
a serial dispatcher uses. The dispatcher expects the following pattern
of calls: ((startPacket)+ (byteReceived)* (endPacket)+)*
It should ignore any signals that do not follow this pattern.
The interface is used to separate the state machine of the wire protocol
from the complexities of dispatch.
- Author:
-
Philip Levis
-
Ben Greenstein
- Date:
-
August 7 2005
Events
event void byteReceived(uint8_t data)
event void endPacket(error_t result)
event error_t startPacket()
Events - Details
byteReceived
event void byteReceived(uint8_t data)
- Parameters:
-
data - A byte of the encapsulated packet that has been received.
endPacket
event void endPacket(error_t result)
- Parameters:
-
result - An error_t code indicating whether the framer has
passed all bytes of an encapsulated packet it receives from
serial to the dispatcher (SUCCESS) or not (FAIL).
startPacket
event error_t startPacket()
- Returns:
-
Returns an error_t code indicating whether the
dispatcher would like to receive a packet (SUCCESS), or not
perhaps because it isn't ready (EBUSY).