ela-compil / BACnet

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

ExceptionSchedule Property - Write #131

Open VitorKawao opened 9 months ago

VitorKawao commented 9 months ago

Hello, I am trying to read the property exceptionSchedule from object Schedule, but the api throws an exception. I can read correctly but I cannot write.

Using a simple exemple (below), reading than trying to write the same value

BacnetClient _client = new BacnetClient(new BacnetIpUdpProtocolTransport(30051, false));
_client.Start();

BacnetAddress bacnetAddress = new BacnetAddress(BacnetAddressTypes.IP, "192.168.1.152");

BacnetObjectTypes bacnetObject = BacnetObjectTypes.OBJECT_SCHEDULE;
BacnetPropertyIds propertyIds = BacnetPropertyIds.PROP_EXCEPTION_SCHEDULE;
uint instance = 1;
BacnetObjectId objId = new BacnetObjectId(bacnetObject, instance);

_client.ReadPropertyRequest(bacnetAddress, objId, propertyIds, out IList<BacnetValue> valueList);
_client.WritePropertyRequest(bacnetAddress, objId, propertyIds, valueList);

It throws an encode exception, because value.Value is not a IEncode, it is a BacnetValue[] image

Trying to do something like this image

It stops to throw this exception, but it send another one: "Reject from device, reason: MISSING_REQUIRED_PARAMETER"

image

Am I doing something wrong?

Thank you, Vítor Guedes