ela-compil / BACnet

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

Abort from device, reason: BUFFER_OVERFLOW #57

Closed Sn3b closed 4 years ago

Sn3b commented 4 years ago

We have a device that has over a thousand objects and we get an overflow when trying to detect them using the code provided in the ObjectBrowseSample example.

Unhandled exception. System.Exception: Abort from device, reason: BUFFER_OVERFLOW
   at System.IO.BACnet.BacnetClient.ReadPropertyRequest(BacnetAddress adr, BacnetObjectId objectId, BacnetPropertyIds propertyId, IList`1& valueList, Byte invokeId, UInt32 arrayIndex)
   at System.IO.BACnet.BacnetClient.<>c__DisplayClass215_0.<ReadPropertyAsync>b__0()
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.<>c.<.cctor>b__274_0(Object obj)
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location where exception was thrown ---
   at Discover.Program.OnIAm(BacnetClient sender, BacnetAddress adr, UInt32 deviceid, UInt32 maxapdu, BacnetSegmentations segmentation, UInt16 vendorid) in C:\Sources\Tests\BacnetTests\Discover\Program.cs:line 27
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__139_1(Object state)
   at System.Threading.QueueUserWorkItemCallbackDefaultContext.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

Here "C:\Sources\Tests\BacnetTests\Discover\Program.cs:line 27" refers to this line

I'm no BACnet expert so I have no idea what to do, any suggestion will be appreciated 👍

Thanks!

Sn3b commented 4 years ago

The manufacturer (Honeywell) told us to use dontFragment = true and useExclusivePort = true, now it works :)