-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy patheasy-connect.h
53 lines (40 loc) · 2 KB
/
easy-connect.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef __EASY_CONNECT_H__
#define __EASY_CONNECT_H__
#include "mbed.h"
#define CELLULAR_WNC14A2A 203
#define CELLULAR_BG96 204
// This is address to mbed Device Connector
#define MBED_SERVER_ADDRESS "coap://api.connector.mbed.com:5684"
/* \brief print_MAC - print_MAC - helper function to print out MAC address
* in: network_interface - pointer to network i/f
* bool log-messages print out logs or not
* MAC address is print, if it can be acquired & log_messages is true.
*
*/
void print_MAC(NetworkInterface* network_interface, bool log_messages);
/* \brief easy_connect - easy_connect function to connect the pre-defined network bearer,
* config done via mbed_app.json (see README.md for details).
* IN: bool log_messages print out diagnostics or not.
*/
NetworkInterface* easy_connect(bool log_messages);
// This is address to mbed Device Connector
#define MBED_SERVER_ADDRESS "coap://api.connector.mbed.com:5684"
/* \brief print_MAC - print_MAC - helper function to print out MAC address
* in: network_interface - pointer to network i/f
* bool log-messages print out logs or not
* MAC address is print, if it can be acquired & log_messages is true.
*
*/
void print_MAC(NetworkInterface* network_interface, bool log_messages);
/* \brief easy_connect - easy_connect function to connect the pre-defined network bearer,
* config done via mbed_app.json (see README.md for details).
* IN: bool log_messages print out diagnostics or not.
*/
NetworkInterface* easy_connect(bool log_messages = false);
/* \brief easy_get_netif - easy_connect function to get pointer to network interface w/o connect it.
You might need this for example getting the WiFi interface, then doing a scan
and then connecting to one of the SSIDs found with a password end user supplies.
* IN: bool log_messages print out diagnostics or not.
*/
NetworkInterface* easy_get_netif(bool log_messages);
#endif // __EASY_CONNECT_H__