3 * Copyright (c) 2017 Samsung Electronics Co., Ltd. All rights reserved.
5 * Contact: Sungsik Jang <sungsik.jang@samsung.com>, Dongwook Lee <dwmax.lee@samsung.com>
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
20 #ifndef __TIZEN_NET_ASP_H__
21 #define __TIZEN_NET_ASP_H__
31 * @addtogroup CAPI_NETWORK_ASP_MODULE
35 #ifndef TIZEN_ERROR_ASP
36 #define TIZEN_ERROR_ASP -0x02F60000
40 * @brief Enumeration for Application Service Platform (ASP) error code.
44 ASP_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
45 ASP_ERROR_NOT_PERMITTED = TIZEN_ERROR_NOT_PERMITTED, /**< Operation not permitted(1) */
46 ASP_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory(12) */
47 ASP_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied(13) */
48 ASP_ERROR_RESOURCE_BUSY = TIZEN_ERROR_RESOURCE_BUSY, /**< Device or resource busy(16) */
49 ASP_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid function parameter(22) */
50 ASP_ERROR_CONNECTION_TIME_OUT = TIZEN_ERROR_CONNECTION_TIME_OUT, /**< Connection timed out(110) */
51 ASP_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported */
52 ASP_ERROR_NOT_INITIALIZED = TIZEN_ERROR_ASP|0x01, /**< Not initialized */
53 ASP_ERROR_ALREADY_INITIALIZED = TIZEN_ERROR_ASP|0x02, /**< Already initialized */
54 ASP_ERROR_COMMUNICATION_FAILED = TIZEN_ERROR_ASP|0x03, /**< I/O error */
55 ASP_ERROR_OPERATION_FAILED = TIZEN_ERROR_ASP|0x04, /**< Operation failed */
56 ASP_ERROR_IN_PROGRESS = TIZEN_ERROR_ASP|0x05, /**< In progress */
57 ASP_ERROR_SERVICE_NOT_FOUND = TIZEN_ERROR_ASP|0x06, /**< Service not found */
58 ASP_ERROR_SESSION_NOT_FOUND = TIZEN_ERROR_ASP|0x07, /**< Session not found */
59 ASP_ERROR_NETWORK_ROLE_REJECTED = TIZEN_ERROR_ASP|0x08 /**< Requested network role rejected */
63 * @brief Enumeration for Advertise Status event reason.
67 ASP_ADVERT_STATUS_REASON_SUCCESS, /**< Status reason: Success */
68 ASP_ADVERT_STATUS_REASON_SERVICE_DUPLICATED, /**< Status reason: Service duplicated */
69 ASP_ADVERT_STATUS_REASON_OTHER_FAILURE, /**< Status reason: Other failure */
70 } asp_advert_status_reason_e;
73 * @brief Enumeration for the Wi-Fi P2P role assignment scheme.
75 * @see asp_advert_set_p2p_role_scheme()
76 * @see asp_advert_get_p2p_role_scheme()
77 * @see asp_session_set_p2p_role()
78 * @see asp_session_get_p2p_role()
81 ASP_ADVERT_P2P_ROLE_SCHEME_ANY, /**< All roles are acceptable */
82 ASP_ADVERT_P2P_ROLE_SCHEME_GO, /**< The interface should assume the GO role */
83 ASP_ADVERT_P2P_ROLE_SCHEME_GC, /**< The interface should assume the GC role */
84 } asp_advert_p2p_role_scheme_e;
87 * @brief Enumeration for service discovery mechanism.
89 * @see asp_advert_set_tech()
90 * @see asp_advert_get_tech()
91 * @see asp_seek_set_tech()
94 ASP_DISCOVERY_TECH_P2P = 1 << 0, /**< Use Wi-Fi P2P for discovery mechanism */
95 ASP_DISCOVERY_TECH_BLE = 1 << 1, /**< Use BLE for discovery mechanism */
96 ASP_DISCOVERY_TECH_NFC = 1 << 2, /**< Use NFC for discovery mechanism */
97 ASP_DISCOVERY_TECH_INFRA = 1 << 3, /**< Use Wi-Fi Infrastructured for discovery mechanism */
98 ASP_DISCOVERY_TECH_NAN = 1 << 4, /**< Use Wi-Fi NAN for discovery mechanism */
99 } asp_discovery_tech_e;
102 * @brief Enumeration for Wi-Fi WPS type.
103 * @see asp_advert_set_p2p_config_method()
104 * @see asp_advert_get_p2p_config_method()
105 * @see asp_session_set_p2p_config_method()
106 * @see asp_session_get_p2p_config_method()
110 ASP_WPS_TYPE_NONE, /**< No WPS type */
111 ASP_WPS_TYPE_DEFAULT, /**< Default WPS type both P2PS and PIN */
112 ASP_WPS_TYPE_PIN_BOTH, /**< WPS type PIN code both display and keypad*/
113 ASP_WPS_TYPE_PIN_DISPLAY, /**< WPS type display PIN code only*/
114 ASP_WPS_TYPE_PIN_KEYPAD, /**< WPS type keypad to input the PIN only*/
118 * @brief Enumeration for Application Service Platform (ASP) Session connect status.
122 ASP_CONNECT_STATUS_NETWORK_ROLE_REJECTED, /**< Network role rejected */
123 ASP_CONNECT_STATUS_CONNECTION_LIMIT_REACHED, /**< The device's connection limit has been reached */
124 ASP_CONNECT_STATUS_REQUEST_SENT, /**< Session request sent */
125 ASP_CONNECT_STATUS_REQUEST_RECEIVED, /**< Session request received */
126 ASP_CONNECT_STATUS_REQUEST_DEFERRED, /**< Session request deferred */
127 ASP_CONNECT_STATUS_REQUEST_ACCEPTED, /**< Session request accepted */
128 ASP_CONNECT_STATUS_REQUEST_FAILED, /**< Session request failed */
129 ASP_CONNECT_STATUS_GROUP_FORMATION_STARTED, /**< Group formation started */
130 ASP_CONNECT_STATUS_GROUP_FORMATION_COMPLETED, /**< Group formation completed */
131 ASP_CONNECT_STATUS_GROUP_FORMATION_FAILED, /**< Group formation failed*/
132 } asp_connect_status_e;
135 * @brief Enumeration for Application Service Platform (ASP) general session state.
139 ASP_SESSION_STATE_ERROR, /**< Session state error*/
140 ASP_SESSION_STATE_CLOSED, /**< Session state closed*/
141 ASP_SESSION_STATE_INITIATED, /**< Session state initiated*/
142 ASP_SESSION_STATE_REQUESTED, /**< Session state requested*/
143 ASP_SESSION_STATE_OPEN, /**< Session state open*/
144 } asp_session_state_e;
147 * @brief Enumeration for Application Service Platform (ASP) session close status.
151 ASP_SESSION_CLOSE_OK, /**< Session closed without error */
152 ASP_SESSION_CLOSE_DISASSOCIATED, /**< Session closed by disassociation (Wi-Fi Direct connection was broken) */
153 ASP_SESSION_CLOSE_LOCAL_CLOSE, /**< Session closed with local close */
154 ASP_SESSION_CLOSE_REMOTE_CLOSE, /**< Session closed with remote close */
155 ASP_SESSION_CLOSE_SYSTEM_FAILURE, /**< Session closed with system failure */
156 ASP_SESSION_CLOSE_NO_RESPONSE, /**< Session closed with no response from remote */
157 } asp_session_close_status_e;
160 * @brief Enumeration for Application Service Platform (ASP) port status.
164 ASP_PORT_STATUS_LOCAL_PORT_ALLOWED, /**< Incoming connections are allowed on this local port for this ASP session */
165 ASP_PORT_STATUS_LOCAL_PORT_BLOCKED, /**< Incoming connections are no longer allowed in the ASP session for this local port */
166 ASP_PORT_STATUS_FAILURE, /**< The ASP was unable to set up this local port */
167 ASP_PORT_STATUS_REMOTE_PORT_ALLOWED, /**< The remote service has allowed access to the given remote port for the given protocol */
171 * @brief Enumeration for service status.
175 ASP_SERVICE_STATUS_NOT_ADVERTISED , /**< Service status not advertised */
176 ASP_SERVICE_STATUS_ADVERTISED, /**< Service status advertised */
177 } asp_service_status_e;
180 * @brief The advertised service description.
183 typedef void *asp_advert_service_h;
186 * @brief The searching service description.
189 typedef void *asp_seek_service_h;
192 * @brief The Application Service Platform (ASP) session description.
195 typedef void *asp_session_h;
198 * @brief Called when the Application Service Platform (ASP) Service is found.
200 * @remarks @a service_mac, @a instance_name and @a service_info are valid only in the callback.
201 * To use outside the callback, make a copy.
202 * @param[in] error_code The error code. \n
203 * #ASP_ERROR_NONE Successful\n
204 * #ASP_ERROR_OUT_OF_MEMORY Out of memory\n
205 * #ASP_ERROR_OPERATION_FAILED Operation failed\n
206 * @param[in] seek_service The seek service which found the current result;
207 * the handle to the same object for which the search was started
208 * @param[in] service_mac The P2P device address of the device which provides the service;
209 * NULL if not available
210 * @param[in] adv_id The service advertisement ID defined by remote P2P device
211 * @param[in] config_method The preferred Wi-Fi Simple Config (WSC) configuration method
212 * @param[in] instance_name The advertised service name defined by the remote P2P device;
213 * NULL if not available
214 * @param[in] service_info The advertised service information defined by the remote P2P device;
215 * NULL if not available
216 * @param[in] info_size The advertised service information payload size;
217 * if the information is not available, this is set to -1
218 * @param[in] status The status of the service
219 * @param[in] user_data The user data passed from the callback registration function
220 * @pre The callback must be registered using asp_seek_set_search_result_cb().\n
221 * asp_seek_start() must be called to invoke this callback.
222 * @see asp_seek_set_search_result_cb()
223 * @see asp_seek_unset_search_result_cb()
224 * @see asp_seek_start()
226 typedef void (*asp_seek_search_result_cb) (int error_code,
227 asp_seek_service_h seek_service,
228 const char *service_mac,
230 asp_wps_type_e config_method,
231 const char *instance_name,
232 const char *service_info,
234 unsigned char status,
238 * @brief Called when the status of an advertisement to a service is changed.
240 * @param[in] adv_service The service whose status has changed;
241 * the handle to the same object for which the callback was set
242 * @param[in] status The status of the service
243 * @param[in] reason The reason of the state change
244 * @param[in] user_data The user data passed from the callback registration function
245 * @pre The callback must be registered using asp_advert_set_status_cb().\n
246 * asp_advert_start_advertising() and asp_change_service_state() invoke this callback.
247 * @see asp_advert_set_status_changed_cb()
248 * @see asp_advert_unset_status_changed_cb()
249 * @see asp_advert_start_advertising()
251 typedef void (*asp_advert_status_changed_cb) (asp_advert_service_h adv_service,
252 asp_service_status_e status,
253 asp_advert_status_reason_e reason,
257 * @brief Called when a remote device is attempting to initiate an ASP session.
259 * @remarks @a network_config_pin, @a device_name and @a info are valid only in the callback.
260 * To use outside the callback, make a copy.
261 * @param[in] error_code The error code.\n
262 * #ASP_ERROR_NONE Successful\n
263 * #ASP_ERROR_OUT_OF_MEMORY Out of memory\n
264 * #ASP_ERROR_OPERATION_FAILED Operation failed\n
265 * @param[in] adv_service Service descriptor handle provided by the asp_advert_create()
266 * it is the "original" object not created specifically for the callback
267 * @param[in] session The session for which the request is made;
268 * the handle to the same object for which the callback was set
269 * @param[in] device_name Device name of the remote peer
270 * @param[in] info The service-specific data payload (up to 144 bytes);
271 * NULL if not available
272 * @param[in] info_size The service-specific data payload size (up to 144)
273 * @param[in] get_network_config_pin (@c true = requires WSC PIN to be entered by
274 * the asp_session_confirm(),
275 * @c false = does not require PIN)
276 * @param[in] network_config_pin The WSC PIN value to be displayed; NULL if not available
277 * @param[in] user_data The user data passed from the callback registration function
278 * @pre The callback must be registered using asp_session_set_request_cb().
279 * @see asp_session_set_request_cb()
281 typedef void (*asp_session_request_cb) (int error_code,
282 asp_advert_service_h adv_service,
283 asp_session_h session,
284 const char *device_name,
287 bool get_network_config_pin,
288 const char *network_config_pin,
292 * @brief Called when the Application Service Platform (ASP) has to provide
293 * a PIN value or collect a PIN value.
295 * @remarks @a config_pin is valid only in the callback.
296 * To use outside the callback, make a copy.
297 * @param[in] error_code The error code.\n
298 * #ASP_ERROR_NONE Successful\n
299 * #ASP_ERROR_OUT_OF_MEMORY Out of memory\n
300 * #ASP_ERROR_OPERATION_FAILED Operation failed\n
301 * @param[in] session The session for which the request is made;
302 * the handle to the same object for which the callback was set
303 * @param[in] get_pin (@c true = instruct the user to enter the PIN,
304 * @c false = display the PIN provided in the @a config_pin parameter)
305 * @param[in] config_pin The WSC PIN value used for setting up; ignored if @a get_pin is @c true
306 * @param[in] user_data The user data passed from the callback registration function
307 * @pre The callback must be registered using asp_session_set_config_request_cb().\n
308 * asp_session_connect() must be called to invoke this callback.
309 * @see asp_session_set_request_cb()
310 * @see asp_session_connect()
312 typedef void (*asp_session_config_request_cb) (int error_code,
313 asp_session_h session,
315 const char *config_pin,
319 * @brief Called when the Application Service Platform (ASP) reports progress on group formation.
321 * @remarks @a deferred_resp is valid only in the callback.
322 * To use outside the callback, make a copy.
323 * @param[in] error_code The error code.\n
324 * #ASP_ERROR_NONE Successful\n
325 * #ASP_ERROR_OUT_OF_MEMORY Out of memory\n
326 * #ASP_ERROR_OPERATION_FAILED Operation failed\n
327 * @param[in] session The session for which progress is reported;
328 * the handle to the same object for which the callback was set
329 * @param[in] status The connection progress status
330 * @param[in] deferred_resp The service-specific data payload up to 144 bytes
331 * @param[in] resp_size The service-specific data payload size(up to 144)
332 * @param[in] user_data The user data passed from the callback registration function
333 * @pre The callback must be registered using asp_session_set_connect_status_cb()
334 * @see asp_session_set_connect_status_cb()
336 typedef void (*asp_session_connect_status_cb) (int error_code,
337 asp_session_h session,
338 asp_connect_status_e status,
339 const char *deferred_resp,
344 * @brief Called when the Application Service Platform (ASP) reports the state and status of an ASP session.
346 * @remarks @a additional_info is valid only in the callback.
347 * To use outside the callback, make a copy.
348 * @param[in] error_code The error code.\n
349 * #ASP_ERROR_NONE Successful\n
350 * #ASP_ERROR_OUT_OF_MEMORY Out of memory\n
351 * #ASP_ERROR_OPERATION_FAILED Operation failed\n
352 * @param[in] session The session for which status is reported;
353 * the handle to the same object for which the callback was set
354 * @param[in] state The session state
355 * @param[in] additional_info Additional information related to the SessionStatus event
356 * @param[in] user_data The user data passed from the callback registration function
357 * @pre The callback must be registered using asp_session_set_status_cb()
358 * @see asp_session_set_status_cb()
360 typedef void (*asp_session_status_cb) (int error_code,
361 asp_session_h session,
362 asp_session_state_e state,
363 const char *additional_info,
367 * @brief Called when the Application Service Platform (ASP) reports the status of the network port on the local and remote end of the ASP session.
369 * @remarks @a ip_address is valid only in the callback.
370 * To use outside the callback, make a copy.
371 * @param[in] error_code The error code.\n
372 * #ASP_ERROR_NONE Successful\n
373 * #ASP_ERROR_OUT_OF_MEMORY Out of memory\n
374 * #ASP_ERROR_OPERATION_FAILED Operation failed\n
375 * @param[in] session Application Service Platform session descriptor handle
376 * @param[in] ip_address The IP address for the port, local or remote
377 * @param[in] port The port number
378 * @param[in] proto The IANA protocol number
379 * @param[in] status The port status
380 * @param[in] user_data The user data passed from the callback registration function
381 * @pre The callback must be registered using asp_session_set_port_status_cb()
382 * @see asp_set_session_port_status_cb()
384 typedef void (*asp_session_port_status_cb) (int error_code,
385 asp_session_h session,
386 const char *ip_address,
389 asp_port_status_e status,
393 * @brief Initializes Application Service Platform (ASP).
396 * @privilege http://tizen.org/privilege/wifidirect
397 * @return 0 on success, otherwise a negative error value.
398 * @retval #ASP_ERROR_NONE Successful
399 * @retval #ASP_ERROR_RESOURCE_BUSY Device or resource busy
400 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
401 * @retval #ASP_ERROR_COMMUNICATION_FAILED Communication failed
402 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
403 * @see asp_deinitialize()
405 int asp_initialize(void);
408 * @brief Deinitializes Application Service Platform (ASP).
411 * @privilege http://tizen.org/privilege/wifidirect
412 * @return 0 on success, otherwise a negative error value.
413 * @retval #ASP_ERROR_NONE Successful
414 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
415 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
416 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
417 * @retval #ASP_ERROR_COMMUNICATION_FAILED Communication failed
418 * @pre Application Service Platform (ASP) must be initialized by asp_initialize().
419 * @see asp_initialize()
421 int asp_deinitialize(void);
424 * @brief Registers the callback function that will be invoked when a service found.
427 * @param[in] cb The callback function to invoke
428 * @param[in] user_data The user data passed from the callback registration function
429 * @return 0 on success, otherwise a negative error value
430 * @retval #ASP_ERROR_NONE Successful
431 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
432 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
433 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
434 * @pre Application Service Platform (ASP) must be initialized by asp_initialize().
435 * @post asp_search_result_cb will be called under certain conditions,
436 * after calling asp_seek_start()
437 * @see asp_initialize()
438 * @see asp_seek_unset_search_result_cb()
439 * @see asp_seek_start()
441 int asp_seek_set_search_result_cb(asp_seek_search_result_cb cb, void *user_data);
444 * @brief Unregisters the callback function that will invoked when a service found.
447 * @return 0 on success, otherwise a negative error value
448 * @retval #ASP_ERROR_NONE Successful
449 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
450 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
451 * @pre Application Service Platform (ASP) must be initialized by asp_initialize().
452 * @see asp_initialize()
453 * @see asp_seek_set_search_result_cb()
455 int asp_seek_unset_search_result_cb(void);
458 * @brief Registers the callback function that will invoked when the status of an advertisement to a service is changed.
461 * @param[in] cb The callback function to invoke
462 * @param[in] user_data The user data passed from the callback registration function
463 * @return 0 on success, otherwise a negative error value
464 * @retval #ASP_ERROR_NONE Successful
465 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
466 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
467 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
468 * @pre Application Service Platform (ASP) must be initialized by asp_initialize().
469 * @post asp_seek_search_result_cb() will be called under certain conditions,
470 * after calling asp_seek_start()
471 * @see asp_initialize()
472 * @see asp_advert_unset_status_changed_cb()
473 * @see asp_advert_start_advertising()
475 int asp_advert_set_status_changed_cb(asp_advert_status_changed_cb cb,
479 * @brief Unregisters the callback function that will invoked when the status of an advertisement to a service is changed.
482 * @return 0 on success, otherwise a negative error value
483 * @retval #ASP_ERROR_NONE Successful
484 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
485 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
486 * @pre Application Service Platform (ASP) must be initialized by asp_initialize().
487 * @see asp_initialize()
488 * @see asp_advert_set_status_changed_cb()
490 int asp_advert_unset_status_changed_cb(void);
493 * @brief Registers the callback called when ASP session connection is requested.
496 * @param[in] cb The callback function to invoke
497 * @param[in] user_data The user data passed from the callback registration function
498 * @return 0 on success, otherwise a negative error value
499 * @retval #ASP_ERROR_NONE Successful
500 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
501 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
502 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
503 * @pre Application Service Platform (ASP) must be initialized by asp_initialize().
504 * @see asp_initialize()
505 * @see asp_session_unset_request_cb()
507 int asp_session_set_request_cb(asp_session_request_cb cb, void *user_data);
510 * @brief Unregisters the callback called ASP when session connection is requested.
513 * @return 0 on success, otherwise a negative error value
514 * @retval #ASP_ERROR_NONE Successful
515 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
516 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
517 * @pre Application Service Platform (ASP) must be initialized by asp_initialize().
518 * @see asp_initialize()
519 * @see asp_session_set_request_cb()
521 int asp_session_unset_request_cb(void);
524 * @brief Registers the callback called when the session configuration is requested.
527 * @param[in] cb The callback function to invoke
528 * @param[in] user_data The user data passed from the callback registration function
529 * @return 0 on success, otherwise a negative error value
530 * @retval #ASP_ERROR_NONE Successful
531 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
532 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
533 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
534 * @pre Application Service Platform (ASP) must be initialized by asp_initialize().
535 * @see asp_initialize()
536 * @see asp_session_unset_config_request_cb()
537 * @see asp_session_config_request_cb()
539 int asp_session_set_config_request_cb(asp_session_config_request_cb cb,
543 * @brief Unregisters the callback called when the session configuration is requested.
546 * @return 0 on success, otherwise a negative error value
547 * @retval #ASP_ERROR_NONE Successful
548 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
549 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
550 * @pre Application Service Platform (ASP) must be initialized by asp_initialize().
551 * @see asp_initialize()
552 * @see asp_session_config_request_cb()
554 int asp_session_unset_config_request_cb(void);
557 * @brief Registers the callback called when the state of the session connection is changed.
560 * @param[in] cb The callback function to invoke
561 * @param[in] user_data The user data passed from the callback registration function
562 * @return 0 on success, otherwise a negative error value
563 * @retval #ASP_ERROR_NONE Successful
564 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
565 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
566 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
567 * @pre Application Service Platform (ASP) must be initialized by asp_initialize().
568 * @see asp_initialize()
569 * @see asp_session_unset_connection_status_changed_cb()
570 * @see asp_session_connect_status_cb()
572 int asp_session_set_connect_status_cb(asp_session_connect_status_cb cb, void *user_data);
575 * @brief Unregisters the callback called when the state of the session connection is changed.
578 * @return 0 on success, otherwise a negative error value
579 * @retval #ASP_ERROR_NONE Successful
580 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
581 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
582 * @pre Application Service Platform (ASP) must be initialized by asp_initialize().
583 * @see asp_initialize()
584 * @see asp_session_set_connection_status_changed_cb()
586 int asp_session_unset_connect_status_cb(void);
589 * @brief Registers the callback called when the state of the session is changed.
592 * @param[in] cb The callback function to invoke
593 * @param[in] user_data The user data passed from the callback registration function
594 * @return 0 on success, otherwise a negative error value
595 * @retval #ASP_ERROR_NONE Successful
596 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
597 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
598 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
599 * @pre Application Service Platform (ASP) must be initialized by asp_initialize().
600 * @see asp_initialize()
601 * @see asp_session_unset_status_cb()
602 * @see asp_session_status_cb()
604 int asp_session_set_status_cb(asp_session_status_cb cb, void *user_data);
607 * @brief Unregisters the callback called when the state of the session is changed.
610 * @return 0 on success, otherwise a negative error value
611 * @retval #ASP_ERROR_NONE Successful
612 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
613 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
614 * @pre Application Service Platform (ASP) must be initialized by asp_initialize().
615 * @see asp_initialize()
616 * @see asp_session_set_status_cb()
618 int asp_session_unset_status_cb(void);
621 * @brief Registers the callback called when the state of the port is changed.
624 * @param[in] cb The callback function to invoke
625 * @param[in] user_data The user data passed from the callback registration function
626 * @return 0 on success, otherwise a negative error value
627 * @retval #ASP_ERROR_NONE Successful
628 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
629 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
630 * @pre Application Service Platform (ASP) must be initialized by asp_initialize().
631 * @see asp_initialize()
632 * @see asp_session_unset_status_cb()
634 int asp_session_set_port_status_cb(asp_session_port_status_cb cb, void *user_data);
637 * @brief Unregisters the callback called when the state of the port is changed.
640 * @return 0 on success, otherwise a negative error value
641 * @retval #ASP_ERROR_NONE Successful
642 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
643 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
644 * @pre Application Service Platform (ASP) must be initialized by asp_initialize().
645 * @see asp_initialize()
646 * @see asp_session_set_port_status_cb()
648 int asp_session_unset_port_status_cb(void);
651 * @brief Creates the description of a service to be advertised.
654 * @privilege http://tizen.org/privilege/wifidirect
655 * @param[in] instance_name Service instance name of a service type to be advertised.
656 * The length of this parameter be 63 byte or less and
657 * encoding shall be single-byte or multi-byte UTF-8 characters.
658 * If you want to advertise one of the original P2PS defined services,
659 * this shall be NULL.
660 * @param[out] adv_service service descriptor handle
661 * @return 0 on success, otherwise a negative error value
662 * @retval #ASP_ERROR_NONE Successful
663 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
664 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
665 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
666 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
667 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
668 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
669 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
670 * @pre Application Service Platform (ASP) must be initialized by asp_initialize().
671 * @see asp_advert_destroy()
673 int asp_advert_create(char *instance_name, asp_advert_service_h *adv_service);
676 * @brief Destroys the description of a service to be advertised.
677 * @details If asp_advert_start_advertising() was called for a service,
678 * asp_advert_stop_advertising() should be called for it before destroying it.
681 * @privilege http://tizen.org/privilege/wifidirect
682 * @param[in] adv_service Service descriptor handle provided by the asp_advert_create()
683 * @return 0 on success, otherwise a negative error value
684 * @retval #ASP_ERROR_NONE Successful
685 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
686 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
687 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
688 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
689 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
690 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
691 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
692 * @retval #ASP_ERROR_SERVICE_NOT_FOUND Service not found
693 * @pre This API needs asp_create_service() before use
694 * @see asp_advert_create()
696 int asp_advert_destroy(asp_advert_service_h adv_service);
699 * @brief Sets the service type for a service to be advertised.
700 * @details Application should set service type after creating service using
701 * asp_advert_create() and before advertising service using
702 * asp_advert_start_advertising().
705 * @privilege http://tizen.org/privilege/wifidirect
706 * @param[in] adv_service Service descriptor handle provided by the asp_advert_create()
707 * @param[in] service_type The unique type of a particular service.
708 * this shall be at least 1 character and no more than 15 characters long
709 * contain only US-ASCII [ANSI.X3.4-1986] letters 'A' - 'Z' and
710 * 'a' - 'z', digits '0' - '9', and hyphens ('-', ASCII 0x2D or decimal 45)
711 * contain at least one letter ('A' - 'Z' or 'a' - ‘z')
712 * not begin or end with a hyphen. If you want to advertise one of the
713 * original P2PS defined services, this means service name.
714 * @return 0 on success, otherwise a negative error value
715 * @retval #ASP_ERROR_NONE Successful
716 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
717 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
718 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
719 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
720 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
721 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
722 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
723 * @retval #ASP_ERROR_SERVICE_NOT_FOUND Service not found
724 * @pre This API needs asp_advert_create() before use
725 * @see asp_advert_create()
727 int asp_advert_set_service_type(asp_advert_service_h adv_service,
731 * @brief Sets auto accept for a service to be advertised.
732 * @details Application should set service auto accept after creating service using
733 * asp_advert_create() and before advertising service using
734 * asp_advert_start_advertising().
737 * @privilege http://tizen.org/privilege/wifidirect
738 * @param[in] adv_service Service descriptor handle provided by the asp_advert_create()
739 * @param[in] auto_accept Enables/Disables auto accept based on the value TRUE/FALSE
740 * @return 0 on success, otherwise a negative error value
741 * @retval #ASP_ERROR_NONE Successful
742 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
743 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
744 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
745 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
746 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
747 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
748 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
749 * @retval #ASP_ERROR_SERVICE_NOT_FOUND Service not found
750 * @pre This API needs asp_advert_create() before use
751 * @see asp_advert_create()
753 int asp_advert_set_auto_accept(asp_advert_service_h adv_service,
757 * @brief Adds the information for a service to be advertised.
758 * @details Application should set service information after creating service using
759 * asp_advert_create() and before advertising service using
760 * asp_advert_start_advertising().
763 * @privilege http://tizen.org/privilege/wifidirect
764 * @param[in] adv_service Service descriptor handle provided by the asp_advert_create()
765 * @param[in] key Service-defined key data specified in Section 6 of RFC6763
766 * @param[in] value Service-defined value data specified in Section 6 of RFC6763
767 * Only one value can be added for a given key. If a value is set for a key,
768 * and another value was set for the key before, the old value will be
769 * overwritten with the new one.
770 * @return 0 on success, otherwise a negative error value
771 * @retval #ASP_ERROR_NONE Successful
772 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
773 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
774 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
775 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
776 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
777 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
778 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
779 * @retval #ASP_ERROR_SERVICE_NOT_FOUND Service not found
780 * @pre This API needs asp_advert_create() before use
781 * @see asp_advert_create()
783 int asp_advert_add_info(asp_advert_service_h adv_service,
784 const char *key, const char *value);
788 * @brief Sets the information for a service to be advertised.
789 * @details Application should set service information after creating service using
790 * asp_advert_create() and before advertising service using
791 * asp_advert_start_advertising().
792 * @remarks @a value should not be freed.
793 * It is recommended to make a copy of it to use.
796 * @privilege http://tizen.org/privilege/wifidirect
797 * @param[in] adv_service Service descriptor handle provided by the asp_advert_create()
798 * @param[in] key Service-defined key data specified in Section 6 of RFC6763
799 * @param[in] length Length of service-defined value data specified in Section 6 of RFC6763
800 * @param[in] value Service-defined value data specified in Section 6 of RFC6763
801 * @return 0 on success, otherwise a negative error value
802 * @retval #ASP_ERROR_NONE Successful
803 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
804 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
805 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
806 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
807 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
808 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
809 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
810 * @retval #ASP_ERROR_SERVICE_NOT_FOUND Service not found
811 * @pre This API needs asp_advert_create() before use
812 * @see asp_advert_create()
814 int asp_advert_get_info(asp_advert_service_h adv_service, const char *key,
815 int *length, char **value);
819 * @brief Sets the information for a service to be advertised.
820 * @details Application should set service information after creating service using
821 * asp_advert_create() and before advertising service using
822 * asp_advert_start_advertising().
825 * @privilege http://tizen.org/privilege/wifidirect
826 * @param[in] adv_service Service descriptor handle provided by the asp_advert_create()
827 * @param[in] key Service-defined key data specified to be removed
828 * @return 0 on success, otherwise a negative error value
829 * @retval #ASP_ERROR_NONE Successful
830 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
831 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
832 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
833 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
834 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
835 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
836 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
837 * @retval #ASP_ERROR_SERVICE_NOT_FOUND Service not found
838 * @pre This API needs asp_advert_create() before use
839 * @see asp_advert_create()
841 int asp_advert_remove_info(asp_advert_service_h adv_service, const char *key);
844 * @brief Sets the status for a service to be advertised.
845 * @details Application should set service status after creating service using
846 * asp_advert_create() and before advertising service using
847 * asp_advert_start_advertising().
850 * @privilege http://tizen.org/privilege/wifidirect
851 * @param[in] adv_service Service descriptor handle provided by the asp_advert_create()
852 * @param[in] status Status of the service:
853 * (@c 1 = available to use, @c 0 = not available to use,
854 * @c 2-255 = service specific information)
855 * @return 0 on success, otherwise a negative error value
856 * @retval #ASP_ERROR_NONE Successful
857 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
858 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
859 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
860 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
861 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
862 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
863 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
864 * @retval #ASP_ERROR_SERVICE_NOT_FOUND Service not found
865 * @pre This API needs asp_advert_create() before use
866 * @see asp_advert_create()
868 int asp_advert_set_status(asp_advert_service_h adv_service,
869 unsigned char status);
873 * @brief Sets the discovery mechanism for a service to be advertised.
874 * @details Application should set discovery mechanism after creating service using
875 * asp_advert_create() and before advertising service using
876 * asp_advert_start_advertising().
879 * @privilege http://tizen.org/privilege/wifidirect
880 * @param[in] adv_service Service descriptor handle provided by the asp_advert_create()
881 * @param[in] discovery_tech The discovery mechanism; values of
882 * #asp_discovery_tech_e combined with bitwise 'or'
883 * @return 0 on success, otherwise a negative error value
884 * @retval #ASP_ERROR_NONE Successful
885 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
886 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
887 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
888 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
889 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
890 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
891 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
892 * @retval #ASP_ERROR_SERVICE_NOT_FOUND Service not found
893 * @pre This API needs asp_advert_create() before use
894 * @see asp_advert_create()
896 int asp_advert_set_discovery_tech(asp_advert_service_h adv_service, int discovery_tech);
899 * @brief Sets the preferred connection for a service to be advertised.
900 * @details Application should set preferred connection after creating service using
901 * asp_advert_create() and before advertising service using
902 * asp_advert_start_advertising().
905 * @privilege http://tizen.org/privilege/wifidirect
906 * @param[in] adv_service Service descriptor handle provided by the asp_advert_create()
907 * @param[in] preferred_connection The preferred connection
908 * @return 0 on success, otherwise a negative error value
909 * @retval #ASP_ERROR_NONE Successful
910 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
911 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
912 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
913 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
914 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
915 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
916 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
917 * @retval #ASP_ERROR_SERVICE_NOT_FOUND Service not found
918 * @pre This API needs asp_advert_create() before use
919 * @see asp_advert_create()
921 int asp_advert_set_preferred_connection(asp_advert_service_h adv_service,
922 unsigned char preferred_connection);
925 * @brief Sets the Wi-Fi P2P role for a service to be advertised.
926 * @details Application should set role after creating service using
927 * asp_advert_create() and before advertising service using
928 * asp_advert_start_advertising().
931 * @privilege http://tizen.org/privilege/wifidirect
932 * @param[in] adv_service Service descriptor handle provided by the asp_advert_create()
933 * @param[in] role The role of the service: \n
934 * #ASP_ADVERT_P2P_ROLE_SCHEME_ANY - All roles are acceptable \n
935 * #ASP_ADVERT_P2P_ROLE_SCHEME_GO - The receiving interface should assume \n
936 * the GO role, if it's not possible, #ASP_ERROR_NETWORK_ROLE_REJECTED \n
938 * #ASP_ADVERT_P2P_ROLE_SCHEME_GC -
939 * The receiving interface should assume the GC role
940 * @return 0 on success, otherwise a negative error value
941 * @retval #ASP_ERROR_NONE Successful
942 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
943 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
944 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
945 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
946 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
947 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
948 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
949 * @retval #ASP_ERROR_SERVICE_NOT_FOUND Service not found
950 * @retval #ASP_ERROR_NETWORK_ROLE_REJECTED Network role rejected
951 * @pre This API needs asp_advert_create() before use
952 * @see asp_advert_create()
954 int asp_advert_set_p2p_role_scheme(asp_advert_service_h adv_service,
955 asp_advert_p2p_role_scheme_e role);
958 * @brief Gets the Wi-Fi P2P role for a service to be advertised.
959 * @details Application should Get role after creating service using
960 * asp_advert_create() and before advertising service using
961 * asp_advert_start_advertising().
964 * @privilege http://tizen.org/privilege/wifidirect
965 * @param[in] adv_service Service descriptor handle provided by the asp_advert_create()
966 * @param[in] role The role of the service: \n
967 * #ASP_ADVERT_P2P_ROLE_SCHEME_ANY - All roles are acceptable \n
968 * #ASP_ADVERT_P2P_ROLE_SCHEME_GO - The receiving interface should assume \n
970 * #ASP_ADVERT_P2P_ROLE_SCHEME_GC -
971 * The receiving interface should assume the GC role
972 * @return 0 on success, otherwise a negative error value
973 * @retval #ASP_ERROR_NONE Successful
974 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
975 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
976 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
977 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
978 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
979 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
980 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
981 * @retval #ASP_ERROR_SERVICE_NOT_FOUND Service not found
982 * @pre This API needs asp_advert_create() before use
983 * @see asp_advert_create()
985 int asp_advert_get_p2p_role_scheme(asp_advert_service_h adv_service,
986 asp_advert_p2p_role_scheme_e *role);
989 * @brief Sets the P2P configuration method for a service to be advertised.
990 * @details Application should set configuration method after creating service using
991 * asp_advert_create() and before advertising service using
992 * asp_advert_start_advertising().
995 * @privilege http://tizen.org/privilege/wifidirect
996 * @param[in] adv_service Service descriptor handle provided by the asp_advert_create()
997 * @param[in] config_method preferred Wi-Fi Simple Config (WSC) configuration method.
998 * Default value is ASP_WPS_TYPE_DEFAULT.
999 * @return 0 on success, otherwise a negative error value
1000 * @retval #ASP_ERROR_NONE Successful
1001 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
1002 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
1003 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
1004 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
1005 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
1006 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
1007 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
1008 * @retval #ASP_ERROR_SERVICE_NOT_FOUND Service not found
1009 * @pre This API needs asp_advert_create() before use
1010 * @see asp_advert_create()
1012 int asp_advert_set_p2p_config_method(asp_advert_service_h adv_service,
1013 asp_wps_type_e config_method);
1015 * @brief Gets the P2P configuration method for a service to be advertised.
1016 * @details Application should Get configuration method after creating service using
1017 * asp_advert_create() and before advertising service using
1018 * asp_advert_start_advertising().
1021 * @privilege http://tizen.org/privilege/wifidirect
1022 * @param[in] adv_service Service descriptor handle provided by the asp_advert_create()
1023 * @param[in] config_method preferred Wi-Fi Simple Config (WSC)configuration method.
1024 * @return 0 on success, otherwise a negative error value
1025 * @retval #ASP_ERROR_NONE Successful
1026 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
1027 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
1028 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
1029 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
1030 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
1031 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
1032 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
1033 * @retval #ASP_ERROR_SERVICE_NOT_FOUND Service not found
1034 * @pre This API needs asp_advert_create() before use
1035 * @see asp_advert_create()
1037 int asp_advert_get_p2p_config_method(asp_advert_service_h adv_service,
1038 asp_wps_type_e *config_method);
1041 * @brief Sets the service response for an advertised service.
1042 * @details Application should set service response after creating service using
1043 * asp_advert_create() and before advertising service using
1044 * asp_advert_create().
1047 * @privilege http://tizen.org/privilege/wifidirect
1048 * @param[in] adv_service Service descriptor handle provided by the asp_advert_create()
1049 * @param[in] rsp_info Specified for a particular service up to 144 bytes.
1050 * You can refer to Wi-Fi Peer-to-Peer Services Technical Specification,
1051 * Wi-Fi Alliance. Available at:http://www.wi-fi.org
1052 * @param[in] length The length of @a rsp_info in bytes, maximum length is 144
1053 * @return 0 on success, otherwise a negative error value
1054 * @retval #ASP_ERROR_NONE Successful
1055 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
1056 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
1057 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
1058 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
1059 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
1060 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
1061 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
1062 * @retval #ASP_ERROR_SERVICE_NOT_FOUND Service not found
1063 * @pre This API needs asp_advert_create() before use
1064 * @see asp_advert_create()
1066 int asp_advert_set_p2p_response(asp_advert_service_h adv_service,
1067 char *rsp_info, int length);
1070 * @brief Starts to advertise a service.
1071 * @details Application should start to advertise after creating service using
1072 * asp_advert_create(). If the service is being advertised, no changes can be made to it.
1075 * @privilege http://tizen.org/privilege/wifidirect
1076 * @param[in] adv_service Service descriptor handle provided by the asp_advert_create()
1077 * @return 0 on success, otherwise a negative error value
1078 * @retval #ASP_ERROR_NONE Successful
1079 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
1080 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
1081 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
1082 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
1083 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
1084 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
1085 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
1086 * @retval #ASP_ERROR_SERVICE_NOT_FOUND Service not found
1087 * @pre This API needs asp_advert_create() before use
1088 * @see asp_advert_create()
1089 * @see asp_advert_stop_advertising()
1091 int asp_advert_start_advertising(asp_advert_service_h adv_service);
1094 * @brief Stops a service advertisement.
1095 * @details Application should cancel to advertise after advertising service using
1096 * asp_advert_start_advertising().
1099 * @privilege http://tizen.org/privilege/wifidirect
1100 * @param[in] adv_service Service descriptor handle provided by the asp_advert_create()
1101 * @return 0 on success, otherwise a negative error value
1102 * @retval #ASP_ERROR_NONE Successful
1103 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
1104 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
1105 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
1106 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
1107 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
1108 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
1109 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
1110 * @retval #ASP_ERROR_SERVICE_NOT_FOUND Service not found
1111 * @pre This API needs asp_advert_start_advertising() before use
1112 * @see asp_advert_start_advertising()
1114 int asp_advert_stop_advertising(asp_advert_service_h adv_service);
1117 * @brief Changes the advertising service status.
1118 * @details Application should change the advertising service
1119 * status after advertising service using asp_advert_start_advertising().
1122 * @privilege http://tizen.org/privilege/wifidirect
1123 * @param[in] adv_service Service descriptor handle provided by the asp_create_service()
1124 * @param[in] status Status of the service:
1125 * (@c 1 = available to use, @c 0 = not available to use,
1126 * @c 2-255 = service specific information)
1127 * @return 0 on success, otherwise a negative error value
1128 * @retval #ASP_ERROR_NONE Successful
1129 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
1130 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
1131 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
1132 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
1133 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
1134 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
1135 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
1136 * @retval #ASP_ERROR_SERVICE_NOT_FOUND Service not found
1137 * @pre This API needs asp_advert_start_advertising() before use
1138 * @see asp_advert_start_advertising()
1140 int asp_advert_change_service_status(asp_advert_service_h adv_service,
1141 unsigned char status);
1144 * @brief Creates the description of a seek operation.
1147 * @privilege http://tizen.org/privilege/wifidirect
1148 * @param[in] service_type Service Type of a service being searched.
1149 * this shall be at least 1 character and no more than 15 characters long
1150 * contain only US-ASCII [ANSI.X3.4-1986] letters 'A' - 'Z' and
1151 * 'a' - 'z', digits '0' - '9', and hyphens ('-', ASCII 0x2D or decimal 45)
1152 * contain at least one letter ('A' - 'Z' or 'a' - ‘z')
1153 * not begin or end with a hyphen. If you want to seek one of the
1154 * original P2PS defined services, this means service name.
1155 * @param[out] seek_service Service seek handle
1156 * @return 0 on success, otherwise a negative error value
1157 * @retval #ASP_ERROR_NONE Successful
1158 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
1159 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
1160 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
1161 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
1162 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
1163 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
1164 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
1165 * @pre Application Service Platform (ASP) must be initialized by asp_initialize().
1166 * @see asp_seek_destroy()
1168 int asp_seek_create(char *service_type, asp_seek_service_h *seek_service);
1171 * @brief Destroys the description of a seek operation.
1172 * @details If asp_seek_start() was called for a service,
1173 * asp_seek_stop() should be called for it before destroying it.
1177 * @privilege http://tizen.org/privilege/wifidirect
1178 * @param[in] seek_service Service seek handle provided by the asp_seek_create()
1179 * @return 0 on success, otherwise a negative error value
1180 * @retval #ASP_ERROR_NONE Successful
1181 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
1182 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
1183 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
1184 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
1185 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
1186 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
1187 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
1188 * @retval #ASP_ERROR_SERVICE_NOT_FOUND Service not found
1189 * @pre A seek service handle must be created with asp_seek_create().
1190 * @see asp_seek_create
1192 int asp_seek_destroy(asp_seek_service_h seek_service);
1195 * @brief Adds the information for a service to be sought.
1196 * @details Application should set service information after creating service using
1197 * asp_seek_create() and before seeking service using asp_seek_start().
1200 * @privilege http://tizen.org/privilege/wifidirect
1201 * @param[in] seek_service Service descriptor handle provided by the asp_seek_create()
1202 * @param[in] key Service-defined key data to be searched,
1203 * specified in Section 6 of RFC6763
1204 * @return 0 on success, otherwise a negative error value
1205 * @retval #ASP_ERROR_NONE Successful
1206 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
1207 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
1208 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
1209 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
1210 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
1211 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
1212 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
1213 * @retval #ASP_ERROR_SERVICE_NOT_FOUND Service not found
1214 * @pre This API needs asp_seek_create() before use
1215 * @see asp_seek_create()
1217 int asp_seek_add_info(asp_seek_service_h seek_service, const char *key);
1220 * @brief Removes the information for a service to be sought.
1221 * @details Application should set service information after creating service using
1222 * asp_seek_create() and before seeking service using asp_seek_start().
1225 * @privilege http://tizen.org/privilege/wifidirect
1226 * @param[in] seek_service Service descriptor handle provided by the asp_seek_create()
1227 * @param[in] key Service-defined key data to be searched,
1228 * specified in Section 6 of RFC6763
1229 * @return 0 on success, otherwise a negative error value
1230 * @retval #ASP_ERROR_NONE Successful
1231 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
1232 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
1233 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
1234 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
1235 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
1236 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
1237 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
1238 * @retval #ASP_ERROR_SERVICE_NOT_FOUND Service not found
1239 * @pre This API needs asp_seek_create() before use
1240 * @see asp_seek_create()
1242 int asp_seek_remove_info(asp_seek_service_h seek_service, const char *key);
1245 * @brief Sets the discovery mechanism for a service to be sought.
1246 * @details Application should set service information after creating service using
1247 * asp_seek_create() and before seeking service using asp_seek_start().
1250 * @privilege http://tizen.org/privilege/wifidirect
1251 * @param[in] adv_service Service descriptor handle provided by the asp_seek_create()
1252 * @param[in] discovery_tech The discovery mechanism, values of
1253 * #asp_discovery_tech_e combined with bitiwse 'or'
1254 * @return 0 on success, otherwise a negative error value
1255 * @retval #ASP_ERROR_NONE Successful
1256 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
1257 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
1258 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
1259 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
1260 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
1261 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
1262 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
1263 * @retval #ASP_ERROR_SERVICE_NOT_FOUND Service not found
1264 * @pre This API needs asp_seek_create() before use
1265 * @see asp_seek_create()
1267 int asp_seek_set_discovery_tech(asp_seek_service_h seek_service, int discovery_tech);
1270 * @brief Sets the preferred connection for a service to be sought.
1271 * @details Application should set service information after creating service using
1272 * asp_seek_create() and before seeking service using asp_seek_start().
1275 * @privilege http://tizen.org/privilege/wifidirect
1276 * @param[in] adv_service Service descriptor handle provided by the asp_seek_create()
1277 * @param[in] preferred_connection The preferred connection
1278 * @return 0 on success, otherwise a negative error value
1279 * @retval #ASP_ERROR_NONE Successful
1280 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
1281 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
1282 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
1283 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
1284 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
1285 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
1286 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
1287 * @retval #ASP_ERROR_SERVICE_NOT_FOUND Service not found
1288 * @pre This API needs asp_seek_create() before use
1289 * @see asp_seek_create()
1291 int asp_seek_set_preferred_connection(asp_seek_service_h seek_service,
1292 unsigned char preferred_connection);
1295 * @brief Starts to seek services on peer devices.
1296 * @details If the service is currently seeking, no changes can be made to it.
1299 * @privilege http://tizen.org/privilege/wifidirect
1300 * @param[in] seek_service Service seek handle provided by the asp_seek_create()
1301 * @return 0 on success, otherwise a negative error value
1302 * @retval #ASP_ERROR_NONE Successful
1303 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
1304 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
1305 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
1306 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
1307 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
1308 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
1309 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
1310 * @retval #ASP_ERROR_SERVICE_NOT_FOUND Service not found
1311 * @pre A seek service handle must be created with asp_seek_create().
1312 * @see asp_seek_create()
1313 * @see asp_seek_stop()
1315 int asp_seek_start(asp_seek_service_h seek_service);
1318 * @brief Stops seeking services.
1319 * @details Application should cancel to seek service after searching service using
1323 * @privilege http://tizen.org/privilege/wifidirect
1324 * @param[in] seek_service Service seek handle provided by the asp_seek_create()
1325 * @return 0 on success, otherwise a negative error value
1326 * @retval #ASP_ERROR_NONE Successful
1327 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
1328 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
1329 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
1330 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
1331 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
1332 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
1333 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
1334 * @retval #ASP_ERROR_SERVICE_NOT_FOUND Service not found
1335 * @pre A seek service handle must be created with asp_seek_create().
1336 * @see asp_seek_start()
1338 int asp_seek_stop(asp_seek_service_h seek_service);
1341 * @brief Creates a local Application Service Platform (ASP) session.
1344 * @privilege http://tizen.org/privilege/wifidirect
1345 * @param[in] service_mac P2P device address of remote P2P device provided by
1346 * asp_seek_search_result_cb()
1347 * @param[in] adv_id The advertisement ID provided by
1348 * asp_seek_search_result_cb()
1349 * @param[in] session ASP session descriptor handle
1350 * @return 0 on success, otherwise a negative error value
1351 * @retval #ASP_ERROR_NONE Successful
1352 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
1353 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
1354 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
1355 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
1356 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
1357 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
1358 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
1359 * @see asp_session_destroy()
1361 int asp_session_create(char *service_mac, unsigned int adv_id,
1362 asp_session_h *session);
1365 * @brief Destroys a local Application Service Platform (ASP) session.
1366 * @details Application should create session by asp_session_create().
1369 * @privilege http://tizen.org/privilege/wifidirect
1370 * @param[in] session Application Service Platform session descriptor handle
1371 * @return 0 on success, otherwise a negative error value
1372 * @retval #ASP_ERROR_NONE Successful
1373 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
1374 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
1375 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
1376 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
1377 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
1378 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
1379 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
1380 * @retval #ASP_ERROR_SESSION_NOT_FOUND Session not found
1381 * @pre This API needs asp_session_create() before use.
1382 * @see asp_session_create()
1384 int asp_session_destroy(asp_session_h session);
1387 * @brief Gets the session MAC for an Application Service Platform session.
1388 * @details Application should request to connect session by
1389 * asp_session_connect() or receive request by asp_session_request_cb().
1390 * @remarks @a session_mac should not be freed.
1391 * It is recommended to make a copy of it to use.
1394 * @privilege http://tizen.org/privilege/wifidirect
1395 * @param[in] session Application Service Platform session descriptor handle
1396 * @param[out] session_mac The session MAC is the MAC address of
1397 * P2P device which assigned the session ID
1398 * @return 0 on success, otherwise a negative error value
1399 * @retval #ASP_ERROR_NONE Successful
1400 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
1401 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
1402 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
1403 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
1404 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
1405 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
1406 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
1407 * @retval #ASP_ERROR_SESSION_NOT_FOUND Session not found
1408 * @pre This API needs asp_session_connect() before use.
1409 * @see asp_session_connect()
1410 * @see asp_session_request_cb()
1412 int asp_session_get_mac(asp_session_h session, char **session_mac);
1415 * @brief Gets the ID of an Application Service Platform session.
1416 * @details Application should create local session by
1417 * asp_session_create() or receive request by asp_session_request_cb().
1420 * @privilege http://tizen.org/privilege/wifidirect
1421 * @param[in] session Application Service Platform session descriptor handle
1422 * @param[out] session_id The session ID
1423 * @return 0 on success, otherwise a negative error value
1424 * @retval #ASP_ERROR_NONE Successful
1425 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
1426 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
1427 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
1428 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
1429 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
1430 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
1431 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
1432 * @retval #ASP_ERROR_SESSION_NOT_FOUND Session not found
1433 * @pre This API needs asp_session_create() before use.
1434 * @see asp_session_create()
1435 * @see asp_session_request_cb()
1437 int asp_session_get_id(asp_session_h session, unsigned int *session_id);
1440 * @brief Sets the information for an Application Service Platform session.
1441 * @details Application should set session_info after creating session by
1442 * asp_session_create() and before requesting to connect
1443 * session by asp_session_connect().
1446 * @privilege http://tizen.org/privilege/wifidirect
1447 * @param[in] session Application Service Platform session descriptor handle
1448 * provided by the asp_session_create()
1449 * @param[in] session_info Detailed information about the session.
1450 * The session_info parameter is defined for each service section
1451 * and up to 144 bytes. You can refer to Wi-Fi Peer-to-Peer Services
1452 * Technical Specification, Wi-Fi Alliance.
1453 * Available at:http://www.wi-fi.org
1454 * @return 0 on success, otherwise a negative error value
1455 * @retval #ASP_ERROR_NONE Successful
1456 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
1457 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
1458 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
1459 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
1460 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
1461 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
1462 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
1463 * @retval #ASP_ERROR_SESSION_NOT_FOUND Session not found
1464 * @pre This API needs asp_session_create() before use.
1465 * @see asp_session_create()
1467 int asp_session_set_info(asp_session_h session, char *session_info);
1470 * @brief Gets the information for an Application Service Platform session.
1471 * @details Application should get session_info after creating session by
1472 * asp_session_create() and before requesting to connect
1473 * session by asp_session_connect().
1474 * @remarks @a session_info should not be freed.
1475 * It is recommended to make a copy of it to use.
1478 * @privilege http://tizen.org/privilege/wifidirect
1479 * @param[in] session Application Service Platform session descriptor handle
1480 * provided by the asp_session_create()
1481 * @param[out] session_info detailed information about session
1482 * @return 0 on success, otherwise a negative error value
1483 * @retval #ASP_ERROR_NONE Successful
1484 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
1485 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
1486 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
1487 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
1488 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
1489 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
1490 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
1491 * @retval #ASP_ERROR_SESSION_NOT_FOUND Session not found
1492 * @pre This API needs asp_session_create() before use.
1493 * @see asp_session_create()
1495 int asp_session_get_info(asp_session_h session, char **session_info);
1498 * @brief Sets the Wi-Fi Direct group role in session.
1499 * @details Application should set role after creating session by
1500 * asp_session_create() and before requesting to connect
1501 * session by asp_session_connect().
1504 * @privilege http://tizen.org/privilege/wifidirect
1505 * @param[in] session Application Service Platform session descriptor handle
1506 * provided by the asp_session_create()
1507 * @param[in] role The role of the service: \n
1508 * #ASP_ADVERT_P2P_ROLE_SCHEME_ANY - All roles are acceptable \n
1509 * #ASP_ADVERT_P2P_ROLE_SCHEME_GO - The receiving interface should assume \n
1510 * the GO role, if it's not possible, #ASP_ERROR_NETWORK_ROLE_REJECTED \n
1512 * #ASP_ADVERT_P2P_ROLE_SCHEME_GC -
1513 * The receiving interface should assume the GC role
1514 * @return 0 on success, otherwise a negative error value
1515 * @retval #ASP_ERROR_NONE Successful
1516 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
1517 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
1518 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
1519 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
1520 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
1521 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
1522 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
1523 * @retval #ASP_ERROR_SESSION_NOT_FOUND Session not found
1524 * @retval #ASP_ERROR_NETWORK_ROLE_REJECTED Network role rejected
1525 * @pre This API needs asp_create_service() before use.
1526 * @see asp_create_session()
1528 int asp_session_set_p2p_role_scheme(asp_session_h session,
1529 asp_advert_p2p_role_scheme_e role);
1532 * @brief Gets the Wi-Fi Direct group role in session.
1535 * @privilege http://tizen.org/privilege/wifidirect
1536 * @param[in] session Application Service Platform session descriptor handle
1537 * provided by the asp_session_create()
1538 * @param[in] role The role of the service: \n
1539 * #ASP_ADVERT_P2P_ROLE_SCHEME_ANY - All roles are acceptable \n
1540 * #ASP_ADVERT_P2P_ROLE_SCHEME_GO - The receiving interface should assume \n
1542 * #ASP_ADVERT_P2P_ROLE_SCHEME_GC -
1543 * The receiving interface should assume the GC role
1544 * @return 0 on success, otherwise a negative error value
1545 * @retval #ASP_ERROR_NONE Successful
1546 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
1547 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
1548 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
1549 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
1550 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
1551 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
1552 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
1553 * @retval #ASP_ERROR_SESSION_NOT_FOUND Session not found
1554 * @pre This API needs asp_session_create() before use.
1555 * @see asp_session_create()
1557 int asp_session_get_p2p_role_scheme(asp_session_h session,
1558 asp_advert_p2p_role_scheme_e *role);
1561 * @brief Sets the Preferred WSC Configuration method.
1562 * @details Application should set the config method after creating session by
1563 * asp_session_create() and before requesting to connect
1564 * session by asp_session_connect().
1567 * @privilege http://tizen.org/privilege/wifidirect
1568 * @param[in] session Application Service Platform session descriptor handle
1569 * provided by the asp_session_create()
1570 * @param[in] config_method Preferred WSC Configuration method.
1571 * Default value is #ASP_WPS_TYPE_DEFAULT.
1572 * @return 0 on success, otherwise a negative error value
1573 * @retval #ASP_ERROR_NONE Successful
1574 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
1575 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
1576 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
1577 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
1578 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
1579 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
1580 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
1581 * @retval #ASP_ERROR_SESSION_NOT_FOUND Session not found
1582 * @pre This API needs asp_session_create() before use.
1583 * @see asp_session_create()
1585 int asp_session_set_p2p_config_method(asp_session_h session,
1586 asp_wps_type_e config_method);
1589 * @brief Gets the Preferred WSC Configuration method.
1592 * @privilege http://tizen.org/privilege/wifidirect
1593 * @param[in] session Application Service Platform session descriptor handle
1594 * provided by the asp_session_create()
1595 * @param[out] config_method Preferred WSC Configuration method
1596 * @return 0 on success, otherwise a negative error value
1597 * @retval #ASP_ERROR_NONE Successful
1598 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
1599 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
1600 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
1601 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
1602 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
1603 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
1604 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
1605 * @retval #ASP_ERROR_SESSION_NOT_FOUND Session not found
1606 * @pre This API needs asp_session_create() before use.
1607 * @see asp_session_create()
1609 int asp_session_get_p2p_config_method(asp_session_h session,
1610 asp_wps_type_e *config_method);
1613 * @brief Gets the session close status.
1614 * @details This call is valid only for closed sessions (sessions in the #ASP_SESSION_STATE_CLOSED
1615 * state). If the @a session does not identify a closed session,
1616 * #ASP_ERROR_NOT_PERMITTED is returned.
1618 * @param[in] session ASP session descriptor handle provided by
1619 * the asp_session_request_cb() callback,
1620 * asp_session_create(), or asp_session_get_handle()
1621 * @param[out] status The session close status
1622 * @return 0 on success, otherwise a negative error value
1623 * @retval #ASP_ERROR_NONE Successful
1624 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
1625 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
1626 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
1627 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
1628 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
1629 * @retval #ASP_ERROR_SESSION_NOT_FOUND Session not found
1631 int asp_session_get_close_status(asp_session_h session, int *status);
1634 * @brief Starts to connect the Application Service Platform session.
1637 * @privilege http://tizen.org/privilege/wifidirect
1638 * @param[in] session Application Service Platform session descriptor handle
1639 * @return 0 on success, otherwise a negative error value
1640 * @retval #ASP_ERROR_NONE Successful
1641 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
1642 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
1643 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
1644 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
1645 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
1646 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
1647 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
1648 * @retval #ASP_ERROR_SESSION_NOT_FOUND Session not found
1649 * @pre This API needs asp_session_create() before use.
1650 * @see asp_session_create()
1652 int asp_session_connect(asp_session_h session);
1655 * @brief Confirms the Application Service Platform(ASP) session request.
1658 * @privilege http://tizen.org/privilege/wifidirect
1659 * @param[in] session ASP session descriptor handle provided by
1660 * the asp_session_request_cb() callback or
1661 * asp_session_create() if pin is requested.
1662 * @param[in] confirmed (@c true = confirm session, @c false = reject session)
1663 * @param[in] pin If session requests the WSC PIN
1664 * @return 0 on success, otherwise a negative error value
1665 * @retval #ASP_ERROR_NONE Successful
1666 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
1667 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
1668 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
1669 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
1670 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
1671 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
1672 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
1673 * @retval #ASP_ERROR_SESSION_NOT_FOUND Session not found
1674 * @see asp_advert_start_advertising()
1675 * @see asp_session_create()
1677 int asp_session_confirm(asp_session_h session, bool confirmed, char *pin);
1680 * @brief Gets the Description of Application Service Platform (ASP) session to be connected.
1683 * @privilege http://tizen.org/privilege/wifidirect
1684 * @param[in] session_mac The MAC address of the P2P device that assigned
1685 * the value of session_id, as provided by
1686 * the asp_session_request_cb() callback or
1687 * asp_session_create() if pin is requested.
1688 * @param[in] session_id The session ID
1689 * @param[out] session Peer-to-Peer service session descriptor handle
1690 * @return 0 on success, otherwise a negative error value
1691 * @retval #ASP_ERROR_NONE Successful
1692 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
1693 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
1694 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
1695 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
1696 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
1697 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
1698 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
1699 * @retval #ASP_ERROR_SESSION_NOT_FOUND Session not found
1700 * @see asp_session_create()
1702 int asp_session_get_handle(char *session_mac, unsigned int session_id,
1703 asp_session_h *session);
1706 * @brief Moves an Application Service Platform (ASP) session from Requested state to the Open state.
1709 * @privilege http://tizen.org/privilege/wifidirect
1710 * @param[in] session ASP session descriptor handle provided by
1711 * the asp_session_request_cb() callback
1712 * @return 0 on success, otherwise a negative error value
1713 * @retval #ASP_ERROR_NONE Successful
1714 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
1715 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
1716 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
1717 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
1718 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
1719 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
1720 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
1721 * @retval #ASP_ERROR_SESSION_NOT_FOUND Session not found
1722 * @pre Peer-to-Peer service must be advertised by asp_advert_start_advertising().\n
1723 * Local device should be listening or finding remote P2P device by
1724 * asp_advert_start_advertising()
1725 * @see asp_advert_start_advertising()
1727 int asp_session_set_state_ready(asp_session_h session);
1730 * @brief Ends an Application Service Platform (ASP) session and releases associated resources.
1731 * @details The ASP may tear down the underlying ASP P2P group
1732 * if not other ASP sessions are using it.
1735 * @privilege http://tizen.org/privilege/wifidirect
1736 * @param[in] session ASP session descriptor handle provided by
1737 * the asp_session_request_cb() callback or
1738 * asp_session_create()
1739 * @return 0 on success, otherwise a negative error value
1740 * @retval #ASP_ERROR_NONE Successful
1741 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
1742 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
1743 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
1744 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
1745 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
1746 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
1747 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
1748 * @retval #ASP_ERROR_SESSION_NOT_FOUND Session not found
1749 * @see asp_session_create()
1750 * @see asp_session_request_cb()
1752 int asp_session_close(asp_session_h session);
1755 * @brief Requests that incoming connections be allowed on a given port.
1758 * @privilege http://tizen.org/privilege/wifidirect
1759 * @param[in] session ASP session descriptor handle provided by
1760 * the asp_session_request_cb() callback or
1761 * asp_session_create()
1762 * @param[in] ip_address The IP address on which the port is being used
1763 * @param[in] port The port number
1764 * @param[in] proto The IANA protocol number
1765 * @return 0 on success, otherwise a negative error value
1766 * @retval #ASP_ERROR_NONE Successful
1767 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
1768 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
1769 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
1770 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
1771 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
1772 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
1773 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
1774 * @retval #ASP_ERROR_SESSION_NOT_FOUND Session not found
1775 * @see asp_session_create()
1776 * @see asp_session_request_cb()
1778 int asp_session_bind_port(asp_session_h session, char *ip_address,
1779 int port, int proto);
1782 * @brief Indicates that the service is no longer utilizing the port in the ASP session.
1785 * @privilege http://tizen.org/privilege/wifidirect
1786 * @param[in] session ASP session descriptor handle provided by
1787 * the asp_session_request_cb() callback or
1788 * asp_session_create()
1789 * @param[in] ip_address The IP address on which the port is being used
1790 * @param[in] port The port number
1791 * @param[in] proto The IANA protocol number
1792 * @return 0 on success, otherwise a negative error value
1793 * @retval #ASP_ERROR_NONE Successful
1794 * @retval #ASP_ERROR_NOT_PERMITTED Operation not permitted
1795 * @retval #ASP_ERROR_OUT_OF_MEMORY Out of memory
1796 * @retval #ASP_ERROR_PERMISSION_DENIED Permission denied
1797 * @retval #ASP_ERROR_INVALID_PARAMETER Invalid parameter
1798 * @retval #ASP_ERROR_NOT_SUPPORTED Not supported
1799 * @retval #ASP_ERROR_NOT_INITIALIZED Not initialized
1800 * @retval #ASP_ERROR_OPERATION_FAILED Operation failed
1801 * @retval #ASP_ERROR_SESSION_NOT_FOUND Session not found
1802 * @see asp_session_create()
1803 * @see asp_session_request_cb()
1805 int asp_session_release_port(asp_session_h session, char *ip_address,
1806 int port, int proto);
1816 #endif /* __TIZEN_NET_ASP_H__ */