public byte I2CReadByte( byte deviceID, byte register )
{
byte[] response = new byte[100];
int read = SendAndReceive( new byte[] { (byte) 'i', (byte) 'r', deviceID, register }, response );
string str = System.Text.ASCIIEncoding.ASCII.GetString( response, 0, read );
try
{
str = str.Trim( );
// split string into separate values
string[] strs = str.Split( ' ' );
return byte.Parse( strs[1] );
}
catch
{
throw new ApplicationException( "Failed parsing response from SRV-1." );
}
}