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:
Ren Boting
Date:
Tue Sep 05 11:56:13 2017 +0900
Revision:
2:b894b3508057
Parent:
0:29983394c6b6
Update all libraries and reform main.cpp

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 #ifndef MBED_CLIENT_CONFIG_H
edamame22 0:29983394c6b6 17 #define MBED_CLIENT_CONFIG_H
edamame22 0:29983394c6b6 18
edamame22 0:29983394c6b6 19
edamame22 0:29983394c6b6 20 // Defines the number of times client should try re-connection towards
edamame22 0:29983394c6b6 21 // Server in case of connectivity loss , also defines the number of CoAP
edamame22 0:29983394c6b6 22 // re-transmission attempts.Default value is 3
edamame22 0:29983394c6b6 23 #define M2M_CLIENT_RECONNECTION_COUNT 3
edamame22 0:29983394c6b6 24
edamame22 0:29983394c6b6 25 // Defines the interval (in seconds) in which client should try re-connection towards
edamame22 0:29983394c6b6 26 // Server in case of connectivity loss , also use the same interval for CoAP
edamame22 0:29983394c6b6 27 // re-transmission attempts. Default value is 5 seconds
edamame22 0:29983394c6b6 28 #define M2M_CLIENT_RECONNECTION_INTERVAL 5
edamame22 0:29983394c6b6 29
edamame22 0:29983394c6b6 30 // Defines the keep-alive interval (in seconds) in which client should send keep alive
edamame22 0:29983394c6b6 31 // pings to server while connected through TCP mode. Default value is 300 seconds
edamame22 0:29983394c6b6 32 #define M2M_CLIENT_TCP_KEEPALIVE_TIME 300
edamame22 0:29983394c6b6 33
edamame22 0:29983394c6b6 34 // Defines the maximum CoAP messages that client can hold, maximum value is 6
edamame22 0:29983394c6b6 35 #define SN_COAP_DUPLICATION_MAX_MSGS_COUNT 2
edamame22 0:29983394c6b6 36
edamame22 0:29983394c6b6 37 // Defines the size of blockwise CoAP messages that client can handle.
edamame22 0:29983394c6b6 38 // The values that can be defined uust be 2^x and x is at least 4.
edamame22 0:29983394c6b6 39 // Suitable values: 0, 16, 32, 64, 128, 256, 512 and 1024
edamame22 0:29983394c6b6 40 #define SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE 1024
edamame22 0:29983394c6b6 41
edamame22 0:29983394c6b6 42 // Many pure LWM2M servers doen't accept 'obs' text in registration message.
edamame22 0:29983394c6b6 43 // While using Client against such servers, this flag can be set to define to
edamame22 0:29983394c6b6 44 // disable client sending 'obs' text for observable resources.
edamame22 0:29983394c6b6 45 #undef COAP_DISABLE_OBS_FEATURE
edamame22 0:29983394c6b6 46
edamame22 0:29983394c6b6 47 // Disable Bootstrap functionality in client in order to reduce code size, if bootstrap
edamame22 0:29983394c6b6 48 // functionality is not required.
edamame22 0:29983394c6b6 49 #undef M2M_CLIENT_DISABLE_BOOTSTRAP_FEATURE
edamame22 0:29983394c6b6 50
edamame22 0:29983394c6b6 51 #endif // MBED_CLIENT_CONFIG_H
edamame22 0:29983394c6b6 52