Thanks for this simple solution.
Only thing is that it returns lower byte b(1) as signed and for s=130 it returns:
High byte: 0 Low byte: -126
This can be solved using your ToUnsigned Sub which gives output:
High byte: 0 Low byte: 130
Si if someone will need, here is all routine:
Sub ToUnsigned(b As Byte) As Int
Return Bit.And(0xFF, b)
End Sub
Sub btnSend_Click
Dim bc As ByteConverter
Dim s As Short = 130
Dim g() As Byte = bc.ShortsToBytes(Array As Short(s))
Log ("High byte: "&g(0)&" Low byte: "&(g(1)))
Log ("High byte: "&g(0)&" Low byte: "&ToUnsigned(g(1)))
End Sub
and output:
High byte: 0 Low byte: -126
High byte: 0 Low byte: 130