User manual
mikroBasic PRO for PIC32
MikroElektronika
449
SPI_Ethernet_24j600_UserUDP
Prototype
sub function SPI_Ethernet_24j600_UserUDP(dim byref remoteHost as byte[4],
dim remotePort as word, dim destPort as word, dim reqLength as word, dim
byref ags as TEthJ600PktFlags) as word
Description This is UDP module routine. It is internally called by the library. The user accesses to the UDP request
by using some of the SPI_Ethernet_24j600_get routines. The user puts data in the transmit buffer by
using some of the SPI_Ethernet_24j600_put routines. The function must return the length in bytes of
the UDP reply, or 0 if nothing to transmit. If you don’t need to reply to the UDP requests, just dene this
function with a return(0) as single statement.
Parameters - remoteHost: client’s IP address.
- remotePort: client’s port.
- localPort: port to which the request is sent.
- reqLength: UDP request data eld length.
- ags: structure consisted of two bit elds :
Copy Code To Clipboard
structure TEthj600PktFlags
dim canCloseTCP as boolean ‘ ag which closes socket (not relevant to
UDP)
dim isBroadcast as boolean ‘ ag which denotes that the IP package has
been received via subnet broadcast address
end structure
Returns - 0 - there should not be a reply to the request.
- Length of UDP reply data eld - otherwise.
Requires Ethernet module has to be initialized. See SPI_Ethernet_24j600_Init.
Example This function is internally called by the library and should not be called by the user’s code.
Notes The function source code is provided with appropriate example projects. The code should be adjusted
by the user to achieve desired reply.