Classes | Macros | Enumerations | Functions | Variables
SBR.h File Reference
#include "stdint.h"
#include "stdbool.h"
Include dependency graph for SBR.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SBR
 
struct  SBR_SECTION
 
struct  SBR_SECTION_RAW
 

Macros

#define SBR_IDENTIFIER_SIZE   (2)
 
#define SBR_MAX_NUM_SECTIONS   (17)
 
#define SBR_RAW_SIZE   (sizeof(SBR_SECTION_RAW) * SBR_MAX_NUM_SECTIONS + SBR_IDENTIFIER_SIZE)
 
#define SBR_SECTION_FLAG_BOOTABLE   (1 << 0)
 
#define SBR_SECTION_FLAG_COMPRESSION_MASK   (0x7 << 2)
 
#define SBR_SECTION_FLAG_IGNORE_CHECKSUM   (1 << 1)
 
#define SBR_SECTION_NAME_MAX_SIZE   (16)
 

Enumerations

enum  SBR_COMPRESSION { SBR_NO_COMPRESSION = 0U << 2, SBR_COMPRESSION_ZLIB = 1U << 2, SBR_COMPRESSION_GZ = 2U << 2, SBR_COMPRESSION_XZ = 3U << 2 }
 

Functions

uint32_t sbr_compute_checksum (const void *buffer, uint32_t size)
 
uint32_t sbr_compute_checksum_prev (const void *buffer, uint32_t size, uint32_t prev_checksum)
 
uint32_t sbr_initial_checksum ()
 
int sbr_parse (const void *buffer, uint32_t size, SBR *sbr)
 
bool sbr_section_get_bootable (const SBR_SECTION *sbr_section)
 
SBR_COMPRESSION sbr_section_get_compression (const SBR_SECTION *sbr_section)
 
bool sbr_section_get_ignore_checksum (const SBR_SECTION *sbr_section)
 
bool sbr_section_is_valid (const SBR_SECTION *sbr_section)
 
void sbr_section_set_bootable (SBR_SECTION *sbr_section, bool bootable)
 
void sbr_section_set_checksum (SBR_SECTION *sbr_section, uint32_t checksum)
 
void sbr_section_set_compression (SBR_SECTION *sbr_section, SBR_COMPRESSION compression)
 
void sbr_section_set_ignore_checksum (SBR_SECTION *sbr_section, bool ignore_checksum)
 
void sbr_section_set_name (SBR_SECTION *sbr_section, const char *name)
 
void sbr_section_set_offset (SBR_SECTION *sbr_section, uint32_t offset)
 
void sbr_section_set_size (SBR_SECTION *sbr_section, uint32_t size)
 
void sbr_section_set_type (SBR_SECTION *sbr_section, uint8_t type)
 
int sbr_serialize (const SBR *sbr, void *buffer, uint32_t max_size)
 

Variables

static const uint8_t SBR_IDENTIFIER [SBR_IDENTIFIER_SIZE] = {'B', 'R'}
 

Macro Definition Documentation

◆ SBR_IDENTIFIER_SIZE

#define SBR_IDENTIFIER_SIZE   (2)

Definition at line 13 of file SBR.h.

◆ SBR_MAX_NUM_SECTIONS

#define SBR_MAX_NUM_SECTIONS   (17)

Definition at line 11 of file SBR.h.

◆ SBR_RAW_SIZE

#define SBR_RAW_SIZE   (sizeof(SBR_SECTION_RAW) * SBR_MAX_NUM_SECTIONS + SBR_IDENTIFIER_SIZE)

Definition at line 55 of file SBR.h.

◆ SBR_SECTION_FLAG_BOOTABLE

#define SBR_SECTION_FLAG_BOOTABLE   (1 << 0)

Definition at line 15 of file SBR.h.

◆ SBR_SECTION_FLAG_COMPRESSION_MASK

#define SBR_SECTION_FLAG_COMPRESSION_MASK   (0x7 << 2)

Definition at line 17 of file SBR.h.

