Apollo3zehn / FluentModbus

Lightweight and fast client and server implementation of the Modbus protocol (TCP/RTU).
MIT License
204 stars 71 forks source link

Add method to return Span<bool> for coils, etc #9

Open Apollo3zehn opened 5 years ago

the-programmer commented 2 years ago

Via https://stackoverflow.com/a/61367679 I found that C# has (quite a while actually) the bitarray class.

If you update the documentation so we get

var coils = client.ReadCoils(1, 0x8000, 255);
var bits = new BitArray(coils.ToArray());

The coils array will be converted to an bitarray by C#

Apollo3zehn commented 2 years ago

Thank you, I will consider it for the next update!