diff --git a/SmartMeshSDK/protocols/oap/OAPMessage.py b/SmartMeshSDK/protocols/oap/OAPMessage.py index 319f1e9..df36f8a 100644 --- a/SmartMeshSDK/protocols/oap/OAPMessage.py +++ b/SmartMeshSDK/protocols/oap/OAPMessage.py @@ -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,