Skip to content

WiFiInterface::get_default_instance() always returns NULL #7246

@SeppoTakalo

Description

@SeppoTakalo

Description

In Mbed OS 5.9, targets are able to provide default network interface of each type.

Ublox Odin W2 however, does not provide WiFiInterface *WiFiInterface::get_default_instance() making it impossible to select default network interface to be a WiFi.

Same seems to be true for REALTEK_RTL8195AM.

To verify, create following main.cpp

// Network interface
NetworkInterface *net;

// Socket demo
int main() {
    net = NetworkInterface::get_default_instance();

    if (!net) {
        printf("Error! No network inteface found.\n");
        return 0;
    }
    printf("Found, OK\n");
}

And following mbed_app.json

{
    "target_overrides": {
        "*": {
            "target.network-default-interface-type": "WIFI"
        }
    }
}

Issue request type

[ ] Question
[ ] Enhancement
[X] Bug

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions