Skip to content
This repository has been archived by the owner on May 24, 2019. It is now read-only.

Enable REALTEK_RTL8195AM WiFi #27

Merged
merged 1 commit into from
Jun 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Add the following to your ``mbed_app.json`` file:
{
"config": {
"network-interface":{
"help": "options are ETHERNET,WIFI_ESP8266,WIFI_ODIN,MESH_LOWPAN_ND,MESH_THREAD",
"help": "options are ETHERNET,WIFI_ESP8266,WIFI_ODIN, WIFI_REALTEK, MESH_LOWPAN_ND,MESH_THREAD",
"value": "ETHERNET"
}
},
Expand All @@ -29,12 +29,12 @@ If you choose `ETHERNET` with `UBLOX_ODIN_EVK_W2` you must add this to your `tar
"target.device_has_remove": ["EMAC"]
```

If you choose `WIFI_ESP8266` or `WIFI_ODIN`, you'll also need to add the WiFi SSID and password:
If you choose `WIFI_ESP8266`, `WIFI_ODIN` or `WIFI_REALTEK`, you'll also need to add the WiFi SSID and password:

```json
"config": {
"network-interface":{
"help": "options are ETHERNET,WIFI_ESP8266,WIFI_ODIN,MESH_LOWPAN_ND,MESH_THREAD",
"help": "options are ETHERNET,WIFI_ESP8266,WIFI_ODIN,WIFI_REALTEK,MESH_LOWPAN_ND,MESH_THREAD",
"value": "WIFI_ESP8266"
},
"esp8266-tx": {
Expand Down
15 changes: 14 additions & 1 deletion easy-connect.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#define MESH_LOWPAN_ND 3
#define MESH_THREAD 4
#define WIFI_ODIN 5
#define WIFI_REALTEK 6

#if MBED_CONF_APP_NETWORK_INTERFACE == WIFI_ESP8266
#include "ESP8266Interface.h"
Expand All @@ -20,7 +21,11 @@ ESP8266Interface wifi(MBED_CONF_APP_ESP8266_TX, MBED_CONF_APP_ESP8266_RX);

#elif MBED_CONF_APP_NETWORK_INTERFACE == WIFI_ODIN
#include "OdinWiFiInterface.h"

OdinWiFiInterface wifi;
#elif MBED_CONF_APP_NETWORK_INTERFACE == WIFI_REALTEK
#include "RTWInterface.h"
RTWInterface wifi;
#elif MBED_CONF_APP_NETWORK_INTERFACE == ETHERNET
#include "EthernetInterface.h"
EthernetInterface eth;
Expand Down Expand Up @@ -102,7 +107,7 @@ NetworkInterface* easy_connect(bool log_messages = false) {
printf("[EasyConnect] IPv4 mode\n");
#endif

#if MBED_CONF_APP_NETWORK_INTERFACE == WIFI_ESP8266
#if MBED_CONF_APP_NETWORK_INTERFACE == WIFI_ESP8266
if (log_messages) {
printf("[EasyConnect] Using WiFi (ESP8266) \n");
printf("[EasyConnect] Connecting to WiFi %s\n", MBED_CONF_APP_WIFI_SSID);
Expand All @@ -116,13 +121,21 @@ NetworkInterface* easy_connect(bool log_messages = false) {
}
network_interface = &wifi;
connect_success = wifi.connect(MBED_CONF_APP_WIFI_SSID, MBED_CONF_APP_WIFI_PASSWORD, NSAPI_SECURITY_WPA_WPA2);
#elif MBED_CONF_APP_NETWORK_INTERFACE == WIFI_REALTEK
if (log_messages) {
printf("[EasyConnect] Using WiFi (REALTEK)\n");
printf("[EasyConnect] Connecting to WiFi %s\n", MBED_CONF_APP_WIFI_SSID);
}
network_interface = &wifi;
connect_success = wifi.connect(MBED_CONF_APP_WIFI_SSID, MBED_CONF_APP_WIFI_PASSWORD, NSAPI_SECURITY_WPA_WPA2);
#elif MBED_CONF_APP_NETWORK_INTERFACE == ETHERNET
if (log_messages) {
printf("[EasyConnect] Using Ethernet\n");
}
network_interface = ð
connect_success = eth.connect();
#endif

#ifdef MESH
if (log_messages) {
printf("[EasyConnect] Using Mesh\n");
Expand Down