Exemplo n.º 1
0
 /// <summary>
 /// Method overloading. <c>HexStringToByteArray</c>
 /// for 1 parameter.
 /// </summary>
 /// <param name="hex">Hex string</param>
 /// <returns>
 /// <c>HexStringToByteArray(string hex, int start_idx, int length)</c>
 /// </returns>
 static public byte[] HexStringToByteArray(string hex)
 {
     return(SocketUtil.HexStringToByteArray(hex, 0, hex.Length));
 }
Exemplo n.º 2
0
 public void HexStringToByteArray()
 {
     byte[] bArray = SocketUtil.HexStringToByteArray("02a3");
     Assert.AreEqual(new byte[] { 0x02, 0xa3 }, bArray);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Method overloading. <c>ByteArrayToHexString</c>
 /// for 1 parameter.
 /// </summary>
 /// <param name="data">Data from device</param>
 /// <returns>
 /// <c>ByteArrayToHexString(byte[] data, int start_idx, int length, bool hyphen)</c>
 /// </returns>
 static public string ByteArrayToHexString(byte[] data)
 {
     return(SocketUtil.ByteArrayToHexString(data, 0, data.Length, false));
 }