* This method is asynchronous.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/dns
+ *
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/dns
*
* @return An error code
* @param[in] hostName The DNS name of the host
* This method is asynchronous.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/dns
+ *
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/dns
*
* @return An error code
* @param[in] ipAddress An IP address
* Gets the realm value received.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/http
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/http
*
* @return The realm value
* @exception E_SUCCESS The method is successful.
* Gets the authentication scheme received.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/http
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/http
*
* @return The authentication scheme, @n
* else @c -1 if an error occurs
- * @exception E_SUCCESS The method is successful.
+ * @exception E_SUCCESS The method is successful.
* @exception E_OUT_OF_MEMORY The memory is insufficient.
- * @exception E_SYSTEM A system error has occurred.
+ * @exception E_SYSTEM A system error has occurred.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @remarks The specific error code can be accessed using the GetLastResult() method.
*/
* Sets the credentials required for setting the "WWW-Authenticate" header in the HttpRequest class.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/http
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/http
*
* @return The new transaction pointer
* @param[in] credentials The credentials
/**
* Removes all the cookies corresponding to the requested URL from the cookie storage.
*
- * @since 2.0
- * @privilege %http://tizen.org/privilege/http
+ * @since 2.0
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/http
*
* @return An error code
* @param[in] url The requested URL
/**
* Removes all the cookies from the cookie storage.
*
- * @since 2.0
- * @privilege %http://tizen.org/privilege/http
+ * @since 2.0
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/http
*
* @return An error code
* @exception E_SUCCESS The method is successful.
- * @exception E_INVALID_STATE The method invoked is invalid.
- * @exception E_OUT_OF_MEMORY The memory is insufficient.
+ * @exception E_INVALID_STATE The method invoked is invalid.
+ * @exception E_OUT_OF_MEMORY The memory is insufficient.
* @exception E_SYSTEM A system error has occurred.
- * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
*/
result RemoveAllCookies();
/**
* Sets the user name for the current instance of %HttpCredentials.
*
- * @since 2.0
- * @privilege %http://tizen.org/privilege/http
+ * @since 2.0
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/http
*
* @param[in] name The user name string
* @exception E_SUCCESS The method is successful.
/**
* Sets the password for the current instance of %HttpCredentials.
*
- * @since 2.0
- * @privilege %http://tizen.org/privilege/http
+ * @since 2.0
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/http
*
* @param[in] password The password string
* @exception E_SUCCESS The method is successful.
/**
* Gets the user name of the current instance of %HttpCredentials.
*
- * @since 2.0
- * @privilege %http://tizen.org/privilege/http
+ * @since 2.0
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/http
*
* @return The user name
* @exception E_SUCCESS The method is successful.
/**
* Gets the password of the current instance of %HttpCredentials.
*
- * @since 2.0
- * @privilege %http://tizen.org/privilege/http
+ * @since 2.0
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/http
*
* @return The password
- * @exception E_SUCCESS The method is successful.
+ * @exception E_SUCCESS The method is successful.
* @exception E_OUT_OF_MEMORY The memory is insufficient.
- * @exception E_SYSTEM A system error has occurred.
+ * @exception E_SYSTEM A system error has occurred.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @remarks The specific error code can be accessed using the GetLastResult() method.
*/
* @since 2.0
*
* @return An error code
- * @param[in] sessionMode The session mode to open the session
+ * @param[in] sessionMode The session mode to open the session
* @param[in] pProxyAddr A proxy address @n
* The specified @c pProxyAddr must be a valid URL. If @c pProxyAddr is @c null, %HttpSession uses the system
* default proxy address.
* @c hostAddr is ignored (In case of multiple host mode, @c hostAddr is set to HttpRequest::SetUri()).
* @param[in] pCommonHeader An instance of HttpHeader @n
* This is a common header used in all the transactions included in this session.
- * @param[in] flag Set to @c true if the cookies must be handled automatically, @n
- * else @c false if the cookies must be handled manually
+ * @param[in] flag Set to @c NET_HTTP_COOKIE_FLAG_ALWAYS_AUTOMATIC if the cookies must be handled automatically, @n
+ * else @c NET_HTTP_COOKIE_FLAG_ALWAYS_MANUAL if the cookies must be handled manually
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_ARG A specified input parameter is invalid.
- * @exception E_OUT_OF_MEMORY The memory is insufficient.
+ * @exception E_OUT_OF_MEMORY The memory is insufficient.
* @exception E_INVALID_CONNECTION The net connection is invalid.
- * @exception E_MAX_EXCEEDED The number of currently opened sessions has exceeded the maximum limit.
- * @exception E_INVALID_PROXY The specified proxy address is invalid.
+ * @exception E_MAX_EXCEEDED The number of currently opened sessions has exceeded the maximum limit.
+ * @exception E_INVALID_PROXY The specified proxy address is invalid.
* @exception E_UNKNOWN An unknown error has occurred.
* @exception E_SYSTEM An internal error has occurred.
* @exception E_INVALID_ADDRESS The host address is invalid.
* The specified @c hostAddr must be a valid URL.
* @param[in] pCommonHeader An instance of HttpHeader @n
* This is a common header used in all the transactions included in this session.
- * @param[in] flag Set to @c true if the cookies must be handled automatically, @n
- * else @c false if the cookies must be handled manually
+ * @param[in] flag Set to @c NET_HTTP_COOKIE_FLAG_ALWAYS_AUTOMATIC if the cookies must be handled automatically, @n
+ * else @c NET_HTTP_COOKIE_FLAG_ALWAYS_MANUAL if the cookies must be handled manually
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_ARG A specified input parameter is invalid.
* @exception E_OUT_OF_MEMORY The memory is insufficient.
/**
* Opens a transaction.
*
- * @since 2.0
- * @privilege %http://tizen.org/privilege/http
+ * @since 2.0
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/http
*
* @return A pointer to a new HttpTransaction, @n
* else @c null if an error occurs
/**
* Opens a transaction with authentication information.
*
- * @since 2.0
- * @privilege %http://tizen.org/privilege/http
+ * @since 2.0
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/http
*
* @return The pointer to a new HttpTransaction, @n
* else @c null if an error occurs
* Cancels the specified transaction. @n
* This method is followed by the CloseTransaction() method.
*
- * @since 2.0
- * @privilege %http://tizen.org/privilege/http
+ * @since 2.0
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/http
*
* @return An error code
* @param[in] httpTransaction The HttpTransaction to cancel
/**
* Closes the specified transaction.
*
- * @since 2.0
- * @privilege %http://tizen.org/privilege/http
+ * @since 2.0
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/http
*
* @return An error code
* @param[in] httpTransaction The HttpTransaction to close
/**
* Closes all the transactions.
*
- * @since 2.0
- * @privilege %http://tizen.org/privilege/http
+ * @since 2.0
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/http
*
* @return An error code
* @exception E_SUCCESS The method is successful.
/**
* Gets the number of active transactions in the current instance of %HttpSession.
*
- * @since 2.0
- * @privilege %http://tizen.org/privilege/http
+ * @since 2.0
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/http
*
* @return An integer value indicating the number of currently active transactions, @n
* else @c -1 if an error occurs
/**
* Gets the maximum number of transactions, the current instance of %HttpSession can have.
*
- * @since 2.0
- * @privilege %http://tizen.org/privilege/http
+ * @since 2.0
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/http
*
* @return An integer value indicating the maximum number of transactions allowed @n
* In NET_HTTP_SESSION_MODE_MULTIPLE_HOST mode, the return value is zero.
/**
* Submits the HTTP request.
*
- * @since 2.0
- * @privilege %http://tizen.org/privilege/http
+ * @since 2.0
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/http
*
* @return An error code
- * @exception E_SUCCESS The method is successful.
+ * @exception E_SUCCESS The method is successful.
* @exception E_OUT_OF_MEMORY The memory is insufficient.
- * @exception E_INVALID_ARG A specified input parameter is invalid. @n
- * At least one of Uri, Method, Header, and Body is invalid.
- * @exception E_INVALID_HEADER The header is @c null.
- * @exception E_INVALID_STATE The method invoked is invalid.
+ * @exception E_INVALID_ARG A specified input parameter is invalid. @n
+ * At least one of Uri, Method, Header, and Body is invalid.
+ * @exception E_INVALID_HEADER The header is @c null.
+ * @exception E_INVALID_STATE The method invoked is invalid.
* @exception E_OUT_OF_RANGE The submitted data is out of range.
* @exception E_MAX_EXCEEDED The number of active transactions has exceeded the maximum limit.
* @exception E_INVALID_PROXY The proxy server address is invalid.
- * @exception E_DNS The DNS query has failed.
+ * @exception E_DNS The DNS query has failed.
* @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
- * @exception E_EMPTY_BODY The body is empty in a POST method case.
- * @exception E_INVALID_SESSION The session is invalid.
- * @exception E_AUTHENTICATION The authentication has failed.
- * @exception E_UNKNOWN An unknown error has occurred.
- * @exception E_SYSTEM A system error has occurred.
+ * @exception E_EMPTY_BODY The body is empty in a POST method case.
+ * @exception E_INVALID_SESSION The session is invalid.
+ * @exception E_AUTHENTICATION The authentication has failed.
+ * @exception E_UNKNOWN An unknown error has occurred.
+ * @exception E_SYSTEM A system error has occurred.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @remarks The appropriate request header and body must be set using HttpRequest before using this method.
* If the session is in a non-pipeline mode, be sure not to submit a transaction before the previous transaction is completed.
/**
* Gets the authentication information.
*
- * @since 2.0
- * @privilege %http://tizen.org/privilege/http
+ * @since 2.0
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/http
*
* @return A pointer to HttpAuthentication
* @exception E_SUCCESS The method is successful.
*/
result SetTimeout(int timeout);
+ /**
+ * Sets the flag to verify server certificate. (the flag is @c HTTP_CV_FLAG_AUTOMATIC by default)
+ *
+ * @since 2.1
+ *
+ * @return An error code
+ * @param[in] flag Set the flag for certificate verification.
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_STATE The method invoked is invalid.
+ * @exception E_SYSTEM A system error has occurred.
+ */
+ result SetServerCertificateVerification(NetHttpCertificateVerificationFlag flag = HTTP_CV_FLAG_AUTOMATIC);
+
private:
/**
* This default constructor is intentionally declared as private so that only the platform can create an instance.
*/
enum NetHttpStatusCode
{
- NET_HTTP_STATUS_UNDEFINED = 0, /**< @if OSPDEPREC The undefined status @endf */
- NET_HTTP_STATUS_CONTINUE = 100, /**< @if OSPDEPREC The status code: 100 Continue @endf */
- NET_HTTP_STATUS_SWITCHING_PROTOCOLS = 101, /**< @if OSPDEPREC The status code: 101 Switching Protocols @endf */
- NET_HTTP_STATUS_OK = 200, /**< @if OSPDEPREC The status code: 200 OK @endf */
- NET_HTTP_STATUS_CREATED = 201, /**< @if OSPDEPREC The status code: 201 Created @endf */
- NET_HTTP_STATUS_ACCEPTED = 202, /**< @if OSPDEPREC The status code: 202 Accepted @endf */
- NET_HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION = 203, /**< @if OSPDEPREC The status code: 203 Non-Authoritative Information @endf */
- NET_HTTP_STATUS_NO_CONTENT = 204, /**< @if OSPDEPREC The status code: 204 No %Content @endf */
- NET_HTTP_STATUS_RESET_CONTENT = 205, /**< @if OSPDEPREC The status code: 205 Reset %Content @endf */
- NET_HTTP_STATUS_PARTIAL_CONTENT = 206, /**< @if OSPDEPREC The status code: 206 Partial %Content @endf */
+ NET_HTTP_STATUS_UNDEFINED = 0, /**< @if OSPDEPREC The undefined status @endif */
+ NET_HTTP_STATUS_CONTINUE = 100, /**< @if OSPDEPREC The status code: 100 Continue @endif */
+ NET_HTTP_STATUS_SWITCHING_PROTOCOLS = 101, /**< @if OSPDEPREC The status code: 101 Switching Protocols @endif */
+ NET_HTTP_STATUS_OK = 200, /**< @if OSPDEPREC The status code: 200 OK @endif */
+ NET_HTTP_STATUS_CREATED = 201, /**< @if OSPDEPREC The status code: 201 Created @endif */
+ NET_HTTP_STATUS_ACCEPTED = 202, /**< @if OSPDEPREC The status code: 202 Accepted @endif */
+ NET_HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION = 203, /**< @if OSPDEPREC The status code: 203 Non-Authoritative Information @endif */
+ NET_HTTP_STATUS_NO_CONTENT = 204, /**< @if OSPDEPREC The status code: 204 No %Content @endif */
+ NET_HTTP_STATUS_RESET_CONTENT = 205, /**< @if OSPDEPREC The status code: 205 Reset %Content @endif */
+ NET_HTTP_STATUS_PARTIAL_CONTENT = 206, /**< @if OSPDEPREC The status code: 206 Partial %Content @endif */
- NET_HTTP_STATUS_MULTIPLE_CHOICE = 300, /**< @if OSPDEPREC The status code: 300 Multiple Choices @endf */
- NET_HTTP_STATUS_MOVED_PERMANENTLY = 301, /**< @if OSPDEPREC The status code: 301 Moved Permanently @endf */
- NET_HTTP_STATUS_MOVED_TEMPORARILY = 302, /**< @if OSPDEPREC The status code: 302 Found @endf */
- NET_HTTP_STATUS_SEE_OTHER = 303, /**< @if OSPDEPREC The status code: 303 See Other @endf */
- NET_HTTP_STATUS_NOT_MODIFIED = 304, /**< @if OSPDEPREC The status code: 304 Not Modified @endf */
- NET_HTTP_STATUS_USE_PROXY = 305, /**< @if OSPDEPREC The status code: 305 Use Proxy @endf */
+ NET_HTTP_STATUS_MULTIPLE_CHOICE = 300, /**< @if OSPDEPREC The status code: 300 Multiple Choices @endif */
+ NET_HTTP_STATUS_MOVED_PERMANENTLY = 301, /**< @if OSPDEPREC The status code: 301 Moved Permanently @endif */
+ NET_HTTP_STATUS_MOVED_TEMPORARILY = 302, /**< @if OSPDEPREC The status code: 302 Found @endif */
+ NET_HTTP_STATUS_SEE_OTHER = 303, /**< @if OSPDEPREC The status code: 303 See Other @endif */
+ NET_HTTP_STATUS_NOT_MODIFIED = 304, /**< @if OSPDEPREC The status code: 304 Not Modified @endif */
+ NET_HTTP_STATUS_USE_PROXY = 305, /**< @if OSPDEPREC The status code: 305 Use Proxy @endif */
- NET_HTTP_STATUS_BAD_REQUEST = 400, /**< @if OSPDEPREC The status code: 400 Bad Request @endf */
- NET_HTTP_STATUS_UNAUTHORIZED = 401, /**< @if OSPDEPREC The status code: 401 Unauthorized @endf */
- NET_HTTP_STATUS_PAYMENT_REQUIRED = 402, /**< @if OSPDEPREC The status code: 402 Payment Required @endf */
- NET_HTTP_STATUS_FORBIDDEN = 403, /**< @if OSPDEPREC The status code: 403 Forbidden @endf */
- NET_HTTP_STATUS_NOT_FOUND = 404, /**< @if OSPDEPREC The status code: 404 Not Found @endf */
- NET_HTTP_STATUS_METHOD_NOT_ALLOWED = 405, /**< @if OSPDEPREC The status code: 405 Method Not Allowed @endf */
- NET_HTTP_STATUS_NOT_ACCEPTABLE = 406, /**< @if OSPDEPREC The status code: 406 Not Acceptable @endf */
- NET_HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED = 407, /**< @if OSPDEPREC The status code: 407 Proxy Authentication Required @endf */
- NET_HTTP_STATUS_REQUEST_TIME_OUT = 408, /**< @if OSPDEPREC The status code: 408 Request Timeout (not used) @endf */
- NET_HTTP_STATUS_CONFLICT = 409, /**< @if OSPDEPREC The status code: 409 Conflict @endf */
- NET_HTTP_STATUS_GONE = 410, /**< @if OSPDEPREC The status code: 410 Gone @endf */
- NET_HTTP_STATUS_LENGTH_REQUIRED = 411, /**< @if OSPDEPREC The status code: 411 Length Required @endf */
- NET_HTTP_STATUS_PRECONDITION_FAILED = 412, /**< @if OSPDEPREC The status code: 412 Precondition Failed @endf */
- NET_HTTP_STATUS_REQUEST_ENTITY_TOO_LARGE = 413, /**< @if OSPDEPREC The status code: 413 Request Entity Too Large (not used) @endf */
- NET_HTTP_STATUS_REQUEST_URI_TOO_LARGE = 414, /**< @if OSPDEPREC The status code: 414 Request-URI Too Long (not used) @endf */
- NET_HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE = 415, /**< @if OSPDEPREC The status code: 415 Unsupported %Media Type @endf */
+ NET_HTTP_STATUS_BAD_REQUEST = 400, /**< @if OSPDEPREC The status code: 400 Bad Request @endif */
+ NET_HTTP_STATUS_UNAUTHORIZED = 401, /**< @if OSPDEPREC The status code: 401 Unauthorized @endif */
+ NET_HTTP_STATUS_PAYMENT_REQUIRED = 402, /**< @if OSPDEPREC The status code: 402 Payment Required @endif */
+ NET_HTTP_STATUS_FORBIDDEN = 403, /**< @if OSPDEPREC The status code: 403 Forbidden @endif */
+ NET_HTTP_STATUS_NOT_FOUND = 404, /**<@if OSPDEPREC The status code: 404 Not Found @endif */
+ NET_HTTP_STATUS_METHOD_NOT_ALLOWED = 405, /**< @if OSPDEPREC The status code: 405 Method Not Allowed @endif */
+ NET_HTTP_STATUS_NOT_ACCEPTABLE = 406, /**< @if OSPDEPREC The status code: 406 Not Acceptable @endif */
+ NET_HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED = 407, /**< @if OSPDEPREC The status code: 407 Proxy Authentication Required @endif */
+ NET_HTTP_STATUS_REQUEST_TIME_OUT = 408, /**< @if OSPDEPREC The status code: 408 Request Timeout (not used) @endif */
+ NET_HTTP_STATUS_CONFLICT = 409, /**<@if OSPDEPREC The status code: 409 Conflict @endif */
+ NET_HTTP_STATUS_GONE = 410, /**< @if OSPDEPREC The status code: 410 Gone @endif */
+ NET_HTTP_STATUS_LENGTH_REQUIRED = 411, /**< @if OSPDEPREC The status code: 411 Length Required @endif */
+ NET_HTTP_STATUS_PRECONDITION_FAILED = 412, /**<@if OSPDEPREC The status code: 412 Precondition Failed @endif */
+ NET_HTTP_STATUS_REQUEST_ENTITY_TOO_LARGE = 413, /**< @if OSPDEPREC The status code: 413 Request Entity Too Large (not used) @endif */
+ NET_HTTP_STATUS_REQUEST_URI_TOO_LARGE = 414, /**< @if OSPDEPREC The status code: 414 Request-URI Too Long (not used) @endif */
+ NET_HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE = 415, /**< @if OSPDEPREC The status code: 415 Unsupported %Media Type @endif */
- NET_HTTP_STATUS_INTERNAL_SERVER_ERROR = 500, /**< @if OSPDEPREC The status code: 500 Internal Server Error @endf */
- NET_HTTP_STATUS_NOT_IMPLEMENTED = 501, /**< @if OSPDEPREC The status code: 501 Not Implemented @endf */
- NET_HTTP_STATUS_BAD_GATEWAY = 502, /**< @if OSPDEPREC The status code: 502 Bad Gateway @endf */
- NET_HTTP_STATUS_SERVICE_UNAVAILABLE = 503, /**< @if OSPDEPREC The status code: 503 Service Unavailable @endf */
- NET_HTTP_STATUS_GATEWAY_TIME_OUT = 504, /**< @if OSPDEPREC The status code: 504 Gateway Timeout @endf */
- NET_HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED = 505 /**< @if OSPDEPREC The status code: 505 HTTP Version Not Supported @endf */
+ NET_HTTP_STATUS_INTERNAL_SERVER_ERROR = 500, /**< @if OSPDEPREC The status code: 500 Internal Server Error @endif */
+ NET_HTTP_STATUS_NOT_IMPLEMENTED = 501, /**< @if OSPDEPREC The status code: 501 Not Implemented @endif */
+ NET_HTTP_STATUS_BAD_GATEWAY = 502, /**< @if OSPDEPREC The status code: 502 Bad Gateway @endif */
+ NET_HTTP_STATUS_SERVICE_UNAVAILABLE = 503, /**< @if OSPDEPREC The status code: 503 Service Unavailable @endif */
+ NET_HTTP_STATUS_GATEWAY_TIME_OUT = 504, /**< @if OSPDEPREC The status code: 504 Gateway Timeout @endif */
+ NET_HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED = 505 /**< @if OSPDEPREC The status code: 505 HTTP Version Not Supported @endif */
};
/**
NET_HTTP_COOKIE_FLAG_ALWAYS_MANUAL /**< The cookie will be handled by the user action with Tizen::Net::Http::HttpRequest::SetCookie() and Tizen::Net::Http::HttpCookieStorageManager::GetCookies() */
};
+/**
+ * @enum NetHttpCertificateVerificationFlag
+ *
+ * Defines the certificate verification mode.
+ *
+ * @since 2.1
+ */
+enum NetHttpCertificateVerificationFlag
+{
+ HTTP_CV_FLAG_AUTOMATIC, /**< The certificate will be verified by system. If server certificate is invalid, the IHttpTransactionEventListener::OnTransactionCertVerificationRequiredN() listener is received. */
+ HTTP_CV_FLAG_MANUAL, /**< The certificate verification will be handled by user action when the IHttpTransactionEventListener::OnTransactionCertVerificationRequestedN() listener is received. */
+ HTTP_CV_FLAG_IGNORED, /**< The certificate verification will be ignored. */
+};
+
} } } //Tizen::Net::Http
#endif // _FNET_HTTP_HTTP_TYPES_H_
#ifndef _FNET_HTTP_IHTTP_TRANSACTION_EVENT_LISTENER_H_
#define _FNET_HTTP_IHTTP_TRANSACTION_EVENT_LISTENER_H_
+#include <unique_ptr.h>
#include <FBaseTypes.h>
#include <FBaseString.h>
+#include <FBaseColIList.h>
#include <FBaseRtIEventListener.h>
namespace Tizen { namespace Net { namespace Http
*/
virtual void OnTransactionCertVerificationRequiredN(HttpSession& httpSession, HttpTransaction& httpTransaction, Tizen::Base::String* pCert) = 0;
+ /**
+ * Called to notify when the server certificate verification has been requested.
+ *
+ * @since 2.1
+ * @return The result for certificate verification.
+ *
+ * @param[in] httpSession The session information of the %Http transaction event
+ * @param[in] httpTransaction The transaction information of the %Http transaction event
+ * @param[in] pCertList The server certificate chain. An IList whose element is of the type Tizen::Security::Cert::X509Certificate *.
+ *
+ * @remarks Do not delete instance of @c httpSession or @c httpTransaction in this listener before the IHttpTransactionEventListener::OnTransactionCompleted() or IHttpTransactionEventListener::OnTransactionAborted() method is called.
+ * @see HttpTransaction::SetServerCertificateVerification()
+ */
+ virtual bool OnTransactionCertVerificationRequestedN(HttpSession& httpSession, HttpTransaction& httpTransaction, Tizen::Base::Collection::IList* pCertList)
+ {
+ std::unique_ptr<Tizen::Base::Collection::IList> upCertList(pCertList);
+ return false;
+ }
+
protected:
//
// This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
//
virtual void IHttpTransactionEventListener_Reserved1(void) {}
- //
- // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
- //
- // This method is reserved and may change its name at any time without prior notice.
- //
- // @since 2.0
- //
- virtual void IHttpTransactionEventListener_Reserved2(void) {}
-
};
} } } // Tizen::Net::Http
* @exception E_SUCCESS The instance is created successfully.
* @exception E_INVALID_ARG The specified @c ipAddr is invalid.
* @remarks The GetLastResult() method is used to check whether the %Ip4Address instance is created successfully.
- * @see IpAddress::NetworkToHostOrder(), IpAddress::HostToNetworkOrder()
+ * @see IpAddress::NetworkToHostOrder()
+ * @see IpAddress::HostToNetworkOrder()
*/
Ip4Address(unsigned long ipAddr);
* @param[out] ipAddr An unsigned @c long integer containing the raw IP address
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_STATE This instance is in an invalid state.
- * @see IpAddress::NetworkToHostOrder(), IpAddress::HostToNetworkOrder()
+ * @see IpAddress::NetworkToHostOrder()
+ * @see IpAddress::HostToNetworkOrder()
*/
result GetAddress(unsigned long& ipAddr) const;
* @return The address scheme
* @exception E_SUCCESS The method is successful.
* @remarks The specific error code can be accessed using the GetLastResult() method.
- * @see SetLocalAddress(), GetLocalAddress()
+ * @see SetLocalAddress()
+ * @see GetLocalAddress()
*/
NetAddressScheme GetLocalAddressScheme(void) const;
* @return The address scheme for the DNS
* @exception E_SUCCESS The method is successful.
* @remarks The specific error code can be accessed using the GetLastResult() method.
- * @see GetPrimaryDnsAddress(), GetSecondaryDnsAddress(), SetDnsAddress()
+ * @see GetPrimaryDnsAddress()
+ * @see GetSecondaryDnsAddress()
+ * @see SetDnsAddress()
*/
NetAddressScheme GetDnsAddressScheme(void) const;
* @param[in] pSecondaryDnsAddress The statically assigned secondary DNS address if @c dnsAddrScheme is NET_ADDRESS_SCHEME_STATIC
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_ARG A specified input parameter is invalid.
- * @see GetPrimaryDnsAddress(), GetSecondaryDnsAddress()
+ * @see GetPrimaryDnsAddress()
+ * @see GetSecondaryDnsAddress()
*/
result SetDnsAddress(NetAddressScheme dnsAddrScheme, const IpAddress* pPrimaryDnsAddress, const IpAddress* pSecondaryDnsAddress);
* Creates a new network account.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/network.account
+ *
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/network.account
*
* @return The @c NetAccountId assigned by the creation of a new network account, @n
* else @c INVALID_HANDLE if an error occurs
* @remarks This method creates a new network account and returns a @c NetAccountId value that can be used in method calls later to operate on the
* account. If @c INVALID_HANDLE is returned, the specific error code can be accessed using the GetLastResult() method. A Wi-Fi account
* cannot be created using %NetAccountManager.
- * @see GetNetAccountInfoN(), UpdateNetAccount(), DeleteNetAccount()
+ * @see GetNetAccountInfoN()
+ * @see UpdateNetAccount()
+ * @see DeleteNetAccount()
*/
NetAccountId CreateNetAccount(NetAccountInfo& netAccountInfo);
* If the account is read-only or in service, the deletion fails. The Wi-Fi accounts cannot be deleted by %NetAccountManager.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/network.account
+ *
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/network.account
*
* @return An error code
* @param[in] netAccountId A NetAccountId instance containing valid account information
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @remarks If the network account is created by another application, this method fails.
* This method must use a warning pop-up to notify the user.
- * @see CreateNetAccount(), GetNetAccountInfoN(), UpdateNetAccount()
+ * @see CreateNetAccount()
+ * @see GetNetAccountInfoN()
+ * @see UpdateNetAccount()
*/
result DeleteNetAccount(NetAccountId netAccountId);
* Updates an existing network account.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/network.account
+ *
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/network.account
*
* @return An error code
* @param[in] netAccountInfo A NetAccountInfo instance containing network information to update an account
* Before calling this method, the user must call GetNetAccountInfoN() to get the latest information in the registry
* and change the desired fields of that information.
* This method must use a warning pop-up to notify the user.
- * @see CreateNetAccount(), GetNetAccountInfoN(), UpdateNetAccount(), DeleteNetAccount()
+ * @see CreateNetAccount()
+ * @see GetNetAccountInfoN()
+ * @see UpdateNetAccount()
+ * @see DeleteNetAccount()
*/
result UpdateNetAccount(const NetAccountInfo& netAccountInfo);
/**
- * @if VISPARTNER-MANUFACTURER
* Updates an existing system network account.
*
- * @since 2.0
- * @visibility partner-manufacturer
- * @privilege %http://tizen.org/privilege/networkmanager
- *
- * @return An error code
- * @param[in] netAccountInfo A NetAccountInfo instance containing network information to update an account
- * @exception E_SUCCESS The method is successful.
- * @exception E_INVALID_ARG The specified input parameter is invalid.
- * @exception E_INVALID_ACCOUNT The input account ID is invalid.
- * @exception E_OPERATION_FAILED This request operation has failed due to an internal error.
- * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
- * @see GetNetAccountInfoN(), UpdateNetAccount()
- * @endif
+ * @since 2.0
+ *
+ * @privlevel platform
+ * @privilege http://tizen.org/privilege/networkmanager
+ *
+ * @return An error code
+ * @param[in] netAccountInfo A NetAccountInfo instance containing network information to update an account
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_ARG The specified input parameter is invalid.
+ * @exception E_INVALID_ACCOUNT The input account ID is invalid.
+ * @exception E_OPERATION_FAILED This request operation has failed due to an internal error.
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @see GetNetAccountInfoN()
+ * @see UpdateNetAccount()
*/
result UpdateSystemNetAccount(const NetAccountInfo& netAccountInfo);
* To determine the type of instance returned, use the GetBearerType() method.
* The instance can then be cast down to %WifiNetAccountInfo and used in a NET_BEARER_WIFI case. If the
* application gets the last result by E_INVALID_PROXY, it must use a warning pop-up to notify the user.
- * @see CreateNetAccount(), UpdateNetAccount(), DeleteNetAccount()
+ * @see CreateNetAccount()
+ * @see UpdateNetAccount()
+ * @see DeleteNetAccount()
*/
NetAccountInfo* GetNetAccountInfoN(NetAccountId netAccountId) const;
NetAccountId GetNetAccountId(NetBearerType netBearerType = NET_BEARER_PS) const;
/**
- * @if VISPARTNER
- *
* Gets a network account, which is set for the application like email, IM, and so on.
*
* @since 2.0
*
- * @visibility partner
- * @privilege %http://tizen.org/privilege/customnetaccount
+ * @privlevel partner
+ * @privilege http://tizen.org/privilege/customnetaccount
*
* @return The @c NetAccountID with the specified name, @n
* else INVALID_HANDLE is returned in case of an error or if %NetAccountInfo is not found
* @exception E_SYSTEM An internal error has occurred.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @remarks The specific error code can be accessed using the GetLastResult() method.
- * @endif
*/
NetAccountId GetAppNetAccountId(const Tizen::Base::String& netProfileName) const;
/**
- * @if VISPARTNER
- *
* Sets the application-wise default account ID to the one specified by the input argument value.
*
* @since 2.0
*
- * @visibility partner
- * @privilege %http://tizen.org/privilege/customnetaccount
+ * @privlevel partner
+ * @privilege http://tizen.org/privilege/customnetaccount
*
* @return An error code
* @param[in] netAccountId The network account ID
* @exception E_INVALID_ARG The specified @c netAccountId is invalid.
* @exception E_SYSTEM An internal error has occurred.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
- *
- * @endif
*/
result SetNetAccountId(NetAccountId netAccountId);
* @brief <i> [Deprecated] </i>
* @deprecated This method is deprecated because it is moved to the NetConnectionManager class.
* @since 2.0
- * @privilege %http://tizen.org/privilege/network.connection
+ *
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/network.connection
*
* @return An error code
* @param[in] netPreference The preferred network
* Starts the network connection.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/network.connection
+ *
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/network.connection
*
* @return An error code
* @exception E_SUCCESS The method is successful.
* Stops the network connection.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/network.connection
+ *
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/network.connection
*
* @return An error code
* @exception E_SUCCESS The method is successful.
* @remarks This method stops the network connection of an application. Additionally, it does not ensure immediate disconnection of the network
* service (for example, 3G data service or Wi-Fi). The network service remains active till all the applications stop using the network
* connection. Once stopped, the network connection can be restarted using the Start() method.
- * @see Start(), Close()
+ * @see Start()
+ * @see Close()
*/
result Stop(void);
* with a remote server or gateway.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/network.connection
+ *
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/network.connection
*
* @return An error code
* @exception E_SUCCESS The method is successful.
* Sets the preferred network.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/network.connection
+ *
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/network.connection
*
* @return An error code
* @param[in] netPreference The preferred network
* Gets the statistical information. @n
* This can consist of details such as the call duration, the sent and received size, and so on.
*
- * @since 2.0
- * @privilege %http://tizen.org/privilege/network.statistics.read
+ * @since 2.0
+ *
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/network.statistics
*
- * @return The number of bytes sent or received, @n
- * else @c INVALID_HANDLE if an error occurs
- * @param[in] bearerType The bearer type of the data call operation @n
+ * @return The number of bytes sent or received, @n
+ * else @c INVALID_HANDLE if an error occurs
+ * @param[in] bearerType The bearer type of the data call operation @n
* NET_BEARER_WIFI_DIRECT and NET_BEARER_USB are not supported.
- * @param[in] netStatType The type of statistical information to get
- * @exception E_SUCCESS The method is successful.
- * @exception E_INVALID_ARG A specified input parameter is invalid.
- * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
- * @remarks The specific error code can be accessed using the GetLastResult() method.
+ * @param[in] netStatType The type of statistical information to get
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_ARG A specified input parameter is invalid.
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @remarks The specific error code can be accessed using the GetLastResult() method.
*/
long long GetNetStatisticsInfo(NetBearerType bearerType, NetStatisticsInfoType netStatType) const;
* Resets the specified statistical information on the network according to the operation mode.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/network.statistics.write
+ *
+ * @privlevel platform
+ * @privilege http://tizen.org/privilege/netstatisticsmanager
*
* @return An error code
* @param[in] bearerType The bearer type (OperationMode) whose statistical information is reset @n NET_BEARER_WIFI_DIRECT and NET_BEARER_USB are not supported.
* Resets all the specified statistical information on the network according to the operation mode.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/network.statistics.write
+ *
+ * @privlevel platform
+ * @privilege http://tizen.org/privilege/netstatisticsmanager
*
* @return An error code
* @param[in] bearerType The bearer type (OperationMode) whose statistical information would be reset @n NET_BEARER_WIFI_DIRECT and NET_BEARER_USB are not supported.
};
/**
- * @if VISPARTNER-MANUFACTURER
- *
* @enum NetProxyType
*
* Defines the proxy type of the network
*
* @since 2.0
- *
- * @visibility partner-manufacturer
- *
- * @endif
*/
enum NetProxyType
{
* Use Ioctl() (with NET_SOCKET_FIONBIO) to use a %SecureSocket in the blocking mode.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/socket
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/socket
*
* @return An error code
* @param[in] netConnection A run-time session where a %SecureSocket instance is used
* Use Ioctl() (with NET_SOCKET_FIONBIO) to use a %SecureSocket in the blocking mode.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/socket
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/socket
*
* @return An error code
* @param[in] addressFamily A ::NetSocketAddressFamily value
* All the resources associated with the secure socket are freed.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/socket
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/socket
*
* @return An error code
* @exception E_SUCCESS The method is successful.
* @if OSPCOMPAT
* @brief <i> [Compatibility] </i>
* @endif
- * @since 2.0
+ * @since 2.0
* @if OSPCOMPAT
* @compatibility This method has compatibility issues with OSP compatible applications. @n
* For more information, see @ref SecureSocketConnectPage "here".
* @endif
- * @privilege %http://tizen.org/privilege/socket
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/socket
*
* @return An error code
* @param[in] remoteEndPoint An instance of NetEndPoint representing the remote device
* @page SecureSocketConnectPage Compatibility for Connect()
*
* @section SecureSocketConnectPageIssueSection Issues
- * Implementing this method in OSP compatible applications has the following issues: @n
+ * Implementation of this method in %Tizen API versions prior to 2.1 has the following issue: @n
* -# If the application provides a loopback address in NetEndPoint, it returns E_SYSTEM.
*
* @section SecureSocketConnectPageResolutionSection Resolutions
- * This issue has been resolved in Tizen. @n
+ * The issue mentioned above is resolved in %Tizen API version 2.1 as follows: @n
* -# If the application provides a loopback address in NetEndPoint, it returns E_SUCCESS instead of E_SYSTEM.
*/
/**
* Binds the secure socket to a local address.
*
- * @since 2.0
- * @privilege %http://tizen.org/privilege/socket
+ * @since 2.0
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/socket
*
* @return An error code
* @param[in] localEndPoint The local NetEndPoint to associate with the secure socket
/**
* Places the secure socket in a listening state.
*
- * @since 2.0
- * @privilege %http://tizen.org/privilege/socket
+ * @since 2.0
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/socket
*
* @return An error code
* @param[in] backLog The maximum length of the pending connections queue
* creates a new secure socket with the same socket type, protocol type, and protocol family
* as the listening secure socket.
*
- * @since 2.0
- * @privilege %http://tizen.org/privilege/socket
+ * @since 2.0
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/socket
*
* @return A new secure socket for a newly created connection with the same socket type, protocol type, and protocol family, @n
* else @c null if an error occurs
* @exception E_SUCCESS The method is successful.
* @exception E_WOULD_BLOCK A non-blocking secure socket operation cannot be completed immediately.
* @exception E_INVALID_CERTIFICATE The server certificate verification has failed on client.
- * @exception E_CERTIFICATE_VERIFICATION_FAILED The client certificate verification has failed.
+ * @exception E_CERTIFICATE_VERIFICATION_FAILED The client certificate verification has failed.
* @exception E_INVALID_SOCKET The secure socket is invalid.
* @exception E_INVALID_STATE The secure socket is not in a valid state.
* @exception E_UNSUPPORTED_OPTION This operation is not supported for this socket.
* @exception E_NETWORK_UNAVAILABLE The network is unavailable.
* @exception E_TIMEOUT An attempt to connect to the server has timed out.
- * @exception E_OUT_OF_MEMORY The memory is insufficient.
+ * @exception E_OUT_OF_MEMORY The memory is insufficient.
* @exception E_SYSTEM A system error has occurred.
- * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @remarks Before calling this method, the Listen() method must be called first
* to listen for and queue the incoming connection requests.
* In the blocking mode, this method blocks until an incoming connection attempt
* Executes the specified command on the socket.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/socket
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/socket
*
* @return An error code
* @param[in] cmd The command to execute on the secure socket
* The socket is initialized in a non-blocking mode by default.
* Use Ioctl() (with NET_SOCKET_FIONBIO) to use a %Socket in the blocking mode.
*
- * @since 2.0
- * @privilege %http://tizen.org/privilege/socket
+ * @since 2.0
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/socket
*
* @return An error code
* @param[in] netConnection A run-time session where a %Socket instance is used
* @param[in] protocol A ::NetSocketProtocol value
* @exception E_SUCCESS The method is successful.
* @exception E_WOULD_BLOCK A non-blocking socket operation cannot be completed immediately.
- * @exception E_OUT_OF_MEMORY The memory is insufficient.
- * @exception E_MAX_EXCEEDED All sockets are in use.
+ * @exception E_OUT_OF_MEMORY The memory is insufficient.
+ * @exception E_MAX_EXCEEDED All sockets are in use.
* @exception E_UNSUPPORTED_OPTION This operation is not supported for this socket.
* @exception E_INVALID_ARG A specified input parameter is invalid.
- * @exception E_UNSUPPORTED_PROTOCOL The protocol is not supported.
- * @exception E_UNSUPPORTED_TYPE The socket type is not supported.
+ * @exception E_UNSUPPORTED_PROTOCOL The protocol is not supported.
+ * @exception E_UNSUPPORTED_TYPE The socket type is not supported.
* @exception E_UNSUPPORTED_FAMILY The address family is not supported.
* @exception E_SYSTEM A system error has occurred.
* @exception E_INVALID_CONNECTION The network connection is invalid.
* @exception E_FAILURE The method has failed.
- * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @remarks The @c netConnection parameter specifies a run-time network connection. @n
* The @c addressFamily parameter specifies an address family. @n
* The @c socketType parameter specifies the type of the socket. @n
* The socket is initialized in a non-blocking mode by default.
* Use Ioctl() (with NET_SOCKET_FIONBIO) to use a %Socket in the blocking mode.
*
- * @since 2.0
- * @privilege %http://tizen.org/privilege/socket
+ * @since 2.0
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/socket
*
* @return An error code
* @param[in] addressFamily A ::NetSocketAddressFamily value
* Closes the socket. @n
* All the resources associated with the socket are freed.
*
- * @since 2.0
- * @privilege %http://tizen.org/privilege/socket
+ * @since 2.0
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/socket
*
* @return An error code
* @exception E_SUCCESS The method is successful.
* @compatibility This method has compatibility issues with OSP compatible applications. @n
* For more information, see @ref SocketConnectPage "here".
* @endif
- * @privilege %http://tizen.org/privilege/socket
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/socket
*
* @return An error code
* @param[in] remoteEndPoint An instance of NetEndPoint representing the remote device
* @page SocketConnectPage Compatibility for Connect()
*
* @section SocketConnectPageIssueSection Issues
- * Implementing this method in OSP compatible applications has the following issues: @n
+ * Implementation of this method in %Tizen API versions prior to 2.1 has the following issue: @n
* -# If the application provides a loopback address in NetEndPoint, it returns E_SYSTEM.
*
* @section SocketConnectPageResolutionSection Resolutions
- * This issue has been resolved in Tizen. @n
+ * The issue mentioned above is resolved in %Tizen API version 2.1 as follows: @n
* -# If the application provides a loopback address in NetEndPoint, it returns E_SUCCESS instead of E_SYSTEM.
*/
* @page SocketSendToPage1 Compatibility for SendTo()
*
* @section SocketSendToPage1IssueSection Issues
- * Implementing this method in OSP compatible applications has the following issues: @n
+ * Implementation of this method in %Tizen API versions prior to 2.1 has the following issue: @n
* -# If the application provides a loopback address in NetEndPoint, it returns E_SYSTEM.
*
* @section SocketSendToPage1ResolutionSection Resolutions
- * This issue has been resolved in Tizen. @n
+ * The issue mentioned above is resolved in %Tizen API version 2.1 as follows: @n
* -# If the application provides a loopback address in NetEndPoint, it returns E_SUCCESS instead E_SYSTEM.
*/
* @page SocketSendToPage2 Compatibility for SendTo()
*
* @section SocketSendToPage2IssueSection Issues
- * Implementing this method in OSP compatible applications has the following issues: @n
+ * Implementation of this method in %Tizen API versions prior to 2.1 has the following issue: @n
* -# If the application provides a loopback address in NetEndPoint, it returns E_SYSTEM.
*
* @section SocketSendToPage2ResolutionSection Resolutions
- * This issue has been resolved in Tizen. @n
+ * The issue mentioned above is resolved in %Tizen API version 2.1 as follows: @n
* -# If the application provides a loopback address in NetEndPoint, it returns E_SUCCESS instead of E_SYSTEM.
*/
* @page SocketReceiveFromPage1 Compatibility for ReceiveFrom()
*
* @section SocketReceiveFromPage1IssueSection Issues
- * Implementing this method in OSP compatible applications has the following issues: @n
+ * Implementation of this method in %Tizen API versions prior to 2.1 has the following issue: @n
* -# If the application provides a loopback address in NetEndPoint, it returns E_SYSTEM.
*
* @section SocketReceiveFromPage1ResolutionSection Resolutions
- * This issue has been resolved in Tizen. @n
+ * The issue mentioned above is resolved in %Tizen API version 2.1 as follows: @n
* -# If the application provides a loopback address in NetEndPoint, it returns E_SUCCESS instead of E_SYSTEM.
*/
* @page SocketReceiveFromPage2 Compatibility for ReceiveFrom()
*
* @section SocketReceiveFromPage2IssueSection Issues
- * Implementing this method in OSP compatible applications has the following issues: @n
+ * Implementation of this method in %Tizen API versions prior to 2.1 has the following issue: @n
* -# If the application provides a loopback address in NetEndPoint, it returns E_SYSTEM.
*
* @section SocketReceiveFromPage2ResolutionSection Resolutions
- * This issue has been resolved in Tizen. @n
+ * The issue mentioned above is resolved in %Tizen API version 2.1 as follows: @n
* -# If the application provides a loopback address in NetEndPoint, it returns E_SUCCESS instead of E_SYSTEM.
*/
/**
* Binds the socket to a local address.
*
- * @since 2.0
- * @privilege %http://tizen.org/privilege/socket
+ * @since 2.0
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/socket
*
* @return An error code
* @param[in] localEndPoint The local NetEndPoint to associate with the socket
/**
* Places the socket in a listening state.
*
- * @since 2.0
- * @privilege %http://tizen.org/privilege/socket
+ * @since 2.0
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/socket
*
* @return An error code
* @param[in] backLog The maximum length of the pending connections queue
* creates a new socket with the same socket type, protocol type, and protocol family
* as the listening socket.
*
- * @since 2.0
- * @privilege %http://tizen.org/privilege/socket
+ * @since 2.0
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/socket
*
* @return A new socket for a newly created connection with the same socket type, protocol type, and protocol family, @n
* else @c null if an error occurs
/**
* Executes the specified command on the socket.
*
- * @since 2.0
- * @privilege %http://tizen.org/privilege/socket
+ * @since 2.0
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/socket
*
* @return An error code
* @param[in] cmd The command to execute on the socket
* Determines the status of one or more sockets.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/socket
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/socket
*
* @return An error code
* @param[in,out] pCheckRead An IList of Socket instances to check for readability
- * @param[in,out] pCheckWrite An IList of Socket instances to check for writability
- * @param[in,out] pCheckError An IList of Socket instances to check for errors
+ * @param[in,out] pCheckWrite An IList of Socket instances to check for writability
+ * @param[in,out] pCheckError An IList of Socket instances to check for errors
* @param[in] microSeconds The time to wait for a response, in microseconds
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_SOCKET The socket is invalid.
#include <FBaseRtIEventListener.h>
#include <FNetWifiWifiTypes.h>
+#include <FNetWifiWifiDirectGroupMember.h>
namespace Tizen { namespace Base { namespace Collection
{
{
class WifiDirectGroupInfo;
class WifiDirectDeviceInfo;
-class WifiDirectGroupMember;
/**
* @interface IWifiDirectDeviceListener
* @see WifiDirectDevice::CreateGroup()
* @see WifiDirectDevice::CancelGroupCreation()
* @endif
- */
- virtual void OnWifiDirectGroupCreatedN(WifiDirectDeviceId localDeviceId, const WifiDirectGroupInfo& wifiDirectGroupInfo, const WifiDirectDeviceInfo& wifiDirectGroupOwnerDeviceInfo, WifiDirectGroupMember* pWifiDirectMember, result r) {}
+ */
+ virtual void OnWifiDirectGroupCreatedN(WifiDirectDeviceId localDeviceId, const WifiDirectGroupInfo& wifiDirectGroupInfo, const WifiDirectDeviceInfo& wifiDirectGroupOwnerDeviceInfo, WifiDirectGroupMember* pWifiDirectMember, result r) { delete pWifiDirectMember; }
/**
* Called to notify the application when the scan is completed.
*/
virtual void OnWifiDirectAssociationCompleted(WifiDirectDeviceId localDeviceId, const WifiDirectDeviceInfo& wifiDirectGroupOwnerDeviceInfo, result r) {}
+ /**
+ * Called to notify the application when a remote device is found during the Wi-Fi Direct scan process.
+ *
+ * @since 2.1
+ *
+ * @param[in] localDeviceId An ID for a Wi-Fi Direct device
+ * @param[in] remoteDeviceInfo The remote device that is found
+ * @see WifiDirectDevice::Scan()
+ */
+ virtual void OnWifiDirectRemoteDeviceFound(WifiDirectDeviceId localDeviceId, const WifiDirectDeviceInfo& remoteDeviceInfo) {}
+
protected:
//
// This method is for internal use only. Using this method can cause behavioral, security-related,
//
virtual void OnWifiDirectDeviceListener_Reserved4(void) {}
- //
- // This method is for internal use only. Using this method can cause behavioral, security-related,
- // and consistency-related issues in the application.
- //
- // This method is reserved and may change its name at any time without prior notice.
- //
- // @since 2.0
- //
- virtual void OnWifiDirectDeviceListener_Reserved5(void) {}
}; // IWifiDirectDeviceListener
} } } //Tizen::Net::Wifi
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// limitations under the License.
//
/**
- * @if VISPARTNER-MANUFACTURER
* @file FNetWifiIWifiSystemMonitoringEventListener.h
* @brief This is the header file for the %IWifiSyWifiSystemMonitoringntListener interface.
- * @visibility partner-manufacturer
*
* This header file contains the declarations of the %IWifiSystemMonitoringEventListener interface.
*
- * @endif
*/
#ifndef _FNET_WIFI_IWIFI_SYSTEM_MONITORING_EVENT_LISTENER_H_
#define _FNET_WIFI_IWIFI_SYSTEM_MONITORING_EVENT_LISTENER_H_
namespace Tizen { namespace Net { namespace Wifi
{
/**
- * @if VISPARTNER-MANUFACTURER
* @interface IWifiSystemMonitoringEventListener
* @brief This interface provides the listeners for monitoring the Wi-Fi underlying system.
*
* @since 2.0
- * @visibility partner-manufacturer
*
* The IWifiSystemMonitoringEventListener interface specifies the methods used for creating notifications about the different
* kinds of Wi-Fi system monitoring events. When a Wi-Fi system monitoring event is generated, one of these methods is called.
- * @endif
*/
class _OSP_EXPORT_ IWifiSystemMonitoringEventListener
: virtual public Tizen::Base::Runtime::IEventListener
{
public:
/**
- * @if VISPARTNER-MANUFACTURER
* This polymorphic destructor should be overridden if required.
* This way, the destructors of the derived classes are called when the destructor of this interface is called.
*
* @since 2.0
- * @visibility partner-manufacturer
- * @endif
*/
virtual ~IWifiSystemMonitoringEventListener(void) {}
/**
- * @if VISPARTNER-MANUFACTURER
* Called to notify the application that the state of local Wi-Fi connection is changed.
*
* @since 2.0
- * @visibility partner-manufacturer
*
* @param[in] state The state of the Wi-Fi current connection
* @remark When the local device is connected with a particular access point,
* IWifiManagerEventListener::OnWifiConnected() as well as this method with @c WIFI_CONN_STATE_CONNECTED
* are called. Therefore, be careful to manipulate only one of those methods. So are the cases of
* IWifiManagerEventListener::OnWifiDisconnected() and this method with @c WIFI_CONN_STATE_NOT_CONNECTED.
- * @endif
*/
virtual void OnWifiConnectionStateChanged(WifiConnectionState state) = 0;
/**
- * @if VISPARTNER-MANUFACTURER
* Called to notify the application that the scan result of Wi-Fi system on background is updated.
*
* @since 2.0
- * @visibility partner-manufacturer
*
* @remark Call WifiManager::GetSystemScanResultN() for checking the content of this update.
- * @endif
*/
virtual void OnWifiSystemScanResultUpdated(void) = 0;
void SetSsid(const Tizen::Base::String& ssid);
/**
- * @if VISPARTNER-MANUFACTURER
* Checks whether an access point (BSS) is known or not. @n
* The access point becomes a known BSS if it has been connected with this device.
*
* @since 2.0
- * @visibility partner-manufacturer
*
* @return @c true if the access point is known, @n
* else @c false
* @see SetUnknown()
- * @endif
*/
bool IsKnown(void) const;
/**
- * @if VISPARTNER-MANUFACTURER
* Sets the access point (BSS) unknown.
*
* @since 2.0
- * @visibility partner-manufacturer
*
* @see IsKnown()
- * @endif
*/
void SetUnknown(void);
/**
- * @if VISPARTNER-MANUFACTURER
* Gets the local IP address scheme.
*
* @since 2.0
- * @visibility partner-manufacturer
*
* @return The address scheme for the local IP address
- * @endif
*/
Tizen::Net::NetAddressScheme GetLocalAddressScheme(void) const;
/**
- * @if VISPARTNER-MANUFACTURER
* Sets the local IP address scheme. @n
* The %SetLocalAddressScheme() method allows determining whether to use static address or dynamic address.
*
* @since 2.0
- * @visibility partner-manufacturer
*
* @param[in] scheme The address scheme for the local IP address
- * @endif
*/
void SetLocalAddressScheme(Tizen::Net::NetAddressScheme scheme);
/**
- * @if VISPARTNER-MANUFACTURER
* Gets the local IP address in the static address scheme.
*
* @since 2.0
- * @visibility partner-manufacturer
*
* @return The local address configured to this access point, @n
* else @c null if an error occurs or there is no previously set address
* For example, the address scheme for the IP address is @c NET_ADDRESS_SCHEME_DYNAMIC.
* @remarks The specific error code can be accessed using the GetLastResult() method.
* @see SetLocalAddress()
- * @endif
*/
const Tizen::Net::IpAddress* GetLocalAddress(void) const;
/**
- * @if VISPARTNER-MANUFACTURER
* Sets the local IP address in the static address scheme.
*
* @since 2.0
- * @visibility partner-manufacturer
*
* @return An error code
* @param[in] pAddress The new address to be assigned
* For example, The address scheme for the IP address is NET_ADDRESS_SCHEME_DYNAMIC.
* @remarks The existing local address is unset when the input argument is @c null.
* @see GetLocalAddress()
- * @endif
*/
result SetLocalAddress(const Tizen::Net::IpAddress* pAddress);
/**
- * @if VISPARTNER-MANUFACTURER
* Gets the subnet mask address in the static address scheme.
*
* @since 2.0
- * @visibility partner-manufacturer
*
* @return The subnet mask address configured to this access point, @n
* else @c null if an error occurs or there is no previously set address
* For example, the address scheme for the IP address is @c NET_ADDRESS_SCHEME_DYNAMIC.
* @remarks The specific error code can be accessed using the GetLastResult() method.
* @see SetSubnetMaskAddress()
- * @endif
*/
const Tizen::Net::IpAddress* GetSubnetMaskAddress(void) const;
/**
- * @if VISPARTNER-MANUFACTURER
* Sets the subnet mask address in the static address scheme.
*
* @since 2.0
- * @visibility partner-manufacturer
*
* @return An error code
* @param[in] pAddress The new address to assign
* For example, the address scheme for the IP address is @c NET_ADDRESS_SCHEME_DYNAMIC.
* @remarks The existing subnet mask address is unset when the input argument is @c null.
* @see GetSubnetMaskAddress()
- * @endif
*/
result SetSubnetMaskAddress(const Tizen::Net::IpAddress* pAddress);
/**
- * @if VISPARTNER-MANUFACTURER
* Gets the default gateway address in the static address scheme.
*
* @since 2.0
- * @visibility partner-manufacturer
*
* @return The default gateway address configured to this access point, @n
* else @c null if an error occurs or there is no previously set address
* For example, the address scheme for the IP address is NET_ADDRESS_SCHEME_DYNAMIC.
* @remarks The specific error code can be accessed using the GetLastResult() method.
* @see SetDefaultGatewayAddress()
- * @endif
*/
const Tizen::Net::IpAddress* GetDefaultGatewayAddress(void) const;
/**
- * @if VISPARTNER-MANUFACTURER
* Sets the default gateway address in the static address scheme.
*
* @since 2.0
- * @visibility partner-manufacturer
*
* @return An error code
* @param[in] pAddress The new address to assign
* For example, the address scheme for the IP address is @c NET_ADDRESS_SCHEME_DYNAMIC.
* @remarks The existing gateway address is unset when the input argument is @c null.
* @see GetDefaultGatewayAddress()
- * @endif
*/
result SetDefaultGatewayAddress(const Tizen::Net::IpAddress* pAddress);
/**
- * @if VISPARTNER-MANUFACTURER
* Gets the primary DNS address in the static address scheme.
*
* @since 2.0
- * @visibility partner-manufacturer
*
* @return The primary DNS address configured to this access point, @n
* else @c null if an error occurs or there is no previously set address
* For example, the address scheme for the IP address is @c NET_ADDRESS_SCHEME_DYNAMIC.
* @remarks The specific error code can be accessed using the GetLastResult() method.
* @see SetPrimaryDnsAddress()
- * @endif
*/
const Tizen::Net::IpAddress* GetPrimaryDnsAddress(void) const;
/**
- * @if VISPARTNER-MANUFACTURER
* Sets the primary DNS address in the static address scheme.
*
* @since 2.0
- * @visibility partner-manufacturer
*
* @return An error code
* @param[in] pAddress The new address to assign
* For example, the address scheme for the IP address is @c NET_ADDRESS_SCHEME_DYNAMIC.
* @remarks The existing primary DNS address is unset when the input argument is @c null.
* @see GetPrimaryDnsAddress()
- * @endif
*/
result SetPrimaryDnsAddress(const Tizen::Net::IpAddress* pAddress);
/**
- * @if VISPARTNER-MANUFACTURER
* Gets the secondary DNS address in the static address scheme.
*
* @since 2.0
- * @visibility partner-manufacturer
*
* @return The secondary DNS address configured to this access point, @n
* else @c null if an error occurs or there is no previously set address
* For example, the address scheme for the IP address is NET_ADDRESS_SCHEME_DYNAMIC.
* @remarks The specific error code can be accessed using the GetLastResult() method.
* @see SetSecondaryDnsAddress()
- * @endif
*/
const Tizen::Net::IpAddress* GetSecondaryDnsAddress(void) const;
/**
- * @if VISPARTNER-MANUFACTURER
* Sets the secondary DNS address in the static address scheme.
*
* @since 2.0
- * @visibility partner-manufacturer
*
* @return An error code
* @param[in] pAddress The new address to assign
* For example, the address scheme for the IP address is @c NET_ADDRESS_SCHEME_DYNAMIC.
* @remarks The existing secondary DNS address is unset when the input argument is @c null.
* @see GetSecondaryDnsAddress()
- * @endif
*/
result SetSecondaryDnsAddress(const Tizen::Net::IpAddress* pAddress);
/**
- * @if VISPARTNER-MANUFACTURER
* Gets the proxy type.
*
* @since 2.0
- * @visibility partner-manufacturer
*
* @return The proxy type
* @see SetProxyType()
- * @endif
*/
Tizen::Net::NetProxyType GetProxyType(void) const;
/**
- * @if VISPARTNER-MANUFACTURER
* Sets the proxy type.
*
* @since 2.0
- * @visibility partner-manufacturer
*
* @param[in] type The proxy type
* @see GetProxyType()
- * @endif
*/
void SetProxyType(Tizen::Net::NetProxyType type);
/**
- * @if VISPARTNER-MANUFACTURER
* Gets the proxy address.
*
* @since 2.0
- * @visibility partner-manufacturer
*
* @return The proxy address, @n
* else an empty string if an error occurs or there is no previously set address
* For example, the specified input type is @c NET_PROXY_TYPE_NONE.
* @remarks The specific error code can be accessed using the GetLastResult() method.
* @see SetProxyAddress()
- * @endif
*/
Tizen::Base::String GetProxyAddress(void) const;
/**
- * @if VISPARTNER-MANUFACTURER
* Sets the proxy address.
*
* @since 2.0
- * @visibility partner-manufacturer
*
* @return An error code
* @param[in] address The proxy address
* For example, The specified input type is NET_PROXY_TYPE_NONE.
* @remarks The existing proxy address is unset when the input argument is an empty string.
* @see GetProxyAddress()
- * @endif
*/
result SetProxyAddress(const Tizen::Base::String& address);
* Activates the local Wi-Fi device by using the Wi-Fi Direct enabled.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/wifi.wifidirect.admin
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/wifi.wifidirect.admin
*
* @return An error code
* @exception E_SUCCESS The activation is successful.
* Deactivates the local Wi-Fi device.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/wifi.wifidirect.admin
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/wifi.wifidirect.admin
*
* @return An error code
* @exception E_SUCCESS The deactivation is successful.
* Instead of using this API, use Connect() or CreateAutonomousGroup() API.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/wifi.wifidirect.admin
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/wifi.wifidirect.admin
*
* @return An error code
* @param[in] pWifiDirectGroupInfo The pointer of a WiFiDirectGroupInfo
* Instead of using this API, use CancelConnect() API
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/wifi.wifidirect.admin
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/wifi.wifidirect.admin
*
* @return An error code
* @exception E_SUCCESS The method is successful.
* Scans Wi-Fi Direct Devices which are in the specified type.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/wifi.wifidirect.read
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/wifi.wifidirect.read
*
* @return An error code
* @exception E_SUCCESS The method is successful.
* Cancels the Wi-Fi Direct previous scan operation.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/wifi.wifidirect.read
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/wifi.wifidirect.read
*
* @return An error code
* @exception E_SUCCESS The method is successful.
* Instead of using this API, use Connect() API
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/wifi.wifidirect.admin
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/wifi.wifidirect.admin
*
* @return An error code
* @param[in] wifiDirectGroupOwnerDeviceInfo The WifiDirectDeviceInfo value of a group owner
* Connects to the Wi-Fi Direct connection with the specified peer device.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/wifi.wifidirect.admin
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/wifi.wifidirect.admin
*
* @return An error code
* @param[in] remoteDeviceInfo The remote peer device to connect.
* Cancels the request for Wi-Fi Direct connection.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/wifi.wifidirect.admin
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/wifi.wifidirect.admin
*
* @return An error code
* @exception E_SUCCESS The method is successful.
* Creates a Wi-Fi Direct group as the group owner.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/wifi.wifidirect.admin
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/wifi.wifidirect.admin
*
* @return An error code
* @exception E_SUCCESS The method is successful.
* Sets the configuration information of a Wi-Fi Direct group.
*
* @since 2.0
- *
- * @privilege %http://tizen.org/privilege/wifi.wifidirect.admin
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/wifi.wifidirect.admin
*
* @return An error code
* @param[in] groupSettingInfo The group setting information
* Disconnects the specified peer device.
*
* @since 2.0
- *
- * @privilege %http://tizen.org/privilege/wifi.wifidirect.admin
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/wifi.wifidirect.admin
*
* @return An error code
* @param[in] peerDeviceInfo The peer device to disconnect
* Leaves the currently participating Wi-Fi Direct group.
*
* @since 2.0
- *
- * @privilege %http://tizen.org/privilege/wifi.wifidirect.admin
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/wifi.wifidirect.admin
*
* @return An error code
* @exception E_SUCCESS The method is successful.
* it is integrated into WifiDirectDevice class. use WifiDirectDevice::Disconnect() API.
*
* @since 2.0
- *
- * @privilege %http://tizen.org/privilege/wifi.wifidirect.admin
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/wifi.wifidirect.admin
*
* @return An error code
* @exception E_SUCCESS The method is successful.
* Instead of using this API, WifiDirectDevice::GetGroupOwnerInfoN() API.
*
* @since 2.0
- *
- * @privilege %http://tizen.org/privilege/wifi.wifidirect.read, %http://tizen.org/privilege/network.connection and %http://tizen.org/privilege/socket @n
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/wifi.wifidirect.read, http://tizen.org/privilege/network.connection and http://tizen.org/privilege/socket @n
* All the above privileges are required
*
* @return An error code
* Now the Wi-Fi Direct APIs have been revised to allow the use of APIs with ease irrespective of the role. @n
*
* @since 2.0
- *
- * @privilege %http://tizen.org/privilege/wifi.wifidirect.read, %http://tizen.org/privilege/network.connection and %http://tizen.org/privilege/socket @n
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/wifi.wifidirect.read, http://tizen.org/privilege/network.connection and http://tizen.org/privilege/socket @n
* All the above privileges are required
*
* @return An error code
* As the APIs have been integrated into the WifiDirectDevice class, use WifiDirectDevice::LeaveGroup() API instead.
*
* @since 2.0
- *
- * @privilege %http://tizen.org/privilege/wifi.wifidirect.admin
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/wifi.wifidirect.admin
*
* @return An error code
* @exception E_SUCCESS The method is successful.
* As the APIs have been integrated into the WifiDirectDevice class, use WifiDirectDevice::Disconnect() API instead.
*
* @since 2.0
- *
- * @privilege %http://tizen.org/privilege/wifi.wifidirect.admin
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/wifi.wifidirect.admin
*
* @return An error code
* @param[in] wifiDirectRemoteDeviceInfo The device information of a group client to disconnect
* Now the Wi-Fi Direct APIs have been revised to allow the use of APIs with ease irrespective of the role. @n
*
* @since 2.0
- *
- * @privilege %http://tizen.org/privilege/wifi.wifidirect.read, %http://tizen.org/privilege/network.connection and %http://tizen.org/privilege/socket @n
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/wifi.wifidirect.read, http://tizen.org/privilege/network.connection and http://tizen.org/privilege/socket @n
* All the above privileges are required
*
* @return An error code
* Now the Wi-Fi Direct APIs have been revised to allow the use of APIs with ease irrespective of the role. @n
*
* @since 2.0
- *
- * @privilege %http://tizen.org/privilege/wifi.wifidirect.read, %http://tizen.org/privilege/network.connection and %http://tizen.org/privilege/socket @n
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/wifi.wifidirect.read, http://tizen.org/privilege/network.connection and http://tizen.org/privilege/socket @n
* All the above privileges are required
*
* @return An error code
* Activates the local Wi-Fi device.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/wifi.admin
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/wifi.admin
*
* @return An error code
* @exception E_SUCCESS The activation is successful.
* Deactivates the local Wi-Fi device.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/wifi.admin
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/wifi.admin
*
* @return An error code
* @exception E_SUCCESS The deactivation is successful.
* Scans for a nearby BSS with both the infrastructure and independent modes.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/wifi.read
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/wifi.read
*
* @return An error code
* @exception E_SUCCESS The method is successful.
* Connects to a specific access point that is a BSS with an infrastructure mode.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/wifi.admin
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/wifi.admin
*
* @return An error code
* @param[in] targetApInfo A BSS information representing the target access point
result Connect(const WifiBssInfo& targetApInfo);
/**
- * @if VISPARTNER-MANUFACTURER
* Sets the behavior mode of the Wi-Fi background system about connection and background scanning.
*
* @since 2.0
- * @visibility partner-manufacturer
- * @privilege %http://tizen.org/privilege/wifimanager
+ * @privlevel platform
+ * @privilege http://tizen.org/privilege/wifimanager
*
* @return An error code
* @param[in] mode A Wi-Fi background system mode
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @exception E_OPERATION_FAILED The operation has failed.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
- * @endif
*/
result SetWifiSystemScanMode(WifiSystemScanMode mode);
/**
- * @if VISPARTNER-MANUFACTURER
* Adds the specified listener for receiving the notification when the state of current Wi-Fi connection is changed
* or the result of Wi-Fi background scanning is updated
*
* @since 2.0
- * @visibility partner-manufacturer
- * @privilege %http://tizen.org/privilege/wifimanager
+ * @privlevel platform
+ * @privilege http://tizen.org/privilege/wifimanager
*
* @return An error code
* @param[in] listener The listener to add
* @exception E_OBJ_ALREADY_EXIST The listener is already added.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
- * @endif
*/
result AddSystemMonitoringEventListener(IWifiSystemMonitoringEventListener& listener);
/**
- * @if VISPARTNER-MANUFACTURER
* Removes the specified IWifiSystemMonitoringEventListener instance for receiving the notification. The removed listener
* cannot listen to the events that are fired.
*
* @since 2.0
- * @visibility partner-manufacturer
- * @privilege %http://tizen.org/privilege/wifimanager
+ * @privlevel platform
+ * @privilege http://tizen.org/privilege/wifimanager
*
* @return An error code
* @param[in] listener The listener to remove
* @exception E_OBJ_NOT_FOUND The listener is not found.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
- * @endif
*/
result RemoveSystemMonitoringEventListener(IWifiSystemMonitoringEventListener& listener);
/**
- * @if VISPARTNER-MANUFACTURER
* Gets the state of current Wi-Fi connection.
*
* @since 2.0
- * @visibility partner-manufacturer
*
* @return The state of the current Wi-Fi connection
- * @endif
*/
WifiConnectionState GetConnectionState(void) const;
/**
- * @if VISPARTNER-MANUFACTURER
* Gets the information of current Wi-Fi connection target which the local device is connecting or connected with.
*
* @since 2.0
- * @visibility partner-manufacturer
*
* @return A pointer to the WifiBssInfo instance representing the information of current Wi-Fi connection target
* else @c null if GetConnectionState() is WIFI_CONN_STATE_NOT_CONNECTED
- * @endif
*/
WifiBssInfo* GetConnectionTargetInfoN(void) const;
/**
- * @if VISPARTNER-MANUFACTURER
* Updates the Wi-Fi BSS information which is saved in the underlying Wi-Fi system.
*
* @since 2.0
- * @visibility partner-manufacturer
- * @privilege %http://tizen.org/privilege/wifimanager
+ * @privlevel platform
+ * @privilege http://tizen.org/privilege/wifimanager
*
* @return An error code
* @param[in] bssInfo A BSS information representing the access point
* @exception E_OBJ_NOT_FOUND The specified input parameter is not found.
* @exception E_OPERATION_FAILED The operation has failed.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
- * @endif
+ *
+ * @remarks The updated information is deleted when Wi-Fi is turned off if the BSS has never been connected before.
*/
result UpdateBssInfo(const WifiBssInfo& bssInfo);
/**
- * @if VISPARTNER-MANUFACTURER
* Gets a list of the latest search results which the underlying Wi-Fi system scan periodically on background.
*
* @since 2.0
- * @visibility partner-manufacturer
*
* @return An IList containing WifiBssInfo of existing Wi-Fi connections if successful, @n
* else @c null
- * @endif
*/
Tizen::Base::Collection::IList* GetSystemScanResultN(void) const;
*/
enum WifiPowerStatus
{
- WIFI_POWER_STATUS_OFF = 0, /**< The local Wi-Fi device is turned off */
- WIFI_POWER_STATUS_ON, /**< The local Wi-Fi device is turned on */
- WIFI_POWER_STATUS_DEEP_SLEEP, /**< The local Wi-Fi device enters deep sleep mode */
+ WIFI_POWER_STATUS_OFF = 0, /**< The local Wi-Fi device is turned off */
+ WIFI_POWER_STATUS_ON, /**< The local Wi-Fi device is turned on */
+ WIFI_POWER_STATUS_DEEP_SLEEP, /**< The local Wi-Fi device enters deep sleep mode */
};
/**
*/
enum WifiBssType
{
- WIFI_BSS_TYPE_INFRASTRUCTURE = 0, /**< The infrastructure type which usually consists of a single Access Point (AP) @n
- * However, in order to provide sufficient coverage, it could be necessary to use two
- * or more APs. @n
- * Logically, there needs to be an interconnection among APs, and this concept is
- * called Distribution %System (DS). @n
- * Connecting with multiple APs through DS creates a wireless network of an arbitrary
- * size. @n
- * This is called Extended Service Set (ESS). Finally, a logical connection point to
- * the wired LAN is supported by a concept designated as Portal. */
- WIFI_BSS_TYPE_INDEPENDENT, /**< The simplest Wi-Fi configuration is called as Independent Basic Service Set (IBSS)
- * or ad hoc @n
- * The IBSS is a self-contained network that only supports direct communication
- * between Stations (STAs) that belong to the same BSS. @n
- * The most common example of this connection is the use of Wi-Fi to establish
- * peer-to-peer network connection between two STAs. */
- WIFI_BSS_TYPE_ANY, /**< The type with no specification */
- WIFI_BSS_TYPE_MAX = 65535 // This enum value is for internal use only. Using this enum value can cause behavioral,
- // security-related, and consistency-related issues in the application.
+ WIFI_BSS_TYPE_INFRASTRUCTURE = 0, /**< The infrastructure type which usually consists of a single Access Point (AP) @n
+ * However, in order to provide sufficient coverage, it could be necessary to use two
+ * or more APs. @n
+ * Logically, there needs to be an interconnection among APs, and this concept is
+ * called Distribution %System (DS). @n
+ * Connecting with multiple APs through DS creates a wireless network of an arbitrary
+ * size. @n
+ * This is called Extended Service Set (ESS). Finally, a logical connection point to
+ * the wired LAN is supported by a concept designated as Portal. */
+ WIFI_BSS_TYPE_INDEPENDENT, /**< The simplest Wi-Fi configuration is called as Independent Basic Service Set (IBSS)
+ * or ad hoc @n
+ * The IBSS is a self-contained network that only supports direct communication
+ * between Stations (STAs) that belong to the same BSS. @n
+ * The most common example of this connection is the use of Wi-Fi to establish
+ * peer-to-peer network connection between two STAs. */
+ WIFI_BSS_TYPE_ANY, /**< The type with no specification */
+ WIFI_BSS_TYPE_MAX = 65535 // This enum value is for internal use only. Using this enum value can cause behavioral,
+ // security-related, and consistency-related issues in the application.
};
/**
*/
enum WifiAuthenticationType
{
- WIFI_AUTHENTICATION_OPEN = 0, /**< The Open %System Authentication that admits any STA to the DS */
- WIFI_AUTHENTICATION_SHARED, /**< The Shared Key Authentication relies on the WEP to demonstrate knowledge of a
- * WEP encryption key */
- WIFI_AUTHENTICATION_WPA, /**< The Enterprise Authentication that supports WPA (Wi-Fi Protected Access) */
- WIFI_AUTHENTICATION_WPA_PSK, /**< The Personal Authentication that supports WPA; PSK stands for PreShared Key */
- WIFI_AUTHENTICATION_WPA2, /**< The Enterprise Authentication that supports WPA2 */
- WIFI_AUTHENTICATION_WPA2_PSK, /**< The Personal Authentication that supports WPA2; PSK stands for PreShared Key */
- WIFI_AUTHENTICATION_WPA_WPA2_MIXED_PSK, /**< The Personal Authentication that supports both WPA and WPA2; PSK stands for
- * PreShared Key */
- WIFI_AUTHENTICATION_MAX = 65535 // This enum value is for internal use only. Using this enum value can cause
- // behavioral, security-related, and consistency-related issues in the application.
+ WIFI_AUTHENTICATION_OPEN = 0, /**< The Open %System Authentication that admits any STA to the DS */
+ WIFI_AUTHENTICATION_SHARED, /**< The Shared Key Authentication relies on the WEP to demonstrate knowledge of a
+ * WEP encryption key */
+ WIFI_AUTHENTICATION_WPA, /**< The Enterprise Authentication that supports WPA (Wi-Fi Protected Access) */
+ WIFI_AUTHENTICATION_WPA_PSK, /**< The Personal Authentication that supports WPA; PSK stands for PreShared Key */
+ WIFI_AUTHENTICATION_WPA2, /**< The Enterprise Authentication that supports WPA2 */
+ WIFI_AUTHENTICATION_WPA2_PSK, /**< The Personal Authentication that supports WPA2; PSK stands for PreShared Key */
+ WIFI_AUTHENTICATION_WPA_WPA2_MIXED_PSK, /**< The Personal Authentication that supports both WPA and WPA2; PSK stands for
+ * PreShared Key */
+ WIFI_AUTHENTICATION_MAX = 65535 // This enum value is for internal use only. Using this enum value can cause
+ // behavioral, security-related, and consistency-related issues in the application.
};
/**
*/
enum WifiEncryptionType
{
- WIFI_ENCRYPTION_NONE = 0, /**< The type with no encryption */
- WIFI_ENCRYPTION_WEP, /**< The Wired Equivalent Privacy @n This is only used for open and shared methods. */
- WIFI_ENCRYPTION_TKIP, /**< The Temporal Key Integrity Protocol */
- WIFI_ENCRYPTION_AES, /**< The Advanced Encryption Standard */
- WIFI_ENCRYPTION_TKIP_AES_MIXED, /**< The TKIP and AES are both supported */
- WIFI_ENCRYPTION_MAX = 65535 // This enum value is for internal use only. Using this enum value can cause behavioral,
- // security-related, and consistency-related issues in the application.
+ WIFI_ENCRYPTION_NONE = 0, /**< The type with no encryption */
+ WIFI_ENCRYPTION_WEP, /**< The Wired Equivalent Privacy @n This is only used for open and shared methods. */
+ WIFI_ENCRYPTION_TKIP, /**< The Temporal Key Integrity Protocol */
+ WIFI_ENCRYPTION_AES, /**< The Advanced Encryption Standard */
+ WIFI_ENCRYPTION_TKIP_AES_MIXED, /**< The TKIP and AES are both supported */
+ WIFI_ENCRYPTION_MAX = 65535 // This enum value is for internal use only. Using this enum value can cause behavioral,
+ // security-related, and consistency-related issues in the application.
};
/**
*/
enum WifiEapType
{
- WIFI_EAP_NONE = 0, /**< The method type where no EAP method is used */
- WIFI_EAP_SIM, /**< The EAP-SIM; EAP for GSM Subscriber Identity */
- WIFI_EAP_AKA, /**< The EAP-AKA; EAP for UMTS Authentication and Key Agreement */
- WIFI_EAP_TTLS_MSCHAPV2, /**< The EAP-TTLS/MSCHAPv2; Tunnel MSCHAPv2 through TTLS(Tunneled Transport Layer Security) */
- WIFI_EAP_PEAP_MSCHAPV2, /**< The PEAPv0/EAP-MSCHAPv2; Tunnel MSCHAPv2 through PEAP(Protected Extensible Authentication
- * Protocol) */
- WIFI_EAP_PEAP_GTC, /**< The PEAPv1/EAP-GTC; Tunnel GTC through PEAP(Protected Extensible Authentication Protocol) */
- WIFI_EAP_TLS /**< The EAP-TLS, Not supported yet */
+ WIFI_EAP_NONE = 0, /**< The method type where no EAP method is used */
+ WIFI_EAP_SIM, /**< The EAP-SIM; EAP for GSM Subscriber Identity */
+ WIFI_EAP_AKA, /**< The EAP-AKA; EAP for UMTS Authentication and Key Agreement */
+ WIFI_EAP_TTLS_MSCHAPV2, /**< The EAP-TTLS/MSCHAPv2; Tunnel MSCHAPv2 through TTLS(Tunneled Transport Layer Security) */
+ WIFI_EAP_PEAP_MSCHAPV2, /**< The PEAPv0/EAP-MSCHAPv2; Tunnel MSCHAPv2 through PEAP(Protected Extensible Authentication
+ * Protocol) */
+ WIFI_EAP_PEAP_GTC, /**< The PEAPv1/EAP-GTC; Tunnel GTC through PEAP(Protected Extensible Authentication Protocol) */
+ WIFI_EAP_TLS /**< The EAP-TLS, Not supported yet */
};
/**
*/
enum WifiWepKeyLen
{
- WIFI_WEP_KEY_LEN_64BIT = 0, /**< @if OSPDEPREC The WEP key of length 64bits @n
- * The minimum length of the WEP key is 5 digits (40bits). @endif */
- WIFI_WEP_KEY_LEN_128BIT, /**< @if OSPDEPREC The WEP key of length 128bits @n
- * The minimum length of the WEP key is 13 digits (104bits). @endif */
- WIFI_WEP_KEY_LEN_MAX = 65535 // This enum value is for internal use only. Using this enum value can cause behavioral,
- // security-related, and consistency-related issues in the application.
+ WIFI_WEP_KEY_LEN_64BIT = 0, /**< @if OSPDEPREC The WEP key of length 64bits @n
+ * The minimum length of the WEP key is 5 digits (40bits). @endif */
+ WIFI_WEP_KEY_LEN_128BIT, /**< @if OSPDEPREC The WEP key of length 128bits @n
+ * The minimum length of the WEP key is 13 digits (104bits). @endif */
+ WIFI_WEP_KEY_LEN_MAX = 65535 // This enum value is for internal use only. Using this enum value can cause behavioral,
+ // security-related, and consistency-related issues in the application.
};
/**
*/
enum WifiWepKeyIndex
{
- WIFI_WEP_KEY_INDEX_1 = 1, /**< @if OSPDEPREC The WEP Key Index 1 @endif */
- WIFI_WEP_KEY_INDEX_2 = 2, /**< @if OSPDEPREC The WEP Key Index 2 @endif */
- WIFI_WEP_KEY_INDEX_3 = 3, /**< @if OSPDEPREC The WEP Key Index 3 @endif */
- WIFI_WEP_KEY_INDEX_4 = 4, /**< @if OSPDEPREC The WEP Key Index 4 @endif */
+ WIFI_WEP_KEY_INDEX_1 = 1, /**< @if OSPDEPREC The WEP Key Index 1 @endif */
+ WIFI_WEP_KEY_INDEX_2 = 2, /**< @if OSPDEPREC The WEP Key Index 2 @endif */
+ WIFI_WEP_KEY_INDEX_3 = 3, /**< @if OSPDEPREC The WEP Key Index 3 @endif */
+ WIFI_WEP_KEY_INDEX_4 = 4, /**< @if OSPDEPREC The WEP Key Index 4 @endif */
};
/**
*/
enum WifiDirectDeviceStatus
{
- WIFI_DIRECT_DEVICE_DEACTIVATED = 0, /**< The Wi-Fi interface is deactivated */
- WIFI_DIRECT_DEVICE_ACTIVATED /**< The Wi-Fi interface is activated */
+ WIFI_DIRECT_DEVICE_DEACTIVATED = 0, /**< The Wi-Fi interface is deactivated */
+ WIFI_DIRECT_DEVICE_ACTIVATED /**< The Wi-Fi interface is activated */
};
/**
*/
enum WifiDirectGroupMemberType
{
- WIFI_DIRECT_GROUP_MEMBER_TYPE_NONE = 0, /**< The Wi-Fi Direct Group Non-member @n That is, the device does not belong to any
- * group. */
- WIFI_DIRECT_GROUP_MEMBER_TYPE_OWNER, /**< The Wi-Fi Direct Group Owner */
- WIFI_DIRECT_GROUP_MEMBER_TYPE_CLIENT /**< The Wi-Fi Direct Group Client */
+ WIFI_DIRECT_GROUP_MEMBER_TYPE_NONE = 0, /**< The Wi-Fi Direct Group Non-member @n That is, the device does not belong to any
+ * group. */
+ WIFI_DIRECT_GROUP_MEMBER_TYPE_OWNER, /**< The Wi-Fi Direct Group Owner */
+ WIFI_DIRECT_GROUP_MEMBER_TYPE_CLIENT /**< The Wi-Fi Direct Group Client */
};
/**
*/
enum WifiDirectDeviceTypeCategory
{
- WIFI_DIRECT_DEVICE_TYPE_CATEGORY_COMPUTER = 0, /**< The PC, Server, %Media Center, UMPC, Notebook, Desktop,
- * MID, Netbook, and so on */
- WIFI_DIRECT_DEVICE_TYPE_CATEGORY_INPUT_DEVICE, /**< The Keyboard, Mouse, Joystick, Trackball, Gaming
- * controller, Remote, Touchscreen, Biometric reader, Barcode
- * reader, and so on */
- WIFI_DIRECT_DEVICE_TYPE_CATEGORY_PRINTER_SCANNER_FAX_COPIER, /**< The Printer, Print Server, Scanner, Fax, Copier,
- * All-in-one, and so on */
- WIFI_DIRECT_DEVICE_TYPE_CATEGORY_CAMERA, /**< The Digital still camera, Video camera, %Web camera,
- * %Security camera, and so on */
- WIFI_DIRECT_DEVICE_TYPE_CATEGORY_STORAGE, /**< The NAS */
- WIFI_DIRECT_DEVICE_TYPE_CATEGORY_NETWORK_INFRASTRUCTURE, /**< The AP, Router, Switch, Gateway, and so on */
- WIFI_DIRECT_DEVICE_TYPE_CATEGORY_DISPLAY, /**< The Television, Electronic picture frame, Projector,
- * Monitor, and so on */
- WIFI_DIRECT_DEVICE_TYPE_CATEGORY_MULTIMEDIA_DEVICE, /**< The DAR, PVR, MCX, Set-top box, %Media server, %Media
- * adapter, %Media extender, Portable video player, and so
- * on */
- WIFI_DIRECT_DEVICE_TYPE_CATEGORY_GAMING_DEVICE, /**< The Xbox, Playstation, Game console, Game console adaptor,
- * Portable gaming device, and so on */
- WIFI_DIRECT_DEVICE_TYPE_CATEGORY_TELEPHONE, /**< The Windows Mobile, Phone, Smartphone, and so on */
- WIFI_DIRECT_DEVICE_TYPE_CATEGORY_AUDIO_DEVICE, /**< The Audio tuner, Audio receiver, Speaker, Portable Music
- * Player, Headset, Headphone, Microphone, and so on */
- WIFI_DIRECT_DEVICE_TYPE_CATEGORY_OTHERS = 255 /**< A device which is not classified into the above types */
+ WIFI_DIRECT_DEVICE_TYPE_CATEGORY_COMPUTER = 0, /**< The PC, Server, %Media Center, UMPC, Notebook, Desktop,
+ * MID, Netbook, and so on */
+ WIFI_DIRECT_DEVICE_TYPE_CATEGORY_INPUT_DEVICE, /**< The Keyboard, Mouse, Joystick, Trackball, Gaming
+ * controller, Remote, Touchscreen, Biometric reader, Barcode
+ * reader, and so on */
+ WIFI_DIRECT_DEVICE_TYPE_CATEGORY_PRINTER_SCANNER_FAX_COPIER, /**< The Printer, Print Server, Scanner, Fax, Copier,
+ * All-in-one, and so on */
+ WIFI_DIRECT_DEVICE_TYPE_CATEGORY_CAMERA, /**< The Digital still camera, Video camera, %Web camera,
+ * %Security camera, and so on */
+ WIFI_DIRECT_DEVICE_TYPE_CATEGORY_STORAGE, /**< The NAS */
+ WIFI_DIRECT_DEVICE_TYPE_CATEGORY_NETWORK_INFRASTRUCTURE, /**< The AP, Router, Switch, Gateway, and so on */
+ WIFI_DIRECT_DEVICE_TYPE_CATEGORY_DISPLAY, /**< The Television, Electronic picture frame, Projector,
+ * Monitor, and so on */
+ WIFI_DIRECT_DEVICE_TYPE_CATEGORY_MULTIMEDIA_DEVICE, /**< The DAR, PVR, MCX, Set-top box, %Media server, %Media
+ * adapter, %Media extender, Portable video player, and so
+ * on */
+ WIFI_DIRECT_DEVICE_TYPE_CATEGORY_GAMING_DEVICE, /**< The Xbox, Playstation, Game console, Game console adaptor,
+ * Portable gaming device, and so on */
+ WIFI_DIRECT_DEVICE_TYPE_CATEGORY_TELEPHONE, /**< The Windows Mobile, Phone, Smartphone, and so on */
+ WIFI_DIRECT_DEVICE_TYPE_CATEGORY_AUDIO_DEVICE, /**< The Audio tuner, Audio receiver, Speaker, Portable Music
+ * Player, Headset, Headphone, Microphone, and so on */
+ WIFI_DIRECT_DEVICE_TYPE_CATEGORY_OTHERS = 255 /**< A device which is not classified into the above types */
};
/**
*/
enum WifiDirectAssociationTerminationReason
{
- WIFI_DIRECT_ASSOCIATION_TERMINATION_REASON_SELF_INITIATED = 0, /**< @if OSPDEPREC The enumerator that is delivered to a group owner or
- * group client who initiates the disassociation request @endif */
- WIFI_DIRECT_ASSOCIATION_TERMINATION_REASON_DISCONNECTED /**< @if OSPDEPREC The enumerator that is delivered to a group owner or
- * group client who receives the disassociation request or
- * when a client is disconnected due to out of range or
- * abrupt connection loss to the group owner @endif */
+ WIFI_DIRECT_ASSOCIATION_TERMINATION_REASON_SELF_INITIATED = 0, /**< @if OSPDEPREC The enumerator that is delivered to a group owner or
+ * group client who initiates the disassociation request @endif */
+ WIFI_DIRECT_ASSOCIATION_TERMINATION_REASON_DISCONNECTED /**< @if OSPDEPREC The enumerator that is delivered to a group owner or
+ * group client who receives the disassociation request or
+ * when a client is disconnected due to out of range or
+ * abrupt connection loss to the group owner @endif */
};
/**
*/
enum WifiWpsConfigurationMode
{
- WIFI_WPS_CONFIG_MODE_NONE = 0, /**< The configuration mode with no method to be provided */
- WIFI_WPS_CONFIG_MODE_PIN_DISPLAY, /**< A method to display the PIN code */
- WIFI_WPS_CONFIG_MODE_PIN_KEYPAD, /**< A method to provide the keypad to input the PIN */
- WIFI_WPS_CONFIG_MODE_PBC /**< A method of Push Button Configuration (PBC) */
+ WIFI_WPS_CONFIG_MODE_NONE = 0, /**< The configuration mode with no method to be provided */
+ WIFI_WPS_CONFIG_MODE_PIN_DISPLAY, /**< A method to display the PIN code */
+ WIFI_WPS_CONFIG_MODE_PIN_KEYPAD, /**< A method to provide the keypad to input the PIN */
+ WIFI_WPS_CONFIG_MODE_PBC /**< A method of Push Button Configuration (PBC) */
};
/**
- * @if VISPARTNER-MANUFACTURER
* @enum WifiConnectionState
*
* Defines the state of the Wi-Fi connection.
*
* @since 2.0
- * @visibility partner-manufacturer
- * @endif
*/
enum WifiConnectionState
{
};
/**
- * @if VISPARTNER-MANUFACTURER
* @enum WifiSystemScanMode
*
* Defines the mode of the Wi-Fi background system behaviors, mainly about background scanning.
*
* @since 2.0
- * @visibility partner-manufacturer
- * @endif
*/
enum WifiSystemScanMode
{
Name: osp-net
Summary: The Network library of OSP
-Version: 1.2.0.0
+Version: 1.2.1.0
Release: 1
Group: System/Libraries
License: Apache License, Version 2.0 or Flora
ClearLastResult();
- r = _AccessController::CheckUserPrivilege(_PRV_NETWORK_STATISTICS_READ);
+ r = _AccessController::CheckUserPrivilege(_PRV_NETWORK_STATISTICS_READ, _PRV_NETWORK_STATISTICS);
r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_OUT_OF_MEMORY);
SysTryReturn(NID_NET, r == E_SUCCESS, INVALID_HANDLE, r,
"[%s] The application does not have the privilege to call this method.", GetErrorMessage(r));
{
result r = E_SUCCESS;
- r = _AccessController::CheckUserPrivilege(_PRV_NETWORK_STATISTICS_WRITE);
- r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_OUT_OF_MEMORY);
- SysTryReturnResult(NID_NET, r == E_SUCCESS, r, "The application does not have the privilege to call this method.");
-
SysAssertf(__pNetStatisticsImpl != null, "Not yet constructed. Construct() should be called before use.");
r = __pNetStatisticsImpl->Reset(operationMode, netStatType);
{
result r = E_SUCCESS;
- r = _AccessController::CheckUserPrivilege(_PRV_NETWORK_STATISTICS_WRITE);
- r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_OUT_OF_MEMORY);
- SysTryReturnResult(NID_NET, r == E_SUCCESS, r, "The application does not have the privilege to call this method.");
-
SysAssertf(__pNetStatisticsImpl != null, "Not yet constructed. Construct() should be called before use.");
r = __pNetStatisticsImpl->ResetAll(operationMode);
{
UpdateConnectionInfo(profileHandle);
connection_profile_destroy(profileHandle);
-
-// ToDo - temporal fix
-#ifdef _OSP_EMUL_
- if (_pConnectionInfo->GetProxyAddress().IsEmpty())
- {
- char* pProxy = null;
-
- ret = connection_get_proxy(connectionHandle, CONNECTION_ADDRESS_FAMILY_IPV4, &pProxy);
- if ((ret == CONNECTION_ERROR_NONE) && (pProxy != null))
- {
- SysLog(NID_NET, "Proxy Address is [%s].", pProxy);
- _pConnectionInfo->SetProxyAddress(String(pProxy));
- free(pProxy);
- }
- }
-#endif // _OSP_EMUL_
-
}
else
{
String(*pGetMacAddressFunction)(const WifiDirectDeviceInfo& deviceinfo) = null;
// Get MAC address of the client
- pGetMacAddressFunction = reinterpret_cast<String(*)(const WifiDirectDeviceInfo& deviceinfo)>(dlsym(__pDllHandle, "_WifiDirectDeviceInfoImpl_GetVirtualMacAddress"));
+ pGetMacAddressFunction = reinterpret_cast<String(*)(const WifiDirectDeviceInfo& deviceinfo)>(dlsym(__pDllHandle, "_WifiDirectDeviceInfoImpl_GetMacAddress"));
SysTryReturnVoidResult(NID_NET, pGetMacAddressFunction != null, E_SYSTEM,
"[%s] A system error has been occurred. Failed to get a function pointer.", GetErrorMessage(E_SYSTEM));
String(*pGetMacAddressFunction)(const WifiDirectDeviceInfo& deviceinfo) = null;
// Get MAC address of the client
- pGetMacAddressFunction = reinterpret_cast<String(*)(const WifiDirectDeviceInfo& deviceinfo)>(dlsym(__pDllHandle, "_WifiDirectDeviceInfoImpl_GetVirtualMacAddress"));
+ pGetMacAddressFunction = reinterpret_cast<String(*)(const WifiDirectDeviceInfo& deviceinfo)>(dlsym(__pDllHandle, "_WifiDirectDeviceInfoImpl_GetMacAddress"));
SysTryReturnVoidResult(NID_NET, pGetMacAddressFunction != null, E_SYSTEM,
"[%s] A system error has been occurred. Failed to get a function pointer.", GetErrorMessage(E_SYSTEM));
"A system error has been occurred. Failed to get a function pointer.");
pGetMacAddressFunction = reinterpret_cast<String(*)(const WifiDirectDeviceInfo& deviceinfo)>
- (dlsym(__pDllHandle, "_WifiDirectDeviceInfoImpl_GetVirtualMacAddress"));
+ (dlsym(__pDllHandle, "_WifiDirectDeviceInfoImpl_GetMacAddress"));
SysTryReturnResult(NID_NET, pGetMacAddressFunction != null, E_SYSTEM,
"A system error has been occurred. Failed to get a function pointer.");
"A system error has been occurred. Failed to get DhcpClientInfo instance.");
pDhcpClientInfoImpl->__dhcpClientName = String(pPeerInfo->device_name);
- pDhcpClientInfoImpl->__macAddress = ConvertMacAddress((char*)pPeerInfo->interface_address);
+ pDhcpClientInfoImpl->__macAddress = ConvertMacAddress((char*)pPeerInfo->mac_address);
- pDhcpClientInfoImpl->__pLocalAddress.reset(new (std::nothrow) Ip4Address(pPeerInfo->ip_address));
+ pDhcpClientInfoImpl->__pLocalAddress.reset(new (std::nothrow) Ip4Address(pPeerInfo->ip_address));
SysTryReturnResult(NID_NET, pDhcpClientInfoImpl->__pLocalAddress != null, E_OUT_OF_MEMORY, "Memory allocation failed");
return r;
}
IList*
+_NetAccountDatabase::GetProfileNamesN(void)
+{
+ static const wchar_t _NET_ACCOUNT_DATABASE_GET_PROFILE_NAMES_STATEMENT[] =
+ L"SELECT profileName FROM NetAccountTable";
+
+ result r = E_SUCCESS;
+ Database accountDb;
+ unique_ptr<DbStatement> pStmt;
+ unique_ptr<DbEnumerator> pEnum;
+ unique_ptr<ArrayList, _CollectionDeleter> pList;
+
+ r = accountDb.Construct(_NetAccountDatabase::GetDbPath(), false);
+ SysTryReturn(NID_NET, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ pStmt.reset(accountDb.CreateStatementN(String(_NET_ACCOUNT_DATABASE_GET_PROFILE_NAMES_STATEMENT)));
+ r = GetLastResult();
+ SysTryReturn(NID_NET, pStmt != null, null, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ pList.reset(new (std::nothrow) ArrayList());
+ r = GetLastResult();
+ SysTryReturn(NID_NET, pList != null, null, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ r = pList->Construct();
+ SysTryReturn(NID_NET, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ pEnum.reset(accountDb.ExecuteStatementN(*pStmt));
+ r = GetLastResult();
+ SysTryReturn(NID_NET, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ if (pEnum != null)
+ {
+ while (pEnum->MoveNext() == E_SUCCESS)
+ {
+ unique_ptr<String> pProfileName(new (std::nothrow) String());
+ SysTryReturn(NID_NET, pProfileName != null, null, E_OUT_OF_MEMORY,
+ "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
+ r = pEnum->GetStringAt(0, *pProfileName);
+ SysTryReturn(NID_NET, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ r = pList->Add(*pProfileName);
+ SysTryReturn(NID_NET, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ pProfileName.release();
+ }
+ }
+
+ ClearLastResult(); // To suppress E_OUT_OF_RANGE
+
+ return pList.release();
+}
+
+IList*
_NetAccountDatabase::GetAppProfileNamesN(void)
{
static const wchar_t _NET_ACCOUNT_DATABASE_GET_PROFILE_NAMES_STATEMENT[] =
static result UpdateAccountName(NetAccountId accountId, const Tizen::Base::String& accountName);
static Tizen::Base::Collection::IListT<NetAccountId>* GetAccountIdsN(void);
static Tizen::Base::Collection::IList* GetAccountNamesN(void);
+ static Tizen::Base::Collection::IList* GetProfileNamesN(void);
static Tizen::Base::Collection::IList* GetAppProfileNamesN(void);
static result GetAccountName(NetAccountId accountId, Tizen::Base::String& accountName);
static result GetProfileName(NetAccountId accountId, Tizen::Base::String& profileName);
char* pAuthPassword = null;
char* pHomeUrl = null;
- ret = connection_profile_get_name(profileHandle, &pProfileName);
+ ret = connection_profile_get_id(profileHandle, &pProfileName);
SysTryReturnResult(NID_NET, ret == CONNECTION_ERROR_NONE, E_SYSTEM,
- "A system error has been occurred. The return value from connection_profile_get_name() is %d", ret);
+ "A system error has been occurred. The return value from connection_profile_get_id() is %d", ret);
profileName = String(pProfileName);
free(pProfileName);
static const char _WIFI_LIBRARY_NAME[] = "libosp-wifi.so";
+_NetProfileInfo::_NetProfileInfo(void)
+{
+}
+
+_NetProfileInfo::_NetProfileInfo(const String& profileName, const String& profileDisplayName)
+ : __profileName(profileName)
+ , __profileDisplayName(profileDisplayName)
+{
+}
+
+_NetProfileInfo::~_NetProfileInfo(void)
+{
+}
+
+String
+_NetProfileInfo::GetProfileName(void) const
+{
+ return __profileName;
+}
+
+String
+_NetProfileInfo::GetProfileDisplayName(void) const
+{
+ return __profileDisplayName;
+}
+
_NetAccountManagerImpl::_NetAccountManagerImpl(void)
: __pConnectionHandle(null)
{
char* pTempProfileName = null;
String tempProfileName;
- ret = connection_profile_get_name(profileHandle, &pTempProfileName);
+ ret = connection_profile_get_id(profileHandle, &pTempProfileName);
SysTryReturn(NID_NET, ret == CONNECTION_ERROR_NONE, null, E_SYSTEM,
- "[%s] A system error has been occurred. The return value from connection_profile_get_name() is %d",
+ "[%s] A system error has been occurred. The return value from connection_profile_get_id() is %d",
GetErrorMessage(E_SYSTEM), ret);
tempProfileName = String(pTempProfileName);
return matchingProfileHandle;
}
-String
-_NetAccountManagerImpl::GetInternetProfileName(void)
+_NetProfileInfo
+_NetAccountManagerImpl::GetInternetProfileInfo(void)
{
ClearLastResult();
- String profileName;
+ _NetProfileInfo profileInfo;
int ret = CONNECTION_ERROR_NONE;
connection_h connectionHandle = null;
- connection_profile_iterator_h iterator = null;
connection_profile_h profileHandle = null;
- connection_profile_type_e profileType = CONNECTION_PROFILE_TYPE_WIFI;
ret = connection_create(&connectionHandle);
- SysTryReturn(NID_NET, ret == CONNECTION_ERROR_NONE, profileName, E_SYSTEM,
+ SysTryReturn(NID_NET, ret == CONNECTION_ERROR_NONE, profileInfo, E_SYSTEM,
"[%s] A system error has been occurred. The return value from connection_create() is %d",
GetErrorMessage(E_SYSTEM), ret);
unique_ptr<void, _ConnectionDeleter> pConnectionHandle(connectionHandle);
- ret = connection_get_profile_iterator(connectionHandle,
- CONNECTION_ITERATOR_TYPE_REGISTERED, &iterator);
- SysTryReturn(NID_NET, ret == CONNECTION_ERROR_NONE, profileName, E_SYSTEM,
- "[%s] A system error has been occurred. The return value from connection_get_profile_iterator() is %d",
+ ret = connection_get_default_cellular_service_profile(connectionHandle, CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET, &profileHandle);
+ if ((ret != CONNECTION_ERROR_NONE) || (profileHandle == null))
+ {
+ SysLog(NID_NET, "Internet profile is not found, so search a prepaid-Internet profile.");
+
+ ret = connection_get_default_cellular_service_profile(connectionHandle, CONNECTION_CELLULAR_SERVICE_TYPE_PREPAID_INTERNET, &profileHandle);
+ }
+ SysTryReturn(NID_NET, profileHandle != null, profileInfo, E_INVALID_ACCOUNT,
+ "[%s] Internet(incl. prepaid) profile is not found.", GetErrorMessage(E_INVALID_ACCOUNT));
+ unique_ptr<void, _ProfileDeleter> pProfileHandle(profileHandle);
+
+ char* pProfileName = null;
+ char* pProfileDisplayName = null;
+ String profileName;
+ String profileDisplayName;
+
+ ret = connection_profile_get_id(profileHandle, &pProfileName);
+ SysTryReturn(NID_NET, ret == CONNECTION_ERROR_NONE, profileInfo, E_SYSTEM,
+ "[%s] A system error has been occurred. The return value from connection_profile_get_id() is %d",
GetErrorMessage(E_SYSTEM), ret);
- unique_ptr<void, _ProfileIteratorDeleter> pIterator(iterator);
- ret = connection_profile_iterator_next(iterator, &profileHandle);
- while ((ret == CONNECTION_ERROR_NONE) && (profileHandle != null))
- {
- char* pProfileName = null;
+ profileName = String(pProfileName);
+ free(pProfileName);
- ret = connection_profile_get_type(profileHandle, &profileType);
- SysTryReturn(NID_NET, ret == CONNECTION_ERROR_NONE, profileName, E_SYSTEM,
- "[%s] A system error has been occurred. The return value from connection_profile_get_type() is %d",
- GetErrorMessage(E_SYSTEM), ret);
+ ret = connection_profile_get_name(profileHandle, &pProfileDisplayName);
+ SysTryReturn(NID_NET, ret == CONNECTION_ERROR_NONE, profileInfo, E_SYSTEM,
+ "[%s] A system error has been occurred. The return value from connection_profile_get_name() is %d",
+ GetErrorMessage(E_SYSTEM), ret);
- if (profileType == CONNECTION_PROFILE_TYPE_CELLULAR)
- {
- connection_cellular_service_type_e serviceType = CONNECTION_CELLULAR_SERVICE_TYPE_UNKNOWN;
+ profileDisplayName = String(pProfileDisplayName);
+ free(pProfileDisplayName);
- ret = connection_profile_get_cellular_service_type(profileHandle, &serviceType);
- SysTryReturn(NID_NET, ret == CONNECTION_ERROR_NONE, profileName, E_SYSTEM,
- "[%s] A system error has been occurred. The return value from connection_profile_get_cellular_service_type() is %d",
- GetErrorMessage(E_SYSTEM), ret);
+ profileInfo = _NetProfileInfo(profileName, profileDisplayName);
- ret = connection_profile_get_name(profileHandle, &pProfileName);
- SysTryReturn(NID_NET, ret == CONNECTION_ERROR_NONE, profileName, E_SYSTEM,
- "[%s] A system error has been occurred. The return value from connection_profile_get_name() is %d",
- GetErrorMessage(E_SYSTEM), ret);
+ SysLog(NID_NET, "GetInternetProfileInfo() has been succeeded with profile[%ls][%ls]", profileInfo.GetProfileDisplayName().GetPointer(), profileInfo.GetProfileName().GetPointer());
- profileName = String(pProfileName);
- free(pProfileName);
+ return profileInfo;
+}
- if ((serviceType == CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET)
- || (serviceType == CONNECTION_CELLULAR_SERVICE_TYPE_PREPAID_INTERNET))
- {
- SysLog(NID_NET, "Internet profile is found.");
- break;
- }
- else
- {
- profileName.Clear();
- }
- }
- else
- {
- SysLog(NID_NET, "Ignore non-cellular profile.");
- }
+_NetProfileInfo
+_NetAccountManagerImpl::GetMmsProfileInfo(void)
+{
+ ClearLastResult();
- profileHandle = null;
- ret = connection_profile_iterator_next(iterator, &profileHandle);
+ _NetProfileInfo profileInfo;
+ int ret = CONNECTION_ERROR_NONE;
+ connection_h connectionHandle = null;
+ connection_profile_h profileHandle = null;
+
+ ret = connection_create(&connectionHandle);
+ SysTryReturn(NID_NET, ret == CONNECTION_ERROR_NONE, profileInfo, E_SYSTEM,
+ "[%s] A system error has been occurred. The return value from connection_create() is %d",
+ GetErrorMessage(E_SYSTEM), ret);
+ unique_ptr<void, _ConnectionDeleter> pConnectionHandle(connectionHandle);
+
+ ret = connection_get_default_cellular_service_profile(connectionHandle, CONNECTION_CELLULAR_SERVICE_TYPE_MMS, &profileHandle);
+ if ((ret != CONNECTION_ERROR_NONE) || (profileHandle == null))
+ {
+ SysLog(NID_NET, "MMS profile is not found, so search a prepaid-MMS profile.");
+
+ ret = connection_get_default_cellular_service_profile(connectionHandle, CONNECTION_CELLULAR_SERVICE_TYPE_PREPAID_MMS, &profileHandle);
}
+ SysTryReturn(NID_NET, profileHandle != null, profileInfo, E_INVALID_ACCOUNT,
+ "[%s] MMS(incl. prepaid) profile is not found.", GetErrorMessage(E_INVALID_ACCOUNT));
+ unique_ptr<void, _ProfileDeleter> pProfileHandle(profileHandle);
+
+ char* pProfileName = null;
+ char* pProfileDisplayName = null;
+ String profileName;
+ String profileDisplayName;
+
+ ret = connection_profile_get_id(profileHandle, &pProfileName);
+ SysTryReturn(NID_NET, ret == CONNECTION_ERROR_NONE, profileInfo, E_SYSTEM,
+ "[%s] A system error has been occurred. The return value from connection_profile_get_id() is %d",
+ GetErrorMessage(E_SYSTEM), ret);
- SysTryReturn(NID_NET, !profileName.IsEmpty(), profileName, E_INVALID_ACCOUNT,
- "[%s] Internet profile is not found.", GetErrorMessage(E_INVALID_ACCOUNT));
+ profileName = String(pProfileName);
+ free(pProfileName);
- SysLog(NID_NET, "GetInternetProfileName() has been succeeded with profile:%ls", profileName.GetPointer());
+ ret = connection_profile_get_name(profileHandle, &pProfileDisplayName);
+ SysTryReturn(NID_NET, ret == CONNECTION_ERROR_NONE, profileInfo, E_SYSTEM,
+ "[%s] A system error has been occurred. The return value from connection_profile_get_name() is %d",
+ GetErrorMessage(E_SYSTEM), ret);
+
+ profileDisplayName = String(pProfileDisplayName);
+ free(pProfileDisplayName);
+
+ profileInfo = _NetProfileInfo(profileName, profileDisplayName);
- return profileName;
+ SysLog(NID_NET, "GetMmsProfileInfo() has been succeeded with profile[%ls][%ls]", profileInfo.GetProfileDisplayName().GetPointer(), profileInfo.GetProfileName().GetPointer());
+
+ return profileInfo;
}
-String
-_NetAccountManagerImpl::GetMmsProfileName(void)
+IList*
+_NetAccountManagerImpl::GetAppProfileNamesN(void)
{
ClearLastResult();
- String profileName;
+ result r = E_SUCCESS;
int ret = CONNECTION_ERROR_NONE;
connection_h connectionHandle = null;
connection_profile_iterator_h iterator = null;
connection_profile_type_e profileType = CONNECTION_PROFILE_TYPE_WIFI;
ret = connection_create(&connectionHandle);
- SysTryReturn(NID_NET, ret == CONNECTION_ERROR_NONE, profileName, E_SYSTEM,
+ SysTryReturn(NID_NET, ret == CONNECTION_ERROR_NONE, null, E_SYSTEM,
"[%s] A system error has been occurred. The return value from connection_create() is %d",
GetErrorMessage(E_SYSTEM), ret);
unique_ptr<void, _ConnectionDeleter> pConnectionHandle(connectionHandle);
- ret = connection_get_profile_iterator(connectionHandle,
- CONNECTION_ITERATOR_TYPE_REGISTERED, &iterator);
- SysTryReturn(NID_NET, ret == CONNECTION_ERROR_NONE, profileName, E_SYSTEM,
+ unique_ptr<ArrayList, _CollectionDeleter> pList(new (std::nothrow) ArrayList());
+ SysTryReturn(NID_NET, pList != null, null, E_OUT_OF_MEMORY,
+ "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
+ r = pList->Construct();
+ SysTryReturn(NID_NET, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ ret = connection_get_profile_iterator(connectionHandle, CONNECTION_ITERATOR_TYPE_REGISTERED, &iterator);
+ SysTryReturn(NID_NET, ret == CONNECTION_ERROR_NONE, null, E_SYSTEM,
"[%s] A system error has been occurred. The return value from connection_get_profile_iterator() is %d",
GetErrorMessage(E_SYSTEM), ret);
unique_ptr<void, _ProfileIteratorDeleter> pIterator(iterator);
char* pProfileName = null;
ret = connection_profile_get_type(profileHandle, &profileType);
- SysTryReturn(NID_NET, ret == CONNECTION_ERROR_NONE, profileName, E_SYSTEM,
+ SysTryReturn(NID_NET, ret == CONNECTION_ERROR_NONE, null, E_SYSTEM,
"[%s] A system error has been occurred. The return value from connection_profile_get_type() is %d",
- GetErrorMessage(E_SYSTEM), ret);
+ GetErrorMessage(E_SYSTEM), ret);
if (profileType == CONNECTION_PROFILE_TYPE_CELLULAR)
{
connection_cellular_service_type_e serviceType = CONNECTION_CELLULAR_SERVICE_TYPE_UNKNOWN;
- ret = connection_profile_get_cellular_service_type(profileHandle,
- &serviceType);
- SysTryReturn(NID_NET, ret == CONNECTION_ERROR_NONE, profileName, E_SYSTEM,
+ ret = connection_profile_get_cellular_service_type(profileHandle, &serviceType);
+ SysTryReturn(NID_NET, ret == CONNECTION_ERROR_NONE, null, E_SYSTEM,
"[%s] A system error has been occurred. The return value from connection_profile_get_cellular_service_type() is %d",
GetErrorMessage(E_SYSTEM), ret);
- ret = connection_profile_get_name(profileHandle, &pProfileName);
- SysTryReturn(NID_NET, ret == CONNECTION_ERROR_NONE, profileName, E_SYSTEM,
- "[%s] A system error has been occurred. The return value from connection_profile_get_name() is %d",
- GetErrorMessage(E_SYSTEM), ret);
+ if (serviceType == CONNECTION_CELLULAR_SERVICE_TYPE_APPLICATION)
+ {
+ ret = connection_profile_get_id(profileHandle, &pProfileName);
+ SysTryReturn(NID_NET, ret == CONNECTION_ERROR_NONE, null, E_SYSTEM,
+ "[%s] A system error has been occurred. The return value from connection_profile_get_id() is %d",
+ GetErrorMessage(E_SYSTEM), ret);
- profileName = String(pProfileName);
- free(pProfileName);
+ unique_ptr<String> pProfileNameString(new (std::nothrow) String(pProfileName));
+ free(pProfileName);
+ SysTryReturn(NID_NET, pProfileNameString != null, null, E_OUT_OF_MEMORY,
+ "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
- if ((serviceType == CONNECTION_CELLULAR_SERVICE_TYPE_MMS)
- || (serviceType == CONNECTION_CELLULAR_SERVICE_TYPE_PREPAID_MMS))
- {
- SysLog(NID_NET, "MMS profile is found.");
- break;
+ r = pList->Add(*pProfileNameString);
+ SysTryReturn(NID_NET, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
+ pProfileNameString.release();
}
else
{
- profileName.Clear();
+ SysLog(NID_NET, "Ignore non-app profile.");
}
}
else
ret = connection_profile_iterator_next(iterator, &profileHandle);
}
- SysTryReturn(NID_NET, !profileName.IsEmpty(), profileName, E_INVALID_ACCOUNT,
- "[%s] MMS profile is not found.", GetErrorMessage(E_INVALID_ACCOUNT));
-
- SysLog(NID_NET, "GetMmsProfileName() has been succeeded with profile:%ls", profileName.GetPointer());
+ SysLog(NID_NET, "GetAppProfileNamesN() has been succeeded with profiles count:%d", pList->GetCount());
- return profileName;
+ return pList.release();
}
IList*
-_NetAccountManagerImpl::GetAppProfileNamesN(void)
+_NetAccountManagerImpl::GetAllProfileInfosN(void)
{
ClearLastResult();
ret = connection_profile_iterator_next(iterator, &profileHandle);
while ((ret == CONNECTION_ERROR_NONE) && (profileHandle != null))
{
- char* pProfileName = null;
-
ret = connection_profile_get_type(profileHandle, &profileType);
SysTryReturn(NID_NET, ret == CONNECTION_ERROR_NONE, null, E_SYSTEM,
"[%s] A system error has been occurred. The return value from connection_profile_get_type() is %d",
"[%s] A system error has been occurred. The return value from connection_profile_get_cellular_service_type() is %d",
GetErrorMessage(E_SYSTEM), ret);
- if (serviceType == CONNECTION_CELLULAR_SERVICE_TYPE_APPLICATION)
+ if ((serviceType == CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET)
+ || (serviceType == CONNECTION_CELLULAR_SERVICE_TYPE_PREPAID_INTERNET)
+ || (serviceType == CONNECTION_CELLULAR_SERVICE_TYPE_MMS)
+ || (serviceType == CONNECTION_CELLULAR_SERVICE_TYPE_PREPAID_MMS)
+ || (serviceType == CONNECTION_CELLULAR_SERVICE_TYPE_APPLICATION))
{
- ret = connection_profile_get_name(profileHandle, &pProfileName);
+ char* pProfileName = null;
+ char* pProfileDisplayName = null;
+ String profileName;
+ String profileDisplayName;
+
+ ret = connection_profile_get_id(profileHandle, &pProfileName);
+ SysTryReturn(NID_NET, ret == CONNECTION_ERROR_NONE, null, E_SYSTEM,
+ "[%s] A system error has been occurred. The return value from connection_profile_get_id() is %d",
+ GetErrorMessage(E_SYSTEM), ret);
+ profileName = String(pProfileName);
+ free(pProfileName);
+
+ ret = connection_profile_get_name(profileHandle, &pProfileDisplayName);
SysTryReturn(NID_NET, ret == CONNECTION_ERROR_NONE, null, E_SYSTEM,
"[%s] A system error has been occurred. The return value from connection_profile_get_name() is %d",
GetErrorMessage(E_SYSTEM), ret);
+ profileDisplayName = String(pProfileDisplayName);
+ free(pProfileDisplayName);
- unique_ptr<String> pProfileNameString(new (std::nothrow) String(pProfileName));
- free(pProfileName);
- SysTryReturn(NID_NET, pProfileNameString != null, null, E_OUT_OF_MEMORY,
- "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ unique_ptr<_NetProfileInfo> pProfileInfo(new (std::nothrow) _NetProfileInfo(profileName, profileDisplayName));
- r = pList->Add(*pProfileNameString);
+ SysLog(NID_NET, "Cellular profile is found: [%d][%ls][%ls].", serviceType, profileDisplayName.GetPointer(), profileName.GetPointer());
+
+ r = pList->Add(*pProfileInfo);
SysTryReturn(NID_NET, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
- pProfileNameString.release();
+ pProfileInfo.release();
}
else
{
ret = connection_profile_iterator_next(iterator, &profileHandle);
}
- SysLog(NID_NET, "GetAppProfileNamesN() has been succeeded with profiles count:%d", pList->GetCount());
+ SysLog(NID_NET, "GetAllProfileInfosN() has been succeeded with profiles count:%d", pList->GetCount());
return pList.release();
}
#include <FBaseDataType.h>
#include <FBaseObject.h>
+#include <FBaseString.h>
#include <FNetNetTypes.h>
#include "FNet_NetUtility.h"
-namespace Tizen { namespace Base
-{
-class String;
-} } // Tizen::Base
-
namespace Tizen { namespace Base { namespace Collection
{
class IList;
class NetAccountManager;
class _PsSystemNetConnection;
+class _NetProfileInfo
+ : public Tizen::Base::Object
+{
+public:
+ _NetProfileInfo(void);
+ _NetProfileInfo(const Tizen::Base::String& profileName, const Tizen::Base::String& profileDisplayName);
+ ~_NetProfileInfo(void);
+
+ Tizen::Base::String GetProfileName(void) const;
+ Tizen::Base::String GetProfileDisplayName(void) const;
+
+private:
+ Tizen::Base::String __profileName;
+ Tizen::Base::String __profileDisplayName;
+}; // _NetProfileInfo
+
class _NetAccountManagerImpl
: public Tizen::Base::Object
{
public:
static void* GetPsProfileHandleN(const Tizen::Base::String& profileName);
static void* GetWifiProfileHandleN(void);
- static Tizen::Base::String GetInternetProfileName(void);
- static Tizen::Base::String GetMmsProfileName(void);
+ static _NetProfileInfo GetInternetProfileInfo(void);
+ static _NetProfileInfo GetMmsProfileInfo(void);
static Tizen::Base::Collection::IList* GetAppProfileNamesN(void);
+ static Tizen::Base::Collection::IList* GetAllProfileInfosN(void);
static NetAccountInfo* CreateWifiNetAccountInfoN(void* pProfileInfo);
private:
return r;
}
+result
+_NetIpcProxy::ResetNetStatistics(NetBearerType bearerType, NetStatisticsInfoType statType)
+{
+ result r = E_SUCCESS;
+ unsigned long ret = 0;
+
+ SysLog(NID_NET, "ResetNetStatistics() has been called with bearer:%d stat:%d", bearerType, statType);
+
+ unique_ptr<IPC::Message> pMessage(new (std::nothrow) ConnectivityNetServiceMsg_resetNetStatistics(bearerType, statType, &ret));
+ SysTryReturnResult(NID_NET, pMessage != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+ r = __pIpcClient->SendRequest(*pMessage);
+ SysTryReturnResult(NID_NET, r == E_SUCCESS, E_SYSTEM, "A system error has been occurred.");
+ SysTryReturnResult(NID_NET, ret == E_SUCCESS, ret, "Propagating.");
+
+ return r;
+}
+
+result
+_NetIpcProxy::ResetAllNetStatistics(NetBearerType bearerType)
+{
+ result r = E_SUCCESS;
+ unsigned long ret = 0;
+
+ SysLog(NID_NET, "ResetAllNetStatistics() has been called with bearer:%d", bearerType);
+
+ unique_ptr<IPC::Message> pMessage(new (std::nothrow) ConnectivityNetServiceMsg_resetAllNetStatistics(bearerType, &ret));
+ SysTryReturnResult(NID_NET, pMessage != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+ r = __pIpcClient->SendRequest(*pMessage);
+ SysTryReturnResult(NID_NET, r == E_SUCCESS, E_SYSTEM, "A system error has been occurred.");
+ SysTryReturnResult(NID_NET, ret == E_SUCCESS, ret, "Propagating.");
+
+ return r;
+}
+
}} // Tizen::Net
result GetAppNetAccountId(const Tizen::Base::String& netProfileName, NetAccountId& netAccountId) const;
result SetNetAccountId(NetAccountId netAccountId, NetAccountId& netAccountId2);
result UpdateSystemNetAccount(const Tizen::Base::String& profileName, const NetAccountInfo& netAccountInfo, NetBearerType bearerType);
+ result ResetNetStatistics(NetBearerType bearerType, NetStatisticsInfoType statType);
+ result ResetAllNetStatistics(NetBearerType bearerType);
private:
_NetIpcProxy(void);
#include <FBaseSysLog.h>
#include "FNet_NetTypes.h"
#include "FNet_NetStatisticsImpl.h"
+#include "FNet_NetIpcProxy.h"
using namespace Tizen::Base;
result
_NetStatisticsImpl::Reset(NetBearerType operationMode, NetStatisticsInfoType netStatType)
{
- int err = CONNECTION_ERROR_NONE;
-
SysAssertf(__isConstructed, "Not yet constructed. Construct() should be called before use.");
- SysTryReturnResult(NID_NET, (operationMode == NET_BEARER_WIFI || operationMode == NET_BEARER_PS),
- E_INVALID_ARG, "Invalid argument is used.");
-
- //Reset net statistics info based on type
- switch (netStatType)
- {
- //supported cases
- case NET_STAT_RCVD_SIZE:
- if (operationMode == NET_BEARER_PS)
- {
- err = connection_reset_statistics(CONNECTION_TYPE_CELLULAR, CONNECTION_STATISTICS_TYPE_LAST_RECEIVED_DATA);
- }
- else if (operationMode == NET_BEARER_WIFI)
- {
- err = connection_reset_statistics(CONNECTION_TYPE_WIFI, CONNECTION_STATISTICS_TYPE_LAST_RECEIVED_DATA);
- }
- else
- {
- // should not reach here.
- SysLog(NID_NET, "_NetStatisticsImpl::Reset invalid mode: %d", operationMode);
- SysTryReturnResult(NID_NET, false, E_INVALID_ARG, "Invalid argument is used.");
- }
-
- break;
-
- case NET_STAT_SENT_SIZE:
- if (operationMode == NET_BEARER_PS)
- {
- err = connection_reset_statistics(CONNECTION_TYPE_CELLULAR, CONNECTION_STATISTICS_TYPE_LAST_SENT_DATA);
- }
- else if (operationMode == NET_BEARER_WIFI)
- {
- err = connection_reset_statistics(CONNECTION_TYPE_WIFI, CONNECTION_STATISTICS_TYPE_LAST_SENT_DATA);
- }
- else
- {
- // should not reach here.
- SysLog(NID_NET, "_NetStatisticsImpl::Reset invalid mode: %d", operationMode);
- SysTryReturnResult(NID_NET, false, E_INVALID_ARG, "Invalid argument is used.");
- }
-
- break;
-
- case NET_STAT_TOTAL_RCVD_SIZE:
- if (operationMode == NET_BEARER_PS)
- {
- err = connection_reset_statistics(CONNECTION_TYPE_CELLULAR, CONNECTION_STATISTICS_TYPE_TOTAL_RECEIVED_DATA);
- }
- else if (operationMode == NET_BEARER_WIFI)
- {
- err = connection_reset_statistics(CONNECTION_TYPE_WIFI, CONNECTION_STATISTICS_TYPE_TOTAL_RECEIVED_DATA);
- }
- else
- {
- // should not reach here.
- SysLog(NID_NET, "_NetStatisticsImpl::Reset invalid mode: %d", operationMode);
- SysTryReturnResult(NID_NET, false, E_INVALID_ARG, "Invalid argument is used.");
- }
-
- break;
-
- case NET_STAT_TOTAL_SENT_SIZE:
- if (operationMode == NET_BEARER_PS)
- {
- err = connection_reset_statistics(CONNECTION_TYPE_CELLULAR, CONNECTION_STATISTICS_TYPE_TOTAL_SENT_DATA);
- }
- else if (operationMode == NET_BEARER_WIFI)
- {
- err = connection_reset_statistics(CONNECTION_TYPE_WIFI, CONNECTION_STATISTICS_TYPE_TOTAL_SENT_DATA);
- }
- else
- {
- // should not reach here.
- SysLog(NID_NET, "_NetStatisticsImpl::Reset invalid mode: %d", operationMode);
- SysTryReturnResult(NID_NET, false, E_INVALID_ARG, "Invalid argument is used.");
- }
-
- break;
+ result r = E_SUCCESS;
- default:
- SysTryReturnResult(NID_NET, false, E_INVALID_ARG, "Invalid argument is used.");
+ _NetIpcProxy* pProxy = _NetIpcProxy::GetInstance();
+ SysTryReturnResult(NID_NET, pProxy != null, E_SYSTEM,
+ "A system error has been occurred. Failed to get an IPC proxy.");
- break;
- }
+ r = pProxy->ResetNetStatistics(operationMode, netStatType);
+ SysTryReturnResult(NID_NET, r == E_SUCCESS, r, "Propagating.");
- // make sure u catch error
- SysLog(NID_NET, "_NetStatisticsImpl::Reset err code: %d", err);
- SysTryReturnResult(NID_NET, err == CONNECTION_ERROR_NONE, E_SYSTEM, "A system error has been occurred. Operation failed .");
-
- return E_SUCCESS;
+ return r;
}
result
_NetStatisticsImpl::ResetAll(NetBearerType operationMode)
{
- int err = CONNECTION_ERROR_NONE;
-
SysAssertf(__isConstructed, "Not yet constructed. Construct() should be called before use.");
- //we support only PS and WIFI
- if (operationMode == NET_BEARER_PS)
- {
- err = connection_reset_statistics(CONNECTION_TYPE_CELLULAR, CONNECTION_STATISTICS_TYPE_LAST_RECEIVED_DATA);
- SysTryReturnResult(NID_NET, err == CONNECTION_ERROR_NONE, E_SYSTEM, "A system error has been occurred. Operation failed .");
-
- err = connection_reset_statistics(CONNECTION_TYPE_CELLULAR, CONNECTION_STATISTICS_TYPE_LAST_SENT_DATA);
- SysTryReturnResult(NID_NET, err == CONNECTION_ERROR_NONE, E_SYSTEM, "A system error has been occurred. Operation failed .");
-
- err = connection_reset_statistics(CONNECTION_TYPE_CELLULAR, CONNECTION_STATISTICS_TYPE_TOTAL_RECEIVED_DATA);
- SysTryReturnResult(NID_NET, err == CONNECTION_ERROR_NONE, E_SYSTEM, "A system error has been occurred. Operation failed .");
-
- err = connection_reset_statistics(CONNECTION_TYPE_CELLULAR, CONNECTION_STATISTICS_TYPE_TOTAL_SENT_DATA);
- SysTryReturnResult(NID_NET, err == CONNECTION_ERROR_NONE, E_SYSTEM, "A system error has been occurred. Operation failed .");
-
- }
- else if (operationMode == NET_BEARER_WIFI)
- {
- err = connection_reset_statistics(CONNECTION_TYPE_WIFI, CONNECTION_STATISTICS_TYPE_LAST_SENT_DATA);
- SysTryReturnResult(NID_NET, err == CONNECTION_ERROR_NONE, E_SYSTEM, "A system error has been occurred. Operation failed .");
-
- err = connection_reset_statistics(CONNECTION_TYPE_WIFI, CONNECTION_STATISTICS_TYPE_LAST_RECEIVED_DATA);
- SysTryReturnResult(NID_NET, err == CONNECTION_ERROR_NONE, E_SYSTEM, "A system error has been occurred. Operation failed .");
-
- err = connection_reset_statistics(CONNECTION_TYPE_WIFI, CONNECTION_STATISTICS_TYPE_TOTAL_SENT_DATA);
- SysTryReturnResult(NID_NET, err == CONNECTION_ERROR_NONE, E_SYSTEM, "A system error has been occurred. Operation failed .");
-
- err = connection_reset_statistics(CONNECTION_TYPE_WIFI, CONNECTION_STATISTICS_TYPE_TOTAL_RECEIVED_DATA);
- SysTryReturnResult(NID_NET, err == CONNECTION_ERROR_NONE, E_SYSTEM, "A system error has been occurred. Operation failed .");
- }
- else
- {
- // we dont support other bearer types
- SysTryReturnResult(NID_NET, false, E_INVALID_ARG, "Invalid argument is used.");
+ result r = E_SUCCESS;
- }
+ _NetIpcProxy* pProxy = _NetIpcProxy::GetInstance();
+ SysTryReturnResult(NID_NET, pProxy != null, E_SYSTEM,
+ "A system error has been occurred. Failed to get an IPC proxy.");
- // make sure u catch error
- SysLog(NID_NET, "_NetStatisticsImpl::ResetAll err code: %d", err);
- SysTryReturnResult(NID_NET, err == CONNECTION_ERROR_NONE, E_SYSTEM, "A system error has been occurred. Operation failed .");
+ r = pProxy->ResetAllNetStatistics(operationMode);
+ SysTryReturnResult(NID_NET, r == E_SUCCESS, r, "Propagating.");
- return E_SUCCESS;
+ return r;
}
_NetStatisticsImpl*
NetConnectionState connectionState = pConnection->GetConnectionState();
bool isConnected = false;
char* pProfileName = null;
+ char* pProfileDisplayName = null;
int ret = CONNECTION_ERROR_NONE;
connection_profile_h profileHandle = pConnection->GetProfileHandle();
connection_profile_state_e state = CONNECTION_PROFILE_STATE_DISCONNECTED;
ret = connection_profile_refresh(profileHandle);
SysLog(NID_NET, "The return value from connection_profile_refresh() is %d", ret);
- ret = connection_profile_get_name(profileHandle, &pProfileName);
+ ret = connection_profile_get_id(profileHandle, &pProfileName);
+ SysLog(NID_NET, "The return value from connection_profile_get_id() is %d", ret);
+ ret = connection_profile_get_name(profileHandle, &pProfileDisplayName);
SysLog(NID_NET, "The return value from connection_profile_get_name() is %d", ret);
ret = connection_profile_get_state(profileHandle, &state);
SysLog(NID_NET, "The return value from connection_profile_get_state() is %d", ret);
- SysLog(NID_NET, "PsOpenCallback() has been called with res:%d, state:%d, name%s", res, state, pProfileName);
+ SysLog(NID_NET, "PsOpenCallback() has been called with res:%d, state:%d, name:[%s][%s]", res, state, pProfileDisplayName, pProfileName);
if ((res == CONNECTION_ERROR_NONE) && (state == CONNECTION_PROFILE_STATE_CONNECTED))
{
}
free(pProfileName);
+ free(pProfileDisplayName);
if (connectionState != NET_CONNECTION_STATE_STARTING)
{
NetConnectionState connectionState = pConnection->GetConnectionState();
bool isConnected = false;
char* pProfileName = null;
+ char* pProfileDisplayName = null;
int ret = CONNECTION_ERROR_NONE;
connection_profile_h profileHandle = pConnection->GetProfileHandle();
connection_profile_state_e state = CONNECTION_PROFILE_STATE_DISCONNECTED;
ret = connection_profile_refresh(profileHandle);
SysLog(NID_NET, "The return value from connection_profile_refresh() is %d", ret);
- ret = connection_profile_get_name(profileHandle, &pProfileName);
+ ret = connection_profile_get_id(profileHandle, &pProfileName);
+ SysLog(NID_NET, "The return value from connection_profile_get_id() is %d", ret);
+ ret = connection_profile_get_name(profileHandle, &pProfileDisplayName);
SysLog(NID_NET, "The return value from connection_profile_get_name() is %d", ret);
ret = connection_profile_get_state(profileHandle, &state);
SysLog(NID_NET, "The return value from connection_profile_get_state() is %d", ret);
- SysLog(NID_NET, "PsCloseCallback() has been called with res:%d, state:%d, name:%s", res, state, pProfileName);
+ SysLog(NID_NET, "PsCloseCallback() has been called with res:%d, state:%d, name:[%s][%s]", res, state, pProfileDisplayName, pProfileName);
if ((res == CONNECTION_ERROR_NONE) && (state == CONNECTION_PROFILE_STATE_CONNECTED))
{
}
free(pProfileName);
+ free(pProfileDisplayName);
if (connectionState != NET_CONNECTION_STATE_STOPPING)
{
NetConnectionState connectionState = pConnection->GetConnectionState();
bool isConnected = false;
char* pProfileName = null;
+ char* pProfileDisplayName = null;
int ret = CONNECTION_ERROR_NONE;
connection_profile_h profileHandle = pConnection->GetProfileHandle();
ret = connection_profile_refresh(profileHandle);
SysLog(NID_NET, "The return value from connection_profile_refresh() is %d", ret);
- ret = connection_profile_get_name(profileHandle, &pProfileName);
+ ret = connection_profile_get_id(profileHandle, &pProfileName);
+ SysLog(NID_NET, "The return value from connection_profile_get_id() is %d", ret);
+ ret = connection_profile_get_name(profileHandle, &pProfileDisplayName);
SysLog(NID_NET, "The return value from connection_profile_get_name() is %d", ret);
- SysLog(NID_NET, "PsStateChangedCallback() has been called with state:%d, name:%s", state, pProfileName);
+ SysLog(NID_NET, "PsStateChangedCallback() has been called with state:%d, name:[%s][%s]", state, pProfileDisplayName, pProfileName);
if (state == CONNECTION_PROFILE_STATE_CONNECTED)
{
}
free(pProfileName);
+ free(pProfileDisplayName);
if ((connectionState == NET_CONNECTION_STATE_STARTING) || (connectionState == NET_CONNECTION_STATE_STOPPING))
{
{
result r = E_SUCCESS;
NetAccountId accountId = INVALID_HANDLE;
+ String accountName;
__pPsSystemConnectionMap = new (std::nothrow) HashMap();
SysTryReturnVoidResult(NID_NET, __pPsSystemConnectionMap != null, E_OUT_OF_MEMORY,
SysTryReturnVoidResult(NID_NET, r == E_SUCCESS, r,
"[%s] A system error has been occurred. Failed to initialize the network database.", GetErrorMessage(r));
- String internetProfileName = _NetAccountManagerImpl::GetInternetProfileName();
- String mmsProfileName = _NetAccountManagerImpl::GetMmsProfileName();
+ _NetProfileInfo internetProfileInfo = _NetAccountManagerImpl::GetInternetProfileInfo();
+ _NetProfileInfo mmsProfileInfo = _NetAccountManagerImpl::GetMmsProfileInfo();
String profileName;
r = _NetAccountDatabase::GetProfileName(_DEFAULT_PS_ACCOUNT_ID, profileName);
- if (internetProfileName.IsEmpty())
+ if (internetProfileInfo.GetProfileName().IsEmpty())
{
SysLog(NID_NET, "Internet profile is not found.");
}
else
{
- if (internetProfileName != profileName)
+ if (internetProfileInfo.GetProfileName() != profileName)
{
- SysLog(NID_NET, "Internet profile is changed. [%ls] -> [%ls]", profileName.GetPointer(), internetProfileName.GetPointer());
+ SysLog(NID_NET, "Internet profile is changed. [%ls] -> [%ls]", profileName.GetPointer(), internetProfileInfo.GetProfileName().GetPointer());
if (!profileName.IsEmpty())
{
r = _NetAccountDatabase::RemoveAccountByAccountId(_DEFAULT_PS_ACCOUNT_ID);
}
- r = _NetAccountDatabase::AddAccount(internetProfileName, internetProfileName, _NET_ACCOUNT_OWNER_SYSTEM_INTERNET, accountId);
+ r = _NetAccountDatabase::RemoveAccountByProfileName(internetProfileInfo.GetProfileName());
+
+ accountName.Clear();
+ accountName.Append(internetProfileInfo.GetProfileDisplayName());
+ accountName.Append(internetProfileInfo.GetProfileName());
+
+ r = _NetAccountDatabase::AddAccount(accountName, internetProfileInfo.GetProfileName(), _NET_ACCOUNT_OWNER_SYSTEM_INTERNET, accountId);
}
}
profileName.Clear();
r = _NetAccountDatabase::GetProfileName(_DEFAULT_MMS_ACCOUNT_ID, profileName);
- if (mmsProfileName.IsEmpty())
+ if (mmsProfileInfo.GetProfileName().IsEmpty())
{
SysLog(NID_NET, "MMS profile is not found.");
}
else
{
- if (mmsProfileName != profileName)
+ if (mmsProfileInfo.GetProfileName() != profileName)
{
- SysLog(NID_NET, "MMS profile is changed. [%ls] -> [%ls]", profileName.GetPointer(), mmsProfileName.GetPointer());
+ SysLog(NID_NET, "MMS profile is changed. [%ls] -> [%ls]", profileName.GetPointer(), mmsProfileInfo.GetProfileName().GetPointer());
if (!profileName.IsEmpty())
{
r = _NetAccountDatabase::RemoveAccountByAccountId(_DEFAULT_MMS_ACCOUNT_ID);
}
- r = _NetAccountDatabase::AddAccount(mmsProfileName, mmsProfileName, _NET_ACCOUNT_OWNER_SYSTEM_MMS, accountId);
+ r = _NetAccountDatabase::RemoveAccountByProfileName(mmsProfileInfo.GetProfileName());
+
+ accountName.Clear();
+ accountName.Append(mmsProfileInfo.GetProfileDisplayName());
+ accountName.Append(mmsProfileInfo.GetProfileName());
+
+ r = _NetAccountDatabase::AddAccount(accountName, mmsProfileInfo.GetProfileName(), _NET_ACCOUNT_OWNER_SYSTEM_MMS, accountId);
}
}
- unique_ptr<IList, _CollectionDeleter> pAccountList(_NetAccountDatabase::GetAppProfileNamesN());
- unique_ptr<IList, _CollectionDeleter> pProfileList(_NetAccountManagerImpl::GetAppProfileNamesN());
+ unique_ptr<IList, _CollectionDeleter> pAccountList(_NetAccountDatabase::GetProfileNamesN());
+ unique_ptr<IList, _CollectionDeleter> pProfileList(_NetAccountManagerImpl::GetAllProfileInfosN());
if (pProfileList != null)
{
unique_ptr<IEnumerator> pEnum(pProfileList->GetEnumeratorN());
if (pEnum != null)
{
- String* pProfileName = null;
+ _NetProfileInfo* pProfileInfo = null;
while (pEnum->MoveNext() == E_SUCCESS)
{
- pProfileName = dynamic_cast<String*>(pEnum->GetCurrent());
- if (pProfileName != null)
+ pProfileInfo = dynamic_cast<_NetProfileInfo*>(pEnum->GetCurrent());
+ if (pProfileInfo != null)
{
- if (pAccountList->Contains(*pProfileName))
+ if (pAccountList->Contains(pProfileInfo->GetProfileName()))
{
- SysLog(NID_NET, "ProfileName[%ls] is already on DB.", pProfileName->GetPointer());
- pAccountList->Remove(*pProfileName, true);
+ SysLog(NID_NET, "ProfileName[%ls] is already on DB.", pProfileInfo->GetProfileName().GetPointer());
+ pAccountList->Remove(pProfileInfo->GetProfileName(), true);
}
else
{
- // OSP account
- SysLog(NID_NET, "ProfileName[%ls] is not found on DB, so add it.", pProfileName->GetPointer());
- r = _NetAccountDatabase::AddAccount(*pProfileName, *pProfileName, _NET_ACCOUNT_OWNER_OTHER, accountId);
+ // OSP or Non-default account
+ accountName.Clear();
+ accountName.Append(pProfileInfo->GetProfileDisplayName());
+ accountName.Append(pProfileInfo->GetProfileName());
+
+ SysLog(NID_NET, "ProfileName[%ls] is not found on DB, so add it.", pProfileInfo->GetProfileName().GetPointer());
+ r = _NetAccountDatabase::AddAccount(accountName, pProfileInfo->GetProfileName(), _NET_ACCOUNT_OWNER_OTHER, accountId);
}
}
}
return r;
}
+result
+HttpTransaction::SetServerCertificateVerification(NetHttpCertificateVerificationFlag flag)
+{
+ result r = E_SUCCESS;
+
+ r = __pHttpTransactionImpl->SetServerCertificateVerification(flag);
+ SysTryReturnResult(NID_NET_HTTP, r == E_SUCCESS, r, "Propagating.");
+
+ return r;
+}
+
} } } // Tizen::Net::Http
#include <FApp_AppInfo.h>
#include <FIoDirectory.h>
#include "FNetHttp_HttpCommon.h"
+#include "FNetHttp_HttpTransactionEvent.h"
using namespace std;
using namespace Tizen::Base;
"_HTTP_TRANSACTION_EVENT_TYPE_DOWNLOAD_PROGRESS"
};
+static const char* NetHttpCertificateVerificationFlagToString[] =
+{
+ "HTTP_CV_FLAG_AUTOMATIC",
+ "HTTP_CV_FLAG_MANUAL",
+ "HTTP_CV_FLAG_IGNORED"
+};
+
+const char*
+_HttpUtility::ConvertHttpTransactionEventTypeToString(_HttpTransactionEventType type)
+{
+ return NetHttpTransactionEventTypesToString[type];
+}
+
const char*
-_HttpUtility::ConvertHttpTransactionEventTypeToString(_HttpTransactionEventType index)
+_HttpUtility::ConvertNetHttpCertificateVerificationFlagToString(NetHttpCertificateVerificationFlag flag)
{
- return NetHttpTransactionEventTypesToString[index];
+ return NetHttpCertificateVerificationFlagToString[flag];
}
void
}
result
-_HttpUtility::AddSslCertInfo(_HttpSslInfo & sslInfo)
+_HttpUtility::SetSslCertInfo(_HttpSslInfo & sslInfo)
{
result r = E_SUCCESS;
return r;
}
-IList*
-_HttpUtility::GetSslCertInfoN(int socketFd)
+_HttpSslInfo*
+_HttpUtility::GetSslCertInfo(int socketFd)
{
ClearLastResult();
- unique_ptr<IList> pResultList(new (std::nothrow)LinkedList());
- SysTryReturn(NID_NET_HTTP, pResultList != null, null, E_OUT_OF_MEMORY,
- "[E_OUT_OF_MEMORY] Memory allocation failed.");
-
IList* pServerCertList = GetSslCertList();
Mutex* pHttpMutex = GetHttpMutex();
_HttpSslInfo* pSSLInfo = null;
if (pSSLInfo->GetSocketFd() == socketFd)
{
SysLog(NID_NET_HTTP, "Found the same server cert.");
- pResultList->Add(*pSSLInfo);
+ return pSSLInfo;
}
}
- return pResultList.release();
+ return null;
}
result
-_HttpUtility::RemoveSslCertInfo(int socketFd)
+_HttpUtility::RemoveSslCertInfo(_HttpSslInfo & sslInfo)
{
ClearLastResult();
result r = E_SUCCESS;
Mutex* pHttpMutex = GetHttpMutex();
- _HttpSslInfo* pSSLInfo = null;
IList *pServerCertList = GetSslCertList();
- unique_ptr<IList> pResultList(GetSslCertInfoN(socketFd));
- SysTryReturnResult(NID_NET_HTTP, pResultList != null, E_OUT_OF_MEMORY,
- "Memory allocation failed.");
-
MutexGuard locked(*pHttpMutex);
SysTryReturnResult(NID_NET_HTTP, locked.IsLocked(), E_SYSTEM,
"Failed to lock mutex.");
- unique_ptr<IEnumerator> pEnum(pResultList->GetEnumeratorN());
- while (pEnum->MoveNext() == E_SUCCESS)
- {
- pSSLInfo = dynamic_cast< _HttpSslInfo* >(pEnum->GetCurrent());
- SysTryReturnResult(NID_NET_HTTP, pSSLInfo != null, E_OUT_OF_MEMORY,
- "Memory allocation failed.");
-
- SysLog(NID_NET_HTTP, "Found the server cert. socketFd(%d), depth(%d)", pSSLInfo->GetSocketFd(), pSSLInfo->GetDepth());
- pServerCertList->Remove(*pSSLInfo, false);
- }
-
- pResultList->RemoveAll(true);
+ pServerCertList->Remove(sslInfo, true);
return r;
}
__depth = depth;
__serverCert = serverCert;
__errorMessage = errorMessage;
+ __pHttpTransactionEvent = null;
+ __flag = HTTP_CV_FLAG_AUTOMATIC;
+}
+
+_HttpSslInfo::_HttpSslInfo(int socketFd, _HttpTransactionEvent* pHttpTransactionEvent)
+{
+ __socketFd = socketFd;
+ __depth = -1;
+ __pHttpTransactionEvent = pHttpTransactionEvent;
+ __flag = HTTP_CV_FLAG_MANUAL;
}
_HttpSslInfo::~_HttpSslInfo()
return __socketFd;
}
+_HttpTransactionEvent*
+_HttpSslInfo::GetHttpTransactionEvent(void) const
+{
+ return __pHttpTransactionEvent;
+}
+
+NetHttpCertificateVerificationFlag
+_HttpSslInfo::GetCertificateVerificationFlag(void) const
+{
+ return __flag;
+}
+
} } } // Tizen::Net::Http
}
};
+struct _CollectionDeleter
+{
+ template<typename Collection>
+ void operator()(Collection* pCollection)
+ {
+ pCollection->RemoveAll(true);
+ delete pCollection;
+ }
+};
+
+struct _CharDeleter
+{
+ void operator()(char* pBytes)
+ {
+ free(pBytes);
+ }
+};
+
+struct _X509Deleter
+{
+ void operator()(X509* pCert)
+ {
+ X509_free(pCert);
+ }
+};
+
+struct _X509ChainDeleter
+{
+ void operator()(STACK_OF(X509)* pCertChain)
+ {
+ sk_X509_free(pCertChain);
+ }
+};
+
+
} } } //Tizen::Net::Http
#endif // _FNET_HTTP_INTERNAL_HTTP_DELETER_H_
{
if (_HttpUtility::IsSslError(curlCode))
{
- IList* pSslList = _HttpUtility::GetSslCertInfoN(pHttpTransactionUserData->GetSocketFd());
- if (pSslList == null || pSslList->GetCount() == 0)
+ _HttpSslInfo* pSSLInfo = _HttpUtility::GetSslCertInfo(pHttpTransactionUserData->GetSocketFd());
+
+ if (pSSLInfo == null)
{
if (curlCode == CURLE_SSL_CACERT || curlCode == CURLE_SSL_ISSUER_ERROR || curlCode == CURLE_SSL_CRL_BADFILE || curlCode == CURLE_SSL_CACERT_BADFILE)
{
}
else
{
- IEnumerator* pEnum = null;
- _HttpSslInfo* pSSLInfo = null;
-
- pEnum = pSslList->GetEnumeratorN();
- while (pEnum->MoveNext() == E_SUCCESS)
+ if (pSSLInfo->GetCertificateVerificationFlag() == HTTP_CV_FLAG_MANUAL)
{
- _HttpSslInfo* pTempSSLInfo = dynamic_cast< _HttpSslInfo* >(pEnum->GetCurrent());
- SysAssertf(pTempSSLInfo != null, "The pTempSSLInfo must hot be null.");
-
- if (pSSLInfo == null || pTempSSLInfo->GetDepth() < pSSLInfo->GetDepth())
+ r = _HttpUtility::RemoveSslCertInfo(*pSSLInfo);
+ if (IsFailed(r))
{
- pSSLInfo = pTempSSLInfo;
- SysLog(NID_NET_HTTP, "The value of _HttpSslInfo is depth(%d), Subject(%ls).", pSSLInfo->GetDepth(), pSSLInfo->GetServerCert().GetPointer());
+ SysLogException(NID_NET_HTTP, E_SYSTEM, "[E_SYSTEM] Failed to remove the server cert.");
}
+
+ SysLog(NID_NET_HTTP, "The server certificate verification is failed by user.");
+
+ //Fire the event(_HTTP_TRANSACTION_EVENT_TYPE_ABORTED)
+ pHttpTransactionEvent->FireTransactionAbortedEvent(E_HTTP_USER);
+
+ goto FINISH;
}
- delete pEnum;
+
+ SysLog(NID_NET_HTTP, "The value of _HttpSslInfo is depth(%d), Subject(%ls).", pSSLInfo->GetDepth(), pSSLInfo->GetServerCert().GetPointer());
SysLog(NID_NET_HTTP, "SERVER CERT FAIL(Reason: %ls)", pSSLInfo->GetErrorMessage().GetPointer());
String* pServerCert = new (std::nothrow) String(pSSLInfo->GetServerCert());
- r = _HttpUtility::RemoveSslCertInfo(pHttpTransactionUserData->GetSocketFd());
+ r = _HttpUtility::RemoveSslCertInfo(*pSSLInfo);
if (IsFailed(r))
{
SysLogException(NID_NET_HTTP, E_SYSTEM, "[E_SYSTEM] Failed to remove the server cert.");
}
}
- delete pSslList;
}
else
{
}
result
+_HttpRequestImpl::Set(_HttpRequestImpl* pHttpRequestImpl)
+{
+ result r = E_SUCCESS;
+
+ HttpHeader* pHttpHeader = null;
+ HttpHeader* pSrcHttpHeader = null;
+
+ //Sets member variables.
+ __method = pHttpRequestImpl->GetMethod();
+ pHttpRequestImpl->GetCustomMethod(__customMethodName);
+ __methodName = pHttpRequestImpl->GetMethodName();
+ __httpVersion = pHttpRequestImpl->GetVersion();
+ pHttpRequestImpl->GetUri(__uri);
+ __cookieValue = pHttpRequestImpl->GetCookie();
+ __encoding = pHttpRequestImpl->GetAcceptEncoding();
+ __pIHttpEntity = pHttpRequestImpl->GetEntity();
+
+ pHttpHeader = pHttpRequestImpl->GetHeader();
+
+ //Sets request buffer. (message queue).
+ ByteBuffer* pBuffer = null;
+ do
+ {
+ pBuffer = pHttpRequestImpl->ReadBodyN();
+ if (pBuffer)
+ {
+ this->WriteBody(*pBuffer);
+ }
+ }
+ while(pBuffer != null);
+
+ // Sets the headers.
+ pSrcHttpHeader = new (std::nothrow) HttpHeader(pHttpHeader);
+ SysTryReturn(NID_NET_HTTP, pSrcHttpHeader != null, null, E_OUT_OF_MEMORY,
+ "[E_OUT_OF_MEMORY] Memory allocation failed.");
+
+ __pHttpRequest->_pHeader = pSrcHttpHeader;
+
+ return r;
+}
+
+result
_HttpRequestImpl::SetCookie(const Tizen::Base::String& cookieString)
{
result r = E_SUCCESS;
void
_HttpSessionImpl::IgnoreSslVerification(void)
{
+ SysLog(NID_NET_HTTP, "Ignore to verify server certificate of current HttpSession[%d]", __sessionId);
__isAlreadyResumed = true;
}
}
HttpTransaction*
-_HttpSessionImpl::OpenTransactionWithCurlN(CURL* pCurl)
+_HttpSessionImpl::OpenTransactionWithCurlN(CURL* pCurl, bool uncheckedMaxTransactions)
{
SysAssertf(!__isClosed, "The HttpSession[%d] has been closed.", __sessionId);
unique_ptr<HttpTransaction> pHttpTransaction;
_HttpTransactionImpl* pHttpTransactionImpl = null;
- if (__sessionMode != NET_HTTP_SESSION_MODE_MULTIPLE_HOST)
+ if (__sessionMode != NET_HTTP_SESSION_MODE_MULTIPLE_HOST && !uncheckedMaxTransactions)
{
SysTryReturn(NID_NET_HTTP, __countOfTransaction < GetMaxTransactionCount(), null, E_MAX_EXCEEDED,
"[E_MAX_EXCEEDED] Number(%d) of HttpTransaction exceeds max HttpTransaction count(%d).", __countOfTransaction, GetMaxTransactionCount());
SysTryReturn(NID_NET_HTTP, r == E_SUCCESS, null, r,
"[%s] Failed to construct the HttpTransaction.", GetErrorMessage(r));
- if (__isAlreadyResumed == true)
+ if (__isAlreadyResumed == true && __sessionMode != NET_HTTP_SESSION_MODE_MULTIPLE_HOST)
{
pHttpTransactionImpl->IgnoreSslVerification();
SysLog(NID_NET_HTTP, "Ignore SSL verification.");
unique_ptr<HttpTransaction> pCreatedTransaction;
_HttpTransactionImpl* pCreatedTransactionImpl = null;
- _HttpRequestImpl* pCreatedHttpRequestImpl = null;
-
_HttpTransactionImpl* pHttpTransactionImpl = null;
- HttpRequest* pHttpRequest = null;
- _HttpRequestImpl* pHttpRequestImpl = null;
- _HttpAuthenticationImpl* pAuthenticationImpl = null;
-
- ByteBuffer bodyBuffer;
- ByteBuffer* pRequestBuffer = null;
- String uri;
- NetHttpMethod method;
- ArrayListT< IHttpTransactionEventListener* > listenerList;
- Object* pUserData = null;
pHttpTransactionImpl = _HttpTransactionImpl::GetInstance(httpTransaction);
SysTryReturn(NID_NET_HTTP, pHttpTransactionImpl != null, null, E_SYSTEM,
"[E_SYSTEM] An internal error has occurred.");
- pHttpRequest = pHttpTransactionImpl->GetRequest();
- SysTryReturn(NID_NET_HTTP, pHttpRequest != null, null, E_SYSTEM,
- "[E_SYSTEM] An internal error has occurred.");
-
- pHttpRequestImpl = _HttpRequestImpl::GetInstance(*pHttpRequest);
- SysTryReturn(NID_NET_HTTP, pHttpRequestImpl != null, null, E_SYSTEM,
- "[E_SYSTEM] An internal error has occurred.");
-
- method = pHttpRequestImpl->GetMethod();
-
- r = pHttpRequestImpl->GetUri(uri);
- SysTryReturn(NID_NET_HTTP, r == E_SUCCESS, null, r,
- "[%s] Failed to get the uri.", GetErrorMessage(r));
-
- r = listenerList.Construct(*(pHttpTransactionImpl->GetEventListenerList()));
- SysTryReturn(NID_NET_HTTP, r == E_SUCCESS, null, E_OUT_OF_MEMORY,
- "[E_OUT_OF_MEMORY] Memory allocation failed.");
-
- pAuthenticationImpl = pHttpTransactionImpl->GetHttpAuthenticationImpl();
- SysTryReturn(NID_NET_HTTP, pAuthenticationImpl != null, null, E_INVALID_STATE,
- "[E_INVALID_STATE] The HttpAuthentication is null.");
-
- pUserData = httpTransaction.GetUserObject();
-
- r = CloseTransaction(httpTransaction);
- SysTryReturn(NID_NET_HTTP, r == E_SUCCESS, null, r,
- "[%s] Propagating.", GetErrorMessage(r));
-
- pCreatedTransaction.reset(OpenTransactionN());
+ pCreatedTransaction.reset(OpenTransactionWithCurlN(null, true));
r = GetLastResult();
SysTryReturn(NID_NET_HTTP, r == E_SUCCESS, null, r,
"[%s] Failed to open the HttpTransaction.", GetErrorMessage(r));
pCreatedTransactionImpl = _HttpTransactionImpl::GetInstance(*pCreatedTransaction);
- r = pCreatedTransactionImpl->SetUserObject(pUserData);
- SysTryReturn(NID_NET_HTTP, r == E_SUCCESS, null, r,
- "[%s] Failed to set the user object.", GetErrorMessage(r));
-
- pCreatedHttpRequestImpl = _HttpRequestImpl::GetInstance(*pCreatedTransactionImpl->GetRequest());
-
- r = pCreatedHttpRequestImpl->SetMethod(method);
- SysTryReturn(NID_NET_HTTP, r == E_SUCCESS, null, r,
- "[%s] Failed to set the method.", GetErrorMessage(r));
+ // The data of pHttpTransactionImpl is set to the pCreatedTransactionImpl.
+ r = pCreatedTransactionImpl->Set(pHttpTransactionImpl);
+ SysTryReturn(NID_NET_HTTP, r == E_SUCCESS, null, E_SYSTEM,
+ "[E_SYSTEM] An internal error has occurred.");
- r = pCreatedHttpRequestImpl->SetUri(uri);
+ r = CloseTransaction(httpTransaction);
SysTryReturn(NID_NET_HTTP, r == E_SUCCESS, null, r,
- "[%s] Failed to set the URI.", GetErrorMessage(r));
-
- pRequestBuffer = pHttpTransactionImpl->GetRequestBuffer();
- if (pRequestBuffer != null)
- {
- //Clear the flag of _HttpRequestImpl
- pHttpRequestImpl->SetReceivedTransactionReadyToWriteEvent(false);
-
- r = pCreatedHttpRequestImpl->WriteBody(*pRequestBuffer);
- SysTryReturn(NID_NET_HTTP, r == E_SUCCESS, null, r, "[%s] Failed to write the body.", GetErrorMessage(r));
-
- SysLog(NID_NET_HTTP, "The __pRequestBuffer is added to the Body.");
- }
-
- for (int i = 0; i < listenerList.GetCount(); i++)
- {
- IHttpTransactionEventListener* pListener = null;
- r = listenerList.GetAt(i, pListener);
- SysTryReturn(NID_NET_HTTP, r == E_SUCCESS && pListener != null, null, E_SYSTEM,
- "[E_SYSTEM] A system error has occurred.");
-
- r = pCreatedTransactionImpl->AddHttpTransactionListener(*pListener);
- SysTryReturn(NID_NET_HTTP, r == E_SUCCESS, null, r,
- "[%s] Failed to add the HttpTransactionEventListener.", GetErrorMessage(r));
- }
+ "[%s] Propagating.", GetErrorMessage(r));
SysLog(NID_NET_HTTP, "The HttpTransaction[%d] was re-opened.", pCreatedTransactionImpl->GetTransactionId());
, __pHttpTransactionImpl(null)
, __pHttpProgressListener(null)
, __transactionId(-1)
+ , __isCertRequestedResult(false)
{
}
return r;
}
+bool
+_HttpTransactionEvent::GetCertRequestedResult(void) const
+{
+ return __isCertRequestedResult;
+}
+
+_HttpSessionImpl*
+_HttpTransactionEvent::GetHttpSessionImpl(void) const
+{
+ return __pHttpSessionImpl;
+}
+
result
_HttpTransactionEvent::FireTransactionReadyToReadEvent(int readBodyLength, bool async)
{
}
result
+_HttpTransactionEvent::FireTransactionCertVerificationRequestedNEvent(Tizen::Base::Collection::IList* pServerCertList, bool async)
+{
+ result r = E_SUCCESS;
+
+ SysLog(NID_NET_HTTP, "Fire the event(_HTTP_TRANSACTION_EVENT_TYPE_CERT_VERIFICATION_REQUESTED), async(%d)", async);
+
+ _HttpTransactionEventArg* pEventArg = new (std::nothrow) _HttpTransactionEventArg(__transactionId, _HTTP_TRANSACTION_EVENT_TYPE_CERT_VERIFICATION_REQUESTED);
+ SysTryReturnResult(NID_NET_HTTP, pEventArg != null,
+ E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+ pEventArg->SetServerCertList(pServerCertList);
+
+ if (async)
+ {
+ FireAsync(*pEventArg);
+ }
+ else
+ {
+ Fire(*pEventArg);
+ }
+
+ return r;
+
+}
+
+result
_HttpTransactionEvent::FireTransactionCompletedEvent(bool async)
{
result r = E_SUCCESS;
break;
+ case _HTTP_TRANSACTION_EVENT_TYPE_CERT_VERIFICATION_REQUESTED:
+
+ SysLog(NID_NET_HTTP, "####### Calling callback : OnTransactionCertVerificationRequestedN(HttpTransaction[%d])", transactionId);
+ __isCertRequestedResult = pHttpTransactionEventListener->OnTransactionCertVerificationRequestedN(*pHttpSessoin, *pHttpTransaction, pHttpTransactionEventArg->GetServerCertList());
+ SysLog(NID_NET_HTTP, "####### Called callback : OnTransactionCertVerificationRequestedN(%d)", __isCertRequestedResult);
+
+ break;
+
case _HTTP_TRANSACTION_EVENT_TYPE_UPLOAD_PROGRESS:
currentUploadProgress = pHttpTransactionEventArg->GetCurrentUploadProgress();
result SetHttpProgressListener(const IHttpProgressEventListener* pListener);
+ bool GetCertRequestedResult(void) const;
+
+ _HttpSessionImpl* GetHttpSessionImpl(void) const;
+
result FireTransactionReadyToReadEvent(int readBodyLength, bool async = false);
result FireTransactionReadyToWriteEvent(int recommenedLength, bool async = false);
result FireTransactionCertVerificationRequiredNEvent(Tizen::Base::String* pServerCert, bool async = false);
+ result FireTransactionCertVerificationRequestedNEvent(Tizen::Base::Collection::IList* pServerCertList, bool async = false);
+
result FireTransactionCompletedEvent(bool async = false);
result FireTransactionAbortedEvent(result error, bool async = false);
_HttpTransactionImpl* __pHttpTransactionImpl;
IHttpProgressEventListener* __pHttpProgressListener;
int __transactionId;
+ bool __isCertRequestedResult;
}; // _HttpTransactionEvent
*/
#include <FBaseSysLog.h>
+#include <FBaseCol.h>
#include "FNetHttp_HttpTransactionImpl.h"
#include "FNetHttp_HttpTransactionEvent.h"
#include "FNetHttp_HttpTransactionEventArg.h"
using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
namespace Tizen { namespace Net { namespace Http
{
, __downloadCurrentProgress(0)
, __downloadTotalProgress(0)
, __pServerCert(null)
+ , __pServerCertList(null)
{
}
return __pServerCert;
}
+void
+_HttpTransactionEventArg::SetServerCertList(IList* pServerCertList)
+{
+ __pServerCertList = pServerCertList;
+}
+
+IList*
+_HttpTransactionEventArg::GetServerCertList(void) const
+{
+ return __pServerCertList;
+}
+
} } } // Tizen::Net::Http
class String;
} }
+namespace Tizen { namespace Base { namespace Collection
+{
+class IList;
+} } }
+
namespace Tizen { namespace Net { namespace Http
{
/**
Tizen::Base::String* GetServerCert(void) const;
+ void SetServerCertList(Tizen::Base::Collection::IList* pServerCertList);
+
+ Tizen::Base::Collection::IList* GetServerCertList(void) const;
+
+
private:
_HttpTransactionEventArg(const _HttpTransactionEventArg& rhs);
long long __downloadCurrentProgress;
long long __downloadTotalProgress;
Tizen::Base::String* __pServerCert;
+ Tizen::Base::Collection::IList* __pServerCertList;
}; // _HttpTransactionEventArg
#include <FNetHttpIHttpEntity.h>
#include <FNetHttpIHttpProgressEventListener.h>
#include <FBaseSysLog.h>
+#include <FSecurity.h>
#include <FBase_StringConverter.h>
#include <FBaseRt_EventDispatcher.h>
#include <FSecCert_CertService.h>
, __isAlreadyResumed(false)
, __isAlreadyPaused(false)
, __isCertRequiredEventFired(false)
+ , __certificateFlag(HTTP_CV_FLAG_AUTOMATIC)
, __pHttpProgressListener(null)
, __pHttpTransactionUserData(null)
, __pHttpCurl(null)
return r;
}
+result
+_HttpTransactionImpl::Set(_HttpTransactionImpl* pHttpTransactionImpl)
+{
+ result r = E_SUCCESS;
+
+ HttpRequest* pHttpRequest = null;
+ _HttpRequestImpl* pHttpRequestImpl = null;
+ _HttpRequestImpl* pSrcHttpRequestImpl = null;
+
+ ByteBuffer* pRequestBuffer = null;
+ ArrayListT< IHttpTransactionEventListener* > listenerList;
+ Object* pUserObject = null;
+
+ //Sets user object.
+ pUserObject = pHttpTransactionImpl->GetUserObject();
+ __pUserData = pUserObject;
+
+ //Sets event listener.
+ r = listenerList.Construct(*(pHttpTransactionImpl->GetEventListenerList()));
+ SysTryReturn(NID_NET_HTTP, r == E_SUCCESS, null, E_OUT_OF_MEMORY,
+ "[E_OUT_OF_MEMORY] Memory allocation failed.");
+
+ for (int i = 0; i < listenerList.GetCount(); i++)
+ {
+ IHttpTransactionEventListener* pListener = null;
+ r = listenerList.GetAt(i, pListener);
+ SysTryReturn(NID_NET_HTTP, r == E_SUCCESS && pListener != null, null, E_SYSTEM,
+ "[E_SYSTEM] A system error has occurred.");
+
+ r = this->AddHttpTransactionListener(*pListener);
+ SysTryReturn(NID_NET_HTTP, r == E_SUCCESS, null, r,
+ "[%s] Failed to add the HttpTransactionEventListener.", GetErrorMessage(r));
+ }
+
+ __pHttpProgressListener = pHttpTransactionImpl->GetHttpProgressEventListener();
+
+ __enableTransactionReadyToWrite = pHttpTransactionImpl->IsTransactionReadyToWriteEanbled();
+ __timeout = pHttpTransactionImpl->GetTimeout();
+ __certificateId = pHttpTransactionImpl->GetClientCertificate();
+ __isAlreadyResumed = pHttpTransactionImpl->IsAlreadyResumed();
+ __certificateFlag = pHttpTransactionImpl->GetServerCertificateVerification();
+
+ pHttpRequest = pHttpTransactionImpl->GetRequest();
+ SysTryReturn(NID_NET_HTTP, pHttpRequest != null, null, E_SYSTEM,
+ "[E_SYSTEM] An internal error has occurred.");
+
+ pHttpRequestImpl = _HttpRequestImpl::GetInstance(*pHttpRequest);
+ SysTryReturn(NID_NET_HTTP, pHttpRequestImpl != null, null, E_SYSTEM,
+ "[E_SYSTEM] An internal error has occurred.");
+
+ pSrcHttpRequestImpl = _HttpRequestImpl::GetInstance(*__pHttpRequest);
+ SysTryReturn(NID_NET_HTTP, pSrcHttpRequestImpl != null, null, E_SYSTEM,
+ "[E_SYSTEM] An internal error has occurred.");
+
+ //Sets HttpRequest.
+ r = pSrcHttpRequestImpl->Set(pHttpRequestImpl);
+ SysTryReturn(NID_NET_HTTP, r == E_SUCCESS, null, E_SYSTEM,
+ "[E_SYSTEM] An internal error has occurred.");
+
+ pRequestBuffer = pHttpTransactionImpl->GetRequestBuffer();
+ if (pRequestBuffer != null)
+ {
+ //Clear the flag of _HttpRequestImpl
+ pSrcHttpRequestImpl->SetReceivedTransactionReadyToWriteEvent(false);
+
+ r = pSrcHttpRequestImpl->WriteBody(*pRequestBuffer);
+ SysTryReturn(NID_NET_HTTP, r == E_SUCCESS, null, r, "[%s] Failed to write the body.", GetErrorMessage(r));
+
+ SysLog(NID_NET_HTTP, "The __pRequestBuffer is added to the Body.");
+ }
+
+ return r;
+}
+
String
_HttpTransactionImpl::GetDefaultUserAgent(void)
{
SysTryReturnResult(NID_NET_HTTP, r == E_SUCCESS,
E_INVALID_ARG, "Failed to parse the content-length.");
//Set Content-Length
- if (contentLen >= 0)
+ if (contentLen > 0)
{
curl_easy_setopt(pCurl, CURLOPT_POSTFIELDSIZE_LARGE, static_cast< curl_off_t >(contentLen));
SysLog(NID_NET_HTTP, "Set the Content-Length(%lld).", contentLen);
}
+ else if (contentLen == 0)
+ {
+ curl_easy_setopt(pCurl, CURLOPT_POSTFIELDSIZE_LARGE, static_cast< curl_off_t >(contentLen));
+ curl_easy_setopt(pCurl, CURLOPT_COPYPOSTFIELDS, NULL);
+ SysLog(NID_NET_HTTP, "Set the Content-Length(%lld).", contentLen);
+ }
SysLog(NID_NET_HTTP, "The Content-Length is %lld.", contentLen);
}
curl_easy_setopt(pCurl, CURLOPT_LOW_SPEED_TIME, 30L);
}
- //Set default CA path.
- String caPath = _CertService::GetCertificateCrtFilePath();
- SysLog(NID_NET_HTTP, "The CA Path is %ls.", caPath.GetPointer());
+ if (__certificateFlag == HTTP_CV_FLAG_IGNORED)
+ {
+ curl_easy_setopt(pCurl, CURLOPT_SSL_VERIFYPEER, 0);
+ curl_easy_setopt(pCurl, CURLOPT_SSL_VERIFYHOST, 0);
+ SysLog(NID_NET_HTTP, "The server certificate verification is ignored.");
- char* pCaPath = _StringConverter::CopyToCharArrayN(caPath);
- SysTryReturnResult(NID_NET_HTTP, pCaPath != null,
- E_OUT_OF_MEMORY, "Memory allocation failed.");
+ } else
+ {
+ //Set default CA path.
+ String caPath = _CertService::GetCertificateCrtFilePath();
+ SysLog(NID_NET_HTTP, "The CA Path is %ls.", caPath.GetPointer());
- curl_easy_setopt(pCurl, CURLOPT_CAINFO, pCaPath);
- curl_easy_setopt(pCurl, CURLOPT_CAPATH, null);
- delete[] pCaPath;
+ char* pCaPath = _StringConverter::CopyToCharArrayN(caPath);
+ SysTryReturnResult(NID_NET_HTTP, pCaPath != null,
+ E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+ curl_easy_setopt(pCurl, CURLOPT_CAINFO, pCaPath);
+ curl_easy_setopt(pCurl, CURLOPT_CAPATH, null);
+ delete[] pCaPath;
- curl_easy_setopt(pCurl, CURLOPT_SSL_VERIFYPEER, 0);
- curl_easy_setopt(pCurl, CURLOPT_SSL_VERIFYHOST, 2);
+ curl_easy_setopt(pCurl, CURLOPT_SSL_VERIFYPEER, 0);
+ curl_easy_setopt(pCurl, CURLOPT_SSL_VERIFYHOST, 2);
+ }
if (__certificateId >= 0)
{
return r;
}
+int
+_HttpTransactionImpl::GetTimeout(void) const
+{
+ return __timeout;
+}
+
result
_HttpTransactionImpl::SetClientCertificate(int certificateId)
{
return r;
}
+int
+_HttpTransactionImpl::GetClientCertificate(void) const
+{
+ return __certificateId;
+}
+
+result
+_HttpTransactionImpl::SetServerCertificateVerification(NetHttpCertificateVerificationFlag flag)
+{
+ result r = E_SUCCESS;
+
+ SysTryReturnResult(NID_NET_HTTP, __isClosed == false,
+ E_INVALID_STATE, "HttpTransaction[%d] is already closed.", __transactionId);
+
+ SysTryReturnResult(NID_NET_HTTP, __isSubmitted == false,
+ E_INVALID_STATE, "HttpTransaction[%d] is already submitted.", __transactionId);
+
+ __certificateFlag = flag;
+
+ SysLog(NID_NET_HTTP, "Set the flag for certificate verification.[%s].", _HttpUtility::ConvertNetHttpCertificateVerificationFlagToString(flag));
+
+ return r;
+}
+
+NetHttpCertificateVerificationFlag
+_HttpTransactionImpl::GetServerCertificateVerification(void) const
+{
+ return __certificateFlag;
+}
+
_HttpTransactionImpl*
_HttpTransactionImpl::GetInstance(HttpTransaction& httpTransaction)
{
result r = E_SUCCESS;
CURLcode curlCode = CURLE_OK;
+ SysLog(NID_NET_HTTP, "Received OnHttpSslHandshake()");
+
_HttpTransactionUserData* pHttpTransactionUserData = static_cast< _HttpTransactionUserData* >(pUserData);
_HttpTransactionImpl* pHttpTransactionImpl = pHttpTransactionUserData->GetHttpTransactionImpl();
- if (pHttpTransactionImpl->__isAlreadyResumed)
+ if (pHttpTransactionImpl->__isAlreadyResumed || pHttpTransactionImpl->__certificateFlag == HTTP_CV_FLAG_IGNORED)
{
SysLog(NID_NET_HTTP, "Resume the HttpTransaction. Ignore to verify the server cert.");
}
else
{
+ if (pHttpTransactionImpl->__certificateFlag == HTTP_CV_FLAG_MANUAL)
+ {
+ unique_ptr<_HttpSslInfo> pSSLInfo;
+
+ SysLog(NID_NET_HTTP, "The certificate mode is HTTP_CV_FLAG_MANUAL");
+
+ pSSLInfo.reset(new (std::nothrow) _HttpSslInfo(pHttpTransactionUserData->GetSocketFd(), pHttpTransactionImpl->__pHttpTransactionEvent));
+ SysTryReturn(NID_NET_HTTP, pSSLInfo != null, CURLE_SSL_CERTPROBLEM, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+
+ r = _HttpUtility::SetSslCertInfo(*pSSLInfo);
+ SysTryReturn(NID_NET_HTTP, r == E_SUCCESS, CURLE_SSL_CERTPROBLEM, r, "[%s] Memory allocation failed.", GetErrorMessage(r));
+
+ pSSLInfo.release();
+ }
+
SSL_CTX_set_verify_depth(pSslctx, _HTTP_CERT_VERIFICATION_DEPTH_LIMIT);
SSL_CTX_set_verify(pSslctx, SSL_VERIFY_PEER, _HttpTransactionImpl::OnHttpSslVerify);
}
result r = E_SUCCESS;
int socketFd = -1;
unique_ptr<_HttpSslInfo> pSSLInfo;
+ _HttpSslInfo* pExistSslInfo = null;
int sslIndex = SSL_get_ex_data_X509_STORE_CTX_idx();
SSL* pSsl = (SSL*) X509_STORE_CTX_get_ex_data(pX509ctx, sslIndex);
socketFd = SSL_get_fd(pSsl);
SysLog(NID_NET_HTTP, "The ssl socket is %d.", socketFd);
- X509* pServerCert = null;
+ X509* pSrcServerCert = null;
+ unique_ptr<X509, _X509Deleter> pServerCert;
int depth = X509_STORE_CTX_get_error_depth(pX509ctx);
int error = X509_STORE_CTX_get_error(pX509ctx);
- if (error != X509_V_OK)
+ pExistSslInfo = _HttpUtility::GetSslCertInfo(socketFd);
+
+ if (pExistSslInfo != null)
{
- STACK_OF(X509)* pServerCertChain = null;
+ bool certVerificationResult = false;
+
+ _HttpTransactionEvent* pHttpTransactionEvent = pExistSslInfo->GetHttpTransactionEvent();
+ SysTryReturn(NID_NET_HTTP, pHttpTransactionEvent != null, 0, E_SYSTEM, "[E_SYSTEM] pHttpTransactionEvent must not be null.");
+
+ if (pHttpTransactionEvent->GetCertRequestedResult())
+ {
+ SysLog(NID_NET_HTTP, "The certificate verification is already resumed.");
+ return 1;
+ }
+
+ //The certificateFlag is HTTP_CV_FLAG_MANUAL.
String serverCertString;
- pServerCertChain = X509_STORE_CTX_get1_chain(pX509ctx);
+ STACK_OF(X509)* pSrcServerCertChain = X509_STORE_CTX_get1_chain(pX509ctx);
+ unique_ptr<STACK_OF(X509), _X509ChainDeleter> pServerCertChain(pSrcServerCertChain);
if (pServerCertChain != null)
{
+ unique_ptr<IList, _CollectionDeleter> pCertList(new (nothrow) LinkedList(SingleObjectDeleter));
+ SysTryReturn(NID_NET_HTTP, pCertList != null, 0, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+
int numberOfCerts = pServerCertChain->stack.num;
for (int i = numberOfCerts; i > 0; i--)
{
- pServerCert = sk_X509_pop(pServerCertChain);
+ pSrcServerCert = sk_X509_pop(pSrcServerCertChain);
+ pServerCert.reset(pSrcServerCert);
if (pServerCert != null)
{
char tempSubjectName[_HTTP_CERT_SUBJECT_SIZE];
- X509_NAME_oneline(X509_get_subject_name(pServerCert), tempSubjectName, _HTTP_CERT_SUBJECT_SIZE);
+ X509_NAME_oneline(X509_get_subject_name(pSrcServerCert), tempSubjectName, _HTTP_CERT_SUBJECT_SIZE);
serverCertString = String(tempSubjectName);
- SysLog(NID_NET_HTTP, "The subject of certificate is %ls[depth: %d].", serverCertString.GetPointer(), i -1);
- depth = i -1;
- X509_free(pServerCert);
+ SysLog(NID_NET_HTTP, "Count of Certs(%d), The subject of certificate is %ls[depth: %d].", numberOfCerts, serverCertString.GetPointer(), i -1);
+
+ // Converter X509 to ByteBuffer.
+ int bufferSize = -1;
+ int len = -1;
+ ByteBuffer buffer;
+ unique_ptr<X509Certificate> pX509Certificate;
+ char* pSrcCertBytes = null;
+ unique_ptr<char, _CharDeleter> pCertBytes;
+
+ BIO* pNewBIoCert = BIO_new(BIO_s_mem());
+ unique_ptr<BIO, _BIoDeleter> pBIoCert(pNewBIoCert);
+ SysTryReturn(NID_NET_HTTP, pBIoCert != null, 0, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+
+ PEM_write_bio_X509(pNewBIoCert, pSrcServerCert);
+ bufferSize = BIO_number_written(pNewBIoCert);
+
+ pSrcCertBytes = (char*) calloc(bufferSize, sizeof(char));
+ pCertBytes.reset(pSrcCertBytes);
+ SysTryReturn(NID_NET_HTTP, pCertBytes != null, 0, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+
+ len = BIO_read(pNewBIoCert, pSrcCertBytes, bufferSize);
+ SysLog(NID_NET_HTTP, "The buffer size is %d.", len);
+
+ r = buffer.Construct((byte*)pSrcCertBytes, 0, len, len);
+ SysTryReturn(NID_NET_HTTP, r == E_SUCCESS, 0, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ pX509Certificate.reset(new (nothrow) X509Certificate());
+ SysTryReturn(NID_NET_HTTP, pX509Certificate != null, 0, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+
+ r = pX509Certificate->Construct(buffer);
+ SysTryReturn(NID_NET_HTTP, r == E_SUCCESS, 0, E_SYSTEM, "[E_SYSTEM] Failed to construct X509Certificate.");
+
+ SysLog(NID_NET_HTTP, "Subject: %ls, Issuer: %ls", pX509Certificate->GetSubject().GetPointer(), pX509Certificate->GetIssuer().GetPointer());
+
+ r = pCertList->Add(*pX509Certificate);
+ SysTryReturn(NID_NET_HTTP, r == E_SUCCESS, 0, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+
+ pX509Certificate.release();
}
}
- sk_X509_free(pServerCertChain);
- }
-
- const char* pErrorMsg = X509_verify_cert_error_string(error);
- SysLog(NID_NET_HTTP, "Failed to verify the cert. depth(%d) - error(%s)", depth, pErrorMsg);
- SysLog(NID_NET_HTTP, "The subject of last certificate is %ls.", serverCertString.GetPointer());
- pSSLInfo.reset(new (std::nothrow) _HttpSslInfo(socketFd, depth, serverCertString, pErrorMsg));
- SysTryReturn(NID_NET_HTTP, pSSLInfo != null, 0, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ //Fire the event(_HTTP_TRANSACTION_EVENT_TYPE_CERT_VERIFICATION_REQUESTED)
+ pHttpTransactionEvent->FireTransactionCertVerificationRequestedNEvent(pCertList.release());
- r = _HttpUtility::AddSslCertInfo(*pSSLInfo);
- SysTryReturn(NID_NET_HTTP, r == E_SUCCESS, 0, r, "[%s] Memory allocation failed.", GetErrorMessage(r));
+ certVerificationResult = pHttpTransactionEvent->GetCertRequestedResult();
+ if (certVerificationResult)
+ {
+ _HttpSessionImpl* pHttpSessionImpl = pHttpTransactionEvent->GetHttpSessionImpl();
+ pHttpSessionImpl->IgnoreSslVerification();
+ }
- pSSLInfo.release();
+ //Check the result
+ return pHttpTransactionEvent->GetCertRequestedResult();
+ }
return 0;
- }
- else
+ } else
{
- return 1;
+ // The certificateFlag is HTTP_CV_FLAG_AUTOMATIC.
+ if (error != X509_V_OK)
+ {
+ String serverCertString;
+ STACK_OF(X509)* pSrcServerCertChain = X509_STORE_CTX_get1_chain(pX509ctx);
+ unique_ptr<STACK_OF(X509), _X509ChainDeleter> pServerCertChain(pSrcServerCertChain);
+ if (pServerCertChain != null)
+ {
+ int numberOfCerts = pServerCertChain->stack.num;
+ for (int i = numberOfCerts; i > 0; i--)
+ {
+ pSrcServerCert = sk_X509_pop(pSrcServerCertChain);
+ pServerCert.reset(pSrcServerCert);
+ if (pServerCert != null)
+ {
+ char tempSubjectName[_HTTP_CERT_SUBJECT_SIZE];
+ X509_NAME_oneline(X509_get_subject_name(pSrcServerCert), tempSubjectName, _HTTP_CERT_SUBJECT_SIZE);
+ serverCertString = String(tempSubjectName);
+
+ SysLog(NID_NET_HTTP, "The subject of certificate is %ls[depth: %d].", serverCertString.GetPointer(), i -1);
+ depth = i -1;
+ }
+ }
+ }
+
+ const char* pErrorMsg = X509_verify_cert_error_string(error);
+ SysLog(NID_NET_HTTP, "Failed to verify the cert. depth(%d) - error(%s)", depth, pErrorMsg);
+ SysLog(NID_NET_HTTP, "The subject of last certificate is %ls.", serverCertString.GetPointer());
+
+ pSSLInfo.reset(new (std::nothrow) _HttpSslInfo(socketFd, depth, serverCertString, pErrorMsg));
+ SysTryReturn(NID_NET_HTTP, pSSLInfo != null, 0, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+
+ r = _HttpUtility::SetSslCertInfo(*pSSLInfo);
+ SysTryReturn(NID_NET_HTTP, r == E_SUCCESS, 0, r, "[%s] Memory allocation failed.", GetErrorMessage(r));
+
+ pSSLInfo.release();
+
+ return 0;
+
+ }
+ else
+ {
+ return 1;
+ }
+
}
}
namespace Tizen { namespace Net { namespace Http
{
class _HttpSslInfo;
+class _HttpTransactionEvent;
/**
* The User-Agent header name
_HTTP_TRANSACTION_EVENT_TYPE_COMPLETD,
_HTTP_TRANSACTION_EVENT_TYPE_ABORTED,
_HTTP_TRANSACTION_EVENT_TYPE_CERT_VERIFICATION_REQUIRED,
+ _HTTP_TRANSACTION_EVENT_TYPE_CERT_VERIFICATION_REQUESTED,
_HTTP_TRANSACTION_EVENT_TYPE_UPLOAD_PROGRESS,
_HTTP_TRANSACTION_EVENT_TYPE_DOWNLOAD_PROGRESS
};
* Converts NetHttpTransactionEventType to string name.
*
* @return The string of NetHttpTransactionEventType
- * @param[in] index The index of NetHttpTransactionEventType
+ * @param[in] type The type of NetHttpTransactionEventType
*/
- static const char* ConvertHttpTransactionEventTypeToString(_HttpTransactionEventType index);
+ static const char* ConvertHttpTransactionEventTypeToString(_HttpTransactionEventType type);
+
+ /**
+ * Converts NetHttpCertificateVerificationFlag to string name.
+ *
+ * @return The string of NetHttpCertificateVerificationFlag
+ * @param[in] flag The flag of NetHttpCertificateVerificationFlag
+ */
+ static const char* ConvertNetHttpCertificateVerificationFlagToString(NetHttpCertificateVerificationFlag flag);
/**
* Adds a buffer to the header buffer.
static Tizen::Base::Collection::IList* GetSslCertList(void);
/**
- * Adds a _HttpSslInfo
+ * Sets a _HttpSslInfo
*
* @return An error code
* @param[in] sslInfo The instance of _HttpSslInfo
* @exception E_OUT_OF_MEMORY The memory is insufficient.
* @exception E_SYSTEM A system error has occurred.
*/
- static result AddSslCertInfo(_HttpSslInfo& sslInfo);
+ static result SetSslCertInfo(_HttpSslInfo& sslInfo);
/**
- * Gets a list of _HttpSslInfo searched by socket fd.
+ * Gets an instance of _HttpSslInfo searched by socket fd.
*
* @return The instance of _HttpSslInfo
* @param[in] socketFd The socket fd
* @exception E_SYSTEM A system error has occurred.
* @remarks The specific error code can be accessed using the GetLastResult() method.
*/
- static Tizen::Base::Collection::IList* GetSslCertInfoN(int socketFd);
+ static _HttpSslInfo* GetSslCertInfo(int socketFd);
/**
* Removes a _HttpSslInfo
*
* @return An error code
- * @param[in] socketFd The socket fd
+ * @param[in] sslInfo The instance of _HttpSslInfo
* @exception E_SYSTEM A system error has occurred.
*/
- static result RemoveSslCertInfo(int socketFd);
+ static result RemoveSslCertInfo(_HttpSslInfo & sslInfo);
private:
/**
public:
_HttpSslInfo(int socketFd, int depth, const Tizen::Base::String& serverCert, const Tizen::Base::String& errorMessage);
+ _HttpSslInfo(int socketFd, _HttpTransactionEvent* pHttpTransactionEvent);
virtual ~_HttpSslInfo(void);
int GetSocketFd(void) const;
int GetDepth(void) const;
Tizen::Base::String GetErrorMessage(void) const;
Tizen::Base::String GetServerCert(void) const;
+ _HttpTransactionEvent* GetHttpTransactionEvent(void) const;
+ NetHttpCertificateVerificationFlag GetCertificateVerificationFlag(void) const;
private:
int __socketFd;
int __depth;
Tizen::Base::String __serverCert;
Tizen::Base::String __errorMessage;
+ _HttpTransactionEvent* __pHttpTransactionEvent;
+ NetHttpCertificateVerificationFlag __flag;
}; //_HttpSslInfo
Tizen::Base::ByteBuffer* GetNextDataN(int recommendedSize);
+ result Set(_HttpRequestImpl* pHttpRequestImpl);
+
private:
_HttpRequestImpl(void);
bool IsConnectionStarted(void) const;
- HttpTransaction* OpenTransactionWithCurlN(CURL* pCurl);
+ HttpTransaction* OpenTransactionWithCurlN(CURL* pCurl, bool uncheckedMaxTransactions = false);
HttpTransaction* ReopenTransactionWithAuthN(HttpTransaction& httpTransaction);
*/
result SetTimeout(int timeout);
+ /**
+ * Sets the flag to verify server certificate. (the flag is @c HTTP_CV_FLAG_AUTOMATIC by default)
+ *
+ * @since 2.1
+ *
+ * @return An error code
+ * @param[in] flag Set the flag for certificate verification.
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_STATE The method invoked is invalid.
+ * @exception E_SYSTEM A system error has occurred.
+ */
+ result SetServerCertificateVerification(NetHttpCertificateVerificationFlag flag = HTTP_CV_FLAG_AUTOMATIC);
+
public:
/**
* Gets the Impl instance.
result Abort(void);
+ int GetTimeout(void) const;
+
+ int GetClientCertificate(void) const;
+
+ NetHttpCertificateVerificationFlag GetServerCertificateVerification(void) const;
+
+ result Set(_HttpTransactionImpl* pHttpTransactionImpl);
+
static int GenerateTransactionId(void);
int GetTransactionId(void) const;
bool __isAlreadyResumed;
bool __isAlreadyPaused;
bool __isCertRequiredEventFired;
+ NetHttpCertificateVerificationFlag __certificateFlag;
Tizen::Base::Collection::ArrayListT< IHttpTransactionEventListener* > __transactionListenerList;
const IHttpProgressEventListener* __pHttpProgressListener;
_HttpTransactionUserData* __pHttpTransactionUserData;
/**
* @see IWifiDirectDeviceListener::OnWifiDirectGroupCreatedN()
*/
- virtual void OnWifiDirectGroupCreatedN(const _WifiDirectEventArg& arg, WifiDirectGroupMemberType wifiDirectMemberType, result r) = 0;
+ virtual void OnWifiDirectGroupCreated(const _WifiDirectEventArg& arg, WifiDirectGroupMemberType wifiDirectMemberType, result r) = 0;
+
+ /**
+ * @see IWifiDirectDeviceListener::OnWifiDirectRemoteDeviceFound()
+ */
+ virtual void OnWifiDirectRemoteDeviceFound(const _WifiDirectEventArg& arg) = 0;
/**
* @see IWifiDirectDeviceListener::OnWifiDirectScanCompletedN()
*/
- virtual void OnWifiDirectScanCompletedN(const _WifiDirectEventArg& arg, result r) = 0;
+ virtual void OnWifiDirectScanCompleted(const _WifiDirectEventArg& arg, result r) = 0;
/**
* @see IWifiDirectDeviceListener::OnWifiDirectAssociationCompleted()
*/
virtual void OnWifiDirectAssociationCompleted(const _WifiDirectEventArg& arg, result r) = 0;
-
/**
* @see IWifiDirectGroupOwnerListener::OnWifiDirectClientAssociated()
*/
/**
* @see IWifiDirectDeviceListener::OnWifiDirectGroupCreatedN()
*/
- void OnWifiDirectGroupCreatedN(const _WifiDirectEventArg& arg, WifiDirectGroupMemberType wifiDirectMemberType, result r);
+ void OnWifiDirectGroupCreated(const _WifiDirectEventArg& arg, WifiDirectGroupMemberType wifiDirectMemberType, result r);
- /**
- * @see IWifiDirectDeviceListener::OnWifiDirectScanCompletedN()
+ /**
+ * @see IWifiDirectDeviceListener::OnWifiDirectRemoteDeviceFound()
*/
- void OnWifiDirectScanCompletedN(const _WifiDirectEventArg& arg, result r);
+ void OnWifiDirectRemoteDeviceFound(const _WifiDirectEventArg& arg);
+
+ /**
+ * @see IWifiDirectDeviceListener::OnWifiDirectScanCompleted()
+ */
+ void OnWifiDirectScanCompleted(const _WifiDirectEventArg& arg, result r);
/**
* @see IWifiDirectDeviceListener::OnWifiDirectAssociationCompleted()
IPC_SYNC_MESSAGE_CONTROL1_2(ConnectivityNetServiceMsg_getAppNetAccountId, Tizen::Base::String /* ProfileName */, int /* NetAccountId */, unsigned long /* result */)
IPC_SYNC_MESSAGE_CONTROL1_2(ConnectivityNetServiceMsg_setNetAccountId, int /* NetAccountId*/, int /* NetAccountId */, unsigned long /* result */)
IPC_SYNC_MESSAGE_CONTROL3_1(ConnectivityNetServiceMsg_updateSystemNetAccount, Tizen::Base::String /* ProfileName */, Tizen::Net::NetAccountInfo /* NetAccountInfo */, int /* NetBearerType*/, unsigned long /* result */)
+IPC_SYNC_MESSAGE_CONTROL2_1(ConnectivityNetServiceMsg_resetNetStatistics, int /* bearerType */, int /* statType */, unsigned long /* result */)
+IPC_SYNC_MESSAGE_CONTROL1_1(ConnectivityNetServiceMsg_resetAllNetStatistics, int /* bearerType */, unsigned long /* result */)
r = ConvertErrorToResult(errno);
SysTryReturnResult(NID_NET_SOCK, r == E_SUCCESS, r, "Failed to close the socket.");
}
- }
- SysLog(NID_NET_SOCK, "Socket is closed. [Fd : %d]", sockFd);
+ SysLog(NID_NET_SOCK, "Socket is closed. [Fd : %d]", sockFd);
+ }
__socketFd = INVALID_HANDLE;
__isClosed = true;
__pSecureSocketImpl->__pGlibSocketInfo = null;
}
- if (__pSecureSocketImpl->__socketFd >= 0)
+ if (__pSecureSocketImpl->__socketFd > INVALID_HANDLE)
{
sockFd = __pSecureSocketImpl->__socketFd;
close(__pSecureSocketImpl->__socketFd);
r = ConvertErrorToResult(errno);
SysTryReturnResult(NID_NET_SOCK, r == E_SUCCESS, r, "Failed to close the socket.");
}
+
+ SysLog(NID_NET_SOCK, "Socket is closed. [Fd : %d]", sockFd);
}
-
- SysLog(NID_NET_SOCK, "Socket is closed. [Fd : %d]", sockFd);
__socketFd = INVALID_HANDLE;
__isClosed = true;
WifiDirectDevice::~WifiDirectDevice(void)
{
- __pWifiDirectDeviceImpl->Release();
+ if (__pWifiDirectDeviceImpl != null)
+ {
+ __pWifiDirectDeviceImpl->Release();
+ }
}
result
#include "FSys_SystemInfoImpl.h"
#include "FNetWifi_WifiDirectDeviceManagerImpl.h"
-static const wchar_t* _WIFI_DIRECT = L"http://tizen.org/feature/network.wifi.direct";
+static const wchar_t* _WIFI_DIRECT_FEATURE_INFO_KEY = L"http://tizen.org/feature/network.wifi.direct";
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
{
bool isWifiDirectSupported = false;
IList* pList = null;
- result r = _SystemInfoImpl::GetSysInfo(_WIFI_DIRECT, isWifiDirectSupported);
+ result r = _SystemInfoImpl::GetSysInfo(_WIFI_DIRECT_FEATURE_INFO_KEY, isWifiDirectSupported);
SysTryReturn(NID_NET_WIFI, r == E_SUCCESS && isWifiDirectSupported == true, null, E_UNSUPPORTED_OPERATION,
"[E_UNSUPPORTED_OPERATION] No WifiDirectDeviceInfo available since the device don't support the Wi-Fi Direct.");
{
bool isWifiDirectSupported = false;
WifiDirectDevice* pWifiDirectDevice = null;
- result r = _SystemInfoImpl::GetSysInfo(_WIFI_DIRECT, isWifiDirectSupported);
+ result r = _SystemInfoImpl::GetSysInfo(_WIFI_DIRECT_FEATURE_INFO_KEY, isWifiDirectSupported);
SysTryReturn(NID_NET_WIFI, r == E_SUCCESS && isWifiDirectSupported == true, null, E_UNSUPPORTED_OPERATION,
"[E_UNSUPPORTED_OPERATION] No WifiDirectDeviceInfo available since the device don't support the Wi-Fi Direct.");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
#include <FNetWifiWifiBssInfo.h>
#include <FNetWifiWifiManager.h>
#include <FSec_AccessController.h>
+#include "FSys_SystemInfoImpl.h"
#include "FNetWifi_WifiManagerImpl.h"
+static const wchar_t* _WIFI_FEATURE_INFO_KEY = L"http://tizen.org/feature/network.wifi";
+
using namespace std;
using namespace Tizen::Base;
using namespace Tizen::Base::Runtime;
using namespace Tizen::Base::Collection;
using namespace Tizen::Security;
+using namespace Tizen::System;
namespace Tizen { namespace Net { namespace Wifi {
{
result r = E_SUCCESS;
+ bool isWifiSupported = false;
+ r = _SystemInfoImpl::GetSysInfo(_WIFI_FEATURE_INFO_KEY, isWifiSupported);
+
+ SysTryReturnResult(NID_NET_WIFI, r == E_SUCCESS && isWifiSupported == true, E_UNSUPPORTED_OPERATION, "Wi-Fi is not supported.");
+
SysAssertf(__pWifiManagerImpl == null,
"Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
void
_WifiDirectDeviceEvent::FireImpl(Tizen::Base::Runtime::IEventListener& listener, const Tizen::Base::Runtime::IEventArg& arg)
{
- const _WifiDirectEventArg* pArg = dynamic_cast<const _WifiDirectEventArg*>(&arg);
- SysTryReturnVoidResult(NID_NET_WIFI, pArg != null, E_INVALID_ARG, "[E_INVALID_ARG] The argument is a null pointer.");
-
- IWifiDirectDeviceListener* pDeviceListener = dynamic_cast<IWifiDirectDeviceListener*>(&listener);
- SysTryReturnVoidResult(NID_NET_WIFI, pDeviceListener != null, E_INVALID_ARG,
- "[E_INVALID_ARG] The result of a dynamic_cast operation is null for external Device listener.");
-
- _WifiDirectEventType eventType = pArg->GetEventType();
- WifiDirectDeviceId localDeviceId = pArg->GetDeviceId();
- result r = pArg->GetError();
-
- switch (eventType)
- {
- case WIFI_DIRECT_DEVICE_EVENT_ACTIVATED:
- SysLog(NID_NET_WIFI, "Firing External Event (Type: WIFI_DIRECT_DEVICE_EVENT_ACTIVATED) : %s",GetErrorMessage(r));
- pDeviceListener->OnWifiDirectDeviceActivated(localDeviceId, r);
- break;
- case WIFI_DIRECT_DEVICE_EVENT_DEACTIVATED:
- SysLog(NID_NET_WIFI, "Firing External Event (Type: WIFI_DIRECT_DEVICE_EVENT_DEACTIVATED) : %s",GetErrorMessage(r));
- pDeviceListener->OnWifiDirectDeviceDeactivated(localDeviceId, r);
- break;
- case WIFI_DIRECT_DEVICE_EVENT_GROUP_CREATED:
- SysLog(NID_NET_WIFI, "Firing External Event (Type: WIFI_DIRECT_DEVICE_EVENT_GROUP_CREATED) : %s",GetErrorMessage(r));
- {
- WifiDirectGroupInfo* pGroupInfo = pArg->GetGroupInfo();
- WifiDirectDeviceInfo* pGroupOwnerInfo = pArg->GetDeviceInfo();
- WifiDirectGroupMember* pGroupMember = pArg->GetGroupMember();
- pDeviceListener->OnWifiDirectGroupCreatedN(localDeviceId, *pGroupInfo, *pGroupOwnerInfo, pGroupMember, r);
- }
- break;
- case WIFI_DIRECT_DEVICE_EVENT_SCAN_COMPLETED:
- SysLog(NID_NET_WIFI, "Firing External Event (Type: WIFI_DIRECT_DEVICE_EVENT_SCAN_COMPLETED) : %s",GetErrorMessage(r));
- {
- if(!IsFailed(r))
- {
- ArrayList* pSrcDeviceInfoList = dynamic_cast<ArrayList*>(pArg->GetDeviceInfoList());
- SysTryCatch(NID_NET_WIFI, pSrcDeviceInfoList != null, , E_SYSTEM, "[E_SYSTEM] Failed to dynamic casting DeviceInfo list.");
-
- ArrayList* pDescDeviceInfoList = new (std::nothrow) ArrayList();
- SysTryCatch(NID_NET_WIFI, pDescDeviceInfoList != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
-
- result res = pDescDeviceInfoList->Construct(*pSrcDeviceInfoList);
-
- if (IsFailed(res))
- {
- delete pDescDeviceInfoList;
- pDescDeviceInfoList = null;
-
- r = E_SYSTEM;
- }
-
- pDeviceListener->OnWifiDirectScanCompletedN(localDeviceId, pDescDeviceInfoList, r);
- }
- else
- {
- pDeviceListener->OnWifiDirectScanCompletedN(localDeviceId, null, r);
- }
- }
- break;
- case WIFI_DIRECT_DEVICE_EVENT_ASSOCIATED:
- SysLog(NID_NET_WIFI, "Firing External Event (Type: WIFI_DIRECT_DEVICE_EVENT_ASSOCIATED) : %s",GetErrorMessage(r));
- {
- WifiDirectDeviceInfo* pGroupOwnerInfo = pArg->GetDeviceInfo();
- if (pGroupOwnerInfo == null)
- {
- pDeviceListener->OnWifiDirectAssociationCompleted(localDeviceId, WifiDirectDeviceInfo(), r);
- }
- else
- {
- pDeviceListener->OnWifiDirectAssociationCompleted(localDeviceId, *pGroupOwnerInfo, r);
- }
- }
- break;
- case WIFI_DIRECT_DEVICE_EVENT_CONNECTED:
- SysLog(NID_NET_WIFI, "Firing External Event (Type: WIFI_DIRECT_DEVICE_EVENT_CONNECTED) : %s",GetErrorMessage(r));
- {
- WifiDirectDeviceInfo* pDeviceInfo = pArg->GetDeviceInfo();
- if (pDeviceInfo == null)
- {
- pDeviceListener->OnWifiDirectConnected(localDeviceId, WifiDirectDeviceInfo(), r);
- }
- else
- {
- pDeviceListener->OnWifiDirectConnected(localDeviceId, *pDeviceInfo, r);
- }
- }
- break;
- case WIFI_DIRECT_DEVICE_EVENT_DISCONNECTED:
- {
- SysLog(NID_NET_WIFI, "Firing External Event (Type: WIFI_DIRECT_DEVICE_EVENT_DISCONNECTED) : %s",GetErrorMessage(r));
- String macAddress = pArg->GetMacAddress();
- pDeviceListener->OnWifiDirectDisconnected(localDeviceId, macAddress, r);
- }
- break;
- case WIFI_DIRECT_DEVICE_EVENT_AUTONOMOS_GROUP_CREATED:
- SysLog(NID_NET_WIFI, "Firing External Event (Type: WIFI_DIRECT_DEVICE_EVENT_AUTONOMOS_GROUP_CREATED) : %s",GetErrorMessage(r));
- pDeviceListener->OnWifiDirectAutonomousGroupCreated(localDeviceId, r);
- break;
- case WIFI_DIRECT_DEVICE_EVENT_GROUP_LEFT:
- SysLog(NID_NET_WIFI, "Firing External Event (Type: WIFI_DIRECT_DEVICE_EVENT_GROUP_LEFT) : %s",GetErrorMessage(r));
- pDeviceListener->OnWifiDirectGroupLeft(localDeviceId, r);
- break;
- default:
- SysLog(NID_NET_WIFI, "An undefined external WifiDirectDevice event occurs. (Type: %d)",eventType);
- SysAssert(false);
- break;
- }
- return;
-
-CATCH:
- pDeviceListener->OnWifiDirectScanCompletedN(localDeviceId, null, r);
-
+ const _WifiDirectEventArg* pArg = dynamic_cast< const _WifiDirectEventArg* >(&arg);
+ SysTryReturnVoidResult(NID_NET_WIFI, pArg != null, E_INVALID_ARG, "[E_INVALID_ARG] The argument is a null pointer.");
+
+ IWifiDirectDeviceListener* pDeviceListener = dynamic_cast< IWifiDirectDeviceListener* >(&listener);
+ SysTryReturnVoidResult(NID_NET_WIFI, pDeviceListener != null, E_INVALID_ARG,
+ "[E_INVALID_ARG] The result of a dynamic_cast operation is null for external Device listener.");
+
+ _WifiDirectEventType eventType = pArg->GetEventType();
+ WifiDirectDeviceId localDeviceId = pArg->GetDeviceId();
+ result r = pArg->GetError();
+
+ switch (eventType)
+ {
+ case WIFI_DIRECT_DEVICE_EVENT_ACTIVATED:
+ SysLog(NID_NET_WIFI, "Firing External Event (Type: WIFI_DIRECT_DEVICE_EVENT_ACTIVATED) : %s", GetErrorMessage(r));
+ pDeviceListener->OnWifiDirectDeviceActivated(localDeviceId, r);
+ break;
+
+ case WIFI_DIRECT_DEVICE_EVENT_DEACTIVATED:
+ SysLog(NID_NET_WIFI, "Firing External Event (Type: WIFI_DIRECT_DEVICE_EVENT_DEACTIVATED) : %s", GetErrorMessage(r));
+ pDeviceListener->OnWifiDirectDeviceDeactivated(localDeviceId, r);
+ break;
+
+ case WIFI_DIRECT_DEVICE_EVENT_GROUP_CREATED:
+ SysLog(NID_NET_WIFI, "Firing External Event (Type: WIFI_DIRECT_DEVICE_EVENT_GROUP_CREATED) : %s", GetErrorMessage(r));
+ {
+ WifiDirectGroupInfo* pGroupInfo = pArg->GetGroupInfo();
+ WifiDirectDeviceInfo* pGroupOwnerInfo = pArg->GetDeviceInfo();
+ WifiDirectGroupMember* pGroupMember = pArg->GetGroupMember();
+ pDeviceListener->OnWifiDirectGroupCreatedN(localDeviceId, *pGroupInfo, *pGroupOwnerInfo, pGroupMember, r);
+ }
+ break;
+ case WIFI_DIRECT_DEVICE_EVENT_SCAN_FOUND:
+ SysLog(NID_NET_WIFI, "Firing External Event (Type: WIFI_DIRECT_DEVICE_EVENT_SCAN_FOUND)");
+ {
+ WifiDirectDeviceInfo* pDeviceInfo = pArg->GetDeviceInfo();
+ pDeviceListener->OnWifiDirectRemoteDeviceFound(localDeviceId, *pDeviceInfo);
+ }
+ break;
+ case WIFI_DIRECT_DEVICE_EVENT_SCAN_COMPLETED:
+ SysLog(NID_NET_WIFI, "Firing External Event (Type: WIFI_DIRECT_DEVICE_EVENT_SCAN_COMPLETED) : %s", GetErrorMessage(r));
+ {
+ if (!IsFailed(r))
+ {
+ ArrayList* pSrcDeviceInfoList = dynamic_cast< ArrayList* >(pArg->GetDeviceInfoList());
+ if (pSrcDeviceInfoList == null)
+ {
+ SysLogException(NID_NET_WIFI, E_SYSTEM, "[E_SYSTEM] Failed to dynamic casting DeviceInfo list.");
+ pDeviceListener->OnWifiDirectScanCompletedN(localDeviceId, null, E_SYSTEM);
+ return;
+ }
+
+ ArrayList* pDescDeviceInfoList = new (std::nothrow) ArrayList();
+ if (pSrcDeviceInfoList == null)
+ {
+ SysLogException(NID_NET_WIFI, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ pDeviceListener->OnWifiDirectScanCompletedN(localDeviceId, null, E_SYSTEM);
+ return;
+ }
+
+ result res = pDescDeviceInfoList->Construct(*pSrcDeviceInfoList);
+
+ if (IsFailed(res))
+ {
+ delete pDescDeviceInfoList;
+ pDescDeviceInfoList = null;
+
+ r = E_SYSTEM;
+ }
+
+ pDeviceListener->OnWifiDirectScanCompletedN(localDeviceId, pDescDeviceInfoList, r);
+ }
+ else
+ {
+ pDeviceListener->OnWifiDirectScanCompletedN(localDeviceId, null, r);
+ }
+ }
+ break;
+
+ case WIFI_DIRECT_DEVICE_EVENT_ASSOCIATED:
+ SysLog(NID_NET_WIFI, "Firing External Event (Type: WIFI_DIRECT_DEVICE_EVENT_ASSOCIATED) : %s", GetErrorMessage(r));
+ {
+ WifiDirectDeviceInfo* pGroupOwnerInfo = pArg->GetDeviceInfo();
+ if (pGroupOwnerInfo == null)
+ {
+ pDeviceListener->OnWifiDirectAssociationCompleted(localDeviceId, WifiDirectDeviceInfo(), r);
+ }
+ else
+ {
+ pDeviceListener->OnWifiDirectAssociationCompleted(localDeviceId, *pGroupOwnerInfo, r);
+ }
+ }
+ break;
+
+ case WIFI_DIRECT_DEVICE_EVENT_CONNECTED:
+ SysLog(NID_NET_WIFI, "Firing External Event (Type: WIFI_DIRECT_DEVICE_EVENT_CONNECTED) : %s", GetErrorMessage(r));
+ {
+ WifiDirectDeviceInfo* pDeviceInfo = pArg->GetDeviceInfo();
+ if (pDeviceInfo == null)
+ {
+ pDeviceListener->OnWifiDirectConnected(localDeviceId, WifiDirectDeviceInfo(), r);
+ }
+ else
+ {
+ pDeviceListener->OnWifiDirectConnected(localDeviceId, *pDeviceInfo, r);
+ }
+ }
+ break;
+
+ case WIFI_DIRECT_DEVICE_EVENT_DISCONNECTED:
+ {
+ SysLog(NID_NET_WIFI, "Firing External Event (Type: WIFI_DIRECT_DEVICE_EVENT_DISCONNECTED) : %s", GetErrorMessage(r));
+ String macAddress = pArg->GetMacAddress();
+ pDeviceListener->OnWifiDirectDisconnected(localDeviceId, macAddress, r);
+ }
+ break;
+
+ case WIFI_DIRECT_DEVICE_EVENT_AUTONOMOS_GROUP_CREATED:
+ SysLog(NID_NET_WIFI, "Firing External Event (Type: WIFI_DIRECT_DEVICE_EVENT_AUTONOMOS_GROUP_CREATED) : %s", GetErrorMessage(r));
+ pDeviceListener->OnWifiDirectAutonomousGroupCreated(localDeviceId, r);
+ break;
+
+ case WIFI_DIRECT_DEVICE_EVENT_GROUP_LEFT:
+ SysLog(NID_NET_WIFI, "Firing External Event (Type: WIFI_DIRECT_DEVICE_EVENT_GROUP_LEFT) : %s", GetErrorMessage(r));
+ pDeviceListener->OnWifiDirectGroupLeft(localDeviceId, r);
+ break;
+
+ default:
+ SysLog(NID_NET_WIFI, "An undefined external WifiDirectDevice event occurs. (Type: %d)", eventType);
+ SysAssert(false);
+ break;
+ }
}
} } } // Tizen::Net::Wifi
}
void
-_WifiDirectDeviceImpl::OnWifiDirectGroupCreatedN(const _WifiDirectEventArg& arg,
+_WifiDirectDeviceImpl::OnWifiDirectGroupCreated(const _WifiDirectEventArg& arg,
WifiDirectGroupMemberType wifiDirectMemberType, result r)
{
SysLog(NID_NET_WIFI, "Enter, [DeviceState:%s], [ScanState:%s], [result:%s]",
}
void
-_WifiDirectDeviceImpl::OnWifiDirectScanCompletedN(const _WifiDirectEventArg& arg, result r)
+_WifiDirectDeviceImpl::OnWifiDirectRemoteDeviceFound(const _WifiDirectEventArg& arg)
{
- SysLog(NID_NET_WIFI, "Enter, [DeviceState:%s], [ScanState:%s], [result:%s]",
- GetStringOfCurrentState(), GetStringOfScanState(), GetErrorMessage(r));
+ if (__scanState == WIFI_DIRECT_SCAN_INTERNAL_SCANNING)
+ {
+ _WifiDirectEventArg* pNewArg = new (std::nothrow) _WifiDirectEventArg(arg);
+ SysTryReturnVoidResult(NID_NET_WIFI, pNewArg != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ __pWifiDirectDeviceEvent->FireAsync(*pNewArg);
+ }
+}
+
+void
+_WifiDirectDeviceImpl::OnWifiDirectScanCompleted(const _WifiDirectEventArg& arg, result r)
+{
+ SysLog(NID_NET_WIFI, "Enter, [DeviceState:%s], [ScanState:%s], [result:%s]",
+ GetStringOfCurrentState(), GetStringOfScanState(), GetErrorMessage(r));
bool isFired = false;
- __stateMutex.Acquire();
+ __stateMutex.Acquire();
if (__scanState != WIFI_DIRECT_SCAN_INTERNAL_IDLE)
{
- isFired = true;
+ isFired = true;
__scanState = WIFI_DIRECT_SCAN_INTERNAL_IDLE;
}
- __stateMutex.Release();
+ __stateMutex.Release();
if (isFired)
{
SysLog(NID_NET_WIFI, "[SCANCOMPLETED_Event:%s]", isFired ? "Fired" : "NotFired");
SysLog(NID_NET_WIFI, "Exit, [DeviceState:%s], [ScanState:%s], [result:%s]",
- GetStringOfCurrentState(), GetStringOfScanState(), GetErrorMessage(r));
+ GetStringOfCurrentState(), GetStringOfScanState(), GetErrorMessage(r));
}
void
{
SysTryReturnVoidResult(NID_NET_WIFI, pWifiDirectDevice != null, E_INVALID_ARG, "[E_INVALID_ARG] WifiDirectDevice is null.");
- pWifiDirectDevice->RemoveWifiDirectGroupClientListener(*pClientListener);
- pWifiDirectDevice->RemoveWifiDirectGroupOwnerListener(*pOwnerListener);
- pWifiDirectDevice->RemoveWifiDirectDeviceListener(*pDeviceListener);
+ if (pClientListener != null)
+ {
+ pWifiDirectDevice->RemoveWifiDirectGroupClientListener(*pClientListener);
+ }
- delete pWifiDirectDevice;
+ if (pOwnerListener != null)
+ {
+ pWifiDirectDevice->RemoveWifiDirectGroupOwnerListener(*pOwnerListener);
+ }
+
+ if (pDeviceListener != null)
+ {
+ pWifiDirectDevice->RemoveWifiDirectDeviceListener(*pDeviceListener);
+ }
- return;
+ delete pWifiDirectDevice;
}
_OSP_EXPORT_ result
}
_OSP_EXPORT_ Tizen::Base::String
-_WifiDirectDeviceInfoImpl_GetVirtualMacAddress(const Tizen::Net::Wifi::WifiDirectDeviceInfo& deviceInfo)
+_WifiDirectDeviceInfoImpl_GetMacAddress(const Tizen::Net::Wifi::WifiDirectDeviceInfo& deviceInfo)
{
- const Tizen::Net::Wifi::_WifiDirectDeviceInfoImpl* pWifiDirectDeviceInfoImpl = null;
-
- pWifiDirectDeviceInfoImpl = Tizen::Net::Wifi::_WifiDirectDeviceInfoImpl::GetInstance(deviceInfo);
- SysTryReturn(NID_NET_WIFI, pWifiDirectDeviceInfoImpl != null, Tizen::Base::String(L""), E_SYSTEM,
- "[E_SYSTEM] A system error has occurred. Failed to get WifiDirectDeviceInfo instance.");
-
- return pWifiDirectDeviceInfoImpl->GetVirtualMacAddress();
+ return deviceInfo.GetMacAddress();
}
#ifdef __cplusplus
void
_WifiDirectEvent::FireImpl(Tizen::Base::Runtime::IEventListener& listener, const Tizen::Base::Runtime::IEventArg& arg)
{
- _WifiDirectEventArg* pArg = const_cast< _WifiDirectEventArg*>(dynamic_cast<const _WifiDirectEventArg*>(&arg));
- SysTryReturnVoidResult(NID_NET_WIFI, pArg != null, E_INVALID_ARG, "[E_INVALID_ARG] The argument is a null pointer.");
-
- _IWifiDirectListener* pInternalListener = dynamic_cast<_IWifiDirectListener*>(&listener);
- SysTryReturnVoidResult(NID_NET_WIFI, pInternalListener != null, E_INVALID_ARG,
- "[E_INVALID_ARG] The result of a dynamic_cast operation is null for internal listener.");
-
- _WifiDirectEventType eventType = pArg->GetEventType();
- result r = pArg->GetError();
-
- switch (eventType)
- {
- case WIFI_DIRECT_DEVICE_EVENT_ACTIVATED:
- SysLog(NID_NET_WIFI, "Firing Internal Event (Type: WIFI_DIRECT_DEVICE_EVENT_ACTIVATED) : %s",GetErrorMessage(r));
- pInternalListener->OnWifiDirectDeviceActivated(*pArg, r);
- break;
- case WIFI_DIRECT_DEVICE_EVENT_DEACTIVATED:
- SysLog(NID_NET_WIFI, "Firing Internal Event (Type: WIFI_DIRECT_DEVICE_EVENT_DEACTIVATED) : %s",GetErrorMessage(r));
- pInternalListener->OnWifiDirectDeviceDeactivated(*pArg, r);
- break;
- case WIFI_DIRECT_DEVICE_EVENT_GROUP_CREATED:
- SysLog(NID_NET_WIFI, "Firing Internal Event (Type: WIFI_DIRECT_DEVICE_EVENT_GROUP_CREATED) : %s",GetErrorMessage(r));
- pInternalListener->OnWifiDirectGroupCreatedN(*pArg, pArg->GetGroupMemberType(), r);
- break;
- case WIFI_DIRECT_DEVICE_EVENT_SCAN_COMPLETED:
- SysLog(NID_NET_WIFI, "Firing Internal Event (Type: WIFI_DIRECT_DEVICE_EVENT_SCAN_COMPLETED) : %s",GetErrorMessage(r));
- pInternalListener->OnWifiDirectScanCompletedN(*pArg, r);
- break;
- case WIFI_DIRECT_DEVICE_EVENT_ASSOCIATED:
- SysLog(NID_NET_WIFI, "Firing Internal Event (Type: WIFI_DIRECT_DEVICE_EVENT_ASSOCIATED) : %s",GetErrorMessage(r));
- pInternalListener->OnWifiDirectAssociationCompleted(*pArg, r);
- break;
- case WIFI_DIRECT_GO_EVENT_CLIENT_ASSOCIATED:
- SysLog(NID_NET_WIFI, "Firing Internal Event (Type: WIFI_DIRECT_GO_EVENT_CLIENT_ASSOCIATED) : %s",GetErrorMessage(r));
- pInternalListener->OnWifiDirectClientAssociated(*pArg);
- break;
- case WIFI_DIRECT_GO_EVENT_CLIENT_DISASSOCIATED:
- SysLog(NID_NET_WIFI, "Firing Internal Event (Type: WIFI_DIRECT_GO_EVENT_CLIENT_DISASSOCIATED) : %s",GetErrorMessage(r));
- {
- WifiDirectAssociationTerminationReason reason = pArg->GetDisassociationReason();
- pInternalListener->OnWifiDirectClientDisassociated(*pArg, reason);
- }
- break;
- case WIFI_DIRECT_GO_EVENT_GROUP_DESTROYED:
- SysLog(NID_NET_WIFI, "Firing Internal Event (Type: WIFI_DIRECT_GO_EVENT_GROUP_DESTROYED) : %s",GetErrorMessage(r));
- pInternalListener->OnWifiDirectGroupDestroyed(*pArg, r);
- break;
- case WIFI_DIRECT_GC_EVENT_DISASSOCIATED:
- SysLog(NID_NET_WIFI, "Firing Internal Event (Type: WIFI_DIRECT_GC_EVENT_DISASSOCIATED) : %s",GetErrorMessage(r));
- pInternalListener->OnWifiDirectAssociationTerminated(*pArg, r);
- break;
- case WIFI_DIRECT_DEVICE_EVENT_CONNECTED:
- SysLog(NID_NET_WIFI, "Firing Internal Event (Type: WIFI_DIRECT_DEVICE_EVENT_CONNECTED) : %s",GetErrorMessage(r));
- pInternalListener->OnWifiDirectConnected(*pArg, r);
- break;
- case WIFI_DIRECT_DEVICE_EVENT_DISCONNECTED:
- SysLog(NID_NET_WIFI, "Firing Internal Event (Type: WIFI_DIRECT_DEVICE_EVENT_DISCONNECTED) : %s",GetErrorMessage(r));
- pInternalListener->OnWifiDirectDisconnected(*pArg, r);
- break;
- case WIFI_DIRECT_DEVICE_EVENT_AUTONOMOS_GROUP_CREATED:
- SysLog(NID_NET_WIFI, "Firing Internal Event (Type: WIFI_DIRECT_DEVICE_EVENT_AUTONOMOS_GROUP_CREATED) : %s",GetErrorMessage(r));
- pInternalListener->OnWifiDirectAutonomousGroupCreated(*pArg, r);
- break;
- case WIFI_DIRECT_DEVICE_EVENT_GROUP_LEFT:
- SysLog(NID_NET_WIFI, "Firing Internal Event (Type: WIFI_DIRECT_DEVICE_EVENT_GROUP_LEFT) : %s",GetErrorMessage(r));
- pInternalListener->OnWifiDirectGroupLeft(*pArg, r);
- break;
- default:
- SysLog(NID_NET_WIFI, "An undefined internal WifiDirectDevice event occurs. (Type: %d)",eventType);
- SysAssert(false);
- break;
- }
+ _WifiDirectEventArg* pArg = const_cast< _WifiDirectEventArg* >(dynamic_cast< const _WifiDirectEventArg* >(&arg));
+ SysTryReturnVoidResult(NID_NET_WIFI, pArg != null, E_INVALID_ARG, "[E_INVALID_ARG] The argument is a null pointer.");
+
+ _IWifiDirectListener* pInternalListener = dynamic_cast< _IWifiDirectListener* >(&listener);
+ SysTryReturnVoidResult(NID_NET_WIFI, pInternalListener != null, E_INVALID_ARG,
+ "[E_INVALID_ARG] The result of a dynamic_cast operation is null for internal listener.");
+
+ _WifiDirectEventType eventType = pArg->GetEventType();
+ result r = pArg->GetError();
+
+ switch (eventType)
+ {
+ case WIFI_DIRECT_DEVICE_EVENT_ACTIVATED:
+ SysLog(NID_NET_WIFI, "Firing Internal Event (Type: WIFI_DIRECT_DEVICE_EVENT_ACTIVATED) : %s", GetErrorMessage(r));
+ pInternalListener->OnWifiDirectDeviceActivated(*pArg, r);
+ break;
+
+ case WIFI_DIRECT_DEVICE_EVENT_DEACTIVATED:
+ SysLog(NID_NET_WIFI, "Firing Internal Event (Type: WIFI_DIRECT_DEVICE_EVENT_DEACTIVATED) : %s", GetErrorMessage(r));
+ pInternalListener->OnWifiDirectDeviceDeactivated(*pArg, r);
+ break;
+
+ case WIFI_DIRECT_DEVICE_EVENT_GROUP_CREATED:
+ SysLog(NID_NET_WIFI, "Firing Internal Event (Type: WIFI_DIRECT_DEVICE_EVENT_GROUP_CREATED) : %s", GetErrorMessage(r));
+ pInternalListener->OnWifiDirectGroupCreated(*pArg, pArg->GetGroupMemberType(), r);
+ break;
+
+ case WIFI_DIRECT_DEVICE_EVENT_SCAN_FOUND:
+ SysLog(NID_NET_WIFI, "Firing Internal Event (Type: WIFI_DIRECT_DEVICE_EVENT_SCAN_FOUND)");
+ pInternalListener->OnWifiDirectRemoteDeviceFound(*pArg);
+ break;
+
+ case WIFI_DIRECT_DEVICE_EVENT_SCAN_COMPLETED:
+ SysLog(NID_NET_WIFI, "Firing Internal Event (Type: WIFI_DIRECT_DEVICE_EVENT_SCAN_COMPLETED) : %s", GetErrorMessage(r));
+ pInternalListener->OnWifiDirectScanCompleted(*pArg, r);
+ break;
+
+ case WIFI_DIRECT_DEVICE_EVENT_ASSOCIATED:
+ SysLog(NID_NET_WIFI, "Firing Internal Event (Type: WIFI_DIRECT_DEVICE_EVENT_ASSOCIATED) : %s", GetErrorMessage(r));
+ pInternalListener->OnWifiDirectAssociationCompleted(*pArg, r);
+ break;
+
+ case WIFI_DIRECT_GO_EVENT_CLIENT_ASSOCIATED:
+ SysLog(NID_NET_WIFI, "Firing Internal Event (Type: WIFI_DIRECT_GO_EVENT_CLIENT_ASSOCIATED) : %s", GetErrorMessage(r));
+ pInternalListener->OnWifiDirectClientAssociated(*pArg);
+ break;
+
+ case WIFI_DIRECT_GO_EVENT_CLIENT_DISASSOCIATED:
+ SysLog(NID_NET_WIFI, "Firing Internal Event (Type: WIFI_DIRECT_GO_EVENT_CLIENT_DISASSOCIATED) : %s", GetErrorMessage(r));
+ {
+ WifiDirectAssociationTerminationReason reason = pArg->GetDisassociationReason();
+ pInternalListener->OnWifiDirectClientDisassociated(*pArg, reason);
+ }
+ break;
+
+ case WIFI_DIRECT_GO_EVENT_GROUP_DESTROYED:
+ SysLog(NID_NET_WIFI, "Firing Internal Event (Type: WIFI_DIRECT_GO_EVENT_GROUP_DESTROYED) : %s", GetErrorMessage(r));
+ pInternalListener->OnWifiDirectGroupDestroyed(*pArg, r);
+ break;
+
+ case WIFI_DIRECT_GC_EVENT_DISASSOCIATED:
+ SysLog(NID_NET_WIFI, "Firing Internal Event (Type: WIFI_DIRECT_GC_EVENT_DISASSOCIATED) : %s", GetErrorMessage(r));
+ pInternalListener->OnWifiDirectAssociationTerminated(*pArg, r);
+ break;
+
+ case WIFI_DIRECT_DEVICE_EVENT_CONNECTED:
+ SysLog(NID_NET_WIFI, "Firing Internal Event (Type: WIFI_DIRECT_DEVICE_EVENT_CONNECTED) : %s", GetErrorMessage(r));
+ pInternalListener->OnWifiDirectConnected(*pArg, r);
+ break;
+
+ case WIFI_DIRECT_DEVICE_EVENT_DISCONNECTED:
+ SysLog(NID_NET_WIFI, "Firing Internal Event (Type: WIFI_DIRECT_DEVICE_EVENT_DISCONNECTED) : %s", GetErrorMessage(r));
+ pInternalListener->OnWifiDirectDisconnected(*pArg, r);
+ break;
+
+ case WIFI_DIRECT_DEVICE_EVENT_AUTONOMOS_GROUP_CREATED:
+ SysLog(NID_NET_WIFI, "Firing Internal Event (Type: WIFI_DIRECT_DEVICE_EVENT_AUTONOMOS_GROUP_CREATED) : %s", GetErrorMessage(r));
+ pInternalListener->OnWifiDirectAutonomousGroupCreated(*pArg, r);
+ break;
+
+ case WIFI_DIRECT_DEVICE_EVENT_GROUP_LEFT:
+ SysLog(NID_NET_WIFI, "Firing Internal Event (Type: WIFI_DIRECT_DEVICE_EVENT_GROUP_LEFT) : %s", GetErrorMessage(r));
+ pInternalListener->OnWifiDirectGroupLeft(*pArg, r);
+ break;
+
+ default:
+ SysLog(NID_NET_WIFI, "An undefined internal WifiDirectDevice event occurs. (Type: %d)", eventType);
+ SysAssert(false);
+ break;
+ }
}
} } } // Tizen::Net::Wifi
WIFI_DIRECT_DEVICE_EVENT_ACTIVATED,
WIFI_DIRECT_DEVICE_EVENT_DEACTIVATED,
WIFI_DIRECT_DEVICE_EVENT_GROUP_CREATED,
+ WIFI_DIRECT_DEVICE_EVENT_SCAN_FOUND,
WIFI_DIRECT_DEVICE_EVENT_SCAN_COMPLETED,
WIFI_DIRECT_DEVICE_EVENT_ASSOCIATED,
WIFI_DIRECT_DEVICE_EVENT_CONNECTED,
* @param[in] wifiDirectGroupOwnerDeviceInfo A reference to the WifiDirectDeviceInfo instance of the group owner.
* @param[in] r The error code.
*
- * @remarks This method can be used for WIFI_DIRECT_DEVICE_EVENT_ASSOCIATED, WIFI_DIRECT_GO_EVENT_CLIENT_ASSOCIATED
+ * @remarks This method can be used for WIFI_DIRECT_DEVICE_EVENT_SCAN_FOUND, WIFI_DIRECT_DEVICE_EVENT_ASSOCIATED, WIFI_DIRECT_GO_EVENT_CLIENT_ASSOCIATED
* ,WIFI_DIRECT_GC_EVENT_GROUP_OWNER_INFO_RESPONDED or WIFI_DIRECT_DEVICE_EVENT_CONNECTED event.
*/
_WifiDirectEventArg(_WifiDirectEventType eventType, WifiDirectDeviceId localDeviceId,
r = InitializeCurrentState();
SysTryCatch(NID_NET_WIFI, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
- r = __peerList.Construct();
+ r = __connectedPeerList.Construct();
SysTryCatch(NID_NET_WIFI, r == E_SUCCESS, , E_SYSTEM, "[%s] Construction of ArrayList has failed.", GetErrorMessage(r));
__pWifiDirectEvent = move(pWifiDirectEvent);
_WifiDirectSystemAdapter::AddPeerInfo(WifiDirectDeviceInfo* pPeerInfo)
{
WifiDirectDeviceInfo* pPeerInfoTemp = new WifiDirectDeviceInfo(*pPeerInfo);
- return __peerList.Add(*pPeerInfoTemp);
+ return __connectedPeerList.Add(*pPeerInfoTemp);
}
result
_WifiDirectSystemAdapter::RemovePeerInfo(WifiDirectDeviceInfo* pPeerInfo)
{
- return __peerList.Remove(*pPeerInfo, true);
+ return __connectedPeerList.Remove(*pPeerInfo, true);
}
WifiDirectDeviceInfo*
_WifiDirectSystemAdapter::GetPeerInfo(const String& macAddress)
{
WifiDirectDeviceInfo* pDeviceInfo = null;
- for(int i = 0; i < __peerList.GetCount(); i++)
+ for(int i = 0; i < __connectedPeerList.GetCount(); i++)
{
- pDeviceInfo = dynamic_cast<WifiDirectDeviceInfo*>(__peerList.GetAt(i));
+ pDeviceInfo = dynamic_cast<WifiDirectDeviceInfo*>(__connectedPeerList.GetAt(i));
if (pDeviceInfo != null && pDeviceInfo->GetMacAddress() == macAddress)
{
, __pScanResult(null)
, __currentState(WIFI_DIRECT_SYSTEM_DEACTIVATED)
, __currentScanState(WIFI_DIRECT_SYSTEM_SCAN_IDLE)
- , __peerList()
+ , __connectedPeerList(SingleObjectDeleter)
+ , __discoveredPeerList(SingleObjectDeleter)
+
, __pWifiServiceProxy(null)
{
{
int err = WIFI_DIRECT_ERROR_NONE;
- __peerList.RemoveAll(true);
-
err = wifi_direct_deinitialize();
SysLog(NID_NET_WIFI, "[0x%x] Return value of wifi_direct_deinitialize()", err);
}
result r = E_SYSTEM;
_WifiDirectConvertErrorResult(errorCode == WIFI_DIRECT_ERROR_NONE, r, E_SUCCESS);
+ ArrayList foundPeerList(SingleObjectDeleter);
+
switch(discoveryState)
{
case WIFI_DIRECT_ONLY_LISTEN_STARTED:
break;
case WIFI_DIRECT_DISCOVERY_STARTED:
SysLog(NID_NET_WIFI, "discoveryState : WIFI_DIRECT_DISCOVERY_STARTED");
+ __pWifiDirectSystemAdapter->__discoveredPeerList.RemoveAll();
break;
case WIFI_DIRECT_DISCOVERY_FOUND:
SysLog(NID_NET_WIFI, "discoveryState : WIFI_DIRECT_DISCOVERY_FOUND");
r = _WifiDirectUtility::ConvertErrorCode(err);
SysTryCatch(NID_NET_WIFI, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
}
+ else if (__pWifiDirectSystemAdapter->__currentScanState == WIFI_DIRECT_SYSTEM_SCAN_SCANNING)
+ {
+ int err = wifi_direct_foreach_discovered_peers(OnWifiDirectPeerFound, &foundPeerList);
+ SysLog(NID_NET_WIFI, "[0x%x] Return value of wifi_direct_foreach_discovered_peers()", err);
+ r = _WifiDirectUtility::ConvertErrorCode(err);
+ SysTryCatch(NID_NET_WIFI, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+ }
+
break;
case WIFI_DIRECT_DISCOVERY_FINISHED:
SysLog(NID_NET_WIFI, "discoveryState: WIFI_DIRECT_DISCOVERY_FINISHED");
}
bool
+_WifiDirectSystemAdapter::OnWifiDirectPeerFound(wifi_direct_discovered_peer_info_s* peer, void* pUserData)
+{
+ unique_ptr<WifiDirectDeviceInfo> pDeviceInfo(_WifiDirectUtility::ConvertDiscoveryEntry2DeviceInfoN(*peer));
+ SysTryReturn(NID_NET_WIFI, pDeviceInfo != null, false, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+
+ int index = 0;
+
+ result r = __pWifiDirectSystemAdapter->__discoveredPeerList.IndexOf(*pDeviceInfo, index);
+
+ if (r == E_OBJ_NOT_FOUND || r == E_OUT_OF_RANGE)
+ {
+ _WifiDirectEventArg* pEventArg = new (std::nothrow)_WifiDirectEventArg(WIFI_DIRECT_DEVICE_EVENT_SCAN_FOUND, DEFAULT_DEVICE_ID,
+ *pDeviceInfo);
+ SysTryReturn(NID_NET_WIFI, pEventArg != null, false, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+
+ __pWifiDirectSystemAdapter->__pWifiDirectEvent->FireAsync(*pEventArg);
+
+ __pWifiDirectSystemAdapter->__discoveredPeerList.Add(pDeviceInfo.release());
+ }
+
+ return true;
+}
+
+bool
_WifiDirectSystemAdapter::OnWifiDirectEachConnectedClient(wifi_direct_connected_peer_info_s* pPeer, void* pUserData)
{
IList* pList = static_cast<IList*>(pUserData);
*/
static void OnWifiDirectClientIpAssigned(const char *mac_address, const char *ip_address,
const char *interface_address, void *user_data);
+
+ /**
+ * Call back for each discovered device
+ *
+ * @param[in] pPeer Device Information
+ * @param[in] pUserData The user data passed from the callback registration function
+ */
+ static bool OnWifiDirectPeerFound(wifi_direct_discovered_peer_info_s* pPeer, void* pUserData);
+
/**
- * Call back for each Discovered device
+ * Call back for each discovered device
*
* @param[in] pPeer Device Information
* @param[in] pUserData The user data passed from the callback registration function
Tizen::Base::Collection::IList* __pScanResult;
_WifiDirectSystemState __currentState;
_WifiDirectSystemScanState __currentScanState;
- Tizen::Base::Collection::ArrayList __peerList;
+ Tizen::Base::Collection::ArrayList __connectedPeerList;
+ Tizen::Base::Collection::ArrayList __discoveredPeerList;
_WifiIpcProxy* __pWifiServiceProxy;
friend class std::default_delete<_WifiDirectSystemAdapter>;
};
connection_profile_get_wifi_bssid(profileHandle, &pBssid);
SysTryCatch(NID_NET_WIFI, pBssid, , E_SYSTEM,
"[E_SYSTEM] connection_profile_get_wifi_essid failed.");
-
- bssid = String(pBssid);
+ bssid = _WifiUtility::ConvertMacAddress(pBssid);
free(pBssid);
wifiBssType = WIFI_BSS_TYPE_INFRASTRUCTURE;
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,