-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add state machine to decode a packet stream, return payloads.
- Loading branch information
Showing
4 changed files
with
144 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// vim:ai:et:fenc=utf-8:ff=unix:sw=4:ts=4: | ||
|
||
digraph | ||
{ | ||
"READY" -> "VALID HEADER?" [label="receive byte"]; | ||
"VALID HEADER?" [shape=diamond]; | ||
"VALID HEADER?" -> "READY" [label="no"]; | ||
"VALID HEADER?" -> "WAIT FOR LENGTH" [label="yes"]; | ||
"WAIT FOR LENGTH" -> "READY" [label="timeout"]; | ||
"WAIT FOR LENGTH" -> "VALID LENGTH?" [label="receive byte"]; | ||
"VALID LENGTH?" [shape=diamond]; | ||
"VALID LENGTH?" -> "READY" [label="no"]; | ||
"VALID LENGTH?" -> "WAIT FOR DATA" [label="yes"]; | ||
"WAIT FOR DATA" -> "READY" [label="timeout"]; | ||
"WAIT FOR DATA" -> "ENOUGH DATA?" [label="receive byte"]; | ||
"ENOUGH DATA?" [shape=diamond]; | ||
"ENOUGH DATA?" -> "WAIT FOR DATA" [label="no"]; | ||
"ENOUGH DATA?" -> "WAIT FOR CRC" [label="yes"]; | ||
"WAIT FOR CRC" -> "READY" [label="timeout"]; | ||
"WAIT FOR CRC" -> "CALCULATE CRC" [label="receive byte"]; | ||
"CALCULATE CRC" -> "VALID CRC?"; | ||
"VALID CRC?" [shape=diamond]; | ||
"VALID CRC?" -> "READY" [label="no"]; | ||
"VALID CRC?" -> "EXTRACT PAYLOAD" [label="yes"]; | ||
"EXTRACT PAYLOAD" -> "READY"; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters