*/
typedef struct
{
- bool is_group_owner;
char device_name[WIFI_DIRECT_MAX_DEVICE_NAME_LEN + 1];
unsigned char mac_address[6];
+ unsigned char intf_address[6];
int channel;
bool is_connected;
- unsigned int services;
+ bool is_group_owner;
bool is_persistent_go;
- unsigned char intf_mac_address[6];
- unsigned int wps_device_pwd_id;
- unsigned int wps_cfg_methods;
unsigned int category;
unsigned int subcategory;
- bool is_wfd_device ;
+ unsigned int services;
+ unsigned int wps_device_pwd_id;
+ unsigned int wps_cfg_methods;
+ bool is_wfd_device;
} wfd_discovery_entry_s;
char device_name[WIFI_DIRECT_MAX_DEVICE_NAME_LEN + 1];
unsigned char ip_address[4];
unsigned char mac_address[6];
- unsigned char intf_mac_address[6];
- unsigned int services;
+ unsigned char intf_address[6];
+ int channel;
bool is_p2p;
unsigned short category;
- int channel;
+ unsigned short subcategory;
+ unsigned int services;
+ bool is_wfd_device;
} wfd_connected_peer_info_s;
typedef struct
{
wifi_direct_cmd_e cmd;
int client_id;
+ unsigned int cmd_data_len;
wifi_direct_client_request_data_s data;
} wifi_direct_client_request_s;
WIFI_DIRECT_ERROR_AUTH_FAILED = -0x00008000|0x0206, /**< Authentication failed */
WIFI_DIRECT_ERROR_OPERATION_FAILED = -0x00008000|0x0207, /**< Operation failed */
WIFI_DIRECT_ERROR_TOO_MANY_CLIENT = -0x00008000|0x0208, /**< Too many client */
+ WIFI_DIRECT_ERROR_CONNECTION_CANCELED, /**< Connection canceled by local device */
} wifi_direct_error_e;
/**
int supported_wps_types; /** The list of supported WPS type. \n
The OR operation on #wifi_direct_wps_type_e can be used like #WIFI_DIRECT_WPS_TYPE_PBC | #WIFI_DIRECT_WPS_TYPE_PIN_DISPLAY */
char *ssid; /**< Service set identifier - DEPRECATED */
+ bool is_miracast_device;
} wifi_direct_discovered_peer_info_s;
wifi_direct_primary_device_type_e primary_device_type; /* primary category of device */
int channel; /* Operating channel */
char* ssid; /**< Service set identifier - DEPRECATED */
+ bool is_miracast_device;
} wifi_direct_connected_peer_info_s;
/**
WDC_LOGD("== Peer index : %d ==\n", i);
WDC_LOGD("device_name : %s\n", list[i].device_name);
WDC_LOGD("Device MAC : " MACSTR "\n", MAC2STR(list[i].mac_address));
- WDC_LOGD("Interface MAC : " MACSTR "\n", MAC2STR(list[i].intf_mac_address));
+ WDC_LOGD("Interface MAC : " MACSTR "\n", MAC2STR(list[i].intf_address));
WDC_LOGD("services : %d\n", list[i].services);
WDC_LOGD("is_p2p : %d\n", list[i].is_p2p);
WDC_LOGD("category : %d\n", list[i].category);
peer_list->is_connected = buff[i].is_connected;
peer_list->is_persistent_group_owner = buff[i].is_persistent_go;
peer_list->interface_address = (char*) calloc(1, MACSTR_LEN);
- snprintf(peer_list->interface_address, MACSTR_LEN, MACSTR, MAC2STR(buff[i].intf_mac_address));
+ snprintf(peer_list->interface_address, MACSTR_LEN, MACSTR, MAC2STR(buff[i].intf_address));
peer_list->supported_wps_types= buff[i].wps_cfg_methods;
peer_list->primary_device_type = buff[i].category;
peer_list->secondary_device_type = buff[i].subcategory;
peer_list->mac_address = (char*) calloc(1, MACSTR_LEN);
snprintf(peer_list->mac_address, MACSTR_LEN, MACSTR, MAC2STR(buff[i].mac_address));
peer_list->interface_address = (char*) calloc(1, MACSTR_LEN);
- snprintf(peer_list->interface_address, MACSTR_LEN, MACSTR, MAC2STR(buff[i].intf_mac_address));
+ snprintf(peer_list->interface_address, MACSTR_LEN, MACSTR, MAC2STR(buff[i].intf_address));
peer_list->p2p_supported = buff[i].is_p2p;
peer_list->primary_device_type = buff[i].category;
peer_list->channel = buff[i].channel;
req.cmd = WIFI_DIRECT_CMD_SET_WPA;
req.client_id = client_info->client_id;
+ req.cmd_data_len = 64;
status = __wfd_client_send_request(client_info->sync_sockfd, &req,
sizeof(wifi_direct_client_request_s));
}
WDC_LOGD("writing msg hdr is success!");
- status = __wfd_client_send_request(client_info->sync_sockfd, passphrase, 64);
+ status = __wfd_client_send_request(client_info->sync_sockfd, passphrase, req.cmd_data_len);
if (status != WIFI_DIRECT_ERROR_NONE) {
WDC_LOGE("Error!!! writing to socket[%s]", __wfd_print_error(status));
__wfd_reset_control();
req.cmd = WIFI_DIRECT_CMD_SET_WPS_PIN;
req.client_id = client_info->client_id;
+ req.cmd_data_len = WIFI_DIRECT_WPS_PIN_LEN+1;
status = __wfd_client_send_request(client_info->sync_sockfd, &req,
sizeof(wifi_direct_client_request_s));