Jim Flynn
/
aws-iot-device-sdk-mbed-c
Changes to enabled on-line compiler
platform/ezconnect/easy-connect.h@0:082731ede69f, 2018-05-30 (annotated)
- Committer:
- JMF
- Date:
- Wed May 30 20:59:51 2018 +0000
- Revision:
- 0:082731ede69f
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
JMF | 0:082731ede69f | 1 | |
JMF | 0:082731ede69f | 2 | #ifndef __EASY_CONNECT_H__ |
JMF | 0:082731ede69f | 3 | #define __EASY_CONNECT_H__ |
JMF | 0:082731ede69f | 4 | |
JMF | 0:082731ede69f | 5 | #include "mbed.h" |
JMF | 0:082731ede69f | 6 | |
JMF | 0:082731ede69f | 7 | #define CELLULAR_WNC14A2A 203 |
JMF | 0:082731ede69f | 8 | #define CELLULAR_BG96 204 |
JMF | 0:082731ede69f | 9 | |
JMF | 0:082731ede69f | 10 | // This is address to mbed Device Connector |
JMF | 0:082731ede69f | 11 | #define MBED_SERVER_ADDRESS "coap://api.connector.mbed.com:5684" |
JMF | 0:082731ede69f | 12 | |
JMF | 0:082731ede69f | 13 | /* \brief print_MAC - print_MAC - helper function to print out MAC address |
JMF | 0:082731ede69f | 14 | * in: network_interface - pointer to network i/f |
JMF | 0:082731ede69f | 15 | * bool log-messages print out logs or not |
JMF | 0:082731ede69f | 16 | * MAC address is print, if it can be acquired & log_messages is true. |
JMF | 0:082731ede69f | 17 | * |
JMF | 0:082731ede69f | 18 | */ |
JMF | 0:082731ede69f | 19 | void print_MAC(NetworkInterface* network_interface, bool log_messages); |
JMF | 0:082731ede69f | 20 | |
JMF | 0:082731ede69f | 21 | |
JMF | 0:082731ede69f | 22 | /* \brief easy_connect - easy_connect function to connect the pre-defined network bearer, |
JMF | 0:082731ede69f | 23 | * config done via mbed_app.json (see README.md for details). |
JMF | 0:082731ede69f | 24 | * IN: bool log_messages print out diagnostics or not. |
JMF | 0:082731ede69f | 25 | */ |
JMF | 0:082731ede69f | 26 | NetworkInterface* easy_connect(bool log_messages); |
JMF | 0:082731ede69f | 27 | |
JMF | 0:082731ede69f | 28 | // This is address to mbed Device Connector |
JMF | 0:082731ede69f | 29 | #define MBED_SERVER_ADDRESS "coap://api.connector.mbed.com:5684" |
JMF | 0:082731ede69f | 30 | |
JMF | 0:082731ede69f | 31 | /* \brief print_MAC - print_MAC - helper function to print out MAC address |
JMF | 0:082731ede69f | 32 | * in: network_interface - pointer to network i/f |
JMF | 0:082731ede69f | 33 | * bool log-messages print out logs or not |
JMF | 0:082731ede69f | 34 | * MAC address is print, if it can be acquired & log_messages is true. |
JMF | 0:082731ede69f | 35 | * |
JMF | 0:082731ede69f | 36 | */ |
JMF | 0:082731ede69f | 37 | void print_MAC(NetworkInterface* network_interface, bool log_messages); |
JMF | 0:082731ede69f | 38 | |
JMF | 0:082731ede69f | 39 | |
JMF | 0:082731ede69f | 40 | /* \brief easy_connect - easy_connect function to connect the pre-defined network bearer, |
JMF | 0:082731ede69f | 41 | * config done via mbed_app.json (see README.md for details). |
JMF | 0:082731ede69f | 42 | * IN: bool log_messages print out diagnostics or not. |
JMF | 0:082731ede69f | 43 | */ |
JMF | 0:082731ede69f | 44 | NetworkInterface* easy_connect(bool log_messages = false); |
JMF | 0:082731ede69f | 45 | |
JMF | 0:082731ede69f | 46 | /* \brief easy_get_netif - easy_connect function to get pointer to network interface w/o connect it. |
JMF | 0:082731ede69f | 47 | You might need this for example getting the WiFi interface, then doing a scan |
JMF | 0:082731ede69f | 48 | and then connecting to one of the SSIDs found with a password end user supplies. |
JMF | 0:082731ede69f | 49 | * IN: bool log_messages print out diagnostics or not. |
JMF | 0:082731ede69f | 50 | */ |
JMF | 0:082731ede69f | 51 | NetworkInterface* easy_get_netif(bool log_messages); |
JMF | 0:082731ede69f | 52 | |
JMF | 0:082731ede69f | 53 | #endif // __EASY_CONNECT_H__ |