/*
* WiFi-Direct UG
*
-* Copyright 2012-2013 Samsung Electronics Co., Ltd
+* Copyright 2012 Samsung Electronics Co., Ltd
* Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
WDPOP_LOGD( "%dth connected peer. [%s]\n", peer_cnt, peer->device_name);
strncpy(ad->raw_connected_peers[peer_cnt].ssid, peer->device_name, sizeof(ad->raw_connected_peers[peer_cnt].ssid));
+ ad->raw_connected_peers[peer_cnt].ssid[31] = '\0';
strncpy(ad->raw_connected_peers[peer_cnt].mac_address, peer->mac_address, WFD_MAC_ADDRESS_SIZE);
+ ad->raw_connected_peers[peer_cnt].mac_address[17] = '\0';
WDPOP_LOGD( "\tSSID: [%s]\n", ad->raw_connected_peers[peer_cnt].ssid);
ad->raw_connected_peer_cnt++;
if (NULL != peer->device_name) {
WDPOP_LOGD( "discovered peer ssid[%s]\n", peer->device_name);
strncpy(ad->discovered_peers[ad->discovered_peer_count].ssid, peer->device_name, 32);
+ ad->discovered_peers[ad->discovered_peer_count].ssid[31] = '\0';
} else {
WDPOP_LOGD( "peer's device name is NULL\n");
}
memset(ad->peer_mac, 0, sizeof(ad->peer_mac));
memset(ad->peer_name, 0, sizeof(ad->peer_name));
strncpy(ad->peer_mac, mac_address, strlen(mac_address));
+ ad->peer_mac[17] = '\0';
peer_info = _wfd_app_find_peer_by_mac_address(ad, mac_address);
if (NULL == peer_info) {
} else {
WDPOP_LOGD( "SSID from connection is %s.\n", peer_info->ssid);
strncpy(ad->peer_name, peer_info->ssid, strlen(peer_info->ssid));
+ ad->peer_name[31] = '\0';
}
if (0 == strlen(ad->peer_name)) {
strncpy(ad->peer_name, ad->peer_mac, strlen(ad->peer_mac));
+ ad->peer_name[31] = '\0';
}
}
if (auto_connection_mode == TRUE) {
result = wifi_direct_accept_connection(ad->peer_mac);
- printf("wifi_direct_accept_connection() result=[%d]\n", result);
+ WDPOP_LOGD("wifi_direct_accept_connection() result=[%d]\n", result);
} else {
if (wps_mode == WIFI_DIRECT_WPS_TYPE_PBC) {
WDPOP_LOGD( "wps_config is WIFI_DIRECT_WPS_TYPE_PBC\n");
wifi_direct_is_autoconnection_mode(&auto_connection_mode);
if (auto_connection_mode == TRUE) {
result = wifi_direct_connect(ad->peer_mac);
- printf("wifi_direct_accept_connection() result=[%d]\n", result);
+ WDPOP_LOGD("wifi_direct_accept_connection() result=[%d]\n", result);
} else {
wfd_prepare_popup(WFD_POP_APRV_CONNECTION_INVITATION_REQ, NULL);
}