Please enable JavaScript to view this site.

Function for sending a UDP message with notification to a previously specified station.

The message mandatorily includes a response, which must be read via the udp_recv_notify() function. The function can be used only for communication from the client.

Syntax

i32 udp_send_notify (i32 idx, buff, i32 buffLen)

idx

UDP communication handler number

buff

Generic buffer containing the data packet to be transmitted. It can be a string variable, a struct_p (packed structure), or an array of struct_p. In the case of struct_p, the variable must be declared global.

In the struct, the first member must be declared of type u32 and represents the message identifier msgId; the value is assigned by the udp_send_notify() function. msgId must be used server-side in the response message and is used to ensure routing to the correct client. All other data is for user use.

The maximum size of this structure is: MAX_UDP_DATA=508 bytes

buffLen

Number of total bytes to be transmitted (including msgId)

Result

Returns:

Value

Meaning

>= 0

Operation performed successfully. The number of characters sent is returned

-1

Illegal idx

-2

Socket not open

-3

Socket open as server and not as client

-4

buffLen greater than maximum allowed

-5

An udp_send_notify() already in progress for the specified idx

-1000 -:- -2000

Error code of the S.O. function sendto(), with offset 1000

To see some returned errors more specifically, see Returned Error Table

Validity

Rule, Task

Note

Only one udp_send_notify() function can be active simultaneously toward each server (i.e., for each open idx)

For a concrete example see in the RDE environment: Workspace -> Specials -> Examples Library.

 

  

Keyboard Navigation

F7 for caret browsing
Hold ALT and press letter

This Info: ALT+q
Page Header: ALT+h
Topic Header: ALT+t
Topic Body: ALT+b
Contents: ALT+c
Search: ALT+s
Exit Menu/Up: ESC