Languages

Menu
Sites
Language
Wifi connection callback gives error even though already connected

Hi,

I'm trying to incorporate connecting to a specific Wi-fi access point into a wearable native application running on TIzen 3.0.0.2 on the Samsung Gear S3 smartwatch. I'm basically using the code provided here:

https://developer.tizen.org/development/guides/native-application/connectivity-and-wireless/wi-fi

Funny thing is that the call back function 

static void
__connected_cb(wifi_error_e result, void* user_data)
{
    if (result == WIFI_ERROR_NONE)
        dlog_print(DLOG_INFO, LOG_TAG, "Wi-Fi Connection Succeeded");
    else
        dlog_print(DLOG_INFO, LOG_TAG, "Wi-Fi Connection Failed!");
}

returns an error even though the device correctly connects to the requested access point!! So all previous function calls complete successfully and the device gets connected. Has anyone experienced this behavior before?

Just for future reference in case anyone has issues with getting the code at the above link running, one first has to declare a (global) variable

wifi_manager_h wifi = NULL;

and the call to 

error_code = wifi_manager_initialize(wifi);

at step 3 should be (the function actually takes a pointer!)

error_code = wifi_manager_initialize(&wifi);

Anyone in the Tizen community can notify to have this typo updated?

 

Edited by: Sam Richardson on 05 Feb, 2019