2017-09-19 17:16:36 +00:00
|
|
|
#include "mbed.h"
|
2017-09-29 09:55:04 +00:00
|
|
|
|
|
|
|
#if TARGET_UBLOX_EVK_ODIN_W2
|
|
|
|
#include "OdinWiFiInterface.h"
|
|
|
|
#elif TARGET_REALTEK_RTL8195AM
|
|
|
|
#include "RTWInterface.h"
|
|
|
|
#else
|
2017-09-19 17:16:36 +00:00
|
|
|
#include "ESP8266Interface.h"
|
2017-09-29 09:55:04 +00:00
|
|
|
#endif
|
2017-09-19 17:16:36 +00:00
|
|
|
|
|
|
|
WiFiInterface *get_interface()
|
|
|
|
{
|
|
|
|
static WiFiInterface *interface = NULL;
|
|
|
|
|
|
|
|
if (interface)
|
|
|
|
delete interface;
|
|
|
|
|
|
|
|
#if TARGET_UBLOX_EVK_ODIN_W2
|
|
|
|
interface = new OdinWiFiInterface();
|
|
|
|
#elif TARGET_REALTEK_RTL8195AM
|
|
|
|
interface = new RTWInterface();
|
|
|
|
#else
|
|
|
|
interface = new ESP8266Interface(D1, D0);
|
|
|
|
#endif
|
|
|
|
return interface;
|
|
|
|
}
|