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/
pal/Test/Unity/test/testdata/mocksample.c@2:b894b3508057, 2017-09-05 (annotated)
- 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?
User | Revision | Line number | New contents of line |
---|---|---|---|
edamame22 | 0:29983394c6b6 | 1 | // This is just a sample test file to be used to test the generator script |
edamame22 | 0:29983394c6b6 | 2 | #ifndef TEST_SAMPLE_H |
edamame22 | 0:29983394c6b6 | 3 | #define TEST_SAMPLE_H |
edamame22 | 0:29983394c6b6 | 4 | |
edamame22 | 0:29983394c6b6 | 5 | #include <setjmp.h> |
edamame22 | 0:29983394c6b6 | 6 | #include "unity.h" |
edamame22 | 0:29983394c6b6 | 7 | #include "funky.h" |
edamame22 | 0:29983394c6b6 | 8 | #include "Mockstanky.h" |
edamame22 | 0:29983394c6b6 | 9 | |
edamame22 | 0:29983394c6b6 | 10 | void setUp(void) |
edamame22 | 0:29983394c6b6 | 11 | { |
edamame22 | 0:29983394c6b6 | 12 | CustomSetupStuff(); |
edamame22 | 0:29983394c6b6 | 13 | } |
edamame22 | 0:29983394c6b6 | 14 | |
edamame22 | 0:29983394c6b6 | 15 | void tearDown(void) |
edamame22 | 0:29983394c6b6 | 16 | { |
edamame22 | 0:29983394c6b6 | 17 | CustomTeardownStuff |
edamame22 | 0:29983394c6b6 | 18 | } |
edamame22 | 0:29983394c6b6 | 19 | |
edamame22 | 0:29983394c6b6 | 20 | //Yup, nice comment |
edamame22 | 0:29983394c6b6 | 21 | void test_TheFirstThingToTest(void) |
edamame22 | 0:29983394c6b6 | 22 | { |
edamame22 | 0:29983394c6b6 | 23 | TEST_ASSERT(1); |
edamame22 | 0:29983394c6b6 | 24 | |
edamame22 | 0:29983394c6b6 | 25 | TEST_ASSERT_TRUE(1); |
edamame22 | 0:29983394c6b6 | 26 | } |
edamame22 | 0:29983394c6b6 | 27 | |
edamame22 | 0:29983394c6b6 | 28 | /* |
edamame22 | 0:29983394c6b6 | 29 | void test_ShouldBeIgnored(void) |
edamame22 | 0:29983394c6b6 | 30 | { |
edamame22 | 0:29983394c6b6 | 31 | DoesStuff(); |
edamame22 | 0:29983394c6b6 | 32 | } |
edamame22 | 0:29983394c6b6 | 33 | */ |
edamame22 | 0:29983394c6b6 | 34 | |
edamame22 | 0:29983394c6b6 | 35 | //void test_ShouldAlsoNotBeTested(void) |
edamame22 | 0:29983394c6b6 | 36 | //{ |
edamame22 | 0:29983394c6b6 | 37 | // Call_An_Expect(); |
edamame22 | 0:29983394c6b6 | 38 | // |
edamame22 | 0:29983394c6b6 | 39 | // CallAFunction(); |
edamame22 | 0:29983394c6b6 | 40 | // test_CallAFunctionThatLooksLikeATest(); |
edamame22 | 0:29983394c6b6 | 41 | //} |
edamame22 | 0:29983394c6b6 | 42 | |
edamame22 | 0:29983394c6b6 | 43 | void test_TheSecondThingToTest(void) |
edamame22 | 0:29983394c6b6 | 44 | { |
edamame22 | 0:29983394c6b6 | 45 | Call_An_Expect(); |
edamame22 | 0:29983394c6b6 | 46 | |
edamame22 | 0:29983394c6b6 | 47 | CallAFunction(); |
edamame22 | 0:29983394c6b6 | 48 | test_CallAFunctionThatLooksLikeATest(); |
edamame22 | 0:29983394c6b6 | 49 | } |
edamame22 | 0:29983394c6b6 | 50 | |
edamame22 | 0:29983394c6b6 | 51 | #endif //TEST_SAMPLE_H |