Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions SmartMeshSDK/protocols/oap/OAPMessage.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@ def __init__(self, addr):
self.sample_count = TLVByte(2)
self.data_format = TLVByte(3)
self.value = TLVShort(4)

if(self.addr[0]==2):
self.sample_count = TLVShort(2) #As the notifications from digital channels generate 2 bytes for sample count
self.value = TLVByte(4) #and one byte for value
#If this change is not made OAPMessage.TLV.parse_value(val_str) fails to parse
#the value tag () as it runs out of bounds.
self.tags = [ self.enable,
self.rate,
self.sample_count,
Expand Down