Classes | Macros | Typedefs | Functions
sbgInterfaceUdp.h File Reference

This file implements an UDP interface. More...

#include "sbgInterface.h"
Include dependency graph for sbgInterfaceUdp.h:
This graph shows which files directly or indirectly include this file:

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

SBG_COMMON_LIB_API SbgErrorCode sbgInterfaceUdpAllowBroadcast (SbgInterface *pHandle, bool allowBroadcast)
 
SBG_COMMON_LIB_API SbgErrorCode sbgInterfaceUdpCreate (SbgInterface *pHandle, sbgIpAddress remoteAddr, uint32_t remotePort, uint32_t localPort)
 
SBG_COMMON_LIB_API SbgErrorCode sbgInterfaceUdpDestroy (SbgInterface *pHandle)
 
SBG_COMMON_LIB_API SbgErrorCode sbgInterfaceUdpRead (SbgInterface *pHandle, void *pBuffer, size_t *pReadBytes, size_t bytesToRead)
 
SBG_COMMON_LIB_API SbgErrorCode sbgInterfaceUdpWrite (SbgInterface *pHandle, const void *pBuffer, size_t bytesToWrite)
 

Detailed Description

This file implements an UDP interface.

Author
SBG Systems
Date
05 February 2013

Copyright Notice

Copyright (C) 2013-2019, 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.

Macro Definition Documentation

◆ SBG_INTERFACE_UDP_PACKET_MAX_SIZE

#define SBG_INTERFACE_UDP_PACKET_MAX_SIZE   (1400)

Definition at line 34 of file sbgInterfaceUdp.h.

Typedef Documentation

◆ SbgInterfaceUdp

Structure that stores all internal data used by the UDP interface.

Function Documentation

◆ sbgInterfaceUdpAllowBroadcast()

SBG_COMMON_LIB_API SbgErrorCode sbgInterfaceUdpAllowBroadcast ( SbgInterface pHandle,
bool  allowBroadcast 
)

Define if a socket can send broadcasted packets.

Parameters
[in]pInterfacePointer on a valid UDP interface created using sbgInterfaceUdpCreate.
[in]allowBroadcastSet to true to allow this socket to send broadcasted UDP packets.
Returns
SBG_NO_ERROR if the allow broadcast status has been changed.

Definition at line 370 of file sbgInterfaceUdp.c.

◆ sbgInterfaceUdpCreate()

SBG_COMMON_LIB_API SbgErrorCode sbgInterfaceUdpCreate ( SbgInterface pHandle,
sbgIpAddress  remoteAddr,
uint32_t  remotePort,
uint32_t  localPort 
)

Initialize an unconnected UDP interface for read and write operations.

If the remote address and port are zero, the interface waits for the first packet received on the local port and uses the source of that packet as its remote host. This provides a convenient way to create "server" UDP interfaces.

Parameters
[in]pHandlePointer on an allocated interface instance to initialize.
[in]remoteAddrIP address to send data to.
[in]remotePortEthernet port to send data to.
[in]localPortEhternet port on which the interface is listening.
Returns
SBG_NO_ERROR if the interface has been created.

◆ sbgInterfaceUdpDestroy()

SBG_COMMON_LIB_API SbgErrorCode sbgInterfaceUdpDestroy ( SbgInterface pHandle)

Destroy an interface initialized using sbgInterfaceUdpCreate.

Parameters
[in]pInterfacePointer on a valid UDP interface created using sbgInterfaceUdpCreate.
Returns
SBG_NO_ERROR if the interface has been closed and released.

Definition at line 315 of file sbgInterfaceUdp.c.

◆ sbgInterfaceUdpRead()

SBG_COMMON_LIB_API SbgErrorCode sbgInterfaceUdpRead ( SbgInterface pHandle,
void *  pBuffer,
size_t *  pReadBytes,
size_t  bytesToRead 
)

Try to read some data from an interface.

Parameters
[in]pHandleValid handle on an initialized interface.
[in]pBufferPointer on an allocated buffer that can hold at least bytesToRead bytes of data.
[out]pReadBytesPointer on an uint32_t used to return the number of read bytes.
[in]bytesToReadNumber of bytes we would like to read.
Returns
SBG_NO_ERROR if no error occurs, please check the number of received bytes.

Try to read some data from an interface.

Parameters
[in]pHandleValid handle on an initialized interface.
[in]pBufferPointer on an allocated buffer that can hold at least bytesToRead bytes of data.
[out]pReadBytesPointer on an uint32 used to return the number of read bytes.
[in]bytesToReadNumber of bytes we would like to read.
Returns
SBG_NO_ERROR if no error occurs, please check the number of received bytes.

Definition at line 529 of file sbgInterfaceUdp.c.

◆ sbgInterfaceUdpWrite()

SBG_COMMON_LIB_API SbgErrorCode sbgInterfaceUdpWrite ( SbgInterface pHandle,
const void *  pBuffer,
size_t  bytesToWrite 
)

Try to write some data to an interface.

Parameters
[in]pHandleValid handle on an initialized interface.
[in]pBufferPointer on an allocated buffer that contains the data to write
[in]bytesToWriteNumber of bytes we would like to write.
Returns
SBG_NO_ERROR if all bytes have been written successfully.

Definition at line 433 of file sbgInterfaceUdp.c.



sbg_driver
Author(s): SBG Systems
autogenerated on Sat Sep 3 2022 02:53:36