New smartmeter
This commit is contained in:
@@ -8,14 +8,14 @@ class ConfirmingSyncPatternState < StatePattern::State
|
||||
while (idx < bytes.length && idx < sync_length && bytes[idx] == Synchronizer::SYNC_PATTERN[idx]) do idx = idx+1 end
|
||||
|
||||
if (idx == sync_length)
|
||||
#p "Sync pattern confirmed"
|
||||
p "Sync pattern confirmed"
|
||||
transition_to(InSyncState)
|
||||
else
|
||||
#p "Back to SearchingForSync state. idx = #{idx}."
|
||||
p "Back to SearchingForSync state. idx = #{idx}."
|
||||
transition_to(SearchingForSyncState)
|
||||
end
|
||||
|
||||
# return the rest
|
||||
return bytes[idx+1..-1] || ""
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user