Dim Bytes_40 As String Bytes_40 = "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ" CallSub2(Starter, "SendMessage", Bytes_40.GetBytes("utf8")) CallSub2(Starter, "SendMessage", Bytes_40.GetBytes("utf8"))
That was just some stray 0's, I've now set my code only to output when it sees more than one byte coming in..by the way... I see that your msg has 7 00's prefixed. maybe you just need to add 7 extra bytes to the msg (lenght)?
or figure out where those 00's are coming from and remove them.
Log(job.GetString) job.GetInputStream.ReadBytes(bytes,0,job.GetInputStream.BytesAvailable) Dim Bytes20(20) As Byte Log("Data Length=" & (job.GetInputStream.BytesAvailable - 1)) Dim Loop_Counter As Int For x = 0 To job.GetInputStream.BytesAvailable - 1 For X2 = 0 To 19' X2_Top Loop_Counter = Loop_Counter + 1 Bytes20(X2) = bytes(x + X2) Next CallSub2(Starter, "SendMessage",Bytes20) ' Wait for the next send byte request For X3 = 0 To 2 If Packet_Requested = False Then X3 = 1 Else Log("Packet Recieved") End If Next Packet_Requested = False x = x + 20 Next
Public Sub SendMessage(msg() As Byte) Dim xv As Int For x=0 To msg.Length-1 Step 20 xv=20 If msg.Length-x<20 Then xv=msg.Length Mod 20 Dim mybytes(xv) As Byte For b=0 To xv-1 mybytes(b)=msg(x+b) Next manager.WriteData(ServiceId2, WriteChar2, mybytes) Next End Sub