{
WDP_LOGD("POLLIN \n");
result = read(sockfd, (char *) reply, reply_buf_len);
-
+
WDP_LOGD("sockfd %d retval %d\n", sockfd, result);
WDP_LOGD("reply[%s]\n", reply);
-
+
if (result < 0)
{
WDP_LOGE( "Error!!! reading data, error [%s]\n", strerror(errno));
ptr = ptr +3;
ptr = __get_event_str(ptr, event_str);
- if (NULL != event_str)
- WDP_LOGD( "event str [%s]\n", event_str);
+ WDP_LOGD( "event str [%s]\n", event_str);
i=0;
event_id = WS_EVENT_NONE;
memcpy(&g_incomming_peer_mac_address, la_mac_addr, 6);
memset(g_incomming_peer_ssid, 0, sizeof(g_incomming_peer_ssid));
strncpy(g_incomming_peer_ssid, event.peer_ssid, sizeof(g_incomming_peer_ssid));
- if (event.wps_pin != NULL) {
- WDP_LOGD( "NEW PIN RECEIVED = %s\n", event.wps_pin);
- memset(g_wps_pin, 0x00, sizeof(g_wps_pin));
- strncpy(g_wps_pin, event.wps_pin, sizeof(g_wps_pin));
- }
+
+ WDP_LOGD( "NEW PIN RECEIVED = %s\n", event.wps_pin);
+ memset(g_wps_pin, 0x00, sizeof(g_wps_pin));
+ strncpy(g_wps_pin, event.wps_pin, sizeof(g_wps_pin));
+
WDP_LOGD( "Prov Req: mac[" MACSTR"] ssid=[%s]\n",
MAC2STR(g_incomming_peer_mac_address), g_incomming_peer_ssid);
} wfd_discovery_entry_s;
*/
// Device MAC address
- if (NULL != ws_peer_list[i].mac)
- {
- unsigned char la_mac_addr[6];
+ unsigned char la_mac_addr1[6];
- wfd_macaddr_atoe(ws_peer_list[i].mac, la_mac_addr);
- memcpy(wfd_peer_list[i].mac_address, (char*)(la_mac_addr), sizeof(la_mac_addr));
- }
+ wfd_macaddr_atoe(ws_peer_list[i].mac, la_mac_addr1);
+ memcpy(wfd_peer_list[i].mac_address, (char*)(la_mac_addr1), sizeof(la_mac_addr1));
// Interface MAC address
- if (NULL != ws_peer_list[i].interface_addr)
- {
- unsigned char la_mac_addr[6];
+ unsigned char la_mac_addr2[6];
- wfd_macaddr_atoe(ws_peer_list[i].interface_addr, la_mac_addr);
- memcpy(wfd_peer_list[i].intf_mac_address, (char*)(la_mac_addr), sizeof(la_mac_addr));
- }
+ wfd_macaddr_atoe(ws_peer_list[i].interface_addr, la_mac_addr2);
+ memcpy(wfd_peer_list[i].intf_mac_address, (char*)(la_mac_addr2), sizeof(la_mac_addr2));
// WPS Config method
wfd_peer_list[i].wps_cfg_methods = 0;
ws_peer_info.pri_dev_type,
ws_peer_info.oper_ssid);
- if (NULL != ws_peer_info.mac)
- {
- unsigned char la_mac_addr[6];
+ // Device MAC address
+ unsigned char la_mac_addr1[6];
- wfd_macaddr_atoe(ws_peer_info.mac, la_mac_addr);
- memcpy(wfd_peer_info->mac_address, (char*)(la_mac_addr), sizeof(la_mac_addr));
- }
+ wfd_macaddr_atoe(ws_peer_info.mac, la_mac_addr1);
+ memcpy(wfd_peer_info->mac_address, (char*)(la_mac_addr1), sizeof(la_mac_addr1));
// Interface MAC address
- if (NULL != ws_peer_info.interface_addr)
- {
- unsigned char la_mac_addr[6];
+ unsigned char la_mac_addr2[6];
- wfd_macaddr_atoe(ws_peer_info.interface_addr, la_mac_addr);
- memcpy(wfd_peer_info->intf_mac_address, (char*)(la_mac_addr), sizeof(la_mac_addr));
- }
+ wfd_macaddr_atoe(ws_peer_info.interface_addr, la_mac_addr2);
+ memcpy(wfd_peer_info->intf_mac_address, (char*)(la_mac_addr2), sizeof(la_mac_addr2));
// WPS Config method
wfd_peer_info->wps_cfg_methods = 0;
{
if (NULL == peer)
{
- if ( NULL == wfd_server->current_peer.intf_mac_address )
- {
- WDS_LOGF( "[wfd_server->current_peer.intf_mac_address] is NULL!\n");
- resp.result = WIFI_DIRECT_ERROR_INVALID_PARAMETER;
- wfd_server_send_response(client->sync_sockfd, &resp, sizeof(wifi_direct_client_response_s));
- break;
- }
-
if (wfd_oem_disconnect_sta(wfd_server->current_peer.intf_mac_address))
{
wfd_server_remember_connecting_peer(client_req->data.mac_addr);
__WDS_LOG_FUNC_EXIT__;
return;
}
- if ( NULL != device_name )
- WDS_LOGI( "device_name = [%s]\n", device_name);
- else
- WDS_LOGF( "device_name is NULL !!\n");
+
+ WDS_LOGI( "device_name = [%s]\n", device_name);
memset(wfd_server->config_data.device_name, 0, WIFI_DIRECT_MAX_DEVICE_NAME_LEN+1);
strncpy(wfd_server->config_data.device_name, device_name, WIFI_DIRECT_MAX_DEVICE_NAME_LEN);
__WDS_LOG_FUNC_EXIT__;
return;
}
- if ( NULL != pin )
- WDS_LOGF( "PIN = [%s]\n", pin);
- else
- WDS_LOGF( "PIN is NULL !!\n");
+
+ WDS_LOGF( "PIN = [%s]\n", pin);
ret = wfd_oem_set_wps_pin(pin);
__WDS_LOG_FUNC_EXIT__;
return;
}
- if ( NULL != ssid )
- WDS_LOGF( "ssid = [%s]\n", ssid);
- else
- WDS_LOGF( "ssid is NULL !!\n");
+
+ WDS_LOGF( "ssid = [%s]\n", ssid);
ret = wfd_oem_set_ssid(ssid);
__WDS_LOG_FUNC_EXIT__;
return;
}
- if ( NULL != new_wpa )
- WDS_LOGF( "new_wpa = [%s]\n", new_wpa);
- else
- WDS_LOGF( "new_wpa is NULL !!\n");
+
+ WDS_LOGF( "new_wpa = [%s]\n", new_wpa);
if (wfd_oem_set_wpa_passphrase(new_wpa) == false)
resp.result = WIFI_DIRECT_ERROR_OPERATION_FAILED;