Skip to content

Latest commit

 

History

History
144 lines (126 loc) · 1.31 KB

packet-reader.adoc

File metadata and controls

144 lines (126 loc) · 1.31 KB

PacketReaderFSM State Chart

PacketReaderFSM State Map

Start Event[Guard] Target Action

[*]

CTRL [{it == CharacterConstants.SOH}]

RCVPCKT

RCVPCKT

CTRL [{it == CharacterConstants.STX}]

RCVDATA

{
addField()
}

RCVPCKT

BYTE

RCVCHK

{
addChecksum(it)
}

RCVDATA

BYTE

RCVDATA

{
addByte(it)
}

RCVDATA

CTRL [{it == CharacterConstants.ETX}]

RCVPCKT

{
endField()
}

RCVDATA

ESC

RCVESC

RCVESC

ESC

RCVDATA

{
addByte(CharacterConstants.ESC)
}

RCVESC

CTRL

RCVDATA

{
addByte(it)
}

RCVCHK

BYTE

RCVCHK

{
addChecksum(it)
}

RCVCHK

ESC

RCVCHKESC

RCVCHK

CTRL [{it == CharacterConstants.EOT}]

CHKSUM

{
checksum()
}

CHKSUM

<<automatic>> [{!checksumValid}]

[*]

{
sendNACK()
}

CHKSUM

<<automatic>> [{checksumValid}]

[*]

{
sendACK()
}

RCVCHKESC

ESC

RCVCHK

{
addChecksum(CharacterConstants.ESC)
}

RCVCHKESC

CTRL

RCVCHK

{byte->
require(byte != null)
addChecksum(byte)
}