Skip to content

Update OAPMessage.py #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
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