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 # Makefile for running unit tests
edamame22 0:29983394c6b6 3 #
edamame22 0:29983394c6b6 4 # List of subdirectories to build
edamame22 0:29983394c6b6 5 TEST_FOLDER := ./test/
edamame22 0:29983394c6b6 6
edamame22 0:29983394c6b6 7 LIB = libmbed-client-mbedtls.a
edamame22 0:29983394c6b6 8
edamame22 0:29983394c6b6 9 # List of unit test directories for libraries
edamame22 0:29983394c6b6 10 UNITTESTS := $(sort $(dir $(wildcard $(TEST_FOLDER)*/unittest/*)))
edamame22 0:29983394c6b6 11 TESTDIRS := $(UNITTESTS:%=build-%)
edamame22 0:29983394c6b6 12 CLEANTESTDIRS := $(UNITTESTS:%=clean-%)
edamame22 0:29983394c6b6 13 COVERAGEFILE := ./lcov/coverage.info
edamame22 0:29983394c6b6 14
edamame22 0:29983394c6b6 15 include sources.mk
edamame22 0:29983394c6b6 16 include include_dirs.mk
edamame22 0:29983394c6b6 17
edamame22 0:29983394c6b6 18 override CFLAGS += $(addprefix -I,$(INCLUDE_DIRS))
edamame22 0:29983394c6b6 19 override CFLAGS += $(addprefix -D,$(FLAGS))
edamame22 0:29983394c6b6 20 ifeq ($(DEBUG),1)
edamame22 0:29983394c6b6 21 override CFLAGS += -DHAVE_DEBUG
edamame22 0:29983394c6b6 22 endif
edamame22 0:29983394c6b6 23
edamame22 0:29983394c6b6 24 #
edamame22 0:29983394c6b6 25 # Define compiler toolchain
edamame22 0:29983394c6b6 26 #
edamame22 0:29983394c6b6 27 include toolchain_rules.mk
edamame22 0:29983394c6b6 28
edamame22 0:29983394c6b6 29 $(eval $(call generate_rules,$(LIB),$(SRCS)))
edamame22 0:29983394c6b6 30
edamame22 0:29983394c6b6 31 # Extend default clean rule
edamame22 0:29983394c6b6 32 clean: clean-extra
edamame22 0:29983394c6b6 33
edamame22 0:29983394c6b6 34 $(TESTDIRS):
edamame22 0:29983394c6b6 35 @yotta target frdm-k64f-gcc
edamame22 0:29983394c6b6 36 @yotta install mbed-client
edamame22 0:29983394c6b6 37 @yotta install mbed-client-mbed-os
edamame22 0:29983394c6b6 38 @make -C $(@:build-%=%)
edamame22 0:29983394c6b6 39
edamame22 0:29983394c6b6 40 $(CLEANDIRS):
edamame22 0:29983394c6b6 41 @make -C $(@:clean-%=%) clean
edamame22 0:29983394c6b6 42
edamame22 0:29983394c6b6 43 $(CLEANTESTDIRS):
edamame22 0:29983394c6b6 44 @make -C $(@:clean-%=%) clean
edamame22 0:29983394c6b6 45
edamame22 0:29983394c6b6 46 .PHONY: test
edamame22 0:29983394c6b6 47 test: $(TESTDIRS)
edamame22 0:29983394c6b6 48 @rm -rf ./lcov
edamame22 0:29983394c6b6 49 @rm -rf ./coverage
edamame22 0:29983394c6b6 50 @mkdir -p lcov
edamame22 0:29983394c6b6 51 @mkdir -p lcov/results
edamame22 0:29983394c6b6 52 @mkdir coverage
edamame22 0:29983394c6b6 53 @find ./test -name '*.xml' | xargs cp -t ./lcov/results/
edamame22 0:29983394c6b6 54 @rm -f lcov/index.xml
edamame22 0:29983394c6b6 55 @./xsl_script.sh
edamame22 0:29983394c6b6 56 @cp junit_xsl.xslt lcov/.
edamame22 0:29983394c6b6 57 @xsltproc -o lcov/testresults.html lcov/junit_xsl.xslt lcov/index.xml
edamame22 0:29983394c6b6 58 @rm -f lcov/junit_xsl.xslt
edamame22 0:29983394c6b6 59 @rm -f lcov/index.xml
edamame22 0:29983394c6b6 60 @find ./ -name '*.gcno' | xargs cp --backup=numbered -t ./coverage/
edamame22 0:29983394c6b6 61 @find ./ -name '*.gcda' | xargs cp --backup=numbered -t ./coverage/
edamame22 0:29983394c6b6 62 gcovr --object-directory ./coverage --exclude-unreachable-branches --exclude '/usr' --exclude '.*mbed-client-mbed-tls_unit_tests_master*.' --exclude '.*mbed-client-mbed-os*.' --exclude '.*common*.' --exclude '.*mbed-net-sockets.v0*.' --exclude '.*stub*.' --exclude '/yotta_modules/' -x -o ./lcov/gcovr.xml
edamame22 0:29983394c6b6 63 @lcov -d test/. -c -o $(COVERAGEFILE)
edamame22 0:29983394c6b6 64 @lcov -q -r $(COVERAGEFILE) "/usr*" -o $(COVERAGEFILE)
edamame22 0:29983394c6b6 65 @lcov -q -r $(COVERAGEFILE) "/test*" -o $(COVERAGEFILE)
edamame22 0:29983394c6b6 66 @lcov -q -r $(COVERAGEFILE) "/mbed-client/*" -o $(COVERAGEFILE)
edamame22 0:29983394c6b6 67 @genhtml -q $(COVERAGEFILE) --show-details --output-directory lcov/html
edamame22 0:29983394c6b6 68 @yotta uninstall mbed-client
edamame22 0:29983394c6b6 69 @yotta uninstall mbed-client-mbed-os
edamame22 0:29983394c6b6 70 @echo mbed-client-mbed-tls module unit tests built
edamame22 0:29983394c6b6 71
edamame22 0:29983394c6b6 72 clean-extra: $(CLEANDIRS) \
edamame22 0:29983394c6b6 73 $(CLEANTESTDIRS)