I’m trying to run a Netduino 3 WiFi and the Gadgeteer Serial Camera L1 module. Before deciding that it is not possible to manage the connection via GoBus, I came across some API inconsistencies.
mscorlib (0.6.0) contains the definition of the Buffer class: I have found an example of how to write and read from the module stream, but it seems that the examples refer to a different version of the various libraries (http: //old.ghielectronics. com / community / forums / topic? id = 24134).
the only public constructor accepts a parameter relative to the overall size of the array;
public Buffer(uint capacity)
this.data = new byte[capacity];
this.offset = 0;
this.length = 0;
this.Capacity = capacity;
internal Buffer(byte data, int offset, int length, int capacity)
if (data == null)
throw new ArgumentNullException(“data”);
if (offset < 0)
throw new ArgumentOutOfRangeException(“offset”);
if (length < 0)
throw new ArgumentOutOfRangeException(“length”);
if (capacity < 0)
throw new ArgumentOutOfRangeException(“capacity”);
if (((length > capacity) || ((data.Length - offset) < length)) || ((data.Length - offset) < capacity))
throw new ArgumentException();
this.data = data;
this.offset = offset;
this.length = (uint) length;
this.Capacity = (uint) capacity;
the variable that contains the data is internal and not accessible using the only available manufacturer;
public sealed class Buffer : IBuffer
internal byte data;
it is not possible to prepare a new class that implements IBuffer since the Write executes a specific cast to the Buffer class and not to IBuffer -> InvalidCastException.
Does anyone know an easy way to read / write to the module stream with the current version of the API?
Thanks in advance