Waits for reply data synchronously.
- replyTerminator (Object)
- The end of the reply data.
- count (Int32)
- The number of reply data bytes to be read.
- waitTime (Int32)
- Maximum time, in milliseconds, to wait for reply data. WaitTime -1 indicates infinite wait time.
- copyAllData (Boolean)
- If True, all the reply data is copied to ReplyData.
- replyDataType (VariantType)
- Determines the type of reply data.
- replyData ( Object %)
- Received reply data.
True, if the send operation was successful.
The ReplyTerminator can, for example, be a single byte ('0xA1'), a string ("OK") or an array of bytes.
Size of ReplyTerminator can be between 1 and n bytes.
Size of ReplyTerminator can be between 1 and n bytes.
'Send long and wait until OK reply is received or 5 seconds.
'Data is returned as string.
dim dataToSend as long
dataToSend = "256"
dim ReplyData as object
GXGPRS1.SendSync dataToSend, GX_VT_INT32, "OK", 0, 5000, True, GX_VT_STR, ReplyData
' While all data is not received read more data.
' This is done because reply data might include "OK" but all data is not read yet.
'While PacketIsNotCompleted
' GXGPRS1.WaitMoreReplyData "OK", 0, 5000, True, GX_VT_STR, ReplyData
'Wend
GXGPRS1.SendSyncComplete = true
'Send data and wait until 4 bytes is received.
'Received data is received as long (Int32)
GXGPRS1.SendSync dataToSend, 0, 0, 4, -1, false, GX_VT_INT32, ReplyData
GXGPRS1.SendSyncComplete = true
Assembly: Gurux.GPRS (Module: Gurux.GPRS) Version: 5.0.0.1