Logo
Link Labs Interface Library
External host library for using Link Lab's modules.
top
Data Structures | Functions
Symphony Utility Functions

Detailed Description

Symphony Utility Functions. These are probably useful.

Data Structures

struct  time
 The structure used to store time. More...
 

Functions

uint16_t crc16 (char *ptr, int count)
 Calculate a 16-bit CRC Checksum. More...
 
uint32_t crc32 (uint32_t crc, uint8_t *buf, size_t len)
 Calculate a 32-bit CRC Checksum. More...
 
int32_t ll_difftime (struct time *a, struct time *b)
 Get the diffrence between two times in seconds. More...
 
int32_t ll_difftime_from_now (struct time *a)
 

Function Documentation

uint16_t crc16 ( char *  ptr,
int  count 
)

Calculate a 16-bit CRC Checksum.

Parameters
[in]ptrThe data you want to calculate the checksum for.
[in]countThe number of bytes to included the CRC calculation.
Returns
The 16-bit CRC Checksum.

source: Amulet Technologies, LLC (MIT)

uint32_t crc32 ( uint32_t  crc,
uint8_t *  buf,
size_t  len 
)

Calculate a 32-bit CRC Checksum.

Parameters
[in]crcInitial value for CRC Calculation. Commonly 0.
[in]bufThe data you want to calculate the checksum for.
[in]lenThe number of bytes included in the CRC calculation.
Returns
The 32-bit CRC Checksum.

source: Zlib

int32_t ll_difftime ( struct time a,
struct time b 
)

Get the diffrence between two times in seconds.

Parameters
[in]aThe start time.
[out]bThe end time.
Returns
The floor of the number of seconds (b-a).
int32_t ll_difftime_from_now ( struct time a)

Get the diffrence from a start time and when the functions called.

Parameters
[in]aThe start time.
Returns
The floor of the number of seconds (now-a).