New cellular update
Fork of ublox-at-cellular-interface-ext by
TESTS/unit_tests/cell-locate/main.cpp@22:46b7bd7979f0, 2019-02-18 (annotated)
- Committer:
- fahim.alavi@u-blox.com
- Date:
- Mon Feb 18 11:47:02 2019 +0500
- Revision:
- 22:46b7bd7979f0
- Parent:
- 11:3631f62bb359
Sync fork from master
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 | |
rob.meades@u-blox.com | 11:3631f62bb359 | 39 | // Whether debug trace is on |
rob.meades@u-blox.com | 11:3631f62bb359 | 40 | #ifndef MBED_CONF_APP_DEBUG_ON |
rob.meades@u-blox.com | 11:3631f62bb359 | 41 | # define MBED_CONF_APP_DEBUG_ON false |
rob.meades@u-blox.com | 11:3631f62bb359 | 42 | #endif |
rob.meades@u-blox.com | 11:3631f62bb359 | 43 | |
RobMeades | 0:0b75e22c9231 | 44 | // The credentials of the SIM in the board. |
RobMeades | 0:0b75e22c9231 | 45 | #ifndef MBED_CONF_APP_DEFAULT_PIN |
rob.meades@u-blox.com | 11:3631f62bb359 | 46 | // Note: if PIN is enabled on your SIM, you must define the PIN |
rob.meades@u-blox.com | 11:3631f62bb359 | 47 | // for your SIM jere (e.g. using mbed_app.json to do so). |
rob.meades@u-blox.com | 11:3631f62bb359 | 48 | # define MBED_CONF_APP_DEFAULT_PIN "0000" |
RobMeades | 0:0b75e22c9231 | 49 | #endif |
RobMeades | 0:0b75e22c9231 | 50 | |
RobMeades | 0:0b75e22c9231 | 51 | // Network credentials. |
RobMeades | 0:0b75e22c9231 | 52 | #ifndef MBED_CONF_APP_APN |
RobMeades | 0:0b75e22c9231 | 53 | # define MBED_CONF_APP_APN NULL |
RobMeades | 0:0b75e22c9231 | 54 | #endif |
RobMeades | 0:0b75e22c9231 | 55 | #ifndef MBED_CONF_APP_USERNAME |
RobMeades | 0:0b75e22c9231 | 56 | # define MBED_CONF_APP_USERNAME NULL |
RobMeades | 0:0b75e22c9231 | 57 | #endif |
RobMeades | 0:0b75e22c9231 | 58 | #ifndef MBED_CONF_APP_PASSWORD |
RobMeades | 0:0b75e22c9231 | 59 | # define MBED_CONF_APP_PASSWORD NULL |
RobMeades | 0:0b75e22c9231 | 60 | #endif |
RobMeades | 0:0b75e22c9231 | 61 | |
RobMeades | 0:0b75e22c9231 | 62 | #ifndef MBED_CONF_APP_RUN_CELL_LOCATE_TCP_SERVER_TEST |
RobMeades | 0:0b75e22c9231 | 63 | # define MBED_CONF_APP_RUN_CELL_LOCATE_TCP_SERVER_TEST 0 |
RobMeades | 0:0b75e22c9231 | 64 | #endif |
RobMeades | 0:0b75e22c9231 | 65 | |
RobMeades | 0:0b75e22c9231 | 66 | // The authentication token for TCP access to the MGA server. |
RobMeades | 0:0b75e22c9231 | 67 | #if MBED_CONF_APP_RUN_CELL_LOCATE_TCP_SERVER_TEST |
RobMeades | 0:0b75e22c9231 | 68 | # ifndef MBED_CONF_APP_CELL_LOCATE_MGA_TOKEN |
RobMeades | 0:0b75e22c9231 | 69 | # error "You must have a token for MGA server access to run Cell Locate with a TCP server" |
RobMeades | 0:0b75e22c9231 | 70 | # endif |
RobMeades | 0:0b75e22c9231 | 71 | #endif |
RobMeades | 0:0b75e22c9231 | 72 | |
RobMeades | 0:0b75e22c9231 | 73 | // The type of response requested |
RobMeades | 0:0b75e22c9231 | 74 | #ifndef MBED_CONF_APP_RESP_TYPE |
RobMeades | 0:0b75e22c9231 | 75 | # define MBED_CONF_APP_RESP_TYPE 1 // CELL_DETAILED |
RobMeades | 0:0b75e22c9231 | 76 | #endif |
RobMeades | 0:0b75e22c9231 | 77 | |
RobMeades | 0:0b75e22c9231 | 78 | // The maximum number of hypotheses requested |
RobMeades | 0:0b75e22c9231 | 79 | #ifndef MBED_CONF_APP_CELL_LOCATE_MAX_NUM_HYPOTHESIS |
RobMeades | 0:0b75e22c9231 | 80 | # if MBED_CONF_APP_RESP_TYPE == 2 // CELL_MULTIHYP |
RobMeades | 0:0b75e22c9231 | 81 | # define MBED_CONF_APP_CELL_LOCATE_MAX_NUM_HYPOTHESIS 16 |
RobMeades | 0:0b75e22c9231 | 82 | # else |
RobMeades | 0:0b75e22c9231 | 83 | # define MBED_CONF_APP_CELL_LOCATE_MAX_NUM_HYPOTHESIS 1 |
RobMeades | 0:0b75e22c9231 | 84 | # endif |
RobMeades | 0:0b75e22c9231 | 85 | #endif |
RobMeades | 0:0b75e22c9231 | 86 | |
RobMeades | 0:0b75e22c9231 | 87 | #ifndef MBED_CONF_APP_CELL_LOCATE_MGA_TOKEN |
RobMeades | 0:0b75e22c9231 | 88 | # define MBED_CONF_APP_CELL_LOCATE_MGA_TOKEN "0" |
RobMeades | 0:0b75e22c9231 | 89 | #endif |
RobMeades | 0:0b75e22c9231 | 90 | |
RobMeades | 0:0b75e22c9231 | 91 | // ---------------------------------------------------------------- |
RobMeades | 0:0b75e22c9231 | 92 | // PRIVATE VARIABLES |
RobMeades | 0:0b75e22c9231 | 93 | // ---------------------------------------------------------------- |
RobMeades | 0:0b75e22c9231 | 94 | |
rob.meades@u-blox.com | 5:9fd89567f769 | 95 | #ifdef FEATURE_COMMON_PAL |
RobMeades | 0:0b75e22c9231 | 96 | // Lock for debug prints |
RobMeades | 0:0b75e22c9231 | 97 | static Mutex mtx; |
rob.meades@u-blox.com | 5:9fd89567f769 | 98 | #endif |
RobMeades | 0:0b75e22c9231 | 99 | |
rob.meades@u-blox.com | 1:26a67ab07275 | 100 | // Power up GNSS |
rob.meades@u-blox.com | 1:26a67ab07275 | 101 | #ifdef TARGET_UBLOX_C030 |
rob.meades@u-blox.com | 1:26a67ab07275 | 102 | static DigitalInOut gnssEnable(GNSSEN, PIN_OUTPUT, PushPullNoPull, 1); |
rob.meades@u-blox.com | 1:26a67ab07275 | 103 | #elif TARGET_UBLOX_C027 |
rob.meades@u-blox.com | 11:3631f62bb359 | 104 | static DigitalOut gnssEnable(GPSEN, 1); |
rob.meades@u-blox.com | 1:26a67ab07275 | 105 | #endif |
rob.meades@u-blox.com | 1:26a67ab07275 | 106 | |
RobMeades | 0:0b75e22c9231 | 107 | // An instance of the cellular interface |
RobMeades | 0:0b75e22c9231 | 108 | static UbloxATCellularInterfaceExt *pDriver = |
RobMeades | 0:0b75e22c9231 | 109 | new UbloxATCellularInterfaceExt(MDMTXD, MDMRXD, |
RobMeades | 0:0b75e22c9231 | 110 | MBED_CONF_UBLOX_CELL_BAUD_RATE, |
rob.meades@u-blox.com | 11:3631f62bb359 | 111 | MBED_CONF_APP_DEBUG_ON); |
RobMeades | 0:0b75e22c9231 | 112 | |
RobMeades | 0:0b75e22c9231 | 113 | // ---------------------------------------------------------------- |
RobMeades | 0:0b75e22c9231 | 114 | // PRIVATE FUNCTIONS |
RobMeades | 0:0b75e22c9231 | 115 | // ---------------------------------------------------------------- |
RobMeades | 0:0b75e22c9231 | 116 | |
rob.meades@u-blox.com | 5:9fd89567f769 | 117 | #ifdef FEATURE_COMMON_PAL |
RobMeades | 0:0b75e22c9231 | 118 | // Locks for debug prints |
RobMeades | 0:0b75e22c9231 | 119 | static void lock() |
RobMeades | 0:0b75e22c9231 | 120 | { |
RobMeades | 0:0b75e22c9231 | 121 | mtx.lock(); |
RobMeades | 0:0b75e22c9231 | 122 | } |
RobMeades | 0:0b75e22c9231 | 123 | |
RobMeades | 0:0b75e22c9231 | 124 | static void unlock() |
RobMeades | 0:0b75e22c9231 | 125 | { |
RobMeades | 0:0b75e22c9231 | 126 | mtx.unlock(); |
RobMeades | 0:0b75e22c9231 | 127 | } |
rob.meades@u-blox.com | 5:9fd89567f769 | 128 | #endif |
RobMeades | 0:0b75e22c9231 | 129 | |
RobMeades | 0:0b75e22c9231 | 130 | static void printCellLocateData(UbloxATCellularInterfaceExt::CellLocData *pData) |
RobMeades | 0:0b75e22c9231 | 131 | { |
RobMeades | 0:0b75e22c9231 | 132 | char timeString[25]; |
RobMeades | 0:0b75e22c9231 | 133 | |
RobMeades | 0:0b75e22c9231 | 134 | tr_debug("Cell Locate data:"); |
rob.meades@u-blox.com | 1:26a67ab07275 | 135 | if (strftime(timeString, sizeof(timeString), "%F %T", (const tm *) &(pData->time)) > 0) { |
RobMeades | 0:0b75e22c9231 | 136 | tr_debug(" time: %s", timeString); |
RobMeades | 0:0b75e22c9231 | 137 | } |
RobMeades | 0:0b75e22c9231 | 138 | tr_debug(" longitude: %.6f", pData->longitude); |
RobMeades | 0:0b75e22c9231 | 139 | tr_debug(" latitude: %.6f", pData->latitude); |
rob.meades@u-blox.com | 1:26a67ab07275 | 140 | tr_debug(" altitude: %d metre(s)", pData->altitude); |
RobMeades | 0:0b75e22c9231 | 141 | switch (pData->sensor) { |
RobMeades | 0:0b75e22c9231 | 142 | case UbloxATCellularInterfaceExt::CELL_LAST: |
RobMeades | 0:0b75e22c9231 | 143 | tr_debug(" sensor type: last"); |
RobMeades | 0:0b75e22c9231 | 144 | break; |
RobMeades | 0:0b75e22c9231 | 145 | case UbloxATCellularInterfaceExt::CELL_GNSS: |
RobMeades | 0:0b75e22c9231 | 146 | tr_debug(" sensor type: GNSS"); |
RobMeades | 0:0b75e22c9231 | 147 | break; |
RobMeades | 0:0b75e22c9231 | 148 | case UbloxATCellularInterfaceExt::CELL_LOCATE: |
RobMeades | 0:0b75e22c9231 | 149 | tr_debug(" sensor type: Cell Locate"); |
RobMeades | 0:0b75e22c9231 | 150 | break; |
RobMeades | 0:0b75e22c9231 | 151 | case UbloxATCellularInterfaceExt::CELL_HYBRID: |
RobMeades | 0:0b75e22c9231 | 152 | tr_debug(" sensor type: hybrid"); |
RobMeades | 0:0b75e22c9231 | 153 | break; |
RobMeades | 0:0b75e22c9231 | 154 | default: |
RobMeades | 0:0b75e22c9231 | 155 | tr_debug(" sensor type: unknown"); |
RobMeades | 0:0b75e22c9231 | 156 | break; |
RobMeades | 0:0b75e22c9231 | 157 | } |
rob.meades@u-blox.com | 1:26a67ab07275 | 158 | tr_debug(" uncertainty: %d metre(s)", pData->uncertainty); |
rob.meades@u-blox.com | 1:26a67ab07275 | 159 | tr_debug(" speed: %d metre(s)/second", pData->speed); |
rob.meades@u-blox.com | 1:26a67ab07275 | 160 | tr_debug(" direction: %d degree(s)", pData->direction); |
rob.meades@u-blox.com | 1:26a67ab07275 | 161 | tr_debug(" vertical accuracy: %d metre(s)/second", pData->speed); |
rob.meades@u-blox.com | 1:26a67ab07275 | 162 | tr_debug(" satellite(s) used: %d", pData->svUsed); |
rob.meades@u-blox.com | 1:26a67ab07275 | 163 | tr_debug("I am here: " |
rob.meades@u-blox.com | 1:26a67ab07275 | 164 | "https://maps.google.com/?q=%.5f,%.5f", pData->latitude, pData->longitude); |
RobMeades | 0:0b75e22c9231 | 165 | } |
RobMeades | 0:0b75e22c9231 | 166 | |
RobMeades | 0:0b75e22c9231 | 167 | // ---------------------------------------------------------------- |
RobMeades | 0:0b75e22c9231 | 168 | // TESTS |
RobMeades | 0:0b75e22c9231 | 169 | // ---------------------------------------------------------------- |
RobMeades | 0:0b75e22c9231 | 170 | |
RobMeades | 0:0b75e22c9231 | 171 | // Test Cell Locate talking to a UDP server |
RobMeades | 0:0b75e22c9231 | 172 | void test_udp_server() { |
RobMeades | 0:0b75e22c9231 | 173 | int numRes = 0; |
RobMeades | 0:0b75e22c9231 | 174 | UbloxATCellularInterfaceExt::CellLocData data; |
RobMeades | 0:0b75e22c9231 | 175 | |
RobMeades | 0:0b75e22c9231 | 176 | memset(&data, 0, sizeof(data)); |
RobMeades | 0:0b75e22c9231 | 177 | TEST_ASSERT(pDriver->connect(MBED_CONF_APP_DEFAULT_PIN, MBED_CONF_APP_APN, |
RobMeades | 0:0b75e22c9231 | 178 | MBED_CONF_APP_USERNAME, MBED_CONF_APP_PASSWORD) == 0); |
RobMeades | 0:0b75e22c9231 | 179 | |
RobMeades | 0:0b75e22c9231 | 180 | TEST_ASSERT(pDriver->cellLocSrvUdp()); |
RobMeades | 0:0b75e22c9231 | 181 | TEST_ASSERT(pDriver->cellLocConfig(1)); |
RobMeades | 0:0b75e22c9231 | 182 | TEST_ASSERT(pDriver->cellLocRequest(UbloxATCellularInterfaceExt::CELL_HYBRID, 10, 100, |
RobMeades | 0:0b75e22c9231 | 183 | (UbloxATCellularInterfaceExt::CellRespType) MBED_CONF_APP_RESP_TYPE, |
RobMeades | 0:0b75e22c9231 | 184 | MBED_CONF_APP_CELL_LOCATE_MAX_NUM_HYPOTHESIS)); |
RobMeades | 0:0b75e22c9231 | 185 | |
RobMeades | 0:0b75e22c9231 | 186 | for (int x = 0; (numRes == 0) && (x < 10); x++) { |
RobMeades | 0:0b75e22c9231 | 187 | numRes = pDriver->cellLocGetRes(); |
RobMeades | 0:0b75e22c9231 | 188 | } |
RobMeades | 0:0b75e22c9231 | 189 | |
RobMeades | 0:0b75e22c9231 | 190 | TEST_ASSERT(numRes > 0); |
RobMeades | 0:0b75e22c9231 | 191 | TEST_ASSERT(pDriver->cellLocGetData(&data)); |
RobMeades | 0:0b75e22c9231 | 192 | |
RobMeades | 0:0b75e22c9231 | 193 | TEST_ASSERT(data.validData); |
RobMeades | 0:0b75e22c9231 | 194 | |
RobMeades | 0:0b75e22c9231 | 195 | printCellLocateData(&data); |
RobMeades | 0:0b75e22c9231 | 196 | |
RobMeades | 0:0b75e22c9231 | 197 | TEST_ASSERT(pDriver->disconnect() == 0); |
RobMeades | 0:0b75e22c9231 | 198 | // Wait for printfs to leave the building or the test result string gets messed up |
RobMeades | 0:0b75e22c9231 | 199 | wait_ms(500); |
RobMeades | 0:0b75e22c9231 | 200 | } |
RobMeades | 0:0b75e22c9231 | 201 | |
RobMeades | 0:0b75e22c9231 | 202 | // Test Cell Locate talking to a TCP server |
RobMeades | 0:0b75e22c9231 | 203 | void test_tcp_server() { |
RobMeades | 0:0b75e22c9231 | 204 | int numRes = 0; |
RobMeades | 0:0b75e22c9231 | 205 | UbloxATCellularInterfaceExt::CellLocData data; |
RobMeades | 0:0b75e22c9231 | 206 | |
RobMeades | 0:0b75e22c9231 | 207 | memset(&data, 0, sizeof(data)); |
RobMeades | 0:0b75e22c9231 | 208 | TEST_ASSERT(pDriver->connect(MBED_CONF_APP_DEFAULT_PIN, MBED_CONF_APP_APN, |
RobMeades | 0:0b75e22c9231 | 209 | MBED_CONF_APP_USERNAME, MBED_CONF_APP_PASSWORD) == 0); |
RobMeades | 0:0b75e22c9231 | 210 | |
RobMeades | 0:0b75e22c9231 | 211 | TEST_ASSERT(pDriver->cellLocSrvTcp(MBED_CONF_APP_CELL_LOCATE_MGA_TOKEN)); |
RobMeades | 0:0b75e22c9231 | 212 | TEST_ASSERT(pDriver->cellLocConfig(1)); |
RobMeades | 0:0b75e22c9231 | 213 | TEST_ASSERT(pDriver->cellLocRequest(UbloxATCellularInterfaceExt::CELL_HYBRID, 10, 100, |
RobMeades | 0:0b75e22c9231 | 214 | (UbloxATCellularInterfaceExt::CellRespType) MBED_CONF_APP_RESP_TYPE, |
RobMeades | 0:0b75e22c9231 | 215 | MBED_CONF_APP_CELL_LOCATE_MAX_NUM_HYPOTHESIS)); |
RobMeades | 0:0b75e22c9231 | 216 | |
RobMeades | 0:0b75e22c9231 | 217 | for (int x = 0; (numRes == 0) && (x < 10); x++) { |
RobMeades | 0:0b75e22c9231 | 218 | numRes = pDriver->cellLocGetRes(); |
RobMeades | 0:0b75e22c9231 | 219 | } |
RobMeades | 0:0b75e22c9231 | 220 | |
RobMeades | 0:0b75e22c9231 | 221 | TEST_ASSERT(numRes > 0); |
RobMeades | 0:0b75e22c9231 | 222 | TEST_ASSERT(pDriver->cellLocGetData(&data)); |
RobMeades | 0:0b75e22c9231 | 223 | |
RobMeades | 0:0b75e22c9231 | 224 | TEST_ASSERT(data.validData); |
RobMeades | 0:0b75e22c9231 | 225 | |
RobMeades | 0:0b75e22c9231 | 226 | printCellLocateData(&data); |
RobMeades | 0:0b75e22c9231 | 227 | |
RobMeades | 0:0b75e22c9231 | 228 | TEST_ASSERT(pDriver->disconnect() == 0); |
RobMeades | 0:0b75e22c9231 | 229 | // Wait for printfs to leave the building or the test result string gets messed up |
RobMeades | 0:0b75e22c9231 | 230 | wait_ms(500); |
RobMeades | 0:0b75e22c9231 | 231 | } |
RobMeades | 0:0b75e22c9231 | 232 | |
RobMeades | 0:0b75e22c9231 | 233 | // Tidy up after testing so as not to screw with the test output strings |
RobMeades | 0:0b75e22c9231 | 234 | void test_tidy_up() { |
RobMeades | 0:0b75e22c9231 | 235 | pDriver->deinit(); |
RobMeades | 0:0b75e22c9231 | 236 | } |
RobMeades | 0:0b75e22c9231 | 237 | |
RobMeades | 0:0b75e22c9231 | 238 | // ---------------------------------------------------------------- |
RobMeades | 0:0b75e22c9231 | 239 | // TEST ENVIRONMENT |
RobMeades | 0:0b75e22c9231 | 240 | // ---------------------------------------------------------------- |
RobMeades | 0:0b75e22c9231 | 241 | |
RobMeades | 0:0b75e22c9231 | 242 | // Setup the test environment |
RobMeades | 0:0b75e22c9231 | 243 | utest::v1::status_t test_setup(const size_t number_of_cases) { |
RobMeades | 0:0b75e22c9231 | 244 | // Setup Greentea with a timeout |
RobMeades | 0:0b75e22c9231 | 245 | GREENTEA_SETUP(540, "default_auto"); |
RobMeades | 0:0b75e22c9231 | 246 | return verbose_test_setup_handler(number_of_cases); |
RobMeades | 0:0b75e22c9231 | 247 | } |
RobMeades | 0:0b75e22c9231 | 248 | |
RobMeades | 0:0b75e22c9231 | 249 | // Test cases |
RobMeades | 0:0b75e22c9231 | 250 | Case cases[] = { |
RobMeades | 0:0b75e22c9231 | 251 | Case("Cell Locate with UDP server", test_udp_server), |
RobMeades | 0:0b75e22c9231 | 252 | #if MBED_CONF_APP_RUN_CELL_LOCATE_TCP_SERVER_TEST |
RobMeades | 0:0b75e22c9231 | 253 | Case("Cell Locate with TCP server", test_tcp_server), |
RobMeades | 0:0b75e22c9231 | 254 | #endif |
RobMeades | 0:0b75e22c9231 | 255 | Case("Tidy up", test_tidy_up) |
RobMeades | 0:0b75e22c9231 | 256 | }; |
RobMeades | 0:0b75e22c9231 | 257 | |
RobMeades | 0:0b75e22c9231 | 258 | Specification specification(test_setup, cases); |
RobMeades | 0:0b75e22c9231 | 259 | |
RobMeades | 0:0b75e22c9231 | 260 | // ---------------------------------------------------------------- |
RobMeades | 0:0b75e22c9231 | 261 | // MAIN |
RobMeades | 0:0b75e22c9231 | 262 | // ---------------------------------------------------------------- |
RobMeades | 0:0b75e22c9231 | 263 | |
RobMeades | 0:0b75e22c9231 | 264 | int main() { |
rob.meades@u-blox.com | 5:9fd89567f769 | 265 | |
rob.meades@u-blox.com | 5:9fd89567f769 | 266 | #ifdef FEATURE_COMMON_PAL |
RobMeades | 0:0b75e22c9231 | 267 | mbed_trace_init(); |
RobMeades | 0:0b75e22c9231 | 268 | |
RobMeades | 0:0b75e22c9231 | 269 | mbed_trace_mutex_wait_function_set(lock); |
RobMeades | 0:0b75e22c9231 | 270 | mbed_trace_mutex_release_function_set(unlock); |
rob.meades@u-blox.com | 5:9fd89567f769 | 271 | #endif |
RobMeades | 0:0b75e22c9231 | 272 | |
RobMeades | 0:0b75e22c9231 | 273 | // Run tests |
RobMeades | 0:0b75e22c9231 | 274 | return !Harness::run(specification); |
RobMeades | 0:0b75e22c9231 | 275 | } |
RobMeades | 0:0b75e22c9231 | 276 | |
RobMeades | 0:0b75e22c9231 | 277 | // End Of File |
RobMeades | 0:0b75e22c9231 | 278 |