sbgECom Library  5.3.2276-stable
Interface SBG Systems IMU/AHRS/INS
Loading...
Searching...
No Matches
sbgEComPager.h File Reference

Page management. More...

#include <sbgCommon.h>

Go to the source code of this file.

Data Structures

struct  _SbgEComPager
 

Typedefs

typedef struct _SbgEComPager SbgEComPager
 

Functions

SbgErrorCode sbgEComPagerInitForJoin (SbgEComPager *pPager, void *pBuffer, size_t bufferSize)
 
SbgErrorCode sbgEComPagerJoin (SbgEComPager *pPager, uint16_t pageIndex, uint16_t nrPages, const void *pPage, size_t pageSize)
 
bool sbgEComPagerJoinIsComplete (const SbgEComPager *pPager)
 
size_t sbgEComPagerGetBufferSize (const SbgEComPager *pPager)
 

Detailed Description

Page management.

Author
SBG Systems
Date
May 5, 2025
License

The MIT license

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Typedef Documentation

◆ SbgEComPager

typedef struct _SbgEComPager SbgEComPager

Pager.

Operations on a pager are not thread-safe.

Function Documentation

◆ sbgEComPagerInitForJoin()

SbgErrorCode sbgEComPagerInitForJoin ( SbgEComPager * pPager,
void * pBuffer,
size_t bufferSize )

Initialize a pager for join operations, and link it to a buffer.

The pager will receive page one by one, and join them into a buffer.

Parameters
[in]pPagerPager.
[in]pBufferPointer on an allocated buffer to link with this pager.
[in]bufferSizeBuffer size, in bytes.
Returns
SBG_NO_ERROR if successful.

◆ sbgEComPagerJoin()

SbgErrorCode sbgEComPagerJoin ( SbgEComPager * pPager,
uint16_t pageIndex,
uint16_t nrPages,
const void * pPage,
size_t pageSize )

Join a page to the pager.

The pager's buffer is complete when all pages have been joined together.

Parameters
[in]pPagerPager.
[in]pageIndexPage index.
[in]nrPagesTotal number of pages.
[in]pPagePage buffer.
[in]pageSizePage size, in bytes.
Returns
SBG_NO_ERROR if successful, i.e. the buffer has been assembled, SBG_NOT_READY if the buffer is not complete.

◆ sbgEComPagerJoinIsComplete()

bool sbgEComPagerJoinIsComplete ( const SbgEComPager * pPager)

Checks whether a multi-page message has been completely received.

Parameters
[in]pPagerPager.
Returns
True if the entire message has been received.

◆ sbgEComPagerGetBufferSize()

size_t sbgEComPagerGetBufferSize ( const SbgEComPager * pPager)

Get the pager's buffer size, in bytes.

Parameters
[in]pPagerPager.
Returns
Buffer size, in bytes.