Tizen Native API  5.5
Application Service Platform

Wi-Fi Direct provides API to manage Application Service Platform.

Required Header

#include <asp.h>

Overview

This set of functions is used to manage the settings of Application Service Platform. In addition, This set provides functions to discovery and manage sessions using Application Service Platform.

Related Features

This API is related with the following features:

  • http://tizen.org/feature/network.wifi
  • http://tizen.org/feature/network.wifi.direct
  • http://tizen.org/feature/network.wifi.direct.asp
  • http://tizen.org/feature/network.wifi.direct.display
  • http://tizen.org/feature/network.wifi.direct.service_discovery

It is recommended to use feature related code in your application for reliability.

You can check if a device supports the related features for this API by using System Information, thereby controlling the procedure of your application.
To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.
More details on using features in your application can be found in the Feature Element.

Functions

int asp_initialize (void)
 Initializes Application Service Platform (ASP).
int asp_deinitialize (void)
 Deinitializes Application Service Platform (ASP).
int asp_seek_set_search_result_cb (asp_seek_search_result_cb cb, void *user_data)
 Registers the callback function that will be invoked when a service found.
int asp_seek_unset_search_result_cb (void)
 Unregisters the callback function that will invoked when a service found.
int asp_advert_set_status_changed_cb (asp_advert_status_changed_cb cb, void *user_data)
 Registers the callback function that will invoked when the status of an advertisement to a service is changed.
int asp_advert_unset_status_changed_cb (void)
 Unregisters the callback function that will invoked when the status of an advertisement to a service is changed.
int asp_session_set_request_cb (asp_session_request_cb cb, void *user_data)
 Registers the callback called when ASP session connection is requested.
int asp_session_unset_request_cb (void)
 Unregisters the callback called ASP when session connection is requested.
int asp_session_set_config_request_cb (asp_session_config_request_cb cb, void *user_data)
 Registers the callback called when the session configuration is requested.
int asp_session_unset_config_request_cb (void)
 Unregisters the callback called when the session configuration is requested.
int asp_session_set_connect_status_cb (asp_session_connect_status_cb cb, void *user_data)
 Registers the callback called when the state of the session connection is changed.
int asp_session_unset_connect_status_cb (void)
 Unregisters the callback called when the state of the session connection is changed.
int asp_session_set_status_cb (asp_session_status_cb cb, void *user_data)
 Registers the callback called when the state of the session is changed.
int asp_session_unset_status_cb (void)
 Unregisters the callback called when the state of the session is changed.
int asp_session_set_port_status_cb (asp_session_port_status_cb cb, void *user_data)
 Registers the callback called when the state of the port is changed.
int asp_session_unset_port_status_cb (void)
 Unregisters the callback called when the state of the port is changed.
int asp_advert_create (char *instance_name, asp_advert_service_h *adv_service)
 Creates the description of a service to be advertised.
int asp_advert_destroy (asp_advert_service_h adv_service)
 Destroys the description of a service to be advertised.
int asp_advert_set_service_type (asp_advert_service_h adv_service, char *service_type)
 Sets the service type for a service to be advertised.
int asp_advert_set_auto_accept (asp_advert_service_h adv_service, bool auto_accept)
 Sets auto accept for a service to be advertised.
int asp_advert_add_info (asp_advert_service_h adv_service, const char *key, const char *value)
 Adds the information for a service to be advertised.
int asp_advert_get_info (asp_advert_service_h adv_service, const char *key, int *length, char **value)
 Sets the information for a service to be advertised.
int asp_advert_remove_info (asp_advert_service_h adv_service, const char *key)
 Sets the information for a service to be advertised.
int asp_advert_set_status (asp_advert_service_h adv_service, unsigned char status)
 Sets the status for a service to be advertised.
int asp_advert_set_discovery_tech (asp_advert_service_h adv_service, int discovery_tech)
 Sets the discovery mechanism for a service to be advertised.
int asp_advert_set_preferred_connection (asp_advert_service_h adv_service, unsigned char preferred_connection)
 Sets the preferred connection for a service to be advertised.
int asp_advert_set_p2p_role_scheme (asp_advert_service_h adv_service, asp_advert_p2p_role_scheme_e role)
 Sets the Wi-Fi P2P role for a service to be advertised.
int asp_advert_get_p2p_role_scheme (asp_advert_service_h adv_service, asp_advert_p2p_role_scheme_e *role)
 Gets the Wi-Fi P2P role for a service to be advertised.
int asp_advert_set_p2p_config_method (asp_advert_service_h adv_service, asp_wps_type_e config_method)
 Sets the P2P configuration method for a service to be advertised.
int asp_advert_get_p2p_config_method (asp_advert_service_h adv_service, asp_wps_type_e *config_method)
 Gets the P2P configuration method for a service to be advertised.
int asp_advert_set_p2p_response (asp_advert_service_h adv_service, char *rsp_info, int length)
 Sets the service response for an advertised service.
int asp_advert_start_advertising (asp_advert_service_h adv_service)
 Starts to advertise a service.
int asp_advert_stop_advertising (asp_advert_service_h adv_service)
 Stops a service advertisement.
int asp_advert_change_service_status (asp_advert_service_h adv_service, unsigned char status)
 Changes the advertising service status.
int asp_seek_create (char *service_type, asp_seek_service_h *seek_service)
 Creates the description of a seek operation.
int asp_seek_destroy (asp_seek_service_h seek_service)
 Destroys the description of a seek operation.
int asp_seek_add_info (asp_seek_service_h seek_service, const char *key)
 Adds the information for a service to be sought.
int asp_seek_remove_info (asp_seek_service_h seek_service, const char *key)
 Removes the information for a service to be sought.
int asp_seek_set_discovery_tech (asp_seek_service_h seek_service, int discovery_tech)
 Sets the discovery mechanism for a service to be sought.
int asp_seek_set_preferred_connection (asp_seek_service_h seek_service, unsigned char preferred_connection)
 Sets the preferred connection for a service to be sought.
int asp_seek_start (asp_seek_service_h seek_service)
 Starts to seek services on peer devices.
int asp_seek_stop (asp_seek_service_h seek_service)
 Stops seeking services.
int asp_session_create (char *service_mac, unsigned int adv_id, asp_session_h *session)
 Creates a local Application Service Platform (ASP) session.
int asp_session_destroy (asp_session_h session)
 Destroys a local Application Service Platform (ASP) session.
int asp_session_get_mac (asp_session_h session, char **session_mac)
 Gets the session MAC for an Application Service Platform session.
int asp_session_get_id (asp_session_h session, unsigned int *session_id)
 Gets the ID of an Application Service Platform session.
int asp_session_set_info (asp_session_h session, char *session_info)
 Sets the information for an Application Service Platform session.
int asp_session_get_info (asp_session_h session, char **session_info)
 Gets the information for an Application Service Platform session.
int asp_session_set_p2p_role_scheme (asp_session_h session, asp_advert_p2p_role_scheme_e role)
 Sets the Wi-Fi Direct group role in session.