◆ SBR_SECTION_FLAG_IGNORE_CHECKSUM

#define SBR_SECTION_FLAG_IGNORE_CHECKSUM   (1 << 1)

Definition at line 16 of file SBR.h.

◆ SBR_SECTION_NAME_MAX_SIZE

#define SBR_SECTION_NAME_MAX_SIZE   (16)

Definition at line 12 of file SBR.h.

Enumeration Type Documentation

◆ SBR_COMPRESSION

Enumerator
SBR_NO_COMPRESSION 
SBR_COMPRESSION_ZLIB 
SBR_COMPRESSION_GZ 
SBR_COMPRESSION_XZ 

Definition at line 18 of file SBR.h.

Function Documentation

◆ sbr_compute_checksum()

uint32_t sbr_compute_checksum ( const void *  buffer,
uint32_t  size 
)

Definition at line 168 of file SBR.c.

◆ sbr_compute_checksum_prev()

uint32_t sbr_compute_checksum_prev ( const void *  buffer,
uint32_t  size,
uint32_t  prev_checksum 
)

Definition at line 157 of file SBR.c.

◆ sbr_initial_checksum()

uint32_t sbr_initial_checksum ( )

Definition at line 153 of file SBR.c.

◆ sbr_parse()

int sbr_parse ( const void *  buffer,
uint32_t  size,
SBR sbr 
)

Definition at line 57 of file SBR.c.

◆ sbr_section_get_bootable()

bool sbr_section_get_bootable ( const SBR_SECTION sbr_section)

Definition at line 128 of file SBR.c.

◆ sbr_section_get_compression()

SBR_COMPRESSION sbr_section_get_compression ( const SBR_SECTION sbr_section)

Definition at line 140 of file SBR.c.

◆ sbr_section_get_ignore_checksum()

bool sbr_section_get_ignore_checksum ( const SBR_SECTION sbr_section)

Definition at line 134 of file SBR.c.

◆ sbr_section_is_valid()

bool sbr_section_is_valid ( const SBR_SECTION sbr_section)

Definition at line 145 of file SBR.c.

◆ sbr_section_set_bootable()

void sbr_section_set_bootable ( SBR_SECTION sbr_section,
bool  bootable 
)

Definition at line 197 of file SBR.c.

◆ sbr_section_set_checksum()

void sbr_section_set_checksum ( SBR_SECTION sbr_section,
uint32_t  checksum 
)

Definition at line 187 of file SBR.c.

◆ sbr_section_set_compression()

void sbr_section_set_compression ( SBR_SECTION sbr_section,
SBR_COMPRESSION  compression 
)

Definition at line 215 of file SBR.c.

◆ sbr_section_set_ignore_checksum()

void sbr_section_set_ignore_checksum ( SBR_SECTION sbr_section,
bool  ignore_checksum 
)

Definition at line 206 of file SBR.c.

◆ sbr_section_set_name()

void sbr_section_set_name ( SBR_SECTION sbr_section,
const char *  name 
)

Definition at line 172 of file SBR.c.

◆ sbr_section_set_offset()

void sbr_section_set_offset ( SBR_SECTION sbr_section,
uint32_t  offset 
)

Definition at line 182 of file SBR.c.

◆ sbr_section_set_size()

void sbr_section_set_size ( SBR_SECTION sbr_section,
uint32_t  size 
)

Definition at line 177 of file SBR.c.

◆ sbr_section_set_type()

void sbr_section_set_type ( SBR_SECTION sbr_section,
uint8_t  type 
)

Definition at line 192 of file SBR.c.

◆ sbr_serialize()

int sbr_serialize ( const SBR sbr,
void *  buffer,
uint32_t  max_size 
)

Definition at line 84 of file SBR.c.

Variable Documentation

◆ SBR_IDENTIFIER

const uint8_t SBR_IDENTIFIER[SBR_IDENTIFIER_SIZE] = {'B', 'R'}
static

Definition at line 25 of file SBR.h.



depthai
Author(s): Martin Peterlin
autogenerated on Sat Mar 22 2025 02:58:20