www.beck-ipc.com

@CHIP-RTOS C Library - TCP/IP API


sendto_iface

Transmit a datagram via specified interface.

int sendto_iface ( int sd, const char far *bufptr, int bufLen,
             int flags, const struct sockaddr far *toPtr,
             DevUserIfaceHandle DevHandlePtr,
             int *error );

Parameters

sd

Socket descriptor.

bufptr

Pointer to output buffer containing characters to be transmitted.

bufLen

Maximum characters to output from bufptr .

flags

Wait option:
  • MSG_BLOCKING - Wait for data send to complete.
  • MSG_DONTWAIT - Don't wait for data send to complete.

toPtr

Data destination, pointer to a sockaddr_in (IPv4) or sockaddr_in6 (IPv6, SC1x3/SC2x only! ) data structure.

DevHandlePtr

Driver handle pointer Device handle, which caller must fill in prior to call. TCPIP send the packet via this specified Device handle.

error

Output parameter:  Failure code, 0 on success.

Return Value

-1: Failure, see error value reported
otherwise: Count of bytes transfered into the socket send queue.

Comments

This API function applies only to UDP sockets and works similiar than the sendto function.   It is required, when the user wants to send a datagram with a multicast destination address via a specified device interface. It is not necessary to use this function, if the packet should by send via the default Ethernet interface of the IPC@CHIP®. The existing API function sendto() function (or sendto_bsd() function) does this by default, if a the multicast destination address is specified.

SC1x3/SC2x Comments

The actual library function reached here is named sendto_iface_ipstackV2 , unless the TCPIP_DYN_LINK_SOCK compilation switch discussed below is defined.   This name change occurs due to a macro in the library header file.

The compilation switch

     #define TCPIP_DYN_LINK_SOCK

may be defined in the user application prior to including the Beck C-Library header files to use the faster executing dynamic link variant of this C-Library function.   In this case, the C-Library header file will redefine the sendto_iface symbol to sendto_iface_Dyn to reach this dynamic linked substitute API function.

See Also

RTOS API

This library function invokes a RTOS software interrupt. Refer to this RTOS API function's documentation for more details.

Supported since or modified in @CHIP-RTOS version

    SC12SC13SC11SC1x3SC2x
    V1.21V1.21V1.21V1.10V1.00

This API List
List of C Libraries
@CHIP-RTOS Main Index


End of document