#include <roch_base/core/crc.h>
Go to the source code of this file.
Functions | |
uint16_t | crc16 (int size, int init_val, uint8_t *data) |
Variables | |
const uint16_t | table [256] |
uint16_t crc16 | ( | int | size, |
int | init_val, | ||
uint8_t * | data | ||
) |
File: crc.h Desc: Definitions of a 16 bit CRC. Uses a table-based implementation. When INIT_VAL=0xFFFF, this is identical to that used on the various uCs which implement Horizon Auth: R. Gariepy
Copyright (c) 2010, Clearpath Robotics, Inc. Copyright (c) 2016, SawYer Robotics, Inc. All Rights Reserved
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Clearpath ROBOTICS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Please send comments, questions, or patches to skyne t@cl earpa thro botic s.co m
const uint16_t table[256] |
/ _ \ / _/ \ \ / / _/ \ / _/ _ \ ___ _ ___ ___ ____ ____ ___ _____ _ _ \ / _/ \ / / _| | | __| / _ \ | ++ \ | ++ \ / _ \ |_ _|| | | | \ _/ _/ / | | | | | ++ | |_| || ++ / | ++_/| |_| | | | | +-+ | \ _/ / | |_ | |_ | ++ | _ || |\ \ | | | _ | | | | +-+ | _____/ ___/|___||___||_| |_||_| _|_| |_| |_| |_| |_| |_| ROBOTICS�
File: crc.cpp Desc: 16 bit CRC function and lookup table. Uses a table-based implementation. When INIT_VAL=0xFFFF, this is identical to that used on the various uCs which implement Horizon Auth: R. Gariepy
Copyright (c) 2010, Clearpath Robotics, Inc. All Rights Reserved
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CLEARPATH ROBOTICS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Please send comments, questions, or patches to skyne t@cl earpa thro botic s.co m