Typedefs | Functions
sbgCrc.h File Reference

This file provides CRC-32 and CRC-16 methods. More...

#include <sbgCommon.h>
Include dependency graph for sbgCrc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef uint16_t SbgCrc16
 
typedef uint32_t SbgCrc32
 

Functions

SBG_COMMON_LIB_API uint16_t sbgCrc16Compute (const void *pData, size_t dataSize)
 
SBG_INLINE uint16_t sbgCrc16Get (const SbgCrc16 *pInstance)
 
SBG_COMMON_LIB_API void sbgCrc16Initialize (SbgCrc16 *pInstance)
 
SBG_COMMON_LIB_API void sbgCrc16Update (SbgCrc16 *pInstance, const void *pData, size_t dataSize)
 
SBG_COMMON_LIB_API uint32_t sbgCrc32Compute (const void *pData, size_t dataSize)
 
SBG_INLINE uint32_t sbgCrc32Get (const SbgCrc32 *pInstance)
 
SBG_COMMON_LIB_API void sbgCrc32Initialize (SbgCrc32 *pInstance)
 
SBG_COMMON_LIB_API void sbgCrc32Update (SbgCrc32 *pInstance, const void *pData, size_t dataSize)
 

Detailed Description

This file provides CRC-32 and CRC-16 methods.

Author
SBG Systems (Raphael Siryani)
Date
15 January 2013

Copyright Notice

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 sbgCrc.h.

Typedef Documentation

typedef uint16_t SbgCrc16

Definition at line 41 of file sbgCrc.h.

typedef uint32_t SbgCrc32

< Type used to compute a 32 bit Ethernet CRC. Type used to compute a 16 bit CRC.

Definition at line 38 of file sbgCrc.h.

Function Documentation

SBG_COMMON_LIB_API uint16_t sbgCrc16Compute ( const void *  pData,
size_t  dataSize 
)

Compute a 32 Bit CRC using an the polynome 0x8408.

Parameters
[in]pDataRead only pointer on the data buffer to compute CRC on.
[in]dataSizeData size in bytes of the buffer.
Returns
The computed CRC.

Definition at line 253 of file sbgCrc.c.

SBG_INLINE uint16_t sbgCrc16Get ( const SbgCrc16 pInstance)

Returns the computed 32 bit CRC value.

Parameters
[in]pInstanceRead only pointer on a valid Crc16 object.
Returns
The computed CRC.

Definition at line 104 of file sbgCrc.h.

SBG_COMMON_LIB_API void sbgCrc16Initialize ( SbgCrc16 pInstance)

Initialize the 16 bit CRC computation system.

Parameters
[in]pInstancePointer on an allocated but non initialized Crc16 object.

Definition at line 206 of file sbgCrc.c.

SBG_COMMON_LIB_API void sbgCrc16Update ( SbgCrc16 pInstance,
const void *  pData,
size_t  dataSize 
)

Compute a 16 bit CRC using an the polynome 0x8408.

Parameters
[in]pInstanceRead only pointer on a valid Crc16 object.
[in]pDataRead only pointer on the data buffer to compute CRC on.
[in]dataSizeData size in bytes of the buffer.

Definition at line 222 of file sbgCrc.c.

SBG_COMMON_LIB_API uint32_t sbgCrc32Compute ( const void *  pData,
size_t  dataSize 
)

Compute a 32 Bit CRC using an Ethernet polynome. Warning: the buffer size should be at least 4 bytes long.

Parameters
[in]pDataRead only pointer on the data buffer to compute CRC on.
[in]dataSizeData size in bytes of the buffer, has to be greater or equals to 4.
Returns
The computed CRC.

Definition at line 178 of file sbgCrc.c.

SBG_INLINE uint32_t sbgCrc32Get ( const SbgCrc32 pInstance)

Returns the computed 32 bit CRC value.

Parameters
[in]pInstanceRead only pointer on a valid Crc32 object.
Returns
The computed CRC.

Definition at line 67 of file sbgCrc.h.

SBG_COMMON_LIB_API void sbgCrc32Initialize ( SbgCrc32 pInstance)

Initialize the 32 bit CRC computation system.

Parameters
[in]pInstancePointer on an allocated but non initialized Crc32 object.

Definition at line 91 of file sbgCrc.c.

SBG_COMMON_LIB_API void sbgCrc32Update ( SbgCrc32 pInstance,
const void *  pData,
size_t  dataSize 
)

Compute a 32 bit CRC using an Ethernet polynome. Warning: the buffer size should be at least 4 bytes long.

Parameters
[in]pInstanceRead only pointer on a valid Crc32 object.
[in]pDataRead only pointer on the data buffer to compute CRC on.
[in]dataSizeData size in bytes of the buffer, has to be greater or equals to 4.

Definition at line 108 of file sbgCrc.c.



sbg_driver
Author(s): SBG Systems
autogenerated on Thu Oct 22 2020 03:47:22