The problem comes from this code:
'**************************************
'* Convert an integer value to Hexadecimal
'**************************************
Public Shared Function IntToHex(ByVal data As Integer) As String
If data < 16 Then
Return "000" & String.Format("{0:X}", data)
ElseIf data < 256 Then
Return "00" & String.Format("{0:X}", data)
ElseIf data < 4096 Then
Return "0" & String.Format("{0:X}", data)
Else
Return String.Format("{0:X}", data)
End If
End Function
It is supposed to return 4 characters representing the hex value, but a negative value doesn't work.
I'll try to look for a fix later, but if anyone can suggest a fix in the mean time, I'll give it a go.