New cellular update
Fork of ublox-at-cellular-interface-ext by
TESTS/unit_tests/cell-locate/main.cpp@5:9fd89567f769, 2017-06-13 (annotated)
- Committer:
- rob.meades@u-blox.com
- Date:
- Tue Jun 13 00:12:01 2017 +0100
- Revision:
- 5:9fd89567f769
- Parent:
- 1:26a67ab07275
- Child:
- 11:3631f62bb359
Updated to use u-blox cellular libraries outside mbed but NOT yet fully working on C027. Please hold off from using this library on C027 for now until a commit comes along stating that it is tested and working on C027.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
RobMeades | 0:0b75e22c9231 | 1 | #include "mbed.h" |
RobMeades | 0:0b75e22c9231 | 2 | #include "greentea-client/test_env.h" |
RobMeades | 0:0b75e22c9231 | 3 | #include "unity.h" |
RobMeades | 0:0b75e22c9231 | 4 | #include "utest.h" |
RobMeades | 0:0b75e22c9231 | 5 | #include "UbloxATCellularInterfaceExt.h" |
RobMeades | 0:0b75e22c9231 | 6 | #include "UDPSocket.h" |
rob.meades@u-blox.com | 5:9fd89567f769 | 7 | #ifdef FEATURE_COMMON_PAL |
RobMeades | 0:0b75e22c9231 | 8 | #include "mbed_trace.h" |
RobMeades | 0:0b75e22c9231 | 9 | #define TRACE_GROUP "TEST" |
rob.meades@u-blox.com | 5:9fd89567f769 | 10 | #else |
rob.meades@u-blox.com | 5:9fd89567f769 | 11 | #define tr_debug(format, ...) debug(format "\n", ## __VA_ARGS__) |
rob.meades@u-blox.com | 5:9fd89567f769 | 12 | #define tr_info(format, ...) debug(format "\n", ## __VA_ARGS__) |
rob.meades@u-blox.com | 5:9fd89567f769 | 13 | #define tr_warn(format, ...) debug(format "\n", ## __VA_ARGS__) |
rob.meades@u-blox.com | 5:9fd89567f769 | 14 | #define tr_error(format, ...) debug(format "\n", ## __VA_ARGS__) |
rob.meades@u-blox.com | 5:9fd89567f769 | 15 | #endif |
RobMeades | 0:0b75e22c9231 | 16 | |
RobMeades | 0:0b75e22c9231 | 17 | using namespace utest::v1; |
RobMeades | 0:0b75e22c9231 | 18 | |
RobMeades | 0:0b75e22c9231 | 19 | // ---------------------------------------------------------------- |
RobMeades | 0:0b75e22c9231 | 20 | // COMPILE-TIME MACROS |
RobMeades | 0:0b75e22c9231 | 21 | // ---------------------------------------------------------------- |
RobMeades | 0:0b75e22c9231 | 22 | |
RobMeades | 0:0b75e22c9231 | 23 | // These macros can be overridden with an mbed_app.json file and |
RobMeades | 0:0b75e22c9231 | 24 | // contents of the following form: |
RobMeades | 0:0b75e22c9231 | 25 | // |
RobMeades | 0:0b75e22c9231 | 26 | //{ |
RobMeades | 0:0b75e22c9231 | 27 | // "config": { |
RobMeades | 0:0b75e22c9231 | 28 | // "apn": { |
RobMeades | 0:0b75e22c9231 | 29 | // "value": "\"my_apn\"" |
RobMeades | 0:0b75e22c9231 | 30 | // }, |
RobMeades | 0:0b75e22c9231 | 31 | // "run-tcp-server-test": { |
RobMeades | 0:0b75e22c9231 | 32 | // "value": 1 |
RobMeades | 0:0b75e22c9231 | 33 | // }, |
RobMeades | 0:0b75e22c9231 | 34 | // "mga-token": { |
RobMeades | 0:0b75e22c9231 | 35 | // "value": "\"my_token\"" |
RobMeades | 0:0b75e22c9231 | 36 | // } |
RobMeades | 0:0b75e22c9231 | 37 | //} |
RobMeades | 0:0b75e22c9231 | 38 | |
RobMeades | 0:0b75e22c9231 | 39 | // The credentials of the SIM in the board. |
RobMeades | 0:0b75e22c9231 | 40 | #ifndef MBED_CONF_APP_DEFAULT_PIN |
RobMeades | 0:0b75e22c9231 | 41 | // Note: this is the PIN for the SIM with ICCID |
RobMeades | 0:0b75e22c9231 | 42 | // 8944501104169548380. |
RobMeades | 0:0b75e22c9231 | 43 | # define MBED_CONF_APP_DEFAULT_PIN "5134" |
RobMeades | 0:0b75e22c9231 | 44 | #endif |
RobMeades | 0:0b75e22c9231 | 45 | |
RobMeades | 0:0b75e22c9231 | 46 | // Network credentials. |
RobMeades | 0:0b75e22c9231 | 47 | #ifndef MBED_CONF_APP_APN |
RobMeades | 0:0b75e22c9231 | 48 | # define MBED_CONF_APP_APN NULL |
RobMeades | 0:0b75e22c9231 | 49 | #endif |
RobMeades | 0:0b75e22c9231 | 50 | #ifndef MBED_CONF_APP_USERNAME |
RobMeades | 0:0b75e22c9231 | 51 | # define MBED_CONF_APP_USERNAME NULL |
RobMeades | 0:0b75e22c9231 | 52 | #endif |
RobMeades | 0:0b75e22c9231 | 53 | #ifndef MBED_CONF_APP_PASSWORD |
RobMeades | 0:0b75e22c9231 | 54 | # define MBED_CONF_APP_PASSWORD NULL |
RobMeades | 0:0b75e22c9231 | 55 | #endif |
RobMeades | 0:0b75e22c9231 | 56 | |
RobMeades | 0:0b75e22c9231 | 57 | #ifndef MBED_CONF_APP_RUN_CELL_LOCATE_TCP_SERVER_TEST |
RobMeades | 0:0b75e22c9231 | 58 | # define MBED_CONF_APP_RUN_CELL_LOCATE_TCP_SERVER_TEST 0 |
RobMeades | 0:0b75e22c9231 | 59 | #endif |
RobMeades | 0:0b75e22c9231 | 60 | |
RobMeades | 0:0b75e22c9231 | 61 | // The authentication token for TCP access to the MGA server. |
RobMeades | 0:0b75e22c9231 | 62 | #if MBED_CONF_APP_RUN_CELL_LOCATE_TCP_SERVER_TEST |
RobMeades | 0:0b75e22c9231 | 63 | # ifndef MBED_CONF_APP_CELL_LOCATE_MGA_TOKEN |
RobMeades | 0:0b75e22c9231 | 64 | # error "You must have a token for MGA server access to run Cell Locate with a TCP server" |
RobMeades | 0:0b75e22c9231 | 65 | # endif |
RobMeades | 0:0b75e22c9231 | 66 | #endif |
RobMeades | 0:0b75e22c9231 | 67 | |
RobMeades | 0:0b75e22c9231 | 68 | // The type of response requested |
RobMeades | 0:0b75e22c9231 | 69 | #ifndef MBED_CONF_APP_RESP_TYPE |
RobMeades | 0:0b75e22c9231 | 70 | # define MBED_CONF_APP_RESP_TYPE 1 // CELL_DETAILED |
RobMeades | 0:0b75e22c9231 | 71 | #endif |
RobMeades | 0:0b75e22c9231 | 72 | |
RobMeades | 0:0b75e22c9231 | 73 | // The maximum number of hypotheses requested |
RobMeades | 0:0b75e22c9231 | 74 | #ifndef MBED_CONF_APP_CELL_LOCATE_MAX_NUM_HYPOTHESIS |
RobMeades | 0:0b75e22c9231 | 75 | # if MBED_CONF_APP_RESP_TYPE == 2 // CELL_MULTIHYP |
RobMeades | 0:0b75e22c9231 | 76 | # define MBED_CONF_APP_CELL_LOCATE_MAX_NUM_HYPOTHESIS 16 |
RobMeades | 0:0b75e22c9231 | 77 | # else |
RobMeades | 0:0b75e22c9231 | 78 | # define MBED_CONF_APP_CELL_LOCATE_MAX_NUM_HYPOTHESIS 1 |
RobMeades | 0:0b75e22c9231 | 79 | # endif |
RobMeades | 0:0b75e22c9231 | 80 | #endif |
RobMeades | 0:0b75e22c9231 | 81 | |
RobMeades | 0:0b75e22c9231 | 82 | #ifndef MBED_CONF_APP_CELL_LOCATE_MGA_TOKEN |
RobMeades | 0:0b75e22c9231 | 83 | # define MBED_CONF_APP_CELL_LOCATE_MGA_TOKEN "0" |
RobMeades | 0:0b75e22c9231 | 84 | #endif |
RobMeades | 0:0b75e22c9231 | 85 | |
RobMeades | 0:0b75e22c9231 | 86 | // ---------------------------------------------------------------- |
RobMeades | 0:0b75e22c9231 | 87 | // PRIVATE VARIABLES |
RobMeades | 0:0b75e22c9231 | 88 | // ---------------------------------------------------------------- |
RobMeades | 0:0b75e22c9231 | 89 | |
rob.meades@u-blox.com | 5:9fd89567f769 | 90 | #ifdef FEATURE_COMMON_PAL |
RobMeades | 0:0b75e22c9231 | 91 | // Lock for debug prints |
RobMeades | 0:0b75e22c9231 | 92 | static Mutex mtx; |
rob.meades@u-blox.com | 5:9fd89567f769 | 93 | #endif |
RobMeades | 0:0b75e22c9231 | 94 | |
rob.meades@u-blox.com | 1:26a67ab07275 | 95 | // Power up GNSS |
rob.meades@u-blox.com | 1:26a67ab07275 | 96 | #ifdef TARGET_UBLOX_C030 |
rob.meades@u-blox.com | 1:26a67ab07275 | 97 | static DigitalInOut gnssEnable(GNSSEN, PIN_OUTPUT, PushPullNoPull, 1); |
rob.meades@u-blox.com | 1:26a67ab07275 | 98 | #elif TARGET_UBLOX_C027 |
rob.meades@u-blox.com | 1:26a67ab07275 | 99 | static DigitalOut gnssEnable(GNSSEN, 1); |
rob.meades@u-blox.com | 1:26a67ab07275 | 100 | #endif |
rob.meades@u-blox.com | 1:26a67ab07275 | 101 | |
RobMeades | 0:0b75e22c9231 | 102 | // An instance of the cellular interface |
RobMeades | 0:0b75e22c9231 | 103 | static UbloxATCellularInterfaceExt *pDriver = |
RobMeades | 0:0b75e22c9231 | 104 | new UbloxATCellularInterfaceExt(MDMTXD, MDMRXD, |
RobMeades | 0:0b75e22c9231 | 105 | MBED_CONF_UBLOX_CELL_BAUD_RATE, |
RobMeades | 0:0b75e22c9231 | 106 | true); |
RobMeades | 0:0b75e22c9231 | 107 | |
RobMeades | 0:0b75e22c9231 | 108 | // ---------------------------------------------------------------- |
RobMeades | 0:0b75e22c9231 | 109 | // PRIVATE FUNCTIONS |
RobMeades | 0:0b75e22c9231 | 110 | // ---------------------------------------------------------------- |
RobMeades | 0:0b75e22c9231 | 111 | |
rob.meades@u-blox.com | 5:9fd89567f769 | 112 | #ifdef FEATURE_COMMON_PAL |
RobMeades | 0:0b75e22c9231 | 113 | // Locks for debug prints |
RobMeades | 0:0b75e22c9231 | 114 | static void lock() |
RobMeades | 0:0b75e22c9231 | 115 | { |
RobMeades | 0:0b75e22c9231 | 116 | mtx.lock(); |
RobMeades | 0:0b75e22c9231 | 117 | } |
RobMeades | 0:0b75e22c9231 | 118 | |
RobMeades | 0:0b75e22c9231 | 119 | static void unlock() |
RobMeades | 0:0b75e22c9231 | 120 | { |
RobMeades | 0:0b75e22c9231 | 121 | mtx.unlock(); |
RobMeades | 0:0b75e22c9231 | 122 | } |
rob.meades@u-blox.com | 5:9fd89567f769 | 123 | #endif |
RobMeades | 0:0b75e22c9231 | 124 | |
RobMeades | 0:0b75e22c9231 | 125 | static void printCellLocateData(UbloxATCellularInterfaceExt::CellLocData *pData) |
RobMeades | 0:0b75e22c9231 | 126 | { |
RobMeades | 0:0b75e22c9231 | 127 | char timeString[25]; |
RobMeades | 0:0b75e22c9231 | 128 | |
RobMeades | 0:0b75e22c9231 | 129 | tr_debug("Cell Locate data:"); |
rob.meades@u-blox.com | 1:26a67ab07275 | 130 | if (strftime(timeString, sizeof(timeString), "%F %T", (const tm *) &(pData->time)) > 0) { |
RobMeades | 0:0b75e22c9231 | 131 | tr_debug(" time: %s", timeString); |
RobMeades | 0:0b75e22c9231 | 132 | } |
RobMeades | 0:0b75e22c9231 | 133 | tr_debug(" longitude: %.6f", pData->longitude); |
RobMeades | 0:0b75e22c9231 | 134 | tr_debug(" latitude: %.6f", pData->latitude); |
rob.meades@u-blox.com | 1:26a67ab07275 | 135 | tr_debug(" altitude: %d metre(s)", pData->altitude); |
RobMeades | 0:0b75e22c9231 | 136 | switch (pData->sensor) { |
RobMeades | 0:0b75e22c9231 | 137 | case UbloxATCellularInterfaceExt::CELL_LAST: |
RobMeades | 0:0b75e22c9231 | 138 | tr_debug(" sensor type: last"); |
RobMeades | 0:0b75e22c9231 | 139 | break; |
RobMeades | 0:0b75e22c9231 | 140 | case UbloxATCellularInterfaceExt::CELL_GNSS: |
RobMeades | 0:0b75e22c9231 | 141 | tr_debug(" sensor type: GNSS"); |
RobMeades | 0:0b75e22c9231 | 142 | break; |
RobMeades | 0:0b75e22c9231 | 143 | case UbloxATCellularInterfaceExt::CELL_LOCATE: |
RobMeades | 0:0b75e22c9231 | 144 | tr_debug(" sensor type: Cell Locate"); |
RobMeades | 0:0b75e22c9231 | 145 | break; |
RobMeades | 0:0b75e22c9231 | 146 | case UbloxATCellularInterfaceExt::CELL_HYBRID: |
RobMeades | 0:0b75e22c9231 | 147 | tr_debug(" sensor type: hybrid"); |
RobMeades | 0:0b75e22c9231 | 148 | break; |
RobMeades | 0:0b75e22c9231 | 149 | default: |
RobMeades | 0:0b75e22c9231 | 150 | tr_debug(" sensor type: unknown"); |
RobMeades | 0:0b75e22c9231 | 151 | break; |
RobMeades | 0:0b75e22c9231 | 152 | } |
rob.meades@u-blox.com | 1:26a67ab07275 | 153 | tr_debug(" uncertainty: %d metre(s)", pData->uncertainty); |
rob.meades@u-blox.com | 1:26a67ab07275 | 154 | tr_debug(" speed: %d metre(s)/second", pData->speed); |
rob.meades@u-blox.com | 1:26a67ab07275 | 155 | tr_debug(" direction: %d degree(s)", pData->direction); |
rob.meades@u-blox.com | 1:26a67ab07275 | 156 | tr_debug(" vertical accuracy: %d metre(s)/second", pData->speed); |
rob.meades@u-blox.com | 1:26a67ab07275 | 157 | tr_debug(" satellite(s) used: %d", pData->svUsed); |
rob.meades@u-blox.com | 1:26a67ab07275 | 158 | tr_debug("I am here: " |
rob.meades@u-blox.com | 1:26a67ab07275 | 159 | "https://maps.google.com/?q=%.5f,%.5f", pData->latitude, pData->longitude); |
RobMeades | 0:0b75e22c9231 | 160 | } |
RobMeades | 0:0b75e22c9231 | 161 | |
RobMeades | 0:0b75e22c9231 | 162 | // ---------------------------------------------------------------- |
RobMeades | 0:0b75e22c9231 | 163 | // TESTS |
RobMeades | 0:0b75e22c9231 | 164 | // ---------------------------------------------------------------- |
RobMeades | 0:0b75e22c9231 | 165 | |
RobMeades | 0:0b75e22c9231 | 166 | // Test Cell Locate talking to a UDP server |
RobMeades | 0:0b75e22c9231 | 167 | void test_udp_server() { |
RobMeades | 0:0b75e22c9231 | 168 | int numRes = 0; |
RobMeades | 0:0b75e22c9231 | 169 | UbloxATCellularInterfaceExt::CellLocData data; |
RobMeades | 0:0b75e22c9231 | 170 | |
RobMeades | 0:0b75e22c9231 | 171 | memset(&data, 0, sizeof(data)); |
RobMeades | 0:0b75e22c9231 | 172 | TEST_ASSERT(pDriver->connect(MBED_CONF_APP_DEFAULT_PIN, MBED_CONF_APP_APN, |
RobMeades | 0:0b75e22c9231 | 173 | MBED_CONF_APP_USERNAME, MBED_CONF_APP_PASSWORD) == 0); |
RobMeades | 0:0b75e22c9231 | 174 | |
RobMeades | 0:0b75e22c9231 | 175 | TEST_ASSERT(pDriver->cellLocSrvUdp()); |
RobMeades | 0:0b75e22c9231 | 176 | TEST_ASSERT(pDriver->cellLocConfig(1)); |
RobMeades | 0:0b75e22c9231 | 177 | TEST_ASSERT(pDriver->cellLocRequest(UbloxATCellularInterfaceExt::CELL_HYBRID, 10, 100, |
RobMeades | 0:0b75e22c9231 | 178 | (UbloxATCellularInterfaceExt::CellRespType) MBED_CONF_APP_RESP_TYPE, |
RobMeades | 0:0b75e22c9231 | 179 | MBED_CONF_APP_CELL_LOCATE_MAX_NUM_HYPOTHESIS)); |
RobMeades | 0:0b75e22c9231 | 180 | |
RobMeades | 0:0b75e22c9231 | 181 | for (int x = 0; (numRes == 0) && (x < 10); x++) { |
RobMeades | 0:0b75e22c9231 | 182 | numRes = pDriver->cellLocGetRes(); |
RobMeades | 0:0b75e22c9231 | 183 | } |
RobMeades | 0:0b75e22c9231 | 184 | |
RobMeades | 0:0b75e22c9231 | 185 | TEST_ASSERT(numRes > 0); |
RobMeades | 0:0b75e22c9231 | 186 | TEST_ASSERT(pDriver->cellLocGetData(&data)); |
RobMeades | 0:0b75e22c9231 | 187 | |
RobMeades | 0:0b75e22c9231 | 188 | TEST_ASSERT(data.validData); |
RobMeades | 0:0b75e22c9231 | 189 | |
RobMeades | 0:0b75e22c9231 | 190 | printCellLocateData(&data); |
RobMeades | 0:0b75e22c9231 | 191 | |
RobMeades | 0:0b75e22c9231 | 192 | TEST_ASSERT(pDriver->disconnect() == 0); |
RobMeades | 0:0b75e22c9231 | 193 | // Wait for printfs to leave the building or the test result string gets messed up |
RobMeades | 0:0b75e22c9231 | 194 | wait_ms(500); |
RobMeades | 0:0b75e22c9231 | 195 | } |
RobMeades | 0:0b75e22c9231 | 196 | |
RobMeades | 0:0b75e22c9231 | 197 | // Test Cell Locate talking to a TCP server |
RobMeades | 0:0b75e22c9231 | 198 | void test_tcp_server() { |
RobMeades | 0:0b75e22c9231 | 199 | int numRes = 0; |
RobMeades | 0:0b75e22c9231 | 200 | UbloxATCellularInterfaceExt::CellLocData data; |
RobMeades | 0:0b75e22c9231 | 201 | |
RobMeades | 0:0b75e22c9231 | 202 | memset(&data, 0, sizeof(data)); |
RobMeades | 0:0b75e22c9231 | 203 | TEST_ASSERT(pDriver->connect(MBED_CONF_APP_DEFAULT_PIN, MBED_CONF_APP_APN, |
RobMeades | 0:0b75e22c9231 | 204 | MBED_CONF_APP_USERNAME, MBED_CONF_APP_PASSWORD) == 0); |
RobMeades | 0:0b75e22c9231 | 205 | |
RobMeades | 0:0b75e22c9231 | 206 | TEST_ASSERT(pDriver->cellLocSrvTcp(MBED_CONF_APP_CELL_LOCATE_MGA_TOKEN)); |
RobMeades | 0:0b75e22c9231 | 207 | TEST_ASSERT(pDriver->cellLocConfig(1)); |
RobMeades | 0:0b75e22c9231 | 208 | TEST_ASSERT(pDriver->cellLocRequest(UbloxATCellularInterfaceExt::CELL_HYBRID, 10, 100, |
RobMeades | 0:0b75e22c9231 | 209 | (UbloxATCellularInterfaceExt::CellRespType) MBED_CONF_APP_RESP_TYPE, |
RobMeades | 0:0b75e22c9231 | 210 | MBED_CONF_APP_CELL_LOCATE_MAX_NUM_HYPOTHESIS)); |
RobMeades | 0:0b75e22c9231 | 211 | |
RobMeades | 0:0b75e22c9231 | 212 | for (int x = 0; (numRes == 0) && (x < 10); x++) { |
RobMeades | 0:0b75e22c9231 | 213 | numRes = pDriver->cellLocGetRes(); |
RobMeades | 0:0b75e22c9231 | 214 | } |
RobMeades | 0:0b75e22c9231 | 215 | |
RobMeades | 0:0b75e22c9231 | 216 | TEST_ASSERT(numRes > 0); |
RobMeades | 0:0b75e22c9231 | 217 | TEST_ASSERT(pDriver->cellLocGetData(&data)); |
RobMeades | 0:0b75e22c9231 | 218 | |
RobMeades | 0:0b75e22c9231 | 219 | TEST_ASSERT(data.validData); |
RobMeades | 0:0b75e22c9231 | 220 | |
RobMeades | 0:0b75e22c9231 | 221 | printCellLocateData(&data); |
RobMeades | 0:0b75e22c9231 | 222 | |
RobMeades | 0:0b75e22c9231 | 223 | TEST_ASSERT(pDriver->disconnect() == 0); |
RobMeades | 0:0b75e22c9231 | 224 | // Wait for printfs to leave the building or the test result string gets messed up |
RobMeades | 0:0b75e22c9231 | 225 | wait_ms(500); |
RobMeades | 0:0b75e22c9231 | 226 | } |
RobMeades | 0:0b75e22c9231 | 227 | |
RobMeades | 0:0b75e22c9231 | 228 | // Tidy up after testing so as not to screw with the test output strings |
RobMeades | 0:0b75e22c9231 | 229 | void test_tidy_up() { |
RobMeades | 0:0b75e22c9231 | 230 | pDriver->deinit(); |
RobMeades | 0:0b75e22c9231 | 231 | } |
RobMeades | 0:0b75e22c9231 | 232 | |
RobMeades | 0:0b75e22c9231 | 233 | // ---------------------------------------------------------------- |
RobMeades | 0:0b75e22c9231 | 234 | // TEST ENVIRONMENT |
RobMeades | 0:0b75e22c9231 | 235 | // ---------------------------------------------------------------- |
RobMeades | 0:0b75e22c9231 | 236 | |
RobMeades | 0:0b75e22c9231 | 237 | // Setup the test environment |
RobMeades | 0:0b75e22c9231 | 238 | utest::v1::status_t test_setup(const size_t number_of_cases) { |
RobMeades | 0:0b75e22c9231 | 239 | // Setup Greentea with a timeout |
RobMeades | 0:0b75e22c9231 | 240 | GREENTEA_SETUP(540, "default_auto"); |
RobMeades | 0:0b75e22c9231 | 241 | return verbose_test_setup_handler(number_of_cases); |
RobMeades | 0:0b75e22c9231 | 242 | } |
RobMeades | 0:0b75e22c9231 | 243 | |
RobMeades | 0:0b75e22c9231 | 244 | // Test cases |
RobMeades | 0:0b75e22c9231 | 245 | Case cases[] = { |
RobMeades | 0:0b75e22c9231 | 246 | Case("Cell Locate with UDP server", test_udp_server), |
RobMeades | 0:0b75e22c9231 | 247 | #if MBED_CONF_APP_RUN_CELL_LOCATE_TCP_SERVER_TEST |
RobMeades | 0:0b75e22c9231 | 248 | Case("Cell Locate with TCP server", test_tcp_server), |
RobMeades | 0:0b75e22c9231 | 249 | #endif |
RobMeades | 0:0b75e22c9231 | 250 | Case("Tidy up", test_tidy_up) |
RobMeades | 0:0b75e22c9231 | 251 | }; |
RobMeades | 0:0b75e22c9231 | 252 | |
RobMeades | 0:0b75e22c9231 | 253 | Specification specification(test_setup, cases); |
RobMeades | 0:0b75e22c9231 | 254 | |
RobMeades | 0:0b75e22c9231 | 255 | // ---------------------------------------------------------------- |
RobMeades | 0:0b75e22c9231 | 256 | // MAIN |
RobMeades | 0:0b75e22c9231 | 257 | // ---------------------------------------------------------------- |
RobMeades | 0:0b75e22c9231 | 258 | |
RobMeades | 0:0b75e22c9231 | 259 | int main() { |
rob.meades@u-blox.com | 5:9fd89567f769 | 260 | |
rob.meades@u-blox.com | 5:9fd89567f769 | 261 | #ifdef FEATURE_COMMON_PAL |
RobMeades | 0:0b75e22c9231 | 262 | mbed_trace_init(); |
RobMeades | 0:0b75e22c9231 | 263 | |
RobMeades | 0:0b75e22c9231 | 264 | mbed_trace_mutex_wait_function_set(lock); |
RobMeades | 0:0b75e22c9231 | 265 | mbed_trace_mutex_release_function_set(unlock); |
rob.meades@u-blox.com | 5:9fd89567f769 | 266 | #endif |
RobMeades | 0:0b75e22c9231 | 267 | |
RobMeades | 0:0b75e22c9231 | 268 | // Run tests |
RobMeades | 0:0b75e22c9231 | 269 | return !Harness::run(specification); |
RobMeades | 0:0b75e22c9231 | 270 | } |
RobMeades | 0:0b75e22c9231 | 271 | |
RobMeades | 0:0b75e22c9231 | 272 | // End Of File |
RobMeades | 0:0b75e22c9231 | 273 |