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 # Makefile.test for mbed-client-classic unit tests
edamame22 0:29983394c6b6 3 #
edamame22 0:29983394c6b6 4
edamame22 0:29983394c6b6 5
edamame22 0:29983394c6b6 6 # List of subdirectories to build
edamame22 0:29983394c6b6 7 TEST_FOLDER := ./test/
edamame22 0:29983394c6b6 8 # List of unit test directories for libraries
edamame22 0:29983394c6b6 9 UNITTESTS := $(sort $(dir $(wildcard $(TEST_FOLDER)*/unittest/*)))
edamame22 0:29983394c6b6 10 TESTDIRS := $(UNITTESTS:%=build-%)
edamame22 0:29983394c6b6 11 CLEANTESTDIRS := $(UNITTESTS:%=clean-%)
edamame22 0:29983394c6b6 12 COVERAGEFILE := ./lcov/coverage.info
edamame22 0:29983394c6b6 13
edamame22 0:29983394c6b6 14 .PHONY: clone
edamame22 0:29983394c6b6 15 clone:
edamame22 0:29983394c6b6 16 @rm -rf ./test_modules
edamame22 0:29983394c6b6 17 @mkdir -p test_modules
edamame22 0:29983394c6b6 18 @git clone --depth 1 git@github.com:ARMmbed/mbed-os.git ./test_modules/mbed-os
edamame22 0:29983394c6b6 19 @git clone --depth 1 git@github.com:ARMmbed/mbed-trace.git ./test_modules/mbed-trace
edamame22 0:29983394c6b6 20 @git clone --depth 1 git@github.com:ARMmbed/sal-stack-nanostack-eventloop.git ./test_modules/sal-stack-nanostack-eventloop
edamame22 0:29983394c6b6 21 @git clone --depth 1 git@github.com:ARMmbed/nanostack-libservice.git ./test_modules/nanostack-libservice
edamame22 0:29983394c6b6 22 @git clone --depth 1 git@github.com:ARMmbed/mbed-client-c.git ./test_modules/mbed-client-c
edamame22 0:29983394c6b6 23 @git clone --depth 1 git@github.com:ARMmbed/mbed-client.git ./test_modules/mbed-client
edamame22 0:29983394c6b6 24 @git clone --depth 1 git@github.com:ARMmbed/mbed-client-pal.git ./test_modules/mbed-client-pal
edamame22 0:29983394c6b6 25
edamame22 0:29983394c6b6 26 .PHONY: test
edamame22 0:29983394c6b6 27 test: $(TESTDIRS)
edamame22 0:29983394c6b6 28 @rm -rf ./lcov
edamame22 0:29983394c6b6 29 @rm -rf ./coverage
edamame22 0:29983394c6b6 30 @mkdir -p lcov
edamame22 0:29983394c6b6 31 @mkdir -p lcov/results
edamame22 0:29983394c6b6 32 @mkdir coverage
edamame22 0:29983394c6b6 33 @find ./test -name '*.xml' | xargs cp -t ./lcov/results/
edamame22 0:29983394c6b6 34 @rm -f lcov/index.xml
edamame22 0:29983394c6b6 35 @./xsl_script.sh
edamame22 0:29983394c6b6 36 @cp junit_xsl.xslt lcov/.
edamame22 0:29983394c6b6 37 @xsltproc -o lcov/testresults.html lcov/junit_xsl.xslt lcov/index.xml
edamame22 0:29983394c6b6 38 @rm -f lcov/junit_xsl.xslt
edamame22 0:29983394c6b6 39 @rm -f lcov/index.xml
edamame22 0:29983394c6b6 40 @find ./ -name '*.gcno' | xargs cp --backup=numbered -t ./coverage/
edamame22 0:29983394c6b6 41 @find ./ -name '*.gcda' | xargs cp --backup=numbered -t ./coverage/
edamame22 0:29983394c6b6 42 @gcovr --object-directory ./coverage --exclude-unreachable-branches -e '.*/builds/.*' -e '.*/test/.*' -e '.*/test_modules/.*' -e '.*/stubs/.*' -e '.*/mbed-client-classic/.*' -e '.*/usr/.*' -x -o ./lcov/gcovr.xml
edamame22 0:29983394c6b6 43 @lcov -d test/. -c -o $(COVERAGEFILE)
edamame22 0:29983394c6b6 44 @lcov -q -r $(COVERAGEFILE) "/usr*" -o $(COVERAGEFILE)
edamame22 0:29983394c6b6 45 @lcov -q -r $(COVERAGEFILE) "/test*" -o $(COVERAGEFILE)
edamame22 0:29983394c6b6 46 @lcov -q -r $(COVERAGEFILE) "/mbed-client-libservice*" -o $(COVERAGEFILE)
edamame22 0:29983394c6b6 47 @genhtml -q $(COVERAGEFILE) --show-details --output-directory lcov/html
edamame22 0:29983394c6b6 48 @echo mbed-client-classic module unit tests built
edamame22 0:29983394c6b6 49
edamame22 0:29983394c6b6 50 $(TESTDIRS):
edamame22 0:29983394c6b6 51 @make -C $(@:build-%=%)
edamame22 0:29983394c6b6 52
edamame22 0:29983394c6b6 53 $(CLEANDIRS):
edamame22 0:29983394c6b6 54 @make -C $(@:clean-%=%) clean
edamame22 0:29983394c6b6 55
edamame22 0:29983394c6b6 56 $(CLEANTESTDIRS):
edamame22 0:29983394c6b6 57 @make -C $(@:clean-%=%) clean
edamame22 0:29983394c6b6 58
edamame22 0:29983394c6b6 59 # Extend default clean rule
edamame22 0:29983394c6b6 60 clean: clean-extra
edamame22 0:29983394c6b6 61
edamame22 0:29983394c6b6 62 clean-extra: $(CLEANDIRS) \
edamame22 0:29983394c6b6 63 $(CLEANTESTDIRS)