@startuml
title S5K231Y data parser
top to bottom direction
hide empty description

[*] --> sWaitForTimestampReference
sWaitForTimestampReference --> sWaitForStartOfFrame : eTimestampReference / aUpdateTimestampReference

sWaitForStartOfFrame --> sWaitForTimestampReference : eDataLost
sWaitForStartOfFrame --> sWaitForStartOfFrame : eTimestampReference / aUpdateTimestampReference
sWaitForStartOfFrame --> sWaitForSMGroup : eColumn[gIsFrameStart] / (aFrameStart, aSetColumnData)

sWaitForSMGroup --> sWaitForTimestampReference : any other / aResetEventFrame
sWaitForSMGroup --> sWaitForSMGroup : eTimestampReference / aUpdateTimestampReference
sWaitForSMGroup --> sWaitForColumnOrSMGroup : eSMGroup[!gIsGroupParsedAlready] / aGenerateEventsFromSMGroup

sWaitForColumnOrSMGroup --> sWaitForTimestampReference : any other / aResetEventFrame
sWaitForColumnOrSMGroup --> sWaitForColumnOrSMGroup : eTimestampReference / aUpdateTimestampReference
sWaitForColumnOrSMGroup --> sWaitForSMGroup : eColumn[gIsFrameStart && gIsIncreasingTimestamp] / (aFrameStart, aSetColumnData)
sWaitForColumnOrSMGroup --> sWaitForSMGroup : eColumn[gIsSameSubTimestamp && gIsIncreasingColumnAddress] / aSetColumnData
sWaitForColumnOrSMGroup --> sWaitForColumnOrSMGroup : eSMGroup[!gIsGroupParsedAlready] / aGenerateEventsFromSMGroup

@enduml
