GXDN: Gurux Developer Network
Send Method (data, type, receiver)
NamespacesGurux.GPRSGXGPRSSend(Object, VariantType, String)
Sends data asynchronously.
No reply from the receiver, whether or not the operation was successful, is expected.
Parameters
data (Object)
Data to send to the device.
type (VariantType)
The type that data is converted to before sending.
receiver (String)
IP address of the receiver (optional).
Remarks
Reply data is received through OnReceived event.
Examples
CopyC#
'Send ASCII (text) string to the device.
dim dataToSend as string
dataToSend = "Test"
GXGPRS1.Send dataToSend, 0, ""

'Send Hex string to the device.
dim dataToSend as string
dataToSend = "0x01 0x02 03 04"
GXGPRS1.Send dataToSend, GX_VT_HEX_STR, ""

'Send byte to the device.
dim dataToSend
dataToSend = "55"
GXGPRS1.Send dataToSend, GX_VT_BYTE, ""

'Send byte array to the device.
dim dataToSend(3)
dataToSend(0) = 0
dataToSend(1) = 1
dataToSend(2) = 2
GXGPRS1.Send dataToSend, 0, ""
Examples
CopyC#
                /// <summary>
/// Send data.
/// </summary>
/// <param name="eventSender"></param>
/// <param name="eventArgs"></param>
private void SendBtn_Click(System.Object eventSender, System.EventArgs eventArgs)
{
    try
    {
        gxgprs1.Send(SendText.Text, Gurux.Common.VariantType.None, Receiver.Text);
    }
    catch (Exception Ex)
    {
        MessageBox.Show(Ex.Message);
    }
}
CopyVB.NET
                ''' <summary>
''' Send data.
''' </summary>
Private Sub SendBtn_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles SendBtn.Click
    Try
        Gxgprs1.Send(SendText.Text, Gurux.Common.VariantType.None, Receiver.Text)
    Catch Ex As Exception
        MessageBox.Show(Ex.Message)
    End Try
End Sub
CopyVBScript
                'Send data
Private Sub SendBtn_Click()
On Error GoTo GXErr
    GXGPRS1.Send SendText.Text, GX_VT_NONE, Receiver.Text
    Exit Sub
GXErr:
    MsgBox Err.Description
End Sub
See Also

Assembly: Gurux.GPRS (Module: Gurux.GPRS) Version: 5.0.0.1