Beckhoff / ADS

Beckhoff protocol to communicate with TwinCAT devices.
MIT License
519 stars 197 forks source link

Receiving notifications with dynamic lengths #235

Open JoshuaFoundry opened 1 month ago

JoshuaFoundry commented 1 month ago

I'm wanting to receive notifications from ADS logs on port 100. When I create a notification with a max length of 1024 I get this error message: "Warning: Notification sample size: 101 doesn't match: 1024"

The code that generates this error: https://github.com/Beckhoff/ADS/blob/20d4a67970a6b954b32f6e51caf622da26adc13c/AdsLib/standalone/NotificationDispatcher.cpp#L76

It looks for the notification in the buffer to be the same size as what was defined in the notification. Instead of: if (size != notification->Size()) could we do: if (size > notification->Size()) or something else?

Thanks!