int asp_session_get_p2p_role_scheme (asp_session_h session, asp_advert_p2p_role_scheme_e *role)
 Gets the Wi-Fi Direct group role in session.
int asp_session_set_p2p_config_method (asp_session_h session, asp_wps_type_e config_method)
 Sets the Preferred WSC Configuration method.
int asp_session_get_p2p_config_method (asp_session_h session, asp_wps_type_e *config_method)
 Gets the Preferred WSC Configuration method.
int asp_session_get_close_status (asp_session_h session, int *status)
 Gets the session close status.
int asp_session_connect (asp_session_h session)
 Starts to connect the Application Service Platform session.
int asp_session_confirm (asp_session_h session, bool confirmed, char *pin)
 Confirms the Application Service Platform(ASP) session request.
int asp_session_get_handle (char *session_mac, unsigned int session_id, asp_session_h *session)
 Gets the Description of Application Service Platform (ASP) session to be connected.
int asp_session_set_state_ready (asp_session_h session)
 Moves an Application Service Platform (ASP) session from Requested state to the Open state.
int asp_session_close (asp_session_h session)
 Ends an Application Service Platform (ASP) session and releases associated resources.
int asp_session_bind_port (asp_session_h session, char *ip_address, int port, int proto)
 Requests that incoming connections be allowed on a given port.
int asp_session_release_port (asp_session_h session, char *ip_address, int port, int proto)
 Indicates that the service is no longer utilizing the port in the ASP session.

Typedefs

typedef void * asp_advert_service_h
 The advertised service description.
typedef void * asp_seek_service_h
 The searching service description.
typedef void * asp_session_h
 The Application Service Platform (ASP) session description.
typedef void(* asp_seek_search_result_cb )(int error_code, asp_seek_service_h seek_service, const char *service_mac, unsigned int adv_id, asp_wps_type_e config_method, const char *instance_name, const char *service_info, int info_size, unsigned char status, void *user_data)
 Called when the Application Service Platform (ASP) Service is found.
typedef void(* asp_advert_status_changed_cb )(asp_advert_service_h adv_service, asp_service_status_e status, asp_advert_status_reason_e reason, void *user_data)
 Called when the status of an advertisement to a service is changed.
typedef void(* asp_session_request_cb )(int error_code, asp_advert_service_h adv_service, asp_session_h session, const char *device_name, const char *info, int info_size, bool get_network_config_pin, const char *network_config_pin, void *user_data)
 Called when a remote device is attempting to initiate an ASP session.
typedef void(* asp_session_config_request_cb )(int error_code, asp_session_h session, bool get_pin, const char *config_pin, void *user_data)
 Called when the Application Service Platform (ASP) has to provide a PIN value or collect a PIN value.
typedef void(* asp_session_connect_status_cb )(int error_code, asp_session_h session, asp_connect_status_e status, const char *deferred_resp, int resp_size, void *user_data)
 Called when the Application Service Platform (ASP) reports progress on group formation.
typedef void(* asp_session_status_cb )(int error_code, asp_session_h session, asp_session_state_e state, const char *additional_info, void *user_data)
 Called when the Application Service Platform (ASP) reports the state and status of an ASP session.
typedef void(* asp_session_port_status_cb )(int error_code, asp_session_h session, const char *ip_address, int port, int proto, asp_port_status_e status, void *user_data)
 Called when the Application Service Platform (ASP) reports the status of the network port on the local and remote end of the ASP session.

Typedef Documentation

typedef void* asp_advert_service_h

The advertised service description.

Since :
4.0
typedef void(* asp_advert_status_changed_cb)(asp_advert_service_h adv_service, asp_service_status_e status, asp_advert_status_reason_e reason, void *user_data)

Called when the status of an advertisement to a service is changed.

Since :
4.0
Parameters:
[in]adv_serviceThe service whose status has changed; the handle to the same object for which the callback was set
[in]statusThe status of the service
[in]reasonThe reason of the state change
[in]user_dataThe user data passed from the callback registration function
Precondition:
The callback must be registered using asp_advert_set_status_cb().
asp_advert_start_advertising() and asp_change_service_state() invoke this callback.
See also:
asp_advert_set_status_changed_cb()
asp_advert_unset_status_changed_cb()
asp_advert_start_advertising()
typedef void(* asp_seek_search_result_cb)(int error_code, asp_seek_service_h seek_service, const char *service_mac, unsigned int adv_id, asp_wps_type_e config_method, const char *instance_name, const char *service_info, int info_size, unsigned char status, void *user_data)

Called when the Application Service Platform (ASP) Service is found.

Since :
4.0
Remarks:
service_mac, instance_name and service_info are valid only in the callback. To use outside the callback, make a copy.
Parameters:
[in]error_codeThe error code.
ASP_ERROR_NONE Successful
ASP_ERROR_OUT_OF_MEMORY Out of memory
ASP_ERROR_OPERATION_FAILED Operation failed
[in]seek_serviceThe seek service which found the current result; the handle to the same object for which the search was started
[in]service_macThe P2P device address of the device which provides the service; NULL if not available
[in]adv_idThe service advertisement ID defined by remote P2P device
[in]config_methodThe preferred Wi-Fi Simple Config (WSC) configuration method
[in]instance_nameThe advertised service name defined by the remote P2P device; NULL if not available
[in]service_infoThe advertised service information defined by the remote P2P device; NULL if not available
[in]info_sizeThe advertised service information payload size; if the information is not available, this is set to -1
[in]statusThe status of the service
[in]user_dataThe user data passed from the callback registration function
Precondition:
The callback must be registered using asp_seek_set_search_result_cb().
asp_seek_start() must be called to invoke this callback.
See also:
asp_seek_set_search_result_cb()
asp_seek_unset_search_result_cb()
asp_seek_start()
typedef void* asp_seek_service_h

The searching service description.

Since :
4.0
typedef void(* asp_session_config_request_cb)(int error_code, asp_session_h session, bool get_pin, const char *config_pin, void *user_data)

Called when the Application Service Platform (ASP) has to provide a PIN value or collect a PIN value.

Since :
4.0
Remarks:
config_pin is valid only in the callback. To use outside the callback, make a copy.
Parameters:
[in]error_codeThe error code.
ASP_ERROR_NONE Successful
ASP_ERROR_OUT_OF_MEMORY Out of memory
ASP_ERROR_OPERATION_FAILED Operation failed
[in]sessionThe session for which the request is made; the handle to the same object for which the callback was set
[in]get_pin(true = instruct the user to enter the PIN, false = display the PIN provided in the config_pin parameter)
[in]config_pinThe WSC PIN value used for setting up; ignored if get_pin is true
[in]user_dataThe user data passed from the callback registration function
Precondition:
The callback must be registered using asp_session_set_config_request_cb().
asp_session_connect() must be called to invoke this callback.
See also:
asp_session_set_request_cb()
asp_session_connect()
typedef void(* asp_session_connect_status_cb)(int error_code, asp_session_h session, asp_connect_status_e status, const char *deferred_resp, int resp_size, void *user_data)

Called when the Application Service Platform (ASP) reports progress on group formation.

Since :
4.0
Remarks:
deferred_resp is valid only in the callback. To use outside the callback, make a copy.
Parameters:
[in]error_codeThe error code.
ASP_ERROR_NONE Successful
ASP_ERROR_OUT_OF_MEMORY Out of memory
ASP_ERROR_OPERATION_FAILED Operation failed
[in]sessionThe session for which progress is reported; the handle to the same object for which the callback was set
[in]statusThe connection progress status
[in]deferred_respThe service-specific data payload up to 144 bytes
[in]resp_sizeThe service-specific data payload size(up to 144)
[in]user_dataThe user data passed from the callback registration function
Precondition:
The callback must be registered using asp_session_set_connect_status_cb()
See also:
asp_session_set_connect_status_cb()
typedef void* asp_session_h

The Application Service Platform (ASP) session description.

Since :
4.0
typedef void(* asp_session_port_status_cb)(int error_code, asp_session_h session, const char *ip_address, int port, int proto, asp_port_status_e status, void *user_data)

Called when the Application Service Platform (ASP) reports the status of the network port on the local and remote end of the ASP session.

Since :
4.0
Remarks:
ip_address is valid only in the callback. To use outside the callback, make a copy.
Parameters:
[in]error_codeThe error code.
ASP_ERROR_NONE Successful
ASP_ERROR_OUT_OF_MEMORY Out of memory
ASP_ERROR_OPERATION_FAILED Operation failed
[in]sessionApplication Service Platform session descriptor handle
[in]ip_addressThe IP address for the port, local or remote
[in]portThe port number
[in]protoThe IANA protocol number
[in]statusThe port status
[in]user_dataThe user data passed from the callback registration function
Precondition:
The callback must be registered using asp_session_set_port_status_cb()
See also:
asp_session_set_port_status_cb()
typedef void(* asp_session_request_cb)(int error_code, asp_advert_service_h adv_service, asp_session_h session, const char *device_name, const char *info, int info_size, bool get_network_config_pin, const char *network_config_pin, void *user_data)

Called when a remote device is attempting to initiate an ASP session.

Since :
4.0
Remarks:
network_config_pin, device_name and info are valid only in the callback. To use outside the callback, make a copy.
Parameters:
[in]error_codeThe error code.
ASP_ERROR_NONE Successful
ASP_ERROR_OUT_OF_MEMORY Out of memory
ASP_ERROR_OPERATION_FAILED Operation failed
[in]adv_serviceService descriptor handle provided by the asp_advert_create() it is the "original" object not created specifically for the callback
[in]sessionThe session for which the request is made; the handle to the same object for which the callback was set
[in]device_nameDevice name of the remote peer
[in]infoThe service-specific data payload (up to 144 bytes); NULL if not available
[in]info_sizeThe service-specific data payload size (up to 144)
[in]get_network_config_pin(true = requires WSC PIN to be entered by the asp_session_confirm(), false = does not require PIN)
[in]network_config_pinThe WSC PIN value to be displayed; NULL if not available
[in]user_dataThe user data passed from the callback registration function
Precondition:
The callback must be registered using asp_session_set_request_cb().
See also:
asp_session_set_request_cb()
typedef void(* asp_session_status_cb)(int error_code, asp_session_h session, asp_session_state_e state, const char *additional_info, void *user_data)

Called when the Application Service Platform (ASP) reports the state and status of an ASP session.

Since :
4.0
Remarks:
additional_info is valid only in the callback. To use outside the callback, make a copy.
Parameters:
[in]error_codeThe error code.
ASP_ERROR_NONE Successful
ASP_ERROR_OUT_OF_MEMORY Out of memory
ASP_ERROR_OPERATION_FAILED Operation failed
[in]sessionThe session for which status is reported; the handle to the same object for which the callback was set
[in]stateThe session state
[in]additional_infoAdditional information related to the SessionStatus event
[in]user_dataThe user data passed from the callback registration function
Precondition:
The callback must be registered using asp_session_set_status_cb()
See also:
asp_session_set_status_cb()

Enumeration Type Documentation

Enumeration for the Wi-Fi P2P role assignment scheme.

Since :
4.0
See also:
asp_advert_set_p2p_role_scheme()
asp_advert_get_p2p_role_scheme()
asp_session_set_p2p_role_scheme()
asp_session_get_p2p_role_scheme()
Enumerator:
ASP_ADVERT_P2P_ROLE_SCHEME_ANY 

All roles are acceptable

ASP_ADVERT_P2P_ROLE_SCHEME_GO 

The interface should assume the GO role

ASP_ADVERT_P2P_ROLE_SCHEME_GC 

The interface should assume the GC role

Enumeration for Advertise Status event reason.

Since :
4.0
Enumerator:
ASP_ADVERT_STATUS_REASON_SUCCESS 

Status reason: Success

ASP_ADVERT_STATUS_REASON_SERVICE_DUPLICATED 

Status reason: Service duplicated

ASP_ADVERT_STATUS_REASON_OTHER_FAILURE 

Status reason: Other failure

Enumeration for Application Service Platform (ASP) Session connect status.

Since :
4.0
Enumerator:
ASP_CONNECT_STATUS_NETWORK_ROLE_REJECTED 

Network role rejected

ASP_CONNECT_STATUS_CONNECTION_LIMIT_REACHED 

The device's connection limit has been reached

ASP_CONNECT_STATUS_REQUEST_SENT 

Session request sent

ASP_CONNECT_STATUS_REQUEST_RECEIVED 

Session request received

ASP_CONNECT_STATUS_REQUEST_DEFERRED 

Session request deferred

ASP_CONNECT_STATUS_REQUEST_ACCEPTED 

Session request accepted

ASP_CONNECT_STATUS_REQUEST_FAILED 

Session request failed

ASP_CONNECT_STATUS_GROUP_FORMATION_STARTED 

Group formation started

ASP_CONNECT_STATUS_GROUP_FORMATION_COMPLETED 

Group formation completed

ASP_CONNECT_STATUS_GROUP_FORMATION_FAILED 

Group formation failed

Enumeration for service discovery mechanism.

Since :
4.0
See also:
asp_advert_set_discovery_tech()
asp_seek_set_discovery_tech()
Enumerator:
ASP_DISCOVERY_TECH_P2P 

Use Wi-Fi P2P for discovery mechanism

ASP_DISCOVERY_TECH_BLE 

Use BLE for discovery mechanism

ASP_DISCOVERY_TECH_NFC 

Use NFC for discovery mechanism

ASP_DISCOVERY_TECH_INFRA 

Use Wi-Fi Infrastructured for discovery mechanism

ASP_DISCOVERY_TECH_NAN 

Use Wi-Fi NAN for discovery mechanism

Enumeration for Application Service Platform (ASP) error code.

Since :
4.0
Enumerator:
ASP_ERROR_NONE 

Successful

ASP_ERROR_NOT_PERMITTED 

Operation not permitted(1)

ASP_ERROR_OUT_OF_MEMORY 

Out of memory(12)

ASP_ERROR_PERMISSION_DENIED 

Permission denied(13)

ASP_ERROR_RESOURCE_BUSY 

Device or resource busy(16)

ASP_ERROR_INVALID_PARAMETER 

Invalid function parameter(22)

ASP_ERROR_CONNECTION_TIME_OUT 

Connection timed out(110)

ASP_ERROR_NOT_SUPPORTED 

Not supported

ASP_ERROR_NOT_INITIALIZED 

Not initialized

ASP_ERROR_ALREADY_INITIALIZED 

Already initialized

ASP_ERROR_COMMUNICATION_FAILED 

I/O error

ASP_ERROR_OPERATION_FAILED 

Operation failed

ASP_ERROR_IN_PROGRESS 

In progress

ASP_ERROR_SERVICE_NOT_FOUND 

Service not found

ASP_ERROR_SESSION_NOT_FOUND 

Session not found

ASP_ERROR_NETWORK_ROLE_REJECTED 

Requested network role rejected

Enumeration for Application Service Platform (ASP) port status.

Since :
4.0
Enumerator:
ASP_PORT_STATUS_LOCAL_PORT_ALLOWED 

Incoming connections are allowed on this local port for this ASP session

ASP_PORT_STATUS_LOCAL_PORT_BLOCKED 

Incoming connections are no longer allowed in the ASP session for this local port

ASP_PORT_STATUS_FAILURE 

The ASP was unable to set up this local port

ASP_PORT_STATUS_REMOTE_PORT_ALLOWED 

The remote service has allowed access to the given remote port for the given protocol

Enumeration for service status.

Since :
4.0
Enumerator:
ASP_SERVICE_STATUS_NOT_ADVERTISED 

Service status not advertised

ASP_SERVICE_STATUS_ADVERTISED 

Service status advertised

Enumeration for Application Service Platform (ASP) session close status.

Since :
4.0
Enumerator:
ASP_SESSION_CLOSE_OK 

Session closed without error

ASP_SESSION_CLOSE_DISASSOCIATED 

Session closed by disassociation (Wi-Fi Direct connection was broken)

ASP_SESSION_CLOSE_LOCAL_CLOSE 

Session closed with local close

ASP_SESSION_CLOSE_REMOTE_CLOSE 

Session closed with remote close

ASP_SESSION_CLOSE_SYSTEM_FAILURE 

Session closed with system failure

ASP_SESSION_CLOSE_NO_RESPONSE 

Session closed with no response from remote

Enumeration for Application Service Platform (ASP) general session state.

Since :
4.0
Enumerator:
ASP_SESSION_STATE_ERROR 

Session state error

ASP_SESSION_STATE_CLOSED 

Session state closed

ASP_SESSION_STATE_INITIATED 

Session state initiated

ASP_SESSION_STATE_REQUESTED 

Session state requested

ASP_SESSION_STATE_OPEN 

Session state open

Enumeration for Wi-Fi WPS type.

See also:
asp_advert_set_p2p_config_method()
asp_advert_get_p2p_config_method()
asp_session_set_p2p_config_method()
asp_session_get_p2p_config_method()
Since :
4.0
Enumerator:
ASP_WPS_TYPE_NONE 

No WPS type

ASP_WPS_TYPE_DEFAULT 

Default WPS type both P2PS and PIN

ASP_WPS_TYPE_PIN_BOTH 

WPS type PIN code both display and keypad

ASP_WPS_TYPE_PIN_DISPLAY 

WPS type display PIN code only

ASP_WPS_TYPE_PIN_KEYPAD 

WPS type keypad to input the PIN only


Function Documentation

int asp_advert_add_info ( asp_advert_service_h  adv_service,
const char *  key,
const char *  value 
)

Adds the information for a service to be advertised.

Application should set service information after creating service using asp_advert_create() and before advertising service using asp_advert_start_advertising().

Since :
4.0
Parameters:
[in]adv_serviceService descriptor handle provided by the asp_advert_create()
[in]keyService-defined key data specified in Section 6 of RFC6763
[in]valueService-defined value data specified in Section 6 of RFC6763 Only one value can be added for a given key. If a value is set for a key, and another value was set for the key before, the old value will be overwritten with the new one.
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SERVICE_NOT_FOUNDService not found
Precondition:
This API needs asp_advert_create() before use
See also:
asp_advert_create()
int asp_advert_change_service_status ( asp_advert_service_h  adv_service,
unsigned char  status 
)

Changes the advertising service status.

Application should change the advertising service status after advertising service using asp_advert_start_advertising().

Since :
4.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/wifidirect
Parameters:
[in]adv_serviceService descriptor handle provided by the asp_advert_create()
[in]statusStatus of the service: (1 = available to use, 0 = not available to use, 2-255 = service specific information)
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_PERMISSION_DENIEDPermission denied
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SERVICE_NOT_FOUNDService not found
Precondition:
This API needs asp_advert_start_advertising() before use
See also:
asp_advert_start_advertising()
int asp_advert_create ( char *  instance_name,
asp_advert_service_h adv_service 
)

Creates the description of a service to be advertised.

Since :
4.0
Remarks:
The adv_service should be released using asp_advert_destroy().
Parameters:
[in]instance_nameService instance name of a service type to be advertised. The length of this parameter be 63 byte or less and encoding shall be single-byte or multi-byte UTF-8 characters. If you want to advertise one of the original P2PS defined services, this shall be NULL.
[out]adv_serviceservice descriptor handle
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
Precondition:
Application Service Platform (ASP) must be initialized by asp_initialize().
See also:
asp_advert_destroy()

Destroys the description of a service to be advertised.

If asp_advert_start_advertising() was called for a service, asp_advert_stop_advertising() should be called for it before destroying it.

Since :
4.0
Parameters:
[in]adv_serviceService descriptor handle provided by the asp_advert_create()
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SERVICE_NOT_FOUNDService not found
Precondition:
This API needs asp_advert_create() before use
See also:
asp_advert_create()
int asp_advert_get_info ( asp_advert_service_h  adv_service,
const char *  key,
int *  length,
char **  value 
)

Sets the information for a service to be advertised.

Application should set service information after creating service using asp_advert_create() and before advertising service using asp_advert_start_advertising().

Since :
4.0
Remarks:
value should not be freed. It is recommended to make a copy of it to use.
Parameters:
[in]adv_serviceService descriptor handle provided by the asp_advert_create()
[in]keyService-defined key data specified in Section 6 of RFC6763
[in]lengthLength of service-defined value data specified in Section 6 of RFC6763
[in]valueService-defined value data specified in Section 6 of RFC6763
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SERVICE_NOT_FOUNDService not found
Precondition:
This API needs asp_advert_create() before use
See also:
asp_advert_create()
int asp_advert_get_p2p_config_method ( asp_advert_service_h  adv_service,
asp_wps_type_e config_method 
)

Gets the P2P configuration method for a service to be advertised.

Application should Get configuration method after creating service using asp_advert_create() and before advertising service using asp_advert_start_advertising().

Since :
4.0
Parameters:
[in]adv_serviceService descriptor handle provided by the asp_advert_create()
[in]config_methodpreferred Wi-Fi Simple Config (WSC)configuration method.
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SERVICE_NOT_FOUNDService not found
Precondition:
This API needs asp_advert_create() before use
See also:
asp_advert_create()

Gets the Wi-Fi P2P role for a service to be advertised.

Application should Get role after creating service using asp_advert_create() and before advertising service using asp_advert_start_advertising().

Since :
4.0
Parameters:
[in]adv_serviceService descriptor handle provided by the asp_advert_create()
[in]roleThe role of the service:
ASP_ADVERT_P2P_ROLE_SCHEME_ANY - All roles are acceptable
ASP_ADVERT_P2P_ROLE_SCHEME_GO - The receiving interface should assume
the GO role
ASP_ADVERT_P2P_ROLE_SCHEME_GC - The receiving interface should assume the GC role
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SERVICE_NOT_FOUNDService not found
Precondition:
This API needs asp_advert_create() before use
See also:
asp_advert_create()
int asp_advert_remove_info ( asp_advert_service_h  adv_service,
const char *  key 
)

Sets the information for a service to be advertised.

Application should set service information after creating service using asp_advert_create() and before advertising service using asp_advert_start_advertising().

Since :
4.0
Parameters:
[in]adv_serviceService descriptor handle provided by the asp_advert_create()
[in]keyService-defined key data specified to be removed
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SERVICE_NOT_FOUNDService not found
Precondition:
This API needs asp_advert_create() before use
See also:
asp_advert_create()
int asp_advert_set_auto_accept ( asp_advert_service_h  adv_service,
bool  auto_accept 
)

Sets auto accept for a service to be advertised.

Application should set service auto accept after creating service using asp_advert_create() and before advertising service using asp_advert_start_advertising().

Since :
4.0
Parameters:
[in]adv_serviceService descriptor handle provided by the asp_advert_create()
[in]auto_acceptEnables/Disables auto accept based on the value TRUE/FALSE
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SERVICE_NOT_FOUNDService not found
Precondition:
This API needs asp_advert_create() before use
See also:
asp_advert_create()
int asp_advert_set_discovery_tech ( asp_advert_service_h  adv_service,
int  discovery_tech 
)

Sets the discovery mechanism for a service to be advertised.

Application should set discovery mechanism after creating service using asp_advert_create() and before advertising service using asp_advert_start_advertising().

Since :
4.0
Parameters:
[in]adv_serviceService descriptor handle provided by the asp_advert_create()
[in]discovery_techThe discovery mechanism; values of asp_discovery_tech_e combined with bitwise 'or'
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SERVICE_NOT_FOUNDService not found
Precondition:
This API needs asp_advert_create() before use
See also:
asp_advert_create()
int asp_advert_set_p2p_config_method ( asp_advert_service_h  adv_service,
asp_wps_type_e  config_method 
)

Sets the P2P configuration method for a service to be advertised.

Application should set configuration method after creating service using asp_advert_create() and before advertising service using asp_advert_start_advertising().

Since :
4.0
Parameters:
[in]adv_serviceService descriptor handle provided by the asp_advert_create()
[in]config_methodpreferred Wi-Fi Simple Config (WSC) configuration method. Default value is ASP_WPS_TYPE_DEFAULT.
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SERVICE_NOT_FOUNDService not found
Precondition:
This API needs asp_advert_create() before use
See also:
asp_advert_create()
int asp_advert_set_p2p_response ( asp_advert_service_h  adv_service,
char *  rsp_info,
int  length 
)

Sets the service response for an advertised service.

Application should set service response after creating service using asp_advert_create() and before advertising service using asp_advert_create().

Since :
4.0
Parameters:
[in]adv_serviceService descriptor handle provided by the asp_advert_create()
[in]rsp_infoSpecified for a particular service up to 144 bytes. You can refer to Wi-Fi Peer-to-Peer Services Technical Specification, Wi-Fi Alliance. Available at: http://www.wi-fi.org
[in]lengthThe length of rsp_info in bytes, maximum length is 144
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SERVICE_NOT_FOUNDService not found
Precondition:
This API needs asp_advert_create() before use
See also:
asp_advert_create()

Sets the Wi-Fi P2P role for a service to be advertised.

Application should set role after creating service using asp_advert_create() and before advertising service using asp_advert_start_advertising().

Since :
4.0
Parameters:
[in]adv_serviceService descriptor handle provided by the asp_advert_create()
[in]roleThe role of the service:
ASP_ADVERT_P2P_ROLE_SCHEME_ANY - All roles are acceptable
ASP_ADVERT_P2P_ROLE_SCHEME_GO - The receiving interface should assume
the GO role, if it's not possible, ASP_ERROR_NETWORK_ROLE_REJECTED
is returned
ASP_ADVERT_P2P_ROLE_SCHEME_GC - The receiving interface should assume the GC role
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SERVICE_NOT_FOUNDService not found
ASP_ERROR_NETWORK_ROLE_REJECTEDNetwork role rejected
Precondition:
This API needs asp_advert_create() before use
See also:
asp_advert_create()
int asp_advert_set_preferred_connection ( asp_advert_service_h  adv_service,
unsigned char  preferred_connection 
)

Sets the preferred connection for a service to be advertised.

Application should set preferred connection after creating service using asp_advert_create() and before advertising service using asp_advert_start_advertising().

Since :
4.0
Parameters:
[in]adv_serviceService descriptor handle provided by the asp_advert_create()
[in]preferred_connectionThe preferred connection
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SERVICE_NOT_FOUNDService not found
Precondition:
This API needs asp_advert_create() before use
See also:
asp_advert_create()
int asp_advert_set_service_type ( asp_advert_service_h  adv_service,
char *  service_type 
)

Sets the service type for a service to be advertised.

Application should set service type after creating service using asp_advert_create() and before advertising service using asp_advert_start_advertising().

Since :
4.0
Parameters:
[in]adv_serviceService descriptor handle provided by the asp_advert_create()
[in]service_typeThe unique type of a particular service. this shall be at least 1 character and no more than 15 characters long contain only US-ASCII [ANSI.X3.4-1986] letters 'A' - 'Z' and 'a' - 'z', digits '0' - '9', and hyphens ('-', ASCII 0x2D or decimal 45) contain at least one letter ('A' - 'Z' or 'a' - ‘z') not begin or end with a hyphen. If you want to advertise one of the original P2PS defined services, this means service name.
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SERVICE_NOT_FOUNDService not found
Precondition:
This API needs asp_advert_create() before use
See also:
asp_advert_create()
int asp_advert_set_status ( asp_advert_service_h  adv_service,
unsigned char  status 
)

Sets the status for a service to be advertised.

Application should set service status after creating service using asp_advert_create() and before advertising service using asp_advert_start_advertising().

Since :
4.0
Parameters:
[in]adv_serviceService descriptor handle provided by the asp_advert_create()
[in]statusStatus of the service: (1 = available to use, 0 = not available to use, 2-255 = service specific information)
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SERVICE_NOT_FOUNDService not found
Precondition:
This API needs asp_advert_create() before use
See also:
asp_advert_create()

Registers the callback function that will invoked when the status of an advertisement to a service is changed.

Since :
4.0
Parameters:
[in]cbThe callback function to invoke
[in]user_dataThe user data passed from the callback registration function
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
Precondition:
Application Service Platform (ASP) must be initialized by asp_initialize().
Postcondition:
asp_seek_search_result_cb() will be called under certain conditions, after calling asp_seek_start()
See also:
asp_initialize()
asp_advert_unset_status_changed_cb()
asp_advert_start_advertising()

Starts to advertise a service.

Application should start to advertise after creating service using asp_advert_create(). If the service is being advertised, no changes can be made to it.

Since :
4.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/wifidirect
Parameters:
[in]adv_serviceService descriptor handle provided by the asp_advert_create()
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_PERMISSION_DENIEDPermission denied
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SERVICE_NOT_FOUNDService not found
Precondition:
This API needs asp_advert_create() before use
See also:
asp_advert_create()
asp_advert_stop_advertising()

Stops a service advertisement.

Application should cancel to advertise after advertising service using asp_advert_start_advertising().

Since :
4.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/wifidirect
Parameters:
[in]adv_serviceService descriptor handle provided by the asp_advert_create()
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_PERMISSION_DENIEDPermission denied
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SERVICE_NOT_FOUNDService not found
Precondition:
This API needs asp_advert_start_advertising() before use
See also:
asp_advert_start_advertising()

Unregisters the callback function that will invoked when the status of an advertisement to a service is changed.

Since :
4.0
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
Precondition:
Application Service Platform (ASP) must be initialized by asp_initialize().
See also:
asp_initialize()
asp_advert_set_status_changed_cb()
int asp_deinitialize ( void  )

Deinitializes Application Service Platform (ASP).

Since :
4.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/wifidirect
Returns:
0 on success, otherwise a negative error value.
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_COMMUNICATION_FAILEDCommunication failed
Precondition:
Application Service Platform (ASP) must be initialized by asp_initialize().
See also:
asp_initialize()
int asp_initialize ( void  )

Initializes Application Service Platform (ASP).

Since :
4.0
Returns:
0 on success, otherwise a negative error value.
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_RESOURCE_BUSYDevice or resource busy
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_COMMUNICATION_FAILEDCommunication failed
ASP_ERROR_OPERATION_FAILEDOperation failed
See also:
asp_deinitialize()
int asp_seek_add_info ( asp_seek_service_h  seek_service,
const char *  key 
)

Adds the information for a service to be sought.

Application should set service information after creating service using asp_seek_create() and before seeking service using asp_seek_start().

Since :
4.0
Privilege Level:
public
Parameters:
[in]seek_serviceService descriptor handle provided by the asp_seek_create()
[in]keyService-defined key data to be searched, specified in Section 6 of RFC6763
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SERVICE_NOT_FOUNDService not found
Precondition:
This API needs asp_seek_create() before use
See also:
asp_seek_create()
int asp_seek_create ( char *  service_type,
asp_seek_service_h seek_service 
)

Creates the description of a seek operation.

Remarks:
The seek_service should be released using asp_seek_destroy().
Since :
4.0
Parameters:
[in]service_typeService Type of a service being searched. this shall be at least 1 character and no more than 15 characters long contain only US-ASCII [ANSI.X3.4-1986] letters 'A' - 'Z' and 'a' - 'z', digits '0' - '9', and hyphens ('-', ASCII 0x2D or decimal 45) contain at least one letter ('A' - 'Z' or 'a' - ‘z') not begin or end with a hyphen. If you want to seek one of the original P2PS defined services, this means service name.
[out]seek_serviceService seek handle
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
Precondition:
Application Service Platform (ASP) must be initialized by asp_initialize().
See also:
asp_seek_destroy()
int asp_seek_destroy ( asp_seek_service_h  seek_service)

Destroys the description of a seek operation.

If asp_seek_start() was called for a service, asp_seek_stop() should be called for it before destroying it. asp_seek_stop().

Since :
4.0
Parameters:
[in]seek_serviceService seek handle provided by the asp_seek_create()
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SERVICE_NOT_FOUNDService not found
Precondition:
A seek service handle must be created with asp_seek_create().
See also:
asp_seek_create
int asp_seek_remove_info ( asp_seek_service_h  seek_service,
const char *  key 
)

Removes the information for a service to be sought.

Application should set service information after creating service using asp_seek_create() and before seeking service using asp_seek_start().

Since :
4.0
Parameters:
[in]seek_serviceService descriptor handle provided by the asp_seek_create()
[in]keyService-defined key data to be searched, specified in Section 6 of RFC6763
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SERVICE_NOT_FOUNDService not found
Precondition:
This API needs asp_seek_create() before use
See also:
asp_seek_create()
int asp_seek_set_discovery_tech ( asp_seek_service_h  seek_service,
int  discovery_tech 
)

Sets the discovery mechanism for a service to be sought.

Application should set service information after creating service using asp_seek_create() and before seeking service using asp_seek_start().

Since :
4.0
Parameters:
[in]seek_serviceService descriptor handle provided by the asp_seek_create()
[in]discovery_techThe discovery mechanism, values of asp_discovery_tech_e combined with bitwise 'or'
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SERVICE_NOT_FOUNDService not found
Precondition:
This API needs asp_seek_create() before use
See also:
asp_seek_create()
int asp_seek_set_preferred_connection ( asp_seek_service_h  seek_service,
unsigned char  preferred_connection 
)

Sets the preferred connection for a service to be sought.

Application should set service information after creating service using asp_seek_create() and before seeking service using asp_seek_start().

Since :
4.0
Parameters:
[in]seek_serviceService descriptor handle provided by the asp_seek_create()
[in]preferred_connectionThe preferred connection
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SERVICE_NOT_FOUNDService not found
Precondition:
This API needs asp_seek_create() before use
See also:
asp_seek_create()
int asp_seek_set_search_result_cb ( asp_seek_search_result_cb  cb,
void *  user_data 
)

Registers the callback function that will be invoked when a service found.

Since :
4.0
Parameters:
[in]cbThe callback function to invoke
[in]user_dataThe user data passed from the callback registration function
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
Precondition:
Application Service Platform (ASP) must be initialized by asp_initialize().
Postcondition:
asp_search_result_cb will be called under certain conditions, after calling asp_seek_start()
See also:
asp_initialize()
asp_seek_unset_search_result_cb()
asp_seek_start()
int asp_seek_start ( asp_seek_service_h  seek_service)

Starts to seek services on peer devices.

If the service is currently seeking, no changes can be made to it.

Since :
4.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/wifidirect
Parameters:
[in]seek_serviceService seek handle provided by the asp_seek_create()
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_PERMISSION_DENIEDPermission denied
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SERVICE_NOT_FOUNDService not found
Precondition:
A seek service handle must be created with asp_seek_create().
See also:
asp_seek_create()
asp_seek_stop()
int asp_seek_stop ( asp_seek_service_h  seek_service)

Stops seeking services.

Application should cancel to seek service after searching service using asp_seek_start().

Since :
4.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/wifidirect
Parameters:
[in]seek_serviceService seek handle provided by the asp_seek_create()
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_PERMISSION_DENIEDPermission denied
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SERVICE_NOT_FOUNDService not found
Precondition:
A seek service handle must be created with asp_seek_create().
See also:
asp_seek_start()

Unregisters the callback function that will invoked when a service found.

Since :
4.0
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
Precondition:
Application Service Platform (ASP) must be initialized by asp_initialize().
See also:
asp_initialize()
asp_seek_set_search_result_cb()
int asp_session_bind_port ( asp_session_h  session,
char *  ip_address,
int  port,
int  proto 
)

Requests that incoming connections be allowed on a given port.

Since :
4.0
Parameters:
[in]sessionASP session descriptor handle provided by the asp_session_request_cb() callback or asp_session_create()
[in]ip_addressThe IP address on which the port is being used
[in]portThe port number
[in]protoThe IANA protocol number
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SESSION_NOT_FOUNDSession not found
See also:
asp_session_create()
asp_session_request_cb()
int asp_session_close ( asp_session_h  session)

Ends an Application Service Platform (ASP) session and releases associated resources.

The ASP may tear down the underlying ASP P2P group if not other ASP sessions are using it.

Since :
4.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/wifidirect
Parameters:
[in]sessionASP session descriptor handle provided by the asp_session_request_cb() callback or asp_session_create()
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_PERMISSION_DENIEDPermission denied
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SESSION_NOT_FOUNDSession not found
See also:
asp_session_create()
asp_session_request_cb()
int asp_session_confirm ( asp_session_h  session,
bool  confirmed,
char *  pin 
)

Confirms the Application Service Platform(ASP) session request.

Since :
4.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/wifidirect
Parameters:
[in]sessionASP session descriptor handle provided by the asp_session_request_cb() callback or asp_session_create() if pin is requested.
[in]confirmed(true = confirm session, false = reject session)
[in]pinIf session requests the WSC PIN
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_PERMISSION_DENIEDPermission denied
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SESSION_NOT_FOUNDSession not found
See also:
asp_advert_start_advertising()
asp_session_create()

Starts to connect the Application Service Platform session.

Since :
4.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/wifidirect
Parameters:
[in]sessionApplication Service Platform session descriptor handle
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_PERMISSION_DENIEDPermission denied
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SESSION_NOT_FOUNDSession not found
Precondition:
This API needs asp_session_create() before use.
See also:
asp_session_create()
int asp_session_create ( char *  service_mac,
unsigned int  adv_id,
asp_session_h session 
)

Creates a local Application Service Platform (ASP) session.

Since :
4.0
Remarks:
The session should be released using asp_session_destroy().
Parameters:
[in]service_macP2P device address of remote P2P device provided by asp_seek_search_result_cb()
[in]adv_idThe advertisement ID provided by asp_seek_search_result_cb()
[out]sessionASP session descriptor handle
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
See also:
asp_session_destroy()

Destroys a local Application Service Platform (ASP) session.

Application should create session by asp_session_create().

Since :
4.0
Parameters:
[in]sessionApplication Service Platform session descriptor handle
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SESSION_NOT_FOUNDSession not found
Precondition:
This API needs asp_session_create() before use.
See also:
asp_session_create()
int asp_session_get_close_status ( asp_session_h  session,
int *  status 
)

Gets the session close status.

This call is valid only for closed sessions (sessions in the ASP_SESSION_STATE_CLOSED state). If the session does not identify a closed session, ASP_ERROR_NOT_PERMITTED is returned.

Since :
4.0
Parameters:
[in]sessionASP session descriptor handle provided by the asp_session_request_cb() callback, asp_session_create(), or asp_session_get_handle()
[out]statusThe session close status
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_SESSION_NOT_FOUNDSession not found
int asp_session_get_handle ( char *  session_mac,
unsigned int  session_id,
asp_session_h session 
)

Gets the Description of Application Service Platform (ASP) session to be connected.

Since :
4.0
Parameters:
[in]session_macThe MAC address of the P2P device that assigned the value of session_id, as provided by the asp_session_request_cb() callback or asp_session_create() if pin is requested.
[in]session_idThe session ID
[out]sessionPeer-to-Peer service session descriptor handle
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SESSION_NOT_FOUNDSession not found
See also:
asp_session_create()
int asp_session_get_id ( asp_session_h  session,
unsigned int *  session_id 
)

Gets the ID of an Application Service Platform session.

Application should create local session by asp_session_create() or receive request by asp_session_request_cb().

Since :
4.0
Parameters:
[in]sessionApplication Service Platform session descriptor handle
[out]session_idThe session ID
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SESSION_NOT_FOUNDSession not found
Precondition:
This API needs asp_session_create() before use.
See also:
asp_session_create()
asp_session_request_cb()
int asp_session_get_info ( asp_session_h  session,
char **  session_info 
)

Gets the information for an Application Service Platform session.

Application should get session_info after creating session by asp_session_create() and before requesting to connect session by asp_session_connect().

Since :
4.0
Remarks:
session_info should not be freed. It is recommended to make a copy of it to use.
Parameters:
[in]sessionApplication Service Platform session descriptor handle provided by the asp_session_create()
[out]session_infodetailed information about session
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SESSION_NOT_FOUNDSession not found
Precondition:
This API needs asp_session_create() before use.
See also:
asp_session_create()
int asp_session_get_mac ( asp_session_h  session,
char **  session_mac 
)

Gets the session MAC for an Application Service Platform session.

Application should request to connect session by asp_session_connect() or receive request by asp_session_request_cb().

Since :
4.0
Remarks:
session_mac should not be freed. It is recommended to make a copy of it to use.
Parameters:
[in]sessionApplication Service Platform session descriptor handle
[out]session_macThe session MAC is the MAC address of P2P device which assigned the session ID
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SESSION_NOT_FOUNDSession not found
Precondition:
This API needs asp_session_connect() before use.
See also:
asp_session_connect()
asp_session_request_cb()
int asp_session_get_p2p_config_method ( asp_session_h  session,
asp_wps_type_e config_method 
)

Gets the Preferred WSC Configuration method.

Since :
4.0
Parameters:
[in]sessionApplication Service Platform session descriptor handle provided by the asp_session_create()
[out]config_methodPreferred WSC Configuration method
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SESSION_NOT_FOUNDSession not found
Precondition:
This API needs asp_session_create() before use.
See also:
asp_session_create()

Gets the Wi-Fi Direct group role in session.

Since :
4.0
Parameters:
[in]sessionApplication Service Platform session descriptor handle provided by the asp_session_create()
[in]roleThe role of the service:
ASP_ADVERT_P2P_ROLE_SCHEME_ANY - All roles are acceptable
ASP_ADVERT_P2P_ROLE_SCHEME_GO - The receiving interface should assume
the GO role
ASP_ADVERT_P2P_ROLE_SCHEME_GC - The receiving interface should assume the GC role
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SESSION_NOT_FOUNDSession not found
Precondition:
This API needs asp_session_create() before use.
See also:
asp_session_create()
int asp_session_release_port ( asp_session_h  session,
char *  ip_address,
int  port,
int  proto 
)

Indicates that the service is no longer utilizing the port in the ASP session.

Since :
4.0
Parameters:
[in]sessionASP session descriptor handle provided by the asp_session_request_cb() callback or asp_session_create()
[in]ip_addressThe IP address on which the port is being used
[in]portThe port number
[in]protoThe IANA protocol number
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SESSION_NOT_FOUNDSession not found
See also:
asp_session_create()
asp_session_request_cb()

Registers the callback called when the session configuration is requested.

Since :
4.0
Parameters:
[in]cbThe callback function to invoke
[in]user_dataThe user data passed from the callback registration function
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
Precondition:
Application Service Platform (ASP) must be initialized by asp_initialize().
See also:
asp_initialize()
asp_session_unset_config_request_cb()
asp_session_config_request_cb()

Registers the callback called when the state of the session connection is changed.

Since :
4.0
Parameters:
[in]cbThe callback function to invoke
[in]user_dataThe user data passed from the callback registration function
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
Precondition:
Application Service Platform (ASP) must be initialized by asp_initialize().
See also:
asp_initialize()
asp_session_unset_connect_status_cb()
asp_session_connect_status_cb()
int asp_session_set_info ( asp_session_h  session,
char *  session_info 
)

Sets the information for an Application Service Platform session.

Application should set session_info after creating session by asp_session_create() and before requesting to connect session by asp_session_connect().

Since :
4.0
Parameters:
[in]sessionApplication Service Platform session descriptor handle provided by the asp_session_create()
[in]session_infoDetailed information about the session. The session_info parameter is defined for each service section and up to 144 bytes. You can refer to Wi-Fi Peer-to-Peer Services Technical Specification, Wi-Fi Alliance. Available at: http://www.wi-fi.org
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SESSION_NOT_FOUNDSession not found
Precondition:
This API needs asp_session_create() before use.
See also:
asp_session_create()
int asp_session_set_p2p_config_method ( asp_session_h  session,
asp_wps_type_e  config_method 
)

Sets the Preferred WSC Configuration method.

Application should set the config method after creating session by asp_session_create() and before requesting to connect session by asp_session_connect().

Since :
4.0
Parameters:
[in]sessionApplication Service Platform session descriptor handle provided by the asp_session_create()
[in]config_methodPreferred WSC Configuration method. Default value is ASP_WPS_TYPE_DEFAULT.
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SESSION_NOT_FOUNDSession not found
Precondition:
This API needs asp_session_create() before use.
See also:
asp_session_create()

Sets the Wi-Fi Direct group role in session.

Application should set role after creating session by asp_session_create() and before requesting to connect session by asp_session_connect().

Since :
4.0
Parameters:
[in]sessionApplication Service Platform session descriptor handle provided by the asp_session_create()
[in]roleThe role of the service:
ASP_ADVERT_P2P_ROLE_SCHEME_ANY - All roles are acceptable
ASP_ADVERT_P2P_ROLE_SCHEME_GO - The receiving interface should assume
the GO role, if it's not possible, ASP_ERROR_NETWORK_ROLE_REJECTED
is returned
ASP_ADVERT_P2P_ROLE_SCHEME_GC - The receiving interface should assume the GC role
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SESSION_NOT_FOUNDSession not found
ASP_ERROR_NETWORK_ROLE_REJECTEDNetwork role rejected
Precondition:
This API needs asp_session_create() before use.
See also:
asp_session_create()
int asp_session_set_port_status_cb ( asp_session_port_status_cb  cb,
void *  user_data 
)

Registers the callback called when the state of the port is changed.

Since :
4.0
Parameters:
[in]cbThe callback function to invoke
[in]user_dataThe user data passed from the callback registration function
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_INITIALIZEDNot initialized
Precondition:
Application Service Platform (ASP) must be initialized by asp_initialize().
See also:
asp_initialize()
asp_session_unset_status_cb()
int asp_session_set_request_cb ( asp_session_request_cb  cb,
void *  user_data 
)

Registers the callback called when ASP session connection is requested.

Since :
4.0
Parameters:
[in]cbThe callback function to invoke
[in]user_dataThe user data passed from the callback registration function
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
Precondition:
Application Service Platform (ASP) must be initialized by asp_initialize().
See also:
asp_initialize()
asp_session_unset_request_cb()

Moves an Application Service Platform (ASP) session from Requested state to the Open state.

Since :
4.0
Parameters:
[in]sessionASP session descriptor handle provided by the asp_session_request_cb() callback
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_PERMITTEDOperation not permitted
ASP_ERROR_OUT_OF_MEMORYOut of memory
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
ASP_ERROR_OPERATION_FAILEDOperation failed
ASP_ERROR_SESSION_NOT_FOUNDSession not found
Precondition:
Peer-to-Peer service must be advertised by asp_advert_start_advertising().
Local device should be listening or finding remote P2P device by asp_advert_start_advertising()
See also:
asp_advert_start_advertising()
int asp_session_set_status_cb ( asp_session_status_cb  cb,
void *  user_data 
)

Registers the callback called when the state of the session is changed.

Since :
4.0
Parameters:
[in]cbThe callback function to invoke
[in]user_dataThe user data passed from the callback registration function
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_INVALID_PARAMETERInvalid parameter
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
Precondition:
Application Service Platform (ASP) must be initialized by asp_initialize().
See also:
asp_initialize()
asp_session_unset_status_cb()
asp_session_status_cb()

Unregisters the callback called when the session configuration is requested.

Since :
4.0
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
Precondition:
Application Service Platform (ASP) must be initialized by asp_initialize().
See also:
asp_initialize()
asp_session_config_request_cb()

Unregisters the callback called when the state of the session connection is changed.

Since :
4.0
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
Precondition:
Application Service Platform (ASP) must be initialized by asp_initialize().
See also:
asp_initialize()
asp_session_set_connect_status_cb()

Unregisters the callback called when the state of the port is changed.

Since :
4.0
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
Precondition:
Application Service Platform (ASP) must be initialized by asp_initialize().
See also:
asp_initialize()
asp_session_set_port_status_cb()

Unregisters the callback called ASP when session connection is requested.

Since :
4.0
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
Precondition:
Application Service Platform (ASP) must be initialized by asp_initialize().
See also:
asp_initialize()
asp_session_set_request_cb()

Unregisters the callback called when the state of the session is changed.

Since :
4.0
Returns:
0 on success, otherwise a negative error value
Return values:
ASP_ERROR_NONESuccessful
ASP_ERROR_NOT_SUPPORTEDNot supported
ASP_ERROR_NOT_INITIALIZEDNot initialized
Precondition:
Application Service Platform (ASP) must be initialized by asp_initialize().
See also:
asp_initialize()
asp_session_set_status_cb()