Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can know length of readstring in Idtcpserver
#1
Hello,

We have 4G IOT adapter which can send json package to my delphi idtcpserver , i use
Memo1.Lines.Add('receiveString-> :' + AContext.Connection.IOHandler.Readstring(160));
but length of string is not fixed, like following 4 json packages,  length of third one is different with others, so i can't fix in IOHandler.Readstring(???)).

{"devId":"492C201010012591","msgType":"aiValueRpt","data":{"AI1":"0","AI2":"0","AI3":"0","AI4":"0"},"timestamp":"1630043052"}
{"devId":"492C201010012591","msgType":"aiValueRpt","data":{"AI1":"0","AI2":"0","AI3":"0","AI4":"0"},"timestamp":"1630043053"}
{"devId":"492C201010012591","msgType":"rs485ValueRpt","data":"0103040ADC1786B643","timestamp":"1630043053"}
{"devId":"492C201010012591","msgType":"aiValueRpt","data":{"AI1":"0","AI2":"0","AI3":"0","AI4":"0"},"timestamp":"1630043054"}


How can read these strings by idtcpserver? Huh

Thank you!
Ike
Reply


Messages In This Thread
How can know length of readstring in Idtcpserver - by Zsanvs - 08-27-2021, 05:50 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)