[Prototype] Add APIs to fetch Wi-Fi Display information of own device. 45/185045/2
authorNishant Chaprana <n.chaprana@samsung.com>
Wed, 25 Jul 2018 11:49:43 +0000 (17:19 +0530)
committerNishant Chaprana <n.chaprana@samsung.com>
Wed, 25 Jul 2018 12:09:45 +0000 (17:39 +0530)
Change-Id: I940d1fe08477a41ac95f22a57a084f1dc3fb00b0
Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
include/wifi-direct.h
packaging/capi-network-wifi-direct.spec

index caf28af393f7e27adc9e550de9fe373aae048adb..904491983e31897050307151116356a6caaf1ea8 100755 (executable)
@@ -3112,7 +3112,7 @@ int wifi_direct_create_group(void);
  * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED  Operation failed
  * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED  Communication failed
  * @retval #WIFI_DIRECT_ERROR_PERMISSION_DENIED  Permission denied
- * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER  Invalid paramters
+ * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER  Invalid parameters
  * @retval #WIFI_DIRECT_ERROR_NOT_SUPPORTED  Not supported
  * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED  Not initialized
  * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY  Device or resource busy
@@ -7339,6 +7339,140 @@ int wifi_direct_set_display(wifi_direct_display_type_e type, int port, int hdcp)
 int wifi_direct_set_display_availability(bool availability);
 
 
+/**
+ * @brief Gets the Wi-Fi Display parameters for the WFD IE of local device.
+ * @since_tizen 5.0
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/wifidirect
+ * @param[out] type  WFD device type: role of WFD device like source or sink
+ * @param[out] port  Session management control port number, it will be of 2 bytes (0~65535)
+ * @param[out] hdcp  CP support bit: (@c 1 = hdcp support is enabled, @c 0 = hdcp support is disabled)
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #WIFI_DIRECT_ERROR_NONE                  Successful
+ * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED      Operation failed
+ * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED  Communication failed
+ * @retval #WIFI_DIRECT_ERROR_PERMISSION_DENIED     Permission denied
+ * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED         Operation not permitted
+ * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED       Not initialized
+ * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY         Device or resource busy
+ * @pre Wi-Fi Direct service must be activated by wifi_direct_activate()
+ *      and enable Wi-Fi Display by wifi_direct_init_display().
+ * @see wifi_direct_activate()
+ * @see wifi_direct_init_display()
+ * @see wifi_direct_deinit_display()
+ *
+ *
+ * Here is an example of the usage:
+ * @code
+ * #include <stdio.h>
+ * #include <wifi_direct.h>
+ *
+ *
+ * int function(void)
+ * {
+ *     int ret;
+ *     wifi_direct_display_type_e type;
+ *     int port;
+ *     int hdcp;
+ *
+ *     ret = wifi_direct_get_display(&type, &port, &hdcp);
+ *
+ *     if (ret != WIFI_DIRECT_ERROR_NONE) {
+ *             printf("Failed to get display property\n");
+ *             return -1;
+ *     }
+ *
+ *     printf("get display param success [type:%d], [port:%d], [hdcp:%d]\n", type, port, hdcp);
+ *     return 0;
+ * }
+ *
+ * int main()
+ * {
+ *     wifi_direct_initialize(); // Initialize Wi-Fi Direct
+ *     wifi_direct_activated(); // Activate Wi-Fi Direct
+ *
+ *     function();
+ *
+ *     //       APP CODE HERE
+ *
+ *     // App must cleaup Wi-Fi Direct before exiting
+ *
+ *     wifi_direct_deactivate(); // Deactivate Wi-Fi Direct
+ *     wifi_direct_deinitialize(); // Deinitialize Wi-Fi Direct
+ *     return 0;
+ * }
+ * @endcode
+ */
+int wifi_direct_get_display(wifi_direct_display_type_e *type, int *port, int *hdcp);
+
+
+/**
+ * @brief Gets the Wi-Fi Display Session Availability.
+ * @since_tizen 5.0
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/wifidirect
+ * @param[out] availability  Wi-Fi display session availability
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #WIFI_DIRECT_ERROR_NONE                  Successful
+ * @retval #WIFI_DIRECT_ERROR_INVALID_PARAMETER     Invalid parameter
+ * @retval #WIFI_DIRECT_ERROR_OPERATION_FAILED      Operation failed
+ * @retval #WIFI_DIRECT_ERROR_COMMUNICATION_FAILED  Communication failed
+ * @retval #WIFI_DIRECT_ERROR_PERMISSION_DENIED     Permission denied
+ * @retval #WIFI_DIRECT_ERROR_NOT_PERMITTED         Operation not permitted
+ * @retval #WIFI_DIRECT_ERROR_NOT_INITIALIZED       Not initialized
+ * @retval #WIFI_DIRECT_ERROR_RESOURCE_BUSY         Device or resource busy
+ * @pre Wi-Fi Direct service must be activated by wifi_direct_activate()
+ *      and enable Wi-Fi Display by wifi_direct_display_init().
+ * @see wifi_direct_activate()
+ * @see wifi_direct_init_display()
+ * @see wifi_direct_deinit_display()
+ *
+ *
+ * Here is an example of the usage:
+ * @code
+ * #include <stdio.h>
+ * #include <wifi_direct.h>
+ *
+ *
+ * int function(void)
+ * {
+ *     int ret;
+ *     int availability;
+ *
+ *     ret = wifi_direct_get_display_availability(&availability);
+ *
+ *     if (ret != WIFI_DIRECT_ERROR_NONE) {
+ *             printf("Failed to get display availability\n");
+ *             return -1;
+ *     }
+ *
+ *     printf("get display availability success [%d]\n", availability);
+ *     return 0;
+ * }
+ *
+ * int main()
+ * {
+ *     wifi_direct_initialize(); // Initialize Wi-Fi Direct
+ *     wifi_direct_activated(); // Activate Wi-Fi Direct
+ *
+ *     function();
+ *
+ *     //       APP CODE HERE
+ *
+ *     // App must cleaup Wi-Fi Direct before exiting
+ *
+ *     wifi_direct_deactivate(); // Deactivate Wi-Fi Direct
+ *     wifi_direct_deinitialize(); // Deinitialize Wi-Fi Direct
+ *     return 0;
+ * }
+ * @endcode
+ */
+int wifi_direct_get_display_availability(bool *availability);
+
+
 /**
  * @brief Gets the information of a peer's Wi-Fi Display device type.
  * @since_tizen 2.4
index c02fabf6bc996dc6ccd65bacd6b2b9d8ea278665..c562d53422ecbdf56f61e6dfe5ae4230f2fd0c93 100644 (file)
@@ -3,7 +3,7 @@
 
 Name:       capi-network-wifi-direct
 Summary:    Network WiFi-Direct Library
-Version:    1.2.95
+Version:    1.2.96
 Release:    1
 Group:      Network & Connectivity/API
 License:    Apache-2.0