Patched version of nrf51822 FOTA compatible driver, with GPTIO disabled, as it clashed with the mbed definitions...

Fork of nRF51822 by Nordic Semiconductor

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ble_srv_common.c Source File

ble_srv_common.c

00001 /* Copyright (c) 2012 Nordic Semiconductor. All Rights Reserved.
00002  *
00003  * The information contained herein is property of Nordic Semiconductor ASA.
00004  * Terms and conditions of usage are described in detail in NORDIC
00005  * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
00006  *
00007  * Licensees are granted free, non-transferable use of the information. NO
00008  * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
00009  * the file.
00010  *
00011  */
00012 
00013 /* Attention! 
00014 *  To maintain compliance with Nordic Semiconductor ASA�s Bluetooth profile 
00015 *  qualification listings, this section of source code must not be modified.
00016 */
00017 
00018 #include "ble_srv_common.h "
00019 #include <string.h>
00020 #include "nordic_common.h"
00021 #include "app_error.h "
00022 
00023 
00024 uint8_t ble_srv_report_ref_encode(uint8_t                    * p_encoded_buffer,
00025                                   const ble_srv_report_ref_t * p_report_ref)
00026 {
00027     uint8_t len = 0;
00028 
00029     p_encoded_buffer[len++] = p_report_ref->report_id;
00030     p_encoded_buffer[len++] = p_report_ref->report_type;
00031 
00032     APP_ERROR_CHECK_BOOL(len == BLE_SRV_ENCODED_REPORT_REF_LEN);
00033     return len;
00034 }
00035 
00036 
00037 void ble_srv_ascii_to_utf8(ble_srv_utf8_str_t * p_utf8, char * p_ascii)
00038 {
00039     p_utf8->length = (uint16_t)strlen(p_ascii);
00040     p_utf8->p_str  = (uint8_t *)p_ascii;
00041 }