- WDUG_LOGI("%dth discovered peer. [%s] [%s]\n", peer_cnt, peer->device_name, peer->mac_address);
-
- strncpy(ugd->raw_discovered_peers[peer_cnt].ssid, peer->device_name, SSID_LENGTH);
- ugd->raw_discovered_peers[peer_cnt].ssid[SSID_LENGTH-1] = '\0';
- ugd->raw_discovered_peers[peer_cnt].category = peer->primary_device_type;
- strncpy(ugd->raw_discovered_peers[peer_cnt].mac_addr, peer->mac_address, MAC_LENGTH);
- ugd->raw_discovered_peers[peer_cnt].mac_addr[MAC_LENGTH-1] = '\0';
- strncpy(ugd->raw_discovered_peers[peer_cnt].if_addr, peer->interface_address, MAC_LENGTH);
- ugd->raw_discovered_peers[peer_cnt].if_addr[MAC_LENGTH-1] = '\0';
- ugd->raw_discovered_peers[peer_cnt].is_group_owner = peer->is_group_owner;
- ugd->raw_discovered_peers[peer_cnt].is_persistent_group_owner = peer->is_persistent_group_owner;
- ugd->raw_discovered_peers[peer_cnt].is_connected = peer->is_connected;
-
- if (TRUE == peer->is_connected) {
- ugd->raw_discovered_peers[peer_cnt].conn_status = PEER_CONN_STATUS_CONNECTED;
+ DBG_SECURE(LOG_INFO, "%dth discovered peer. [%s] ["MACSECSTR"]\n", peer_cnt,
+ peer->device_name, MAC2SECSTR(peer->mac_address));
+
+ if (ugd->device_filter < 0 || peer->primary_device_type == ugd->device_filter) {
+ strncpy(peer_tmp->ssid, peer->device_name, sizeof(peer_tmp->ssid) - 1);
+ peer_tmp->ssid[SSID_LENGTH - 1] = '\0';
+ peer_tmp->category = peer->primary_device_type;
+ peer_tmp->sub_category = peer->secondary_device_type;
+ strncpy(peer_tmp->mac_addr, peer->mac_address, MAC_LENGTH - 1);
+ peer_tmp->mac_addr[MAC_LENGTH - 1] = '\0';
+ strncpy(peer_tmp->if_addr, peer->interface_address, MAC_LENGTH - 1);
+ peer_tmp->if_addr[MAC_LENGTH - 1] = '\0';
+ peer_tmp->is_group_owner = peer->is_group_owner;
+ peer_tmp->is_persistent_group_owner = peer->is_persistent_group_owner;
+ peer_tmp->is_connected = peer->is_connected;
+ peer_tmp->dev_sel_state = FALSE;
+
+ if (TRUE == peer->is_connected) {
+ peer_tmp->conn_status = PEER_CONN_STATUS_CONNECTED;
+ } else {
+ peer_tmp->conn_status = PEER_CONN_STATUS_DISCONNECTED;
+ }
+
+ ugd->raw_discovered_peer_list = g_list_append(ugd->raw_discovered_peer_list, peer_tmp);
+ DBG(LOG_INFO, "\tSSID: [%s]\n", peer_tmp->ssid);
+ DBG(LOG_INFO, "\tPeer category [%d] -> [%d]\n", peer->primary_device_type, peer_tmp->category);
+ DBG(LOG_INFO, "\tStatus: [%d]\n", peer_tmp->conn_status);
+ DBG(LOG_INFO, "\tservice_count: [%d]\n", peer->service_count);
+ ugd->raw_discovered_peer_cnt++;