Modifying internal APIs 82/14782/1
authorJiung Yu <jiung.yu@samsung.com>
Mon, 13 Jan 2014 02:49:04 +0000 (11:49 +0900)
committerJiung Yu <jiung.yu@samsung.com>
Mon, 13 Jan 2014 02:49:21 +0000 (11:49 +0900)
Change-Id: Iaf0373d7c1a1f439d5fe9efeb0f56ea8c982594a
Signed-off-by: Yu jiung <jiung.yu@samsung.com>
include/wifi-direct-internal.h
include/wifi-direct.h
packaging/libwifi-direct.changes
src/wifi-direct-client-proxy.c

index 1042c96..5c97825 100644 (file)
@@ -195,19 +195,19 @@ typedef struct
  */
 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;
 
 
@@ -219,11 +219,13 @@ typedef struct
        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
@@ -245,6 +247,7 @@ 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;
 
index 95d500d..e010203 100644 (file)
@@ -55,6 +55,7 @@ typedef enum
        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;
 
 /**
@@ -225,6 +226,7 @@ typedef struct
        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;
 
 
@@ -242,6 +244,7 @@ typedef struct
        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;
 
 /**
index 528ab43..c17e27b 100644 (file)
@@ -1,3 +1,6 @@
+* Fri, 10 Jan 2014 Jiung Yu <jiung.yu@samsung.com> (1.0.1)
+  - Modifying internal APIs
+
 * Tue, 15 Oct 2013 Jiung Yu <jiung.yu@samsung.com> (1.0.0)
   - add CMD_SET_REQ_WPS_MODE CMD_GET_REQ_WPS_MODE
 
index da15efb..ac6ca71 100644 (file)
@@ -559,7 +559,7 @@ void __wfd_client_print_connected_peer_info(wfd_connected_peer_info_s *list, int
                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);
@@ -1360,7 +1360,7 @@ int wifi_direct_foreach_discovered_peers(wifi_direct_discovered_peer_cb cb,
                                        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;
@@ -1795,7 +1795,7 @@ int wifi_direct_foreach_connected_peers(wifi_direct_connected_peer_cb cb,
                        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;
@@ -2509,6 +2509,7 @@ int wifi_direct_set_wpa_passphrase(char *passphrase)
 
        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));
@@ -2520,7 +2521,7 @@ int wifi_direct_set_wpa_passphrase(char *passphrase)
        }
        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();
@@ -2636,6 +2637,7 @@ int wifi_direct_set_wps_pin(char *pin)
 
        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));