-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
On line 23 of RelayBoardInterface.cs the "string lpszBuffer" should be "byte[] lpszBuffer".
I recently used your class to write a test app to drive the 8 relay variant of the sainsmart boards. With string as the data type, the returned char's are at UTF-16 format and as a result with the nature of how these devices work, the value 128 does not set the relay correctly. When the value 128 is cast to char it returns the wrong character. This is due to characters 128-159 not being defined and as a result it returns a question mark (63). Instead use the byte[] data type to ensure compatibility with both types of boards.
Subsequently lines 75 - 82 will change to:
public void SetPins(byte pins)
{
byte[] arg = new byte[1] { pins };
int writtenCount = 0;
if (FT_Write(handle, arg, 1, ref writtenCount) != FT_OK)
{
throw new IOException("FT_Write Failed");
}
}
Metadata
Metadata
Assignees
Labels
No labels