|
7 | 7 | #define TCP 1
|
8 | 8 |
|
9 | 9 | // SIM pin code goes here
|
10 |
| -#define PIN_CODE "1234" |
| 10 | +#ifndef MBED_CONF_APP_SIM_PIN_CODE |
| 11 | +# define MBED_CONF_APP_SIM_PIN_CODE "1234" |
| 12 | +#endif |
11 | 13 |
|
12 |
| -// Network credentials like APN go here, e.g., |
13 |
| -// "apn, username, password" |
14 |
| -#define CREDENTIALS "internet" |
| 14 | +#ifndef MBED_CONF_APP_APN |
| 15 | +# define MBED_CONF_APP_APN "internet" |
| 16 | +#endif |
| 17 | +#ifndef MBED_CONF_APP_USERNAME |
| 18 | +# define MBED_CONF_APP_USERNAME NULL |
| 19 | +#endif |
| 20 | +#ifndef MBED_CONF_APP_PASSWORD |
| 21 | +# define MBED_CONF_APP_PASSWORD NULL |
| 22 | +#endif |
15 | 23 |
|
16 | 24 | // Number of retries /
|
17 | 25 | #define RETRY_COUNT 3
|
18 | 26 |
|
19 | 27 | // CellularInterface object
|
20 | 28 | OnboardCellularInterface iface;
|
21 | 29 |
|
22 |
| -// NIST ntp hostname |
| 30 | +// Echo server hostname |
23 | 31 | const char *host_name = "echo.u-blox.com";
|
24 | 32 |
|
25 |
| -// NIST ntp port |
| 33 | +// Echo server port (same for TCP and UDP) |
26 | 34 | const int port = 7;
|
27 | 35 |
|
28 | 36 | /**
|
@@ -135,10 +143,10 @@ int main()
|
135 | 143 | {
|
136 | 144 | iface.modem_debug_on(MBED_CONF_APP_MODEM_TRACE);
|
137 | 145 | /* Set Pin code for SIM card */
|
138 |
| - iface.set_sim_pin(PIN_CODE); |
| 146 | + iface.set_sim_pin(MBED_CONF_APP_SIM_PIN_CODE); |
139 | 147 |
|
140 | 148 | /* Set network credentials here, e.g., APN*/
|
141 |
| - iface.set_credentials(CREDENTIALS); |
| 149 | + iface.set_credentials(MBED_CONF_APP_APN, MBED_CONF_APP_USERNAME, MBED_CONF_APP_PASSWORD); |
142 | 150 |
|
143 | 151 | printf("\n\nmbed-os-example-cellular, Connecting...\n");
|
144 | 152 |
|
|
0 commit comments