テスト用です。

Dependencies:   mbed

Committer:
jksoft
Date:
Tue Oct 11 11:09:42 2016 +0000
Revision:
0:8468a4403fea
SB??ver;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jksoft 0:8468a4403fea 1 /* Copyright (c) 2012 Nordic Semiconductor. All Rights Reserved.
jksoft 0:8468a4403fea 2 *
jksoft 0:8468a4403fea 3 * The information contained herein is property of Nordic Semiconductor ASA.
jksoft 0:8468a4403fea 4 * Terms and conditions of usage are described in detail in NORDIC
jksoft 0:8468a4403fea 5 * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
jksoft 0:8468a4403fea 6 *
jksoft 0:8468a4403fea 7 * Licensees are granted free, non-transferable use of the information. NO
jksoft 0:8468a4403fea 8 * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
jksoft 0:8468a4403fea 9 * the file.
jksoft 0:8468a4403fea 10 *
jksoft 0:8468a4403fea 11 */
jksoft 0:8468a4403fea 12
jksoft 0:8468a4403fea 13 /* Attention!
jksoft 0:8468a4403fea 14 * To maintain compliance with Nordic Semiconductor ASA’s Bluetooth profile
jksoft 0:8468a4403fea 15 * qualification listings, this section of source code must not be modified.
jksoft 0:8468a4403fea 16 */
jksoft 0:8468a4403fea 17
jksoft 0:8468a4403fea 18 #include "ble_srv_common.h"
jksoft 0:8468a4403fea 19 #include <string.h>
jksoft 0:8468a4403fea 20 #include "nordic_common.h"
jksoft 0:8468a4403fea 21 #include "app_error.h"
jksoft 0:8468a4403fea 22
jksoft 0:8468a4403fea 23
jksoft 0:8468a4403fea 24 uint8_t ble_srv_report_ref_encode(uint8_t * p_encoded_buffer,
jksoft 0:8468a4403fea 25 const ble_srv_report_ref_t * p_report_ref)
jksoft 0:8468a4403fea 26 {
jksoft 0:8468a4403fea 27 uint8_t len = 0;
jksoft 0:8468a4403fea 28
jksoft 0:8468a4403fea 29 p_encoded_buffer[len++] = p_report_ref->report_id;
jksoft 0:8468a4403fea 30 p_encoded_buffer[len++] = p_report_ref->report_type;
jksoft 0:8468a4403fea 31
jksoft 0:8468a4403fea 32 APP_ERROR_CHECK_BOOL(len == BLE_SRV_ENCODED_REPORT_REF_LEN);
jksoft 0:8468a4403fea 33 return len;
jksoft 0:8468a4403fea 34 }
jksoft 0:8468a4403fea 35
jksoft 0:8468a4403fea 36
jksoft 0:8468a4403fea 37 void ble_srv_ascii_to_utf8(ble_srv_utf8_str_t * p_utf8, char * p_ascii)
jksoft 0:8468a4403fea 38 {
jksoft 0:8468a4403fea 39 p_utf8->length = (uint16_t)strlen(p_ascii);
jksoft 0:8468a4403fea 40 p_utf8->p_str = (uint8_t *)p_ascii;
jksoft 0:8468a4403fea 41 }