-
Notifications
You must be signed in to change notification settings - Fork 4
/
secplus.h
42 lines (31 loc) · 1.13 KB
/
secplus.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
* Copyright 2022 Clayton Smith ([email protected])
*
* This file is part of secplus.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#ifndef SECPLUS_H
#define SECPLUS_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
extern int8_t encode_v1(uint32_t rolling, uint32_t fixed, uint8_t *symbols1,
uint8_t *symbols2);
extern int8_t decode_v1(const uint8_t *symbols1, const uint8_t *symbols2,
uint32_t *rolling, uint32_t *fixed);
extern int8_t encode_v2(uint32_t rolling, uint64_t fixed, uint32_t data,
uint8_t frame_type, uint8_t *packet1, uint8_t *packet2);
extern int8_t decode_v2(uint8_t frame_type, const uint8_t *packet1,
const uint8_t *packet2, uint32_t *rolling,
uint64_t *fixed, uint32_t *data);
extern int8_t encode_wireline(uint32_t rolling, uint64_t fixed, uint32_t data,
uint8_t *packet);
extern int8_t decode_wireline(const uint8_t *packet, uint32_t *rolling,
uint64_t *fixed, uint32_t *data);
#ifdef __cplusplus
}
#endif
#endif