libosmocore
0.6.3
Osmocom core library
Main Page
Modules
Data Structures
Files
File List
Globals
crc16gen.h
Go to the documentation of this file.
1
/*
2
* crc16gen.h
3
*
4
* Copyright (C) 2011 Sylvain Munaut <tnt@246tNt.com>
5
*
6
* All Rights Reserved
7
*
8
* This program is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation; either version 2 of the License, or
11
* (at your option) any later version.
12
*
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
17
*
18
* You should have received a copy of the GNU General Public License along
19
* with this program; if not, write to the Free Software Foundation, Inc.,
20
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21
*/
22
23
#ifndef __OSMO_CRC16GEN_H__
24
#define __OSMO_CRC16GEN_H__
25
35
#include <stdint.h>
36
#include <
osmocom/core/bits.h
>
37
38
40
struct
osmo_crc16gen_code
{
41
int
bits
;
42
uint16_t
poly
;
43
uint16_t
init
;
44
uint16_t
remainder
;
45
};
46
47
uint16_t
osmo_crc16gen_compute_bits
(
const
struct
osmo_crc16gen_code
*code,
48
const
ubit_t
*in,
int
len);
49
int
osmo_crc16gen_check_bits
(
const
struct
osmo_crc16gen_code
*code,
50
const
ubit_t
*in,
int
len,
const
ubit_t
*crc_bits);
51
void
osmo_crc16gen_set_bits
(
const
struct
osmo_crc16gen_code
*code,
52
const
ubit_t
*in,
int
len,
ubit_t
*crc_bits);
53
54
57
#endif
/* __OSMO_CRC16GEN_H__ */
58
59
/* vim: set syntax=c: */
include
osmocom
core
crc16gen.h
Generated on Fri Aug 23 2013 20:51:42 for libosmocore by
1.8.1.2