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 #!/bin/bash
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 echo
edamame22 0:29983394c6b6 17 echo "Build mbed Client API unit tests"
edamame22 0:29983394c6b6 18 echo
edamame22 0:29983394c6b6 19 yt target x86-linux-native-coverage
edamame22 0:29983394c6b6 20 yt clean
edamame22 0:29983394c6b6 21 yt build
edamame22 0:29983394c6b6 22 yt test --no-build -- -ojunit
edamame22 0:29983394c6b6 23 echo
edamame22 0:29983394c6b6 24 echo Create results
edamame22 0:29983394c6b6 25 echo
edamame22 0:29983394c6b6 26 rm -rf results
edamame22 0:29983394c6b6 27 rm -rf coverage
edamame22 0:29983394c6b6 28 mkdir results
edamame22 0:29983394c6b6 29 mkdir coverage
edamame22 0:29983394c6b6 30
edamame22 0:29983394c6b6 31 find ./build -name '*.xml' | xargs cp -t ./results/
edamame22 0:29983394c6b6 32 find ./build/x86-linux-native-coverage/test -name '*.gcno' | xargs cp -t ./coverage/
edamame22 0:29983394c6b6 33 find ./build/x86-linux-native-coverage/test -name '*.gcda' | xargs cp -t ./coverage/
edamame22 0:29983394c6b6 34 touch coverage/*.gcda
edamame22 0:29983394c6b6 35 exclude_files="${PWD}/test/"
edamame22 0:29983394c6b6 36 gcovr -r ./ --gcov-filter='.*source*.' --exclude-unreachable-branches --exclude $exclude_files --object-directory ./coverage -x -o ./results/gcovr.xml
edamame22 0:29983394c6b6 37 echo
edamame22 0:29983394c6b6 38 echo "Create coverage document"
edamame22 0:29983394c6b6 39 echo
edamame22 0:29983394c6b6 40 lcov -b ./ -d ./coverage -c -o ./coverage/app.info
edamame22 0:29983394c6b6 41 lcov -q -r ./coverage/app.info "/test/mbedclient/*" -o ./coverage/app.info
edamame22 0:29983394c6b6 42 lcov -q -r ./coverage/app.info "/usr*" -o ./coverage/app.info
edamame22 0:29983394c6b6 43 genhtml -q --no-branch-coverage --function-coverage --demangle-cpp --title "mbed Client coverage" ./coverage/app.info -o ./coverage
edamame22 0:29983394c6b6 44 rm -f ./coverage/*.gcno
edamame22 0:29983394c6b6 45 rm -f ./coverage/*.gcda
edamame22 0:29983394c6b6 46 echo
edamame22 0:29983394c6b6 47 echo "Creating report"
edamame22 0:29983394c6b6 48 echo
edamame22 0:29983394c6b6 49 echo '<?xml version="1.0" encoding="UTF-8" ?>
edamame22 0:29983394c6b6 50 <?xml-stylesheet type="text/xsl" href="junit_xsl.xslt"?>
edamame22 0:29983394c6b6 51 <list>' >> index.xml
edamame22 0:29983394c6b6 52
edamame22 0:29983394c6b6 53 for f in results/*.xml
edamame22 0:29983394c6b6 54 do
edamame22 0:29983394c6b6 55 name=${f##*/}
edamame22 0:29983394c6b6 56 echo '<entry name="results/'"$name"'" />'>> index.xml
edamame22 0:29983394c6b6 57 done
edamame22 0:29983394c6b6 58
edamame22 0:29983394c6b6 59 echo '</list>' >> index.xml
edamame22 0:29983394c6b6 60
edamame22 0:29983394c6b6 61 echo
edamame22 0:29983394c6b6 62 echo "Report created to index.xml (outputs html)"
edamame22 0:29983394c6b6 63 echo
edamame22 0:29983394c6b6 64 xsltproc -o results/testresults.html junit_xsl.xslt index.xml
edamame22 0:29983394c6b6 65 rm -f index.xml
edamame22 0:29983394c6b6 66