Sending and receiving UDP messages.

Functions

EmberStatus emberUdpListen (uint16_t port, const uint8_t *address)
This function sets up a listener for UDP messages for a given address.
EmberStatus emberSendUdp (const uint8_t *destination, uint16_t sourcePort, uint16_t destinationPort, uint8_t *payload, uint16_t payloadLength)
This function sends a UDP message.
void emberUdpHandler (const uint8_t *destination, const uint8_t *source, uint16_t localPort, uint16_t remotePort, const uint8_t *payload, uint16_t payloadLength)
An application callback for an incoming UDP message.
void emberUdpMulticastHandler (const uint8_t *destination, const uint8_t *source, uint16_t localPort, uint16_t remotePort, const uint8_t *payload, uint16_t payloadLength)
An application callback for an incoming UDP multicast.

Detailed Description

See udp.h for source code.

Function Documentation

EmberStatus emberSendUdp ( const uint8_t * destination,
uint16_t sourcePort,
uint16_t destinationPort,
uint8_t * payload,
uint16_t payloadLength
)
Parameters
destination IPv6 destination address
sourcePort UDP source port
destinationPort UDP destination port
payload UDP transport payload
payloadLength Payload length
Returns
EMBER_SUCCESS if successful EMBER_NO_BUFFERS if failed to allocate a buffer EMBER_ERR_FATAL other fatal failure
void emberUdpHandler ( const uint8_t * destination,
const uint8_t * source,
uint16_t localPort,
uint16_t remotePort,
const uint8_t * payload,
uint16_t payloadLength
)
Parameters
destination IPv6 destination address
source IPv6 source address
localPort UDP source port
remotePort UDP destination port
payload UDP transport payload
payloadLength payload length

An application callback for an incoming UDP message.

Parameters
destination IPV6 destination address
source IPV6 source address
localPort UDP source port
remotePort UDP destination port
payload UDP transport payload
payloadLength payload length

Referenced by emberUdpMulticastHandler() .

EmberStatus emberUdpListen ( uint16_t port,
const uint8_t * address
)
Parameters
port A port to bind the UDP address to
address The IPv6 address listened to.
Returns
EMBER_SUCCESS if successful EMBER_TABLE_FULL if we failed to set up a listener EMBER_ERR_FATAL other fatal failure
void emberUdpMulticastHandler ( const uint8_t * destination,
const uint8_t * source,
uint16_t localPort,
uint16_t remotePort,
const uint8_t * payload,
uint16_t payloadLength
)
Parameters
destination IPv6 destination address
source IPv6 source address
localPort UDP source port
remotePort UDP destination port
payload UDP transport payload
payloadLength payload length

An application callback for an incoming UDP multicast.

Parameters
destination IPV6 destination address
source IPV6 source address
localPort UDP source port
remotePort UDP destination port
payload UDP transport payload
payloadLength payload length

References emberUdpHandler() .