![](/media/cache/profiles/5f14615696649541a025d3d0f8e0447f.jpg.50x50_q85.jpg)
iOSのBLEコントローラアプリ「RCBController」と接続し、コントローラの操作を取得するサンプルプログラムです。 mbed HRM1017で動作を確認しています。 2014.08.20時点でのBLEライブラリに対応しました。
Fork of BLE_RCBController by
HRM1017/nordic/nrf-sdk/app_common/crc16.h@4:ebda47d22091, 2014-08-20 (annotated)
- Committer:
- jksoft
- Date:
- Wed Aug 20 13:41:01 2014 +0000
- Revision:
- 4:ebda47d22091
- Parent:
- nRF51822/nordic/nrf-sdk/app_common/crc16.h@1:48f6e08a3ac2
?????????
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jksoft | 1:48f6e08a3ac2 | 1 | /* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved. |
jksoft | 1:48f6e08a3ac2 | 2 | * |
jksoft | 1:48f6e08a3ac2 | 3 | * The information contained herein is property of Nordic Semiconductor ASA. |
jksoft | 1:48f6e08a3ac2 | 4 | * Terms and conditions of usage are described in detail in NORDIC |
jksoft | 1:48f6e08a3ac2 | 5 | * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. |
jksoft | 1:48f6e08a3ac2 | 6 | * |
jksoft | 1:48f6e08a3ac2 | 7 | * Licensees are granted free, non-transferable use of the information. NO |
jksoft | 1:48f6e08a3ac2 | 8 | * WARRANTY of ANY KIND is provided. This heading must NOT be removed from |
jksoft | 1:48f6e08a3ac2 | 9 | * the file. |
jksoft | 1:48f6e08a3ac2 | 10 | * |
jksoft | 1:48f6e08a3ac2 | 11 | */ |
jksoft | 1:48f6e08a3ac2 | 12 | |
jksoft | 1:48f6e08a3ac2 | 13 | /** @file |
jksoft | 1:48f6e08a3ac2 | 14 | * |
jksoft | 1:48f6e08a3ac2 | 15 | * @defgroup crc_compute CRC compute |
jksoft | 1:48f6e08a3ac2 | 16 | * @{ |
jksoft | 1:48f6e08a3ac2 | 17 | * @ingroup hci_transport |
jksoft | 1:48f6e08a3ac2 | 18 | * |
jksoft | 1:48f6e08a3ac2 | 19 | * @brief This module implements the CRC-16 calculation in the blocks. |
jksoft | 1:48f6e08a3ac2 | 20 | */ |
jksoft | 1:48f6e08a3ac2 | 21 | |
jksoft | 1:48f6e08a3ac2 | 22 | #ifndef CRC16_H__ |
jksoft | 1:48f6e08a3ac2 | 23 | #define CRC16_H__ |
jksoft | 1:48f6e08a3ac2 | 24 | |
jksoft | 1:48f6e08a3ac2 | 25 | #include <stdint.h> |
jksoft | 1:48f6e08a3ac2 | 26 | |
jksoft | 1:48f6e08a3ac2 | 27 | #ifdef __cplusplus |
jksoft | 1:48f6e08a3ac2 | 28 | extern "C" { |
jksoft | 1:48f6e08a3ac2 | 29 | #endif |
jksoft | 1:48f6e08a3ac2 | 30 | |
jksoft | 1:48f6e08a3ac2 | 31 | /**@brief Function for calculating CRC-16 in blocks. |
jksoft | 1:48f6e08a3ac2 | 32 | * |
jksoft | 1:48f6e08a3ac2 | 33 | * Feed each consecutive data block into this function, along with the current value of p_crc as |
jksoft | 1:48f6e08a3ac2 | 34 | * returned by the previous call of this function. The first call of this function should pass NULL |
jksoft | 1:48f6e08a3ac2 | 35 | * as the initial value of the crc in p_crc. |
jksoft | 1:48f6e08a3ac2 | 36 | * |
jksoft | 1:48f6e08a3ac2 | 37 | * @param[in] p_data The input data block for computation. |
jksoft | 1:48f6e08a3ac2 | 38 | * @param[in] size The size of the input data block in bytes. |
jksoft | 1:48f6e08a3ac2 | 39 | * @param[in] p_crc The previous calculated CRC-16 value or NULL if first call. |
jksoft | 1:48f6e08a3ac2 | 40 | * |
jksoft | 1:48f6e08a3ac2 | 41 | * @return The updated CRC-16 value, based on the input supplied. |
jksoft | 1:48f6e08a3ac2 | 42 | */ |
jksoft | 1:48f6e08a3ac2 | 43 | uint16_t crc16_compute(const uint8_t * p_data, uint32_t size, const uint16_t * p_crc); |
jksoft | 1:48f6e08a3ac2 | 44 | |
jksoft | 1:48f6e08a3ac2 | 45 | #ifdef __cplusplus |
jksoft | 1:48f6e08a3ac2 | 46 | } |
jksoft | 1:48f6e08a3ac2 | 47 | #endif |
jksoft | 1:48f6e08a3ac2 | 48 | |
jksoft | 1:48f6e08a3ac2 | 49 | |
jksoft | 1:48f6e08a3ac2 | 50 | #endif // CRC16_H__ |
jksoft | 1:48f6e08a3ac2 | 51 | |
jksoft | 1:48f6e08a3ac2 | 52 | /** @} */ |