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) 2015 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 NSDL_ACCESS_HELPER_H
edamame22 0:29983394c6b6 17 #define NSDL_ACCESS_HELPER_H
edamame22 0:29983394c6b6 18 #include "mbed-client/m2mconnectionhandler.h"
edamame22 0:29983394c6b6 19 #include "include/m2mnsdlinterface.h"
edamame22 0:29983394c6b6 20
edamame22 0:29983394c6b6 21 typedef Vector<M2MNsdlInterface *> M2MNsdlInterfaceList;
edamame22 0:29983394c6b6 22 extern M2MNsdlInterfaceList __nsdl_interface_list;
edamame22 0:29983394c6b6 23 extern M2MConnectionHandler *__connection_handler;
edamame22 0:29983394c6b6 24
edamame22 0:29983394c6b6 25 #ifdef __cplusplus
edamame22 0:29983394c6b6 26 extern "C" {
edamame22 0:29983394c6b6 27 #endif
edamame22 0:29983394c6b6 28
edamame22 0:29983394c6b6 29 uint8_t __nsdl_c_callback(struct nsdl_s * nsdl_handle,
edamame22 0:29983394c6b6 30 sn_coap_hdr_s *received_coap_ptr,
edamame22 0:29983394c6b6 31 sn_nsdl_addr_s *address,
edamame22 0:29983394c6b6 32 sn_nsdl_capab_e nsdl_capab);
edamame22 0:29983394c6b6 33 void *__nsdl_c_memory_alloc(uint16_t size);
edamame22 0:29983394c6b6 34 void __nsdl_c_memory_free(void *ptr);
edamame22 0:29983394c6b6 35 uint8_t __nsdl_c_send_to_server(struct nsdl_s * nsdl_handle,
edamame22 0:29983394c6b6 36 sn_nsdl_capab_e protocol,
edamame22 0:29983394c6b6 37 uint8_t *data_ptr,
edamame22 0:29983394c6b6 38 uint16_t data_len,
edamame22 0:29983394c6b6 39 sn_nsdl_addr_s *address_ptr);
edamame22 0:29983394c6b6 40 uint8_t __nsdl_c_received_from_server(struct nsdl_s * nsdl_handle,
edamame22 0:29983394c6b6 41 sn_coap_hdr_s *coap_header,
edamame22 0:29983394c6b6 42 sn_nsdl_addr_s *address_ptr);
edamame22 0:29983394c6b6 43
edamame22 0:29983394c6b6 44 void *__socket_malloc( void * context, size_t size);
edamame22 0:29983394c6b6 45 void __socket_free(void * context, void * ptr);
edamame22 0:29983394c6b6 46
edamame22 0:29983394c6b6 47 M2MNsdlInterface* get_interface(struct nsdl_s* nsdl_handle);
edamame22 0:29983394c6b6 48
edamame22 0:29983394c6b6 49 void __mutex_claim();
edamame22 0:29983394c6b6 50 void __mutex_release();
edamame22 0:29983394c6b6 51
edamame22 0:29983394c6b6 52 #ifdef __cplusplus
edamame22 0:29983394c6b6 53 }
edamame22 0:29983394c6b6 54 #endif
edamame22 0:29983394c6b6 55
edamame22 0:29983394c6b6 56 #endif // NSDL_ACCESS_HELPER_H