This file implements an UDP interface. More...
#include "sbgInterface.h"
Go to the source code of this file.
Classes | |
struct | _SbgInterfaceUdp |
Macros | |
#define | SBG_INTERFACE_UDP_PACKET_MAX_SIZE (1400) |
Typedefs | |
typedef struct _SbgInterfaceUdp | SbgInterfaceUdp |
Functions | |
SbgErrorCode | sbgInterfaceUdpAllowBroadcast (SbgInterface *pHandle, bool allowBroadcast) |
SbgErrorCode | sbgInterfaceUdpCreate (SbgInterface *pHandle, sbgIpAddress remoteAddr, uint32 remotePort, uint32 localPort) |
SbgErrorCode | sbgInterfaceUdpDestroy (SbgInterface *pHandle) |
SbgErrorCode | sbgInterfaceUdpRead (SbgInterface *pHandle, void *pBuffer, size_t *pReadBytes, size_t bytesToRead) |
SbgErrorCode | sbgInterfaceUdpWrite (SbgInterface *pHandle, const void *pBuffer, size_t bytesToWrite) |
This file implements an UDP interface.
Copyright (C) 2007-2013, SBG Systems SAS. All rights reserved.
This source code is intended for use only by SBG Systems SAS and those that have explicit written permission to use it from SBG Systems SAS.
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
Definition in file sbgInterfaceUdp.h.
#define SBG_INTERFACE_UDP_PACKET_MAX_SIZE (1400) |
Definition at line 41 of file sbgInterfaceUdp.h.
typedef struct _SbgInterfaceUdp SbgInterfaceUdp |
Structure that stores all internal data used by the UDP interface.
SbgErrorCode sbgInterfaceUdpAllowBroadcast | ( | SbgInterface * | pHandle, |
bool | allowBroadcast | ||
) |
Define if a socket can send broadcasted packets.
[in] | pInterface | Pointer on a valid UDP interface created using sbgInterfaceUdpCreate. |
[in] | allowBroadcast | Set to true to allow this socket to send broadcasted UDP packets. |
Definition at line 376 of file sbgInterfaceUdp.c.
SbgErrorCode sbgInterfaceUdpCreate | ( | SbgInterface * | pHandle, |
sbgIpAddress | remoteAddr, | ||
uint32 | remotePort, | ||
uint32 | localPort | ||
) |
Initialize an unconnected UDP interface for read and write operations. An UDP interface can send some data to an output ip address and port and read all received data on a input port.
[in] | pHandle | Pointer on an allocated interface instance to initialize. |
[in] | remoteAddr | IP address to send data to. |
[in] | remotePort | Ethernet port to send data to. |
[in] | localPort | Ehternet port on which the interface is listening. |
Definition at line 158 of file sbgInterfaceUdp.c.
SbgErrorCode sbgInterfaceUdpDestroy | ( | SbgInterface * | pHandle | ) |
Destroy an interface initialized using sbgInterfaceUdpCreate.
[in] | pInterface | Pointer on a valid UDP interface created using sbgInterfaceUdpCreate. |
Definition at line 318 of file sbgInterfaceUdp.c.
SbgErrorCode sbgInterfaceUdpRead | ( | SbgInterface * | pHandle, |
void * | pBuffer, | ||
size_t * | pReadBytes, | ||
size_t | bytesToRead | ||
) |
Try to read some data from an interface.
[in] | pHandle | Valid handle on an initialized interface. |
[in] | pBuffer | Pointer on an allocated buffer that can hold at least bytesToRead bytes of data. |
[out] | pReadBytes | Pointer on an uint32 used to return the number of read bytes. |
[in] | bytesToRead | Number of bytes we would like to read. |
Definition at line 541 of file sbgInterfaceUdp.c.
SbgErrorCode sbgInterfaceUdpWrite | ( | SbgInterface * | pHandle, |
const void * | pBuffer, | ||
size_t | bytesToWrite | ||
) |
Try to write some data to an interface.
[in] | pHandle | Valid handle on an initialized interface. |
[in] | pBuffer | Pointer on an allocated buffer that contains the data to write |
[in] | bytesToWrite | Number of bytes we would like to write. |
Definition at line 442 of file sbgInterfaceUdp.c.