This is an example of BLE GATT Client, which receives broadcast data from BLE_Server_BME280 ( a GATT server) , then transfers values up to mbed Device Connector (cloud).

Please refer details about BLEClient_mbedDevConn below. https://github.com/soramame21/BLEClient_mbedDevConn

The location of required BLE GATT server, BLE_Server_BME280, is at here. https://developer.mbed.org/users/edamame22/code/BLE_Server_BME280/

Committer:
edamame22
Date:
Thu Apr 13 04:48:11 2017 +0000
Revision:
0:29983394c6b6
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
edamame22 0:29983394c6b6 1 /*
edamame22 0:29983394c6b6 2 * Copyright (c) 2016 ARM Limited. All rights reserved.
edamame22 0:29983394c6b6 3 * SPDX-License-Identifier: Apache-2.0
edamame22 0:29983394c6b6 4 * Licensed under the Apache License, Version 2.0 (the License); you may
edamame22 0:29983394c6b6 5 * not use this file except in compliance with the License.
edamame22 0:29983394c6b6 6 * You may obtain a copy of the License at
edamame22 0:29983394c6b6 7 *
edamame22 0:29983394c6b6 8 * http://www.apache.org/licenses/LICENSE-2.0
edamame22 0:29983394c6b6 9 *
edamame22 0:29983394c6b6 10 * Unless required by applicable law or agreed to in writing, software
edamame22 0:29983394c6b6 11 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
edamame22 0:29983394c6b6 12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
edamame22 0:29983394c6b6 13 * See the License for the specific language governing permissions and
edamame22 0:29983394c6b6 14 * limitations under the License.
edamame22 0:29983394c6b6 15 */
edamame22 0:29983394c6b6 16
edamame22 0:29983394c6b6 17
edamame22 0:29983394c6b6 18 #ifndef _PAL_COFIGURATION_H
edamame22 0:29983394c6b6 19 #define _PAL_COFIGURATION_H
edamame22 0:29983394c6b6 20
edamame22 0:29983394c6b6 21 #ifdef __cplusplus
edamame22 0:29983394c6b6 22 extern "C" {
edamame22 0:29983394c6b6 23 #endif
edamame22 0:29983394c6b6 24
edamame22 0:29983394c6b6 25 //! pal configuration options
edamame22 0:29983394c6b6 26 #define PAL_NET_TCP_AND_TLS_SUPPORT true/* add pal support for TCP */
edamame22 0:29983394c6b6 27 #define PAL_NET_ASYNCHRONOUS_SOCKET_API true/* add pal support for asynchronous sockets */
edamame22 0:29983394c6b6 28 #define PAL_NET_DNS_SUPPORT true/* add pal support for DNS lookup */
edamame22 0:29983394c6b6 29
edamame22 0:29983394c6b6 30 #define PAL_RTOS_64BIT_TICK_SUPPORTED false /* add pal support for asynchronous sockets */
edamame22 0:29983394c6b6 31 #define PAL_UNIQUE_THREAD_PRIORITY (!defined(PAL_IGNORE_UNIQUE_THREAD_PRIORITY))/* if defined code skips the uniqueness priority check */
edamame22 0:29983394c6b6 32
edamame22 0:29983394c6b6 33 //! number of valid priorities limits the number of threads- if priorities are added this value should be increased
edamame22 0:29983394c6b6 34 #define PAL_MAX_NUMBER_OF_THREADS 7
edamame22 0:29983394c6b6 35
edamame22 0:29983394c6b6 36 //! the maximal number of interfaces that can be supported at once.
edamame22 0:29983394c6b6 37 #define PAL_MAX_SUPORTED_NET_INTEFACES 5
edamame22 0:29983394c6b6 38
edamame22 0:29983394c6b6 39 #ifdef __GNUC__ // we are compiling using GCC/G++
edamame22 0:29983394c6b6 40 #define PAL_TARGET_POINTER_SIZE __SIZEOF_POINTER__
edamame22 0:29983394c6b6 41 #ifdef __BYTE_ORDER
edamame22 0:29983394c6b6 42 #if __BYTE_ORDER == __BIG_ENDIAN //if both are not defined it is TRUE!
edamame22 0:29983394c6b6 43 #define PAL_COMPILATION_ENDIANITY 1 //define pal compilation endianity (0 is little endian, 1 is big endian)
edamame22 0:29983394c6b6 44 #elif __BYTE_ORDER == __LITTLE_ENDIAN
edamame22 0:29983394c6b6 45 #define PAL_COMPILATION_ENDIANITY 0//define pal compilation endianity (0 is little endian, 1 is big endian)
edamame22 0:29983394c6b6 46 #else
edamame22 0:29983394c6b6 47 #error missing endiantiy defintion for GCC
edamame22 0:29983394c6b6 48 #endif
edamame22 0:29983394c6b6 49
edamame22 0:29983394c6b6 50 #endif
edamame22 0:29983394c6b6 51 #else
edamame22 0:29983394c6b6 52 #ifdef __arm__ // we are compiling using the ARM compiler
edamame22 0:29983394c6b6 53 #define PAL_TARGET_POINTER_SIZE __sizeof_ptr
edamame22 0:29983394c6b6 54 #ifdef __BIG_ENDIAN
edamame22 0:29983394c6b6 55 #define PAL_COMPILATION_ENDIANITY 1 //define pal compilation endianity (0 is little endian, 1 is big endian)
edamame22 0:29983394c6b6 56 #else
edamame22 0:29983394c6b6 57 #define PAL_COMPILATION_ENDIANITY 0 //define pal compilation endianity (0 is little endian, 1 is big endian)
edamame22 0:29983394c6b6 58 #endif
edamame22 0:29983394c6b6 59 #else
edamame22 0:29983394c6b6 60 //#error neither ARMCC nor GCC used for compilation - not supported
edamame22 0:29983394c6b6 61 #endif
edamame22 0:29983394c6b6 62
edamame22 0:29983394c6b6 63
edamame22 0:29983394c6b6 64 #endif
edamame22 0:29983394c6b6 65
edamame22 0:29983394c6b6 66 #ifdef __cplusplus
edamame22 0:29983394c6b6 67 }
edamame22 0:29983394c6b6 68 #endif
edamame22 0:29983394c6b6 69 #endif //_PAL_COFIGURATION_H