Search code examples
blackberry-10

wifi_set_sta_power results in EPERM Operation isn't permitted


I have created this function in my BB10 C application:

int setWifiStatus(bool status) {
    int result;
    int errvalue = -10;
    result = wifi_set_sta_power(status);
    if (result != WIFI_SUCCESS) {

        errvalue = errno;
    }

    return errvalue;
}

I set the following permission in the bar_descriptor file:

<permission>access_wifi_public</permission>

The error number 1 (EPERM) Operation Not Permitted is returned in errno when I call the function. What am I missing?


Solution

  • Are you calling it with status == false ? According to the comments on the API documentation site, this call is now only able to turn the WiFi radio on.