Nordic stack and drivers for the mbed BLE API

Dependents:   idd_hw5_bleFanProto

Fork of nRF51822 by Nordic Semiconductor

Committer:
pgao
Date:
Thu Nov 06 05:29:15 2014 +0000
Revision:
70:c36c550b7208
Parent:
65:98215c4f3a25
asdf

Who changed what in which revision?

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