Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of nRF51822 by
nordic/ble/ble_services/ble_srv_common.cpp@69:b4a3693da52b, 2014-12-04 (annotated)
- Committer:
- nobukuma
- Date:
- Thu Dec 04 12:50:37 2014 +0000
- Revision:
- 69:b4a3693da52b
- Parent:
- 65:98215c4f3a25
modified locally to use with HRM1017
Who changed what in which revision?
User | Revision | Line number | New 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 ASAs 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 | } |