mirror of https://github.com/ARMmbed/mbed-os.git
WIFI_EMAC class renamed to OdinWiFiEMAC, Formatting
Revert "in ODIN emac initialization required before connection"pull/6847/head
parent
7e4eb5c24b
commit
657ac3f643
|
@ -108,9 +108,7 @@ nsapi_error_t EmacTestNetworkStack::add_ethernet_interface(EMAC &emac, bool defa
|
||||||
{
|
{
|
||||||
// Test network stack supports only one interface
|
// Test network stack supports only one interface
|
||||||
TEST_ASSERT_MESSAGE(!m_interface, "Only one interface supported!");
|
TEST_ASSERT_MESSAGE(!m_interface, "Only one interface supported!");
|
||||||
#ifdef TARGET_UBLOX_EVK_ODIN_W2
|
|
||||||
emac_if_init();
|
|
||||||
#endif
|
|
||||||
m_interface = &EmacTestNetworkStack::Interface::get_instance();
|
m_interface = &EmacTestNetworkStack::Interface::get_instance();
|
||||||
TEST_ASSERT_MESSAGE(m_interface, "Invalid interface!");
|
TEST_ASSERT_MESSAGE(m_interface, "Invalid interface!");
|
||||||
|
|
||||||
|
|
|
@ -19,27 +19,12 @@
|
||||||
#include "lwip/def.h"
|
#include "lwip/def.h"
|
||||||
#include "lwip_random.h"
|
#include "lwip_random.h"
|
||||||
|
|
||||||
#if defined(DEVICE_TRNG)
|
|
||||||
#include "hal/trng_api.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "randLIB.h"
|
#include "randLIB.h"
|
||||||
|
|
||||||
void lwip_seed_random(void)
|
void lwip_seed_random(void)
|
||||||
{
|
{
|
||||||
#if defined(DEVICE_TRNG)
|
|
||||||
uint32_t result;
|
|
||||||
size_t olen;
|
|
||||||
trng_t trng_obj;
|
|
||||||
|
|
||||||
trng_init(&trng_obj);
|
|
||||||
trng_get_bytes(&trng_obj, (uint8_t*)&result, sizeof result, &olen);
|
|
||||||
trng_free(&trng_obj);
|
|
||||||
|
|
||||||
srand(result);
|
|
||||||
#else
|
|
||||||
randLIB_seed_random();
|
randLIB_seed_random();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void lwip_add_random_seed(uint64_t seed)
|
void lwip_add_random_seed(uint64_t seed)
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#include "cb_otp.h"
|
#include "cb_otp.h"
|
||||||
#include "cb_main.h"
|
#include "cb_main.h"
|
||||||
|
|
||||||
#define WIFI_EMAC_MTU_SIZE (1500U)
|
#define OdinWiFiEMAC_MTU_SIZE (1500U)
|
||||||
static const char _ifname[] = "WL0";
|
static const char _ifname[] = "WL0";
|
||||||
|
|
||||||
cb_boolean handleWlanTargetCopyFromDataFrame(uint8_t* buffer, cbWLANTARGET_dataFrame* frame, uint32_t size, uint32_t offsetInFrame);
|
cb_boolean handleWlanTargetCopyFromDataFrame(uint8_t* buffer, cbWLANTARGET_dataFrame* frame, uint32_t size, uint32_t offsetInFrame);
|
||||||
|
@ -37,7 +37,7 @@ static const cbWLANTARGET_Callback _wlanTargetCallback =
|
||||||
|
|
||||||
void handleWlanStatusIndication(void *dummy, cbWLAN_StatusIndicationInfo status, void *data)
|
void handleWlanStatusIndication(void *dummy, cbWLAN_StatusIndicationInfo status, void *data)
|
||||||
{
|
{
|
||||||
WIFI_EMAC &instance = WIFI_EMAC::get_instance();
|
OdinWiFiEMAC &instance = OdinWiFiEMAC::get_instance();
|
||||||
bool linkUp = false;
|
bool linkUp = false;
|
||||||
bool sendCb = true;
|
bool sendCb = true;
|
||||||
(void)dummy;
|
(void)dummy;
|
||||||
|
@ -65,7 +65,7 @@ void handleWlanStatusIndication(void *dummy, cbWLAN_StatusIndicationInfo status,
|
||||||
|
|
||||||
void handleWlanPacketIndication(void *dummy, cbWLAN_PacketIndicationInfo *packetInfo)
|
void handleWlanPacketIndication(void *dummy, cbWLAN_PacketIndicationInfo *packetInfo)
|
||||||
{
|
{
|
||||||
WIFI_EMAC &instance = WIFI_EMAC::get_instance();
|
OdinWiFiEMAC &instance = OdinWiFiEMAC::get_instance();
|
||||||
(void)dummy;
|
(void)dummy;
|
||||||
|
|
||||||
if (instance.emac_link_input_cb) {
|
if (instance.emac_link_input_cb) {
|
||||||
|
@ -75,17 +75,17 @@ void handleWlanPacketIndication(void *dummy, cbWLAN_PacketIndicationInfo *packet
|
||||||
|
|
||||||
cb_boolean handleWlanTargetCopyFromDataFrame(uint8_t* buffer, cbWLANTARGET_dataFrame* frame, uint32_t size, uint32_t offsetInFrame)
|
cb_boolean handleWlanTargetCopyFromDataFrame(uint8_t* buffer, cbWLANTARGET_dataFrame* frame, uint32_t size, uint32_t offsetInFrame)
|
||||||
{
|
{
|
||||||
EMACMemoryManager *mem = WIFI_EMAC::get_instance().memory_manager;
|
EMACMemoryManager *mem = OdinWiFiEMAC::get_instance().memory_manager;
|
||||||
MBED_ASSERT(mem != NULL);
|
MBED_ASSERT(mem != NULL);
|
||||||
|
|
||||||
//emac_mem_buf_t* phead = (emac_mem_buf_t *)frame;
|
emac_mem_buf_t* phead = static_cast<emac_mem_buf_t *>(frame);
|
||||||
emac_mem_buf_t* pbuf = (emac_mem_buf_t *)frame;
|
emac_mem_buf_t* pbuf;
|
||||||
uint32_t copySize, bytesCopied = 0, pbufOffset = 0;
|
uint32_t copySize, bytesCopied = 0, pbufOffset = 0;
|
||||||
|
|
||||||
MBED_ASSERT(frame != NULL);
|
MBED_ASSERT(frame != NULL);
|
||||||
MBED_ASSERT(buffer != NULL);
|
MBED_ASSERT(buffer != NULL);
|
||||||
|
|
||||||
//pbuf = mem->get_next(phead);
|
pbuf = phead;
|
||||||
while (pbuf != NULL) {
|
while (pbuf != NULL) {
|
||||||
if ((pbufOffset + mem->get_len(pbuf)) >= offsetInFrame) {
|
if ((pbufOffset + mem->get_len(pbuf)) >= offsetInFrame) {
|
||||||
copySize = cb_MIN(size, mem->get_len(pbuf) - (offsetInFrame - pbufOffset));
|
copySize = cb_MIN(size, mem->get_len(pbuf) - (offsetInFrame - pbufOffset));
|
||||||
|
@ -114,17 +114,17 @@ cb_boolean handleWlanTargetCopyFromDataFrame(uint8_t* buffer, cbWLANTARGET_dataF
|
||||||
|
|
||||||
cb_boolean handleWlanTargetCopyToDataFrame(cbWLANTARGET_dataFrame* frame, uint8_t* buffer, uint32_t size, uint32_t offsetInFrame)
|
cb_boolean handleWlanTargetCopyToDataFrame(cbWLANTARGET_dataFrame* frame, uint8_t* buffer, uint32_t size, uint32_t offsetInFrame)
|
||||||
{
|
{
|
||||||
EMACMemoryManager *mem = WIFI_EMAC::get_instance().memory_manager;
|
EMACMemoryManager *mem = OdinWiFiEMAC::get_instance().memory_manager;
|
||||||
MBED_ASSERT(mem != NULL);
|
MBED_ASSERT(mem != NULL);
|
||||||
|
|
||||||
//emac_mem_buf_t* phead = (emac_mem_buf_t *)frame;
|
emac_mem_buf_t* phead = static_cast<emac_mem_buf_t *>(frame);
|
||||||
emac_mem_buf_t* pbuf = (emac_mem_buf_t *)frame;
|
emac_mem_buf_t* pbuf;
|
||||||
uint32_t copySize, bytesCopied = 0, pbufOffset = 0;
|
uint32_t copySize, bytesCopied = 0, pbufOffset = 0;
|
||||||
|
|
||||||
MBED_ASSERT(frame != NULL);
|
MBED_ASSERT(frame != NULL);
|
||||||
MBED_ASSERT(buffer != NULL);
|
MBED_ASSERT(buffer != NULL);
|
||||||
|
|
||||||
//pbuf = mem->get_next(phead);
|
pbuf = phead;
|
||||||
while (pbuf != NULL) {
|
while (pbuf != NULL) {
|
||||||
if ((pbufOffset + mem->get_len(pbuf)) >= offsetInFrame) {
|
if ((pbufOffset + mem->get_len(pbuf)) >= offsetInFrame) {
|
||||||
copySize = cb_MIN(size, mem->get_len(pbuf) - (offsetInFrame - pbufOffset));
|
copySize = cb_MIN(size, mem->get_len(pbuf) - (offsetInFrame - pbufOffset));
|
||||||
|
@ -153,23 +153,23 @@ cb_boolean handleWlanTargetCopyToDataFrame(cbWLANTARGET_dataFrame* frame, uint8_
|
||||||
|
|
||||||
cbWLANTARGET_dataFrame* handleWlanTargetAllocDataFrame(uint32_t size)
|
cbWLANTARGET_dataFrame* handleWlanTargetAllocDataFrame(uint32_t size)
|
||||||
{
|
{
|
||||||
EMACMemoryManager *mem = WIFI_EMAC::get_instance().memory_manager;
|
EMACMemoryManager *mem = OdinWiFiEMAC::get_instance().memory_manager;
|
||||||
MBED_ASSERT(mem != NULL);
|
MBED_ASSERT(mem != NULL);
|
||||||
return (cbWLANTARGET_dataFrame*)mem->alloc_pool(size, 0);
|
return (cbWLANTARGET_dataFrame*)mem->alloc_pool(size, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleWlanTargetFreeDataFrame(cbWLANTARGET_dataFrame* frame)
|
void handleWlanTargetFreeDataFrame(cbWLANTARGET_dataFrame* frame)
|
||||||
{
|
{
|
||||||
EMACMemoryManager *mem = WIFI_EMAC::get_instance().memory_manager;
|
EMACMemoryManager *mem = OdinWiFiEMAC::get_instance().memory_manager;
|
||||||
MBED_ASSERT(mem != NULL);
|
MBED_ASSERT(mem != NULL);
|
||||||
mem->free((emac_mem_buf_t*)frame);
|
mem->free(static_cast<emac_mem_buf_t *>(frame));
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t handleWlanTargetGetDataFrameSize(cbWLANTARGET_dataFrame* frame)
|
uint32_t handleWlanTargetGetDataFrameSize(cbWLANTARGET_dataFrame* frame)
|
||||||
{
|
{
|
||||||
EMACMemoryManager *mem = WIFI_EMAC::get_instance().memory_manager;
|
EMACMemoryManager *mem = OdinWiFiEMAC::get_instance().memory_manager;
|
||||||
MBED_ASSERT(mem != NULL);
|
MBED_ASSERT(mem != NULL);
|
||||||
return mem->get_total_len((emac_mem_buf_t*)frame);
|
return mem->get_total_len(static_cast<emac_mem_buf_t *>(frame));
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t handleWlanTargetGetDataFrameTID(cbWLANTARGET_dataFrame* frame)
|
uint8_t handleWlanTargetGetDataFrameTID(cbWLANTARGET_dataFrame* frame)
|
||||||
|
@ -178,7 +178,7 @@ uint8_t handleWlanTargetGetDataFrameTID(cbWLANTARGET_dataFrame* frame)
|
||||||
return (uint8_t)cbWLAN_AC_BE;
|
return (uint8_t)cbWLAN_AC_BE;
|
||||||
}
|
}
|
||||||
|
|
||||||
WIFI_EMAC::WIFI_EMAC()
|
OdinWiFiEMAC::OdinWiFiEMAC()
|
||||||
{
|
{
|
||||||
emac_link_input_cb = NULL;
|
emac_link_input_cb = NULL;
|
||||||
emac_link_state_cb = NULL;
|
emac_link_state_cb = NULL;
|
||||||
|
@ -190,9 +190,9 @@ void send_wlan_packet(void *buf)
|
||||||
cbWLAN_sendPacket(buf);
|
cbWLAN_sendPacket(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WIFI_EMAC::link_out(emac_mem_buf_t *buf)
|
bool OdinWiFiEMAC::link_out(emac_mem_buf_t *buf)
|
||||||
{
|
{
|
||||||
EMACMemoryManager *mem = WIFI_EMAC::get_instance().memory_manager;
|
EMACMemoryManager *mem = OdinWiFiEMAC::get_instance().memory_manager;
|
||||||
|
|
||||||
// Break call chain to avoid the driver affecting stack usage for the IP stack thread too much
|
// Break call chain to avoid the driver affecting stack usage for the IP stack thread too much
|
||||||
emac_mem_buf_t *new_buf = mem->alloc_pool(mem->get_total_len(buf), 0);
|
emac_mem_buf_t *new_buf = mem->alloc_pool(mem->get_total_len(buf), 0);
|
||||||
|
@ -209,40 +209,40 @@ bool WIFI_EMAC::link_out(emac_mem_buf_t *buf)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WIFI_EMAC::power_up()
|
bool OdinWiFiEMAC::power_up()
|
||||||
{
|
{
|
||||||
/* Initialize the hardware */
|
/* Initialize the hardware */
|
||||||
/* No-op at this stage */
|
/* No-op at this stage */
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t WIFI_EMAC::get_mtu_size() const
|
uint32_t OdinWiFiEMAC::get_mtu_size() const
|
||||||
{
|
{
|
||||||
return WIFI_EMAC_MTU_SIZE;
|
return OdinWiFiEMAC_MTU_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WIFI_EMAC::get_ifname(char *name, uint8_t size) const
|
void OdinWiFiEMAC::get_ifname(char *name, uint8_t size) const
|
||||||
{
|
{
|
||||||
memcpy(name, _ifname, (size < sizeof(_ifname)) ? size : sizeof(_ifname));
|
memcpy(name, _ifname, (size < sizeof(_ifname)) ? size : sizeof(_ifname));
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t WIFI_EMAC::get_hwaddr_size() const
|
uint8_t OdinWiFiEMAC::get_hwaddr_size() const
|
||||||
{
|
{
|
||||||
return sizeof(cbWLAN_MACAddress);
|
return sizeof(cbWLAN_MACAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WIFI_EMAC::get_hwaddr(uint8_t *addr) const
|
bool OdinWiFiEMAC::get_hwaddr(uint8_t *addr) const
|
||||||
{
|
{
|
||||||
cbOTP_read(cbOTP_MAC_WLAN, sizeof(cbWLAN_MACAddress), addr);
|
cbOTP_read(cbOTP_MAC_WLAN, sizeof(cbWLAN_MACAddress), addr);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WIFI_EMAC::set_hwaddr(const uint8_t *addr)
|
void OdinWiFiEMAC::set_hwaddr(const uint8_t *addr)
|
||||||
{
|
{
|
||||||
/* No-op at this stage */
|
/* No-op at this stage */
|
||||||
}
|
}
|
||||||
|
|
||||||
void WIFI_EMAC::set_link_input_cb(emac_link_input_cb_t input_cb)
|
void OdinWiFiEMAC::set_link_input_cb(emac_link_input_cb_t input_cb)
|
||||||
{
|
{
|
||||||
emac_link_input_cb = input_cb;
|
emac_link_input_cb = input_cb;
|
||||||
|
|
||||||
|
@ -251,7 +251,7 @@ void WIFI_EMAC::set_link_input_cb(emac_link_input_cb_t input_cb)
|
||||||
cbMAIN_driverUnlock();
|
cbMAIN_driverUnlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WIFI_EMAC::set_link_state_cb(emac_link_state_change_cb_t state_cb)
|
void OdinWiFiEMAC::set_link_state_cb(emac_link_state_change_cb_t state_cb)
|
||||||
{
|
{
|
||||||
emac_link_state_cb = state_cb;
|
emac_link_state_cb = state_cb;
|
||||||
|
|
||||||
|
@ -260,45 +260,39 @@ void WIFI_EMAC::set_link_state_cb(emac_link_state_change_cb_t state_cb)
|
||||||
cbMAIN_driverUnlock();
|
cbMAIN_driverUnlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WIFI_EMAC::power_down()
|
void OdinWiFiEMAC::power_down()
|
||||||
{
|
{
|
||||||
/* No-op at this stage */
|
/* No-op at this stage */
|
||||||
}
|
}
|
||||||
|
|
||||||
void WIFI_EMAC::set_memory_manager(EMACMemoryManager &mem_mngr)
|
void OdinWiFiEMAC::set_memory_manager(EMACMemoryManager &mem_mngr)
|
||||||
{
|
{
|
||||||
memory_manager = &mem_mngr;
|
memory_manager = &mem_mngr;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t WIFI_EMAC::get_align_preference() const
|
uint32_t OdinWiFiEMAC::get_align_preference() const
|
||||||
{
|
{
|
||||||
return 1; // TODO not sure if there is a requirement but don't think so
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WIFI_EMAC::add_multicast_group(const uint8_t *address)
|
void OdinWiFiEMAC::add_multicast_group(const uint8_t *address)
|
||||||
{
|
{
|
||||||
// TODO anything to do here for WiFi?
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WIFI_EMAC::remove_multicast_group(const uint8_t *address)
|
void OdinWiFiEMAC::remove_multicast_group(const uint8_t *address)
|
||||||
{
|
{
|
||||||
// TODO anything to do here for WiFi?
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WIFI_EMAC::set_all_multicast(bool all)
|
void OdinWiFiEMAC::set_all_multicast(bool all)
|
||||||
{
|
{
|
||||||
// TODO anything to do here for WiFi?
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WIFI_EMAC &WIFI_EMAC::get_instance() {
|
OdinWiFiEMAC &OdinWiFiEMAC::get_instance() {
|
||||||
static WIFI_EMAC emac;
|
static OdinWiFiEMAC emac;
|
||||||
return emac;
|
return emac;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Weak so a module can override
|
|
||||||
MBED_WEAK EMAC &EMAC::get_default_instance()
|
|
||||||
{
|
|
||||||
return WIFI_EMAC::get_instance();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // DEVICE_WIFI
|
#endif // DEVICE_WIFI
|
||||||
|
|
|
@ -9,11 +9,11 @@
|
||||||
#include "cb_wlan_target_data.h"
|
#include "cb_wlan_target_data.h"
|
||||||
#include "cb_wlan.h"
|
#include "cb_wlan.h"
|
||||||
|
|
||||||
class WIFI_EMAC : public EMAC {
|
class OdinWiFiEMAC : public EMAC {
|
||||||
public:
|
public:
|
||||||
WIFI_EMAC();
|
OdinWiFiEMAC();
|
||||||
|
|
||||||
static WIFI_EMAC &get_instance();
|
static OdinWiFiEMAC &get_instance();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return maximum transmission unit
|
* Return maximum transmission unit
|
||||||
|
|
|
@ -45,11 +45,9 @@ struct wlan_scan_indication_s;
|
||||||
/** OdinWiFiInterface class
|
/** OdinWiFiInterface class
|
||||||
* Implementation of the WiFiInterface for the ODIN-W2 module
|
* Implementation of the WiFiInterface for the ODIN-W2 module
|
||||||
*/
|
*/
|
||||||
#ifdef DEVICE_WIFI_AP
|
|
||||||
class OdinWiFiInterface : public WiFiInterface, public WiFiSoftAPInterface, public EMACInterface
|
|
||||||
#else
|
|
||||||
class OdinWiFiInterface : public WiFiInterface, public EMACInterface
|
class OdinWiFiInterface : public WiFiInterface, public EMACInterface
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/** OdinWiFiInterface lifetime
|
/** OdinWiFiInterface lifetime
|
||||||
|
@ -140,100 +138,6 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual nsapi_error_t set_timeout(int ms);
|
virtual nsapi_error_t set_timeout(int ms);
|
||||||
|
|
||||||
#ifdef DEVICE_WIFI_AP
|
|
||||||
|
|
||||||
/** Set IP config for access point
|
|
||||||
*
|
|
||||||
* This function has to be called before the access point is started.
|
|
||||||
*
|
|
||||||
* @param gateway Null-terminated representation of the local gateway
|
|
||||||
* @param netmask Null-terminated representation of the network mask
|
|
||||||
* @return 0 on success, negative error code on failure
|
|
||||||
*/
|
|
||||||
//TODO: In previous WiFiInterface.h but not in new WiFiSoftAPInterface
|
|
||||||
virtual nsapi_error_t set_ap_network(const char *ip_address, const char *netmask, const char *gateway);
|
|
||||||
|
|
||||||
/** Set the WiFi network credentials
|
|
||||||
*
|
|
||||||
* @param ssid Name of the network to connect to
|
|
||||||
* @param pass Security passphrase to connect to the network
|
|
||||||
* @param security Type of encryption for connection
|
|
||||||
* (defaults to NSAPI_SECURITY_NONE)
|
|
||||||
* @return 0 on success, or error code on failure
|
|
||||||
*/
|
|
||||||
virtual nsapi_error_t set_ap_credentials(const char *ssid, const char *pass = 0,
|
|
||||||
nsapi_security_t security = NSAPI_SECURITY_NONE);
|
|
||||||
|
|
||||||
/** Set the WiFi network channel
|
|
||||||
*
|
|
||||||
* @param channel Channel on which the connection is to be made, or 0 for any (Default: 0)
|
|
||||||
* @return 0 on success, or error code on failure
|
|
||||||
*/
|
|
||||||
virtual nsapi_error_t set_ap_channel(uint8_t channel);
|
|
||||||
|
|
||||||
/** Gets the current number of active connections
|
|
||||||
*
|
|
||||||
* @return number of active connections
|
|
||||||
*/
|
|
||||||
virtual int get_ap_connection_count();
|
|
||||||
|
|
||||||
/** Gets the max supported number of active connections
|
|
||||||
*
|
|
||||||
* @return maximum number of active connections
|
|
||||||
*/
|
|
||||||
virtual int get_ap_max_connection_count();
|
|
||||||
|
|
||||||
/** Enable or disable DHCP on the network access point
|
|
||||||
*
|
|
||||||
* Enables DHCP in SoftAP mode. Defaults to enabled unless
|
|
||||||
* a static IP address has been assigned. Requires that the network is
|
|
||||||
* service stopped.
|
|
||||||
*
|
|
||||||
* @param dhcp True to enable DHCP
|
|
||||||
* @return 0 on success, negative error code on failure
|
|
||||||
*/
|
|
||||||
virtual nsapi_error_t set_ap_dhcp(bool dhcp);
|
|
||||||
|
|
||||||
/** Set the beacon interval.
|
|
||||||
*
|
|
||||||
* Note that the value needs to be set before ap_start in order to take effect.
|
|
||||||
*
|
|
||||||
* @param interval Beason interval in time units (Default: 100 time units = 102.4 ms)
|
|
||||||
* @return 0 on success, or error code on failure
|
|
||||||
*/
|
|
||||||
virtual nsapi_error_t set_ap_beacon_interval(uint16_t interval);
|
|
||||||
|
|
||||||
/** Start the interface
|
|
||||||
*
|
|
||||||
* Attempts to serve a WiFi network.
|
|
||||||
*
|
|
||||||
* @param ssid Name of the network to connect to
|
|
||||||
* @param pass Security passphrase to connect to the network
|
|
||||||
* @param security Type of encryption for connection (Default: NSAPI_SECURITY_NONE)
|
|
||||||
* @param channel Channel on which the connection is to be made, or 0 for any (Default: 0)
|
|
||||||
* @return 0 on success, or error code on failure
|
|
||||||
*/
|
|
||||||
virtual nsapi_error_t ap_start(const char *ssid, const char *pass = 0,
|
|
||||||
nsapi_security_t security = NSAPI_SECURITY_NONE, uint8_t channel = 0);
|
|
||||||
|
|
||||||
/** Start the interface
|
|
||||||
*
|
|
||||||
* Attempts to serve a WiFi network. Requires ssid to be set.
|
|
||||||
* passphrase is optional.
|
|
||||||
* If passphrase is invalid, NSAPI_ERROR_AUTH_ERROR is returned.
|
|
||||||
*
|
|
||||||
* @return 0 on success, negative error code on failure
|
|
||||||
*/
|
|
||||||
virtual nsapi_error_t ap_start();
|
|
||||||
|
|
||||||
/** Stop the interface
|
|
||||||
*
|
|
||||||
* @return 0 on success, or error code on failure
|
|
||||||
*/
|
|
||||||
virtual nsapi_error_t ap_stop();
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
enum OdinWifiState {
|
enum OdinWifiState {
|
||||||
|
|
|
@ -186,6 +186,7 @@ typedef cb_int32 (*cbBCM_SetMaxLinksCmd)(cb_uint32 maxLinks);
|
||||||
* @return TRUE if handle is free, FALSE otherwise
|
* @return TRUE if handle is free, FALSE otherwise
|
||||||
*/
|
*/
|
||||||
typedef cb_boolean (*cbBCM_IsHandleFree)(cbBCM_Handle handle);
|
typedef cb_boolean (*cbBCM_IsHandleFree)(cbBCM_Handle handle);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback to indicate that remaining buffer size needs to be obtained from
|
* Callback to indicate that remaining buffer size needs to be obtained from
|
||||||
* upper layer. The callback returns remaining buffer size and there is
|
* upper layer. The callback returns remaining buffer size and there is
|
||||||
|
@ -293,7 +294,6 @@ extern cb_int32 cbBCM_enableServerProfileUuid128(
|
||||||
cbBCM_ConnectionCallback *pConnectionCallback,
|
cbBCM_ConnectionCallback *pConnectionCallback,
|
||||||
cbBCM_ServiceClassEnabled pServiceClassEnabled);
|
cbBCM_ServiceClassEnabled pServiceClassEnabled);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registers the server role of the local device. If role is cbBCM_PAN_ROLE_NAP a service
|
* Registers the server role of the local device. If role is cbBCM_PAN_ROLE_NAP a service
|
||||||
* record will be registred in the local service data base. The local device can only act as a
|
* record will be registred in the local service data base. The local device can only act as a
|
||||||
|
@ -523,7 +523,7 @@ extern cbBCM_Handle cbBCM_reqConnectUuid(
|
||||||
*
|
*
|
||||||
* @param handle Connection handle
|
* @param handle Connection handle
|
||||||
* @param accept TRUE to accept the incoming connection.
|
* @param accept TRUE to accept the incoming connection.
|
||||||
FALSE to reject.
|
* FALSE to reject.
|
||||||
* @return If the operation is successful cbBCM_OK is returned.
|
* @return If the operation is successful cbBCM_OK is returned.
|
||||||
*/
|
*/
|
||||||
extern cb_int32 cbBCM_rspConnectUuidCnf(
|
extern cb_int32 cbBCM_rspConnectUuidCnf(
|
||||||
|
@ -876,9 +876,3 @@ extern cb_int32 cbBCM_changeConnectionPacketType(
|
||||||
|
|
||||||
|
|
||||||
#endif /* _CB_BT_CONN_MAN_H_ */
|
#endif /* _CB_BT_CONN_MAN_H_ */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -373,6 +373,7 @@ extern cb_int32 cbBSM_deleteAllBondedDevices(void);
|
||||||
* @return cbBSM_OK.
|
* @return cbBSM_OK.
|
||||||
*/
|
*/
|
||||||
cb_int32 cbBSM_setStaticLinkKeyNvdsId(cb_int32 nvdsId);
|
cb_int32 cbBSM_setStaticLinkKeyNvdsId(cb_int32 nvdsId);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -68,6 +68,7 @@ typedef struct
|
||||||
/*===========================================================================
|
/*===========================================================================
|
||||||
* FUNCTIONS
|
* FUNCTIONS
|
||||||
*=========================================================================*/
|
*=========================================================================*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialization of Bluetooth serial manager. Called during stack
|
* Initialization of Bluetooth serial manager. Called during stack
|
||||||
* initialization. Shall not be called by application.
|
* initialization. Shall not be called by application.
|
||||||
|
|
|
@ -66,6 +66,7 @@ typedef struct
|
||||||
/*===========================================================================
|
/*===========================================================================
|
||||||
* FUNCTIONS
|
* FUNCTIONS
|
||||||
*=========================================================================*/
|
*=========================================================================*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialization of Bluetooth serial manager. Called during stack
|
* Initialization of Bluetooth serial manager. Called during stack
|
||||||
* initialization. Shall not be called by application.
|
* initialization. Shall not be called by application.
|
||||||
|
|
|
@ -86,6 +86,7 @@ extern "C" {
|
||||||
/*===========================================================================
|
/*===========================================================================
|
||||||
* TYPES
|
* TYPES
|
||||||
*=========================================================================*/
|
*=========================================================================*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start parameters passed to WLAN driver.
|
* Start parameters passed to WLAN driver.
|
||||||
*
|
*
|
||||||
|
@ -140,8 +141,6 @@ typedef struct cbWLAN_WPAPSK {
|
||||||
*/
|
*/
|
||||||
typedef struct cbWLAN_WPAPSKConnectParameters {
|
typedef struct cbWLAN_WPAPSKConnectParameters {
|
||||||
cbWLAN_WPAPSK psk; /**< WPA pre-shared key*/
|
cbWLAN_WPAPSK psk; /**< WPA pre-shared key*/
|
||||||
#if defined(CB_FEATURE_802DOT11W)
|
|
||||||
#endif
|
|
||||||
} cbWLAN_WPAPSKConnectParameters;
|
} cbWLAN_WPAPSKConnectParameters;
|
||||||
|
|
||||||
#if defined(CB_FEATURE_802DOT11R)
|
#if defined(CB_FEATURE_802DOT11R)
|
||||||
|
|
|
@ -235,7 +235,6 @@ struct cb_wlan_configuration* cbTARGET_configuration_create();
|
||||||
|
|
||||||
cbRTSL_Status cbTARGET_configure(cbTARGET_Handle* hTarget, cbTARGET_ConfigParams parameter, void* value);
|
cbRTSL_Status cbTARGET_configure(cbTARGET_Handle* hTarget, cbTARGET_ConfigParams parameter, void* value);
|
||||||
|
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
* Constants
|
* Constants
|
||||||
*-------------------------------------------------------------------------*/
|
*-------------------------------------------------------------------------*/
|
||||||
|
|
|
@ -423,6 +423,7 @@ cb_PACKED_STRUCT_BEGIN(cbWLAN_TimeOutInformation){
|
||||||
cb_uint8 timeOutType;
|
cb_uint8 timeOutType;
|
||||||
cb_uint32 value;
|
cb_uint32 value;
|
||||||
} cb_PACKED_STRUCT_END(cbWLAN_TimeOutInformation);
|
} cb_PACKED_STRUCT_END(cbWLAN_TimeOutInformation);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Description of the Mobility Domain Information Element
|
* Description of the Mobility Domain Information Element
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue