ela-compil / BACnet

BACnet protocol library for .NET :satellite:
https://www.nuget.org/packages/bacnet/
MIT License
215 stars 95 forks source link

Decode error when reading PROP_ACTIVE_COV_SUBSCRIPTIONS #134

Closed Discolai closed 4 months ago

Discolai commented 5 months ago

Decoding fails whenever I read the property PROP_ACTIVE_COV_SUBSCRIPTIONS from a device. It seems like decoding fails on the second item when validating the first opening tag number. https://github.com/ela-compil/BACnet/blob/96b580d92b0b14e14d4c84d49ec92c5af426872a/Serialize/ASN1.cs#L2290

It expects a value of 6, but gets 4.

This is not caused by some error in the device, since I am able to read the property in YABE

I would appreciate any help getting to the bottom of this

Discolai commented 4 months ago

I did a compare with YABE and was able to pinpoint the fix in r265. It looks like the decodinf process reads past the last closing tag of the first item. Leading to a decoding error of the second one.

I will create a PR for this shortly

gralin commented 4 months ago

Thanks @Discolai and sorry for my poor responsiveness. Your bug tracking was very helpful and spot on. One day I will try to cherry pick all the missing fixes like this one from the original repo. This repo also contains fixes which original repo doesn't, so I need to be careful with that.

New version published as https://www.nuget.org/packages/BACnet/3.0.1-beta8