Functions
sbgInterfaceFile.c File Reference
#include "sbgInterfaceFile.h"
Include dependency graph for sbgInterfaceFile.c:

Go to the source code of this file.

Functions

SBG_COMMON_LIB_API SbgErrorCode sbgInterfaceFileClose (SbgInterface *pHandle)
 
SBG_COMMON_LIB_API SbgErrorCode sbgInterfaceFileFlush (SbgInterface *pHandle)
 
SBG_COMMON_LIB_API size_t sbgInterfaceFileGetCursor (const SbgInterface *pHandle)
 
SBG_COMMON_LIB_API size_t sbgInterfaceFileGetSize (SbgInterface *pHandle)
 
SBG_COMMON_LIB_API SbgErrorCode sbgInterfaceFileOpen (SbgInterface *pHandle, const char *filePath)
 
SBG_COMMON_LIB_API SbgErrorCode sbgInterfaceFileRead (SbgInterface *pHandle, void *pBuffer, size_t *pReadBytes, size_t bytesToRead)
 
SBG_COMMON_LIB_API SbgErrorCode sbgInterfaceFileReadFake (SbgInterface *pHandle, void *pBuffer, size_t *pReadBytes, size_t bytesToRead)
 
SBG_COMMON_LIB_API SbgErrorCode sbgInterfaceFileWrite (SbgInterface *pHandle, const void *pBuffer, size_t bytesToWrite)
 
SBG_COMMON_LIB_API SbgErrorCode sbgInterfaceFileWriteFake (SbgInterface *pHandle, const void *pBuffer, size_t bytesToWrite)
 
SBG_COMMON_LIB_API SbgErrorCode sbgInterfaceFileWriteOpen (SbgInterface *pHandle, const char *filePath)
 

Function Documentation

◆ sbgInterfaceFileClose()

SBG_COMMON_LIB_API SbgErrorCode sbgInterfaceFileClose ( SbgInterface pHandle)

Destroy an interface initialized using sbgInterfaceFileOpen.

Parameters
[in]pInterfaceValid handle on an initialized interface.
Returns
SBG_NO_ERROR if the interface has been closed and released.

Definition at line 121 of file sbgInterfaceFile.c.

◆ sbgInterfaceFileFlush()

SBG_COMMON_LIB_API SbgErrorCode sbgInterfaceFileFlush ( SbgInterface pHandle)

Make an interface flush all pending input or output data.

Parameters
[in]pHandleValid handle on an initialized interface.
Returns
SBG_NO_ERROR if successful.

Definition at line 307 of file sbgInterfaceFile.c.

◆ sbgInterfaceFileGetCursor()

SBG_COMMON_LIB_API size_t sbgInterfaceFileGetCursor ( const SbgInterface pHandle)

Returns the current cursor position in the file in bytes.

Parameters
[in]pInterfaceValid handle on an initialized interface.
Returns
The current cursor position in bytes.

Definition at line 195 of file sbgInterfaceFile.c.

◆ sbgInterfaceFileGetSize()

SBG_COMMON_LIB_API size_t sbgInterfaceFileGetSize ( SbgInterface pHandle)

Returns the file size in bytes.

Parameters
[in]pInterfaceValid handle on an initialized interface.
Returns
The file size in bytes.

Definition at line 152 of file sbgInterfaceFile.c.

◆ sbgInterfaceFileOpen()

SBG_COMMON_LIB_API SbgErrorCode sbgInterfaceFileOpen ( SbgInterface pHandle,
const char *  filePath 
)

Open a file as an interface for read only operations.

Parameters
[in]pHandlePointer on an allocated interface instance to initialize.
[in]filePathFile path to open.
Returns
SBG_NO_ERROR if the interface has been created.

Definition at line 17 of file sbgInterfaceFile.c.

◆ sbgInterfaceFileRead()

SBG_COMMON_LIB_API SbgErrorCode sbgInterfaceFileRead ( 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.

Definition at line 278 of file sbgInterfaceFile.c.

◆ sbgInterfaceFileReadFake()

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

Fake read function for write only interfaces

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.

Definition at line 367 of file sbgInterfaceFile.c.

◆ sbgInterfaceFileWrite()

SBG_COMMON_LIB_API SbgErrorCode sbgInterfaceFileWrite ( 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 235 of file sbgInterfaceFile.c.

◆ sbgInterfaceFileWriteFake()

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

Fake write function for read only interfaces

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 347 of file sbgInterfaceFile.c.

◆ sbgInterfaceFileWriteOpen()

SBG_COMMON_LIB_API SbgErrorCode sbgInterfaceFileWriteOpen ( SbgInterface pHandle,
const char *  filePath 
)

Open a file as an interface for write only operations.

Parameters
[in]pHandlePointer on an allocated interface instance to initialize.
[in]filePathFile path to open.
Returns
SBG_NO_ERROR if the interface has been created.

Definition at line 75 of file sbgInterfaceFile.c.



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