diff options
author | dukan.kim <dukan.kim@samsung.com> | 2013-12-09 15:54:20 +0900 |
---|---|---|
committer | dukan.kim <dukan.kim@samsung.com> | 2013-12-09 15:56:38 +0900 |
commit | d2ffcdd0f633b45639766e9e0aa5c6074570d981 (patch) | |
tree | 99eab9d4cd54018c5b64d7d14be4e62dee9d0919 | |
parent | 1c09b080c21e4505770ed2133bbb674ff2f00eb9 (diff) | |
download | bluetooth-d2ffcdd0f633b45639766e9e0aa5c6074570d981.tar.gz bluetooth-d2ffcdd0f633b45639766e9e0aa5c6074570d981.tar.bz2 bluetooth-d2ffcdd0f633b45639766e9e0aa5c6074570d981.zip |
Merged from Tizen2.2submit/tizen/20131209.075925accepted/tizen/mobile/20131216.220438
Change-Id: I6aa5b88fa4ac3e9a6236f782c0ee2d0260f8dfb2
Signed-off-by: dukan.kim <dukan.kim@samsung.com>
38 files changed, 458 insertions, 823 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a04d661..146baec 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,17 +9,17 @@ INCLUDE_DIRECTORIES( src src/inc /usr/include/chromium - /usr/include/glib-2.0 - /usr/lib/glib-2.0/include + /usr/include/glib-2.0 + /usr/lib/glib-2.0/include /usr/include/system /usr/include/network /usr/include/osp /usr/include/osp/app /usr/include/osp/base - /usr/include/osp/io + /usr/include/osp/io /usr/include/osp/net - /usr/include/osp/security - /usr/include/osp/system + /usr/include/osp/security + /usr/include/osp/system ) SET (${this_target}_SOURCE_FILES @@ -32,8 +32,6 @@ SET (${this_target}_SOURCE_FILES src/FNetBtBluetoothSppInitiator.cpp src/FNetBtBluetoothHealth.cpp src/FNetBt_BluetoothAdapterUtility.cpp - src/FNetBt_BluetoothConnectionEvent.cpp - src/FNetBt_BluetoothConnectionEventArg.cpp src/FNetBt_BluetoothDeviceEvent.cpp src/FNetBt_BluetoothDeviceEventArg.cpp src/FNetBt_BluetoothDeviceImpl.cpp @@ -83,22 +81,39 @@ TARGET_LINK_LIBRARIES(${this_target} "-lpthread" ) TARGET_LINK_LIBRARIES(${this_target} "-L/usr/lib/osp -losp-appfw -losp-net" ) TARGET_LINK_LIBRARIES(${this_target} "-lcapi-network-bluetooth" ) -SET_TARGET_PROPERTIES(${this_target} - PROPERTIES +SET_TARGET_PROPERTIES(${this_target} + PROPERTIES VERSION ${FULLVER} SOVERSION ${MAJORVER} CLEAN_DIRECT_OUTPUT 1 ) -INSTALL(DIRECTORY ${LIBRARY_OUTPUT_PATH}/ DESTINATION lib/osp - FILES_MATCHING PATTERN "*.so*" - PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ +ADD_CUSTOM_COMMAND(TARGET ${this_target} + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${LIBRARY_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX} ${LIBRARY_OUTPUT_PATH}/debug/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX}.${FULLVER} + COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX}.${FULLVER} ${LIBRARY_OUTPUT_PATH}/debug/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX}.${MAJORVER} + COMMAND ${CMAKE_STRIP} --strip-unneeded ${LIBRARY_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX} + COMMENT "strip ${this_target}" + ) + +INSTALL(DIRECTORY ${LIBRARY_OUTPUT_PATH}/ DESTINATION lib/osp + FILES_MATCHING PATTERN "*.so*" + PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ + GROUP_EXECUTE GROUP_READ + WORLD_EXECUTE WORLD_READ) +INSTALL(DIRECTORY ${LIBRARY_OUTPUT_PATH}/debug/ DESTINATION lib/osp/debug + FILES_MATCHING PATTERN "*.so*" + PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ) INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/inc/ DESTINATION include/osp FILES_MATCHING PATTERN "*.h") INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/src/inc/ DESTINATION include/osp/net FILES_MATCHING PATTERN "*.h") +SET(PC_NAME ${this_target}) +SET(VERSION ${FULLVER}) +SET(PC_LDFLAGS -l${this_target}) + # pkgconfig file CONFIGURE_FILE(${this_target}.pc.in ${CMAKE_SOURCE_DIR}/${this_target}.pc @ONLY) INSTALL(FILES ${CMAKE_SOURCE_DIR}/${this_target}.pc DESTINATION lib/pkgconfig)
\ No newline at end of file diff --git a/inc/FNetBluetooth.h b/inc/FNetBluetooth.h index 6c611e3..1ea0688 100755 --- a/inc/FNetBluetooth.h +++ b/inc/FNetBluetooth.h @@ -44,20 +44,20 @@ namespace Tizen { namespace Net { /** * @namespace Tizen::Net::Bluetooth - * @brief This namespace contains the classes and interfaces for %Bluetooth services. + * @brief This namespace contains classes and interfaces for %Bluetooth services. * @since 2.0 * * @remarks @b Header @b %file: @b \#include @b <FNet.h> @n - * @b Library : @b osp-bluetooth @n + * @b Library: @b osp-bluetooth + * + * The %Bluetooth namespace contains classes and interfaces for %Bluetooth services that provide mechanisms for + * peer-to-peer communication that involves connecting, sending, and receiving data over a %Bluetooth connection. It + * consists of submodules that support different profiles such as GAP, OPP, and SPP. * - * The %Bluetooth namespace contains the classes and interfaces for %Bluetooth services that provide the mechanisms for - * peer-to-peer communication involving connecting, sending, and receiving data over a %Bluetooth connection. It - * consists of the submodules that support different profiles such as GAP, OPP, and SPP. - * @n * For more information on the %Bluetooth namespace features, see * <a href="../org.tizen.native.appprogramming/html/guide/net/bluetooth_namespace.htm">Bluetooth Guide</a>. * - * The following diagram illustrates the relationships between the classes within the %Bluetooth namespace. + * The following diagram illustrates the relationships between the classes belonging to the %Bluetooth namespace. * @image html net_bluetooth_using_the_apis_classdiagram.png * */ diff --git a/inc/FNetBtBluetoothDevice.h b/inc/FNetBtBluetoothDevice.h index f1806dc..e698290 100755 --- a/inc/FNetBtBluetoothDevice.h +++ b/inc/FNetBtBluetoothDevice.h @@ -79,14 +79,14 @@ public: * * @param[in] address The %Bluetooth device address * @param[in] deviceName The name of the device - * @param[in] majorClassType The major class type of a %Bluetooth device - * @param[in] minorClassType The minor class type of a %Bluetooth device + * @param[in] majorClassType The major class type of the %Bluetooth device + * @param[in] minorClassType The minor class type of the %Bluetooth device * @param[in] serviceClassList The service class type list * @param[in] serviceList The service type list * @remarks - * - The @c serviceClassList parameter consists of Bluetooth::BluetoothServiceClassType values, which + * - The @c serviceClassList consists of Bluetooth::BluetoothServiceClassType values, which * are joined by the logical OR operator. - * - The @c serviceList parameter consists of Bluetooth::BluetoothServiceType values which are joined + * - The @c serviceList consists of Bluetooth::BluetoothServiceType values which are joined * by the logical OR operator. * @endif */ @@ -99,7 +99,7 @@ public: * * @since 2.0 * - * @param[in] value An instance of %BluetoothDevice + * @param[in] value An instance of %BluetoothDevice to copy */ BluetoothDevice(const BluetoothDevice& value); @@ -111,23 +111,23 @@ public: virtual ~BluetoothDevice(void); /** - * Gets the address of a %Bluetooth device which consists of @c 6 bytes. + * Gets the address of the %Bluetooth device which consists of @c 6 bytes. * * @since 2.0 * - * @return The address of a %Bluetooth device + * @return The address of the %Bluetooth device */ const Tizen::Base::ByteBuffer* GetAddress(void) const; /** - * Sets the address of a %Bluetooth device. + * Sets the address of the %Bluetooth device. * * @since 2.0 * * @return An error code - * @param[in] address An address of the %Bluetooth device + * @param[in] address The address of the %Bluetooth device * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG The specified address is invalid. @n + * @exception E_INVALID_ARG The specified input parameter is invalid. @n * The size of the address should be @c 6 bytes. * @remarks Setting the address of the %BluetoothDevice instance which is obtained from the paired list does not * affect the information of the paired list in the system. @@ -187,7 +187,7 @@ public: * * @since 2.0 * - * @return The service class of the device + * @return The service class of the %Bluetooth device */ unsigned long GetServiceClassList(void) const; @@ -218,7 +218,7 @@ public: * * @return @c true if both the instances are equal, @n * else @c false - * @param[in] obj The object to compare + * @param[in] obj The object to compare */ virtual bool Equals(const Tizen::Base::Object& obj) const; @@ -236,18 +236,19 @@ public: * * @brief <i> [Deprecated] </i> * @deprecated This method is deprecated because the type of AppControl result has changed. Instead of using this - * method, GetInstanceFromAppControlResultN(const Tizen::Base::Collection::IMap&) is + * method, the GetInstanceFromAppControlResultN(const Tizen::Base::Collection::IMap&) method is * recommended. * * @since 2.0 * - * @return The %Bluetooth device containing the specified information extracted from the input data if successful, @n - * else @c null + * @return The %Bluetooth device that contains the specified information extracted from the input data, @n + * else @c null if it fails * @param[in] appControlResult The data list, which is the result of the %Bluetooth AppControl * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG The specified list contains an invalid value. @n - * The result of %Bluetooth AppControl is only permitted to be used as an input - * argument. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified list contains an invalid value. + * - The result of %Bluetooth AppControl is only permitted to be used as an input + * argument. * @remarks The specific error code can be accessed using the GetLastResult() method. */ static BluetoothDevice* GetInstanceFromAppControlResultN(const Tizen::Base::Collection::IList& appControlResult); @@ -257,13 +258,14 @@ public: * * @since 2.1 * - * @return The %Bluetooth device containing the specified information extracted from the input data if successful, @n - * else @c null + * @return The %Bluetooth device that contains the specified information extracted from the input data, @n + * else @c null if it fails * @param[in] appControlResult The data map, which is the result of the %Bluetooth AppControl * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG The specified map contains an invalid value. @n - * The result of %Bluetooth AppControl is only permitted to be used as an input - * argument. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified map contains an invalid value. + * - The result of %Bluetooth AppControl is only permitted to be used as an input + * argument. * @remarks The specific error code can be accessed using the GetLastResult() method. * @see <a href="../org.tizen.native.appprogramming/html/guide/app/appcontrol_bluetooth.htm">Bluetooth * AppControl</a>. diff --git a/inc/FNetBtBluetoothHealth.h b/inc/FNetBtBluetoothHealth.h index 0e335c9..c9971c6 100755 --- a/inc/FNetBtBluetoothHealth.h +++ b/inc/FNetBtBluetoothHealth.h @@ -42,28 +42,31 @@ class _BluetoothHealthImpl; /** * @class BluetoothHealth - * @brief This class provides the methods to handle the %Bluetooth Health Device Profile (HDP), such as the + * @brief This class provides methods to handle the %Bluetooth Health Device Profile (HDP), such as * establishing a connection and exchanging data through the data channel. * @since 2.0 * * @final This class is not intended for extension. * - * This %BluetoothHealth class provides the methods to handle the %Bluetooth Health Device Profile (HDP), which is a + * This %BluetoothHealth class provides methods to handle the %Bluetooth Health Device Profile (HDP), which is a * profile that defines the requirements for qualified %Bluetooth healthcare and fitness (referred to as 'health') * device implementations. @n - * This class allows Sink device such as mobile phone to establish a connection and exchange data to Source devices + * This class allows a sink device such as a mobile phone to establish a connection and exchange data to source devices * such as blood pressure monitors, weight scales, glucose meters, thermometers, and pulse oximeters. * * For more information on the class features, see * <a href="../org.tizen.native.appprogramming/html/guide/net/bluetooth_namespace.htm">Bluetooth Guide</a>. + * + * The following diagram illustrates the interactions between this class and the application. + * @image html net_bluetooth_health_sequence_diagram.png */ class _OSP_EXPORT_ BluetoothHealth : public Tizen::Base::Object { public: /** - * The object is not fully constructed after this constructor is called. For full construction, the Construct() - * method must be called right after calling this constructor. + * The object is not fully constructed after this constructor is called. @n + * For full construction, the Construct() method must be called right after calling this constructor. * * @since 2.0 */ @@ -83,7 +86,7 @@ public: * @feature %http://tizen.org/feature/network.bluetooth * * @return An error code - * @param[in] listener The event listener for the %BluetoothHealth @n + * @param[in] listener The event listener for %BluetoothHealth @n * The specified listener must be allocated at heap, not stack. * @exception E_SUCCESS The method is successful. * @exception E_OUT_OF_MEMORY The memory is insufficient. @@ -98,9 +101,9 @@ public: result Construct(IBluetoothHealthEventListener& listener); /** - * Starts %Bluetooth health as a role of sink with the specified data type. @n - * One %BluetoothHealth instance supports only a sink role with the specific data type at one time and only one - * sink role for the specific data type can be enabled system-widely. @n + * Starts %BluetoothHealth as a role of sink with the specified data type. @n + * One %BluetoothHealth instance supports only one sink role with the specific data type at one time and only one + * sink role for the specific data type can be enabled system-wide. @n * For providing sink roles with various data types, make multiple %BluetoothHealth instances with different data types. * * @since 2.0 @@ -109,25 +112,25 @@ public: * * @return An error code * @param[in] dataType The type of data used in communication which is defined in ISO/IEEE - * 11073-20601 and represents type of health device such as thermometer, + * 11073-20601 and represents the type of health device such as thermometer, * heart rate monitor, weight scale, and so on * @exception E_SUCCESS The method is successful. * @exception E_INVALID_STATE %Bluetooth is not activated. * @exception E_IN_PROGRESS The sink role with the specified data type has already started. * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified * operation. @n - * For example, the sink role already started with another data type. + * For example, the sink role has already started with another data type. * @exception E_SERVICE_UNAVAILABLE The sink role with the specified data type is currently busy with another * instance or application. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. - * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 * @exception E_OPERATION_FAILED The method has failed. */ result StartAsSink(int dataType); /** - * Stops %Bluetooth health as a role of sink. @n - * The %Stop() method disconnects all established channels before stop. + * Stops %BluetoothHealth as a role of sink. @n + * The %Stop() method disconnects all established channels before stopping %BluetoothHealth. * * @since 2.0 * @privlevel public @@ -140,13 +143,13 @@ public: * operation. @n * For example, the sink role is not started yet. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. - * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 * @exception E_OPERATION_FAILED The method has failed. */ result Stop(void); /** - * Connects to a new channel with a remote health device which has source role. @n + * Connects to a new channel with a remote health device which has a source role. @n * The %ConnectToSource() method establishes a channel after the source device accepts the request. * * @since 2.0 @@ -162,10 +165,10 @@ public: * For example, the sink role is not started yet. * @exception E_DEVICE_BUSY The pairing and connection process is in progress. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. - * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 * @exception E_OPERATION_FAILED The method has failed. * @remarks If the local device is not paired with the specified target device, the pairing process starts - * internally before the connect request is sent. + * internally before the connection request is sent. * @see IBluetoothHealthEventListener::OnHealthConnected() */ result ConnectToSource(const BluetoothDevice& remoteDevice); @@ -173,7 +176,7 @@ public: /** * Disconnects the connection which has the specified channel ID. @n * After calling the %Disconnect() method, the IBluetoothHealthEventListener::OnHealthDisconnected() method is called regardless of - * whether this method is called during connection or before connection is established. + * whether this method is called during the connection or before the connection is established. * * @since 2.0 * @privlevel public @@ -181,15 +184,15 @@ public: * * @return An error code * @param[in] channelId The ID of the specified channel to disconnect @n - * The ID can be obtained by IBluetoothHealthEventListener::OnHealthConnected() - * after the specific channel is established. + * The ID can be obtained by the IBluetoothHealthEventListener::OnHealthConnected() + * method after the specific channel is established. * @exception E_SUCCESS The method is successful. * @exception E_INVALID_STATE %Bluetooth is not activated. * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified * operation. @n * For example, there is no connection with the specified channel ID. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. - * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 * @exception E_OPERATION_FAILED The method has failed. */ result Disconnect(int channelId); @@ -203,8 +206,8 @@ public: * * @return An error code * @param[in] channelId The ID of the specified channel on which the data is sent @n - * The ID can be obtained by IBluetoothHealthEventListener::OnHealthConnected() - * after the specific channel is established. + * The ID can be obtained by the IBluetoothHealthEventListener::OnHealthConnected() + * method after the specific channel is established. * @param[in] buffer The data to send * @exception E_SUCCESS The method is successful. * @exception E_INVALID_STATE %Bluetooth is not activated. @@ -213,7 +216,7 @@ public: * For example, there is no connection with the specified channel ID. * @exception E_INVALID_ARG The input buffer has no data. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. - * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 * @exception E_OPERATION_FAILED The operation has failed. * @see IBluetoothHealthEventListener::OnHealthDataReceived() */ diff --git a/inc/FNetBtBluetoothManager.h b/inc/FNetBtBluetoothManager.h index 1999c50..36b9e0a 100755 --- a/inc/FNetBtBluetoothManager.h +++ b/inc/FNetBtBluetoothManager.h @@ -49,23 +49,26 @@ class _BluetoothManagerImpl; /** * @class BluetoothManager - * @brief This class is used to obtain information about the local device or the paired devices, and to configure + * @brief This class is used to obtain information about a local device or a paired device and also helps configure * the %Bluetooth stack. * @since 2.0 * - * The %BluetoothManager class is used to obtain information about the local device or the paired devices and to configure the + * The %BluetoothManager class is used to obtain information about a local device or a paired device and also helps configure the * %Bluetooth stack. * * For more information on the class features, see * <a href="../org.tizen.native.appprogramming/html/guide/net/bluetooth_namespace.htm">Bluetooth Guide</a>. + * + * The following diagram illustrates the interactions between this class and the application. + * @image html net_bluetooth_manager_sequence_diagram.png */ class _OSP_EXPORT_ BluetoothManager : public Tizen::Base::Object { public: /** - * The object is not fully constructed after this constructor is called. For full construction, the Construct() - * method must be called right after calling this constructor. + * The object is not fully constructed after this constructor is called. @n + * For full construction, the Construct() method must be called right after calling this constructor. * * @since 2.0 */ @@ -113,7 +116,7 @@ public: * For example, %Bluetooth is already activated. * @exception E_OUT_OF_MEMORY The memory is insufficient. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. - * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 * @exception E_SYSTEM A system error has occurred. * @see IBluetoothManagerEventListener::OnBluetoothActivated() */ @@ -131,10 +134,10 @@ public: * @exception E_IN_PROGRESS The %Bluetooth deactivation process is in progress. * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified * operation. @n - * For example, the %Bluetooth is already deactivated. + * For example, %Bluetooth is already deactivated. * @exception E_OUT_OF_MEMORY The memory is insufficient. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. - * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 * @exception E_SYSTEM A system error has occurred. * @see IBluetoothManagerEventListener::OnBluetoothDeactivated() */ @@ -146,14 +149,14 @@ public: * * @brief <i> [Deprecated] </i> * @deprecated This method is deprecated because multiple clients as well as multiple SPP servers with unique - * service UUIDs are supported. In case of OPP server, invoke - * BluetoothOppServer::StartService() directly without checking OPP server's availability. - * If a new OPP server is not available, the method returns the E_SERVICE_UNAVAILABLE exception. + * service UUIDs are supported. In case of the OPP server, invoke + * BluetoothOppServer::StartService() directly without checking the OPP server's availability. + * If a new OPP server is not available, the method returns the @c E_SERVICE_UNAVAILABLE exception. * @since 2.0 * * @return @c true if the specified type of connection is available, @n * else @c false - * @param[in] type The connection type + * @param[in] type The connection type * * @endif */ @@ -165,7 +168,7 @@ public: * * @brief <i> [Deprecated] </i> * @deprecated This method is deprecated because the return value of this method is a dangling pointer if this - * instance of %BluetoothManager is deleted. In addition to this, the %BluetoothDevice class + * instance of %BluetoothManager is deleted. In addition to this, the BluetoothDevice class * represents only remote devices since Tizen. Instead of using this method, the GetLocalDeviceAddress() * and GetLocalDeviceName() methods are recommended. * @since 2.0 @@ -185,8 +188,8 @@ public: * @since 2.0 * * @return The local %Bluetooth device address @n - * The address is expressed as a @c 6 byte hexadecimal value delimited by colons. @n - * For example, "00:3D:47:EF:8A:03". + * The address is expressed as a @c 6 byte hexadecimal value delimited by colons, @n + * for example, "00:3D:47:EF:8A:03". */ Tizen::Base::String GetLocalDeviceAddress(void) const; @@ -204,7 +207,7 @@ public: * Gets the operational mode of the %Bluetooth unit. * * @brief <i> [Deprecated] </i> - * @deprecated %BluetoothDeviceStateType is deprecated. Therefore, this method is also deprecated, because the + * @deprecated BluetoothDeviceStateType is deprecated. Therefore, this method is also deprecated, because the * return value of this method is of type %BluetoothDeviceStateType. Instead of using this method, the * IsActivated() and GetDiscoverableMode() methods are recommended. * @@ -246,26 +249,26 @@ public: * @page BluetoothManagerGetDiscoverableModePage Compatibility for GetDiscoverableMode() * * @section BluetoothManagerGetDiscoverableModePageIssueSection Issues - * Implementation of this method in API versions prior to 2.0 has the following issue: @n + * Implementation of this method in %Tizen API versions prior to 2.0 has the following issue: @n * * -# The always discoverable mode and the discoverable mode with a certain amount of time cannot be - * differentiated. BT_DISC_MODE_DISCOVERABLE of BluetoothDiscoverableMode means both. + * differentiated. ::BT_DISC_MODE_DISCOVERABLE of BluetoothDiscoverableMode means both. * * @section BluetoothManagerGetDiscoverableModePageSolutionSection Resolutions - * The issue mentioned above is resolved in API version 2.0, and it is recommended to use API version - * 3.0 or above. @n + * The issue mentioned above is resolved in %Tizen API version 2.0, and it is recommended to use %Tizen + * API version 3.0 or above. @n * - * -# The new element, BT_DISC_MODE_TIME_LIMITED_DISCOVERABLE, is added into BluetoothDiscoverableMode - * in API version 2.0, Therefore, BT_DISC_MODE_DISCOVERABLE means the always discoverable mode and - * BT_DISC_MODE_TIME_LIMITED_DISCOVERABLE means the discoverable mode with a certain amount of time. + * -# The new element, ::BT_DISC_MODE_TIME_LIMITED_DISCOVERABLE, is added into BluetoothDiscoverableMode + * in %Tizen API version 2.0, therefore, ::BT_DISC_MODE_DISCOVERABLE means the always discoverable mode and + * @c BT_DISC_MODE_TIME_LIMITED_DISCOVERABLE means the discoverable mode with a certain amount of time. * @endif */ /** * Gets the remaining time, in seconds, until the discoverable mode is changed from - * ::BT_DISC_MODE_TIME_LIMITED_DISCOVERABLE to be ::BT_DISC_MODE_NOT_DISCOVERABLE. @n - * The %GetRemainingTimeAsDiscoverable() method is valid only if the current discoverable mode is @c - * BT_DISC_MODE_TIME_LIMITED_DISCOVERABLE. + * ::BT_DISC_MODE_TIME_LIMITED_DISCOVERABLE to ::BT_DISC_MODE_NOT_DISCOVERABLE. @n + * The %GetRemainingTimeAsDiscoverable() method is valid only if the current discoverable mode is + * @c BT_DISC_MODE_TIME_LIMITED_DISCOVERABLE. * * @since 2.0 * @@ -285,7 +288,7 @@ public: bool IsDiscoveryInProgress(void) const; /** - * Sets a name of the local device. @n + * Sets the name of the local device. @n * The searching device detects the local devices in close proximity based on the specified device name, and the * name is only valid while an application is active. * @@ -300,7 +303,7 @@ public: * @exception E_SUCCESS The method is successful. * @exception E_INVALID_ARG The specified device name is an empty string. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. - * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 * @exception E_SYSTEM A system error has occurred. * @remarks This method does not affect the system settings. */ @@ -319,11 +322,11 @@ public: * The specified duration is adopted only if the specified @c mode is * @c BT_DISC_MODE_TIME_LIMITED_DISCOVERABLE. * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG The specified @c seconds should be greater than 0 if the specified @c mode + * @exception E_INVALID_ARG The specified @c seconds should be greater than @c 0 if the specified @c mode * is @c BT_DISC_MODE_TIME_LIMITED_DISCOVERABLE. * @exception E_INVALID_OPERATION %Bluetooth is not activated. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. - * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 * @exception E_SYSTEM A system error has occurred. * @see IBluetoothManagerEventListener::OnBluetoothDiscoverableModeChanged() */ @@ -357,7 +360,7 @@ public: * is recommended. * @since 2.0 * - * @return The instance of %BluetoothDevice containing the specified address, @n + * @return An instance of BluetoothDevice that contains the specified address, @n * else @c null if the search is not successful * @param[in] deviceAddress The address to locate * @exception E_SUCCESS The method is successful. @@ -368,11 +371,11 @@ public: const BluetoothDevice* GetPairedDeviceByAddress(const Tizen::Base::ByteBuffer& deviceAddress) const; /** - * Gets an element that matches a %Bluetooth address. + * Gets the element that matches a %Bluetooth address. * * @since 2.0 * - * @return The instance of %BluetoothDevice containing the specified address, @n + * @return An instance of BluetoothDevice that contains the specified address, @n * else @c null if the search is not successful * @param[in] deviceAddress The address to locate * @exception E_SUCCESS The method is successful. @@ -387,7 +390,7 @@ public: * * @since 2.0 * - * @return A list containing the matching devices, @n + * @return The list that contains the matching devices, @n * else @c null if the search is not successful * @param[in] deviceName The name of the device to locate * @exception E_SUCCESS The method is successful. @@ -404,15 +407,15 @@ public: * @brief <i> [Deprecated] </i> * @deprecated This method is deprecated because the return value of this method is a dangling pointer, if this * instance of %BluetoothManager is deleted. In addition to this, it is also an invalid pointer if the - * paired device list is updated internally. Instead of using this method, GetPairedDeviceListN() and - * Tizen::Base::Collection::IList::GetAt() are recommended. + * paired device list is updated internally. Instead of using this method, the GetPairedDeviceListN() and + * Tizen::Base::Collection::IList::GetAt() methods are recommended. * @since 2.0 * - * @return The instance of %BluetoothDevice at the specified index, @n + * @return An instance of BluetoothDevice at the specified index, @n * else @c null if there is no element * @param[in] index The index in the list * @exception E_SUCCESS The method is successful. - * @exception E_OBJ_NOT_FOUND The specified index is not found in the paired device list. + * @exception E_OBJ_NOT_FOUND The specified input parameter is not found in the paired device list. * @remarks The specific error code can be accessed using the GetLastResult() method. * @endif */ @@ -429,8 +432,8 @@ public: * GetPairedDeviceListN() is recommended. * @since 2.0 * - * @return A pointer to the paired device list on success, @n - * else @c null + * @return A pointer to the paired device list, @n + * else @c null if it fails * @exception E_SUCCESS The method is successful. * @remarks The specific error code can be accessed using the GetLastResult() method. * @endif @@ -442,8 +445,8 @@ public: * * @since 2.0 * - * @return A pointer to the paired device list on success, @n - * else @c null + * @return A pointer to the paired device list, @n + * else @c null if it fails * @exception E_SUCCESS The method is successful. * @exception E_OUT_OF_MEMORY The memory is insufficient. * @remarks The specific error code can be accessed using the GetLastResult() method. @@ -475,10 +478,10 @@ public: * @return An error code * @exception E_SUCCESS The method is successful. * @exception E_IN_PROGRESS The device discovery process is in progress. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of this + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified * operation. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. - * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 * @exception E_SYSTEM A system error has occurred. * @see IBluetoothDeviceEventListener::OnBluetoothDiscoveryStarted() * @see IBluetoothDeviceEventListener::OnBluetoothRemoteDeviceFoundN() @@ -496,11 +499,11 @@ public: * @return An error code * @exception E_SUCCESS The method is successful. * @exception E_IN_PROGRESS The termination of the device discovery process is in progress. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of this + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified * operation. @n * For example, the discovery has not started as yet. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. - * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 * @exception E_SYSTEM A system error has occurred. * @see IBluetoothDeviceEventListener::OnBluetoothDiscoveryDone() */ @@ -514,15 +517,15 @@ public: * @privilege %http://tizen.org/privilege/bluetooth.gap * * @return An error code - * @param[in] pairedDevice A remote device that is already paired with the local device + * @param[in] pairedDevice The remote device that is already paired with the local device * @exception E_SUCCESS The method is successful. * @exception E_IN_PROGRESS The retrieving is in progress. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of this + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified * operation. @n * For example, the discovery is in progress. * @exception E_NOT_PAIRED The input device is not found in the paired device list. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. - * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 * @exception E_SYSTEM A system error has occurred. * @remarks The target remote device should be a paired device. * @see IBluetoothDeviceEventListener::OnBluetoothServiceListReceived() @@ -539,15 +542,15 @@ public: * @return An error code * @param[in] remoteDevice The remote %Bluetooth device to pair with * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of this + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified * operation. @n - * For example, the %Bluetooth is not activated. - * @exception E_DEVICE_BUSY The device cannot be approached because other operation is in progress. + * For example, %Bluetooth is not activated. + * @exception E_DEVICE_BUSY The device cannot be approached because another operation is in progress. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. - * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 * @exception E_SYSTEM A system error has occurred. * @remarks IBluetoothDeviceEventListener::OnBluetoothPaired() is called if the pairing is successful, @n - * IBluetoothDeviceEventListener::OnBluetoothPairingFailed() if the pairing has failed. + * otherwise IBluetoothDeviceEventListener::OnBluetoothPairingFailed() is called if the pairing has failed. */ result Pair(const BluetoothDevice& remoteDevice); @@ -560,20 +563,20 @@ public: * * @return An error code * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of this + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified * operation. @n * For example, the pairing process is not in progress. * @exception E_IN_PROGRESS The termination of the pairing process is in progress. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. - * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 * @exception E_SYSTEM A system error has occurred. - * @remarks If the canceling of the pairing process is successful, @n + * @remarks If the cancelling of the pairing process is successful, @n * IBluetoothDeviceEventListener::OnBluetoothPairingFailed() is called with @c E_OPERATION_CANCELED. */ result CancelPair(void); /** - * Unpairs with a paired device. @n + * Unpairs a paired device. @n * The process of unpairing is to remove a specified device from the paired device list. No notification is * transmitted to the remote device. @n * The %Unpair() method is synchronous. Only when the result of this method is @c E_SUCCESS, the unpaired event is fired. @@ -585,13 +588,13 @@ public: * @return An error code * @param[in] pairedDevice The paired device to unpair * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of this + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified * operation. @n - * For example, the %Bluetooth is not activated, or retrieving the service + * For example, %Bluetooth is not activated, or retrieving the service * list is in progress. * @exception E_NOT_PAIRED The input device is not found in the paired device list. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. - * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 * @exception E_SYSTEM A system error has occurred. * @see IBluetoothDeviceEventListener::OnBluetoothUnpaired() */ diff --git a/inc/FNetBtBluetoothOppClient.h b/inc/FNetBtBluetoothOppClient.h index 522b46d..5232a6a 100755 --- a/inc/FNetBtBluetoothOppClient.h +++ b/inc/FNetBtBluetoothOppClient.h @@ -49,17 +49,20 @@ class _BluetoothOppClientImpl; * * The %BluetoothOppClient class provides methods to handle the %Bluetooth Object Push Profile (OPP) client, such as the outgoing * connection requests. - * @n + * * For more information on the class features, see * <a href="../org.tizen.native.appprogramming/html/guide/net/bluetooth_namespace.htm">Bluetooth Guide</a>. + * + * The following diagram illustrates the interactions between this class and the application. + * @image html net_bluetooth_oppclient_sequence_diagram.png */ class _OSP_EXPORT_ BluetoothOppClient : public Tizen::Base::Object { public: /** - * The object is not fully constructed after this constructor is called. For full construction, the Construct() method - * must be called right after calling this constructor. + * The object is not fully constructed after this constructor is called. @n + * For full construction, the Construct() method must be called right after calling this constructor. * * @since 2.0 */ @@ -109,13 +112,13 @@ public: * * @return An error code * @param[in] remoteDevice The remote OPP server - * @param[in] filePath The path of the source file + * @param[in] filePath The path to the source file * @exception E_SUCCESS The method is successful. * @exception E_INVALID_STATE This instance is in an invalid state. @n * For example, %Bluetooth is not activated. * @exception E_IN_PROGRESS The push process is in progress. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. - * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 * @exception E_SERVICE_UNAVAILABLE The OPP service is unavailable. * @exception E_INACCESSIBLE_PATH The specified @c filePath is inaccessible. * @exception E_REMOTE_DEVICE_NOT_FOUND The input device is not found. @n @@ -130,7 +133,7 @@ public: /** * Cancels the file push request in progress. @n * If the %CancelPush() method is called before the OPP server accepts the push request, the - * IBluetoothOppClientEventListener::OnOppPushResponded() method is called and its result @c E_SYSTEM is thrown. @n + * IBluetoothOppClientEventListener::OnOppPushResponded() method is called and @c E_SYSTEM is thrown. @n * If this method is called during the file transfer, the IBluetoothOppClientEventListener::OnOppTransferDone() * method is called with @c isCompleted as @c false. * @@ -144,24 +147,24 @@ public: * For example, %Bluetooth is not activated. * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified * operation. @n - * For example, the push request is not sent or accepted by a remote device. + * For example, the push request is not sent or accepted by the remote device. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. - * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 * @exception E_FAILURE The method has failed. */ result CancelPush(void); /** - * Sets the minimum interval of invocation of IBluetoothOppClientEventListener::OnOppTransferInProgress() in + * Sets the minimum interval for the invocation of IBluetoothOppClientEventListener::OnOppTransferInProgress() in * percentage. @n * The default value is @c 5. * * @since 2.0 * * @return An error code - * @param[in] percent The minimum period of progress interval as a percentage value + * @param[in] percent The minimum period of the progress interval as a percentage value * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_RANGE The value of an argument is outside the valid range defined by the method. + * @exception E_OUT_OF_RANGE The specified input parameter is outside the valid range defined by the method. */ result SetMinProgressInterval(int percent); diff --git a/inc/FNetBtBluetoothOppServer.h b/inc/FNetBtBluetoothOppServer.h index 786fd1e..2a042ac 100755 --- a/inc/FNetBtBluetoothOppServer.h +++ b/inc/FNetBtBluetoothOppServer.h @@ -51,14 +51,17 @@ class _BluetoothOppServerImpl; * * For more information on the class features, see * <a href="../org.tizen.native.appprogramming/html/guide/net/bluetooth_namespace.htm">Bluetooth Guide</a>. + * + * The following diagram illustrates the interactions between this class and the application. + * @image html net_bluetooth_oppserver_sequence_diagram.png */ class _OSP_EXPORT_ BluetoothOppServer : public Tizen::Base::Object { public: /** - * The object is not fully constructed after this constructor is called. For full construction, the Construct() - * method must be called right after calling this constructor. + * The object is not fully constructed after this constructor is called. @n + * For full construction, the Construct() method must be called right after calling this constructor. * * @since 2.0 */ @@ -87,7 +90,7 @@ public: * Application Filtering</a>. * @exception E_SYSTEM A system error has occurred. * @remarks Before calling this method, check whether the feature is supported by - * Tizen::System::SystemInfo::GetValue(const Tizen::Base::String&, bool&). + * Tizen::System::SystemInfo::GetValue(const Tizen::Base::String&, bool&). */ result Construct(IBluetoothOppServerEventListener& listener); @@ -107,9 +110,9 @@ public: * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified * operation. @n * For example, the service is not started yet or a push request is not - * received from a remote device. + * received from the remote device. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. - * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 * @exception E_FAILURE The method has failed. * @see IBluetoothOppClientEventListener::OnOppPushResponded() */ @@ -130,9 +133,9 @@ public: * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified * operation. @n * For example, the service is not started yet or a push request is not - * received from a remote device. + * received from the remote device. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. - * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 * @exception E_FAILURE The method has failed. * @see IBluetoothOppClientEventListener::OnOppPushResponded() */ @@ -155,9 +158,13 @@ public: * @exception E_SUCCESS The method is successful. * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified * operation. @n - * For example, trying to change the path on Push transition is prohibited. - * @exception E_INACCESSIBLE_PATH The specified @c dstPath is inaccessible. + * For example, trying to change the path on a Push transition is prohibited. + * @exception E_INACCESSIBLE_PATH The specified input parameter is inaccessible. * @exception E_FAILURE The method has failed. + * @remarks + * - The destination path is either a media directory or an external storage directory. + * - Use Tizen::System::Environment::GetMediaPath() to access the media directory and + * Tizen::System::Environment::GetExternalStoragePath() to access the external storage directory. */ result SetDestinationPath(const Tizen::Base::String& dstPath); @@ -182,13 +189,17 @@ public: * For example, %Bluetooth is not activated. * @exception E_IN_PROGRESS The service has already started. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. - * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 * @exception E_SERVICE_UNAVAILABLE The OPP service is unavailable. - * @exception E_INACCESSIBLE_PATH The specified @c dstPath is inaccessible. + * @exception E_INACCESSIBLE_PATH The specified input parameter is inaccessible. * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified * operation. @n - * For example, The stop process is in progress. + * For example, the stop process is in progress. * @exception E_FAILURE The method has failed. + * @remarks + * - The destination path is either a media directory or an external storage directory. + * - Use Tizen::System::Environment::GetMediaPath() to access the media directory and + * Tizen::System::Environment::GetExternalStoragePath() to access the external storage directory. */ result StartService(const Tizen::Base::String& dstPath); @@ -208,14 +219,14 @@ public: * operation. @n * For example, the service is not started as yet. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. - * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 * @exception E_IN_PROGRESS The stop process is in progress. * @exception E_FAILURE The method has failed. */ result StopService(void); /** - * Stops the file transfer in progress which was started by the client. @n + * Stops the file transfer in progress which is started by the client. @n * If the %StopTransfer() method is called during the file transfer, the IBluetoothOppServerEventListener::OnOppTransferDone() * method is called with @c isCompleted as @c false. * @@ -231,22 +242,22 @@ public: * operation. @n * For example, the file transfer is not in progress. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. - * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 * @exception E_OPERATION_FAILED The operation has failed. */ result StopTransfer(void); /** - * Sets the minimum interval of invocation of IBluetoothOppServerEventListener::OnOppTransferInProgress() in + * Sets the minimum interval for the invocation of IBluetoothOppServerEventListener::OnOppTransferInProgress() in * percentage. @n * The default value is @c 5. * * @since 2.0 * * @return An error code - * @param[in] percent The minimum period of progress interval as a percentage value + * @param[in] percent The minimum period of the progress interval as a percentage value * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method. + * @exception E_OUT_OF_RANGE The specified input parameter is outside the valid range defined by the method. * @see IBluetoothOppServerEventListener::OnOppTransferInProgress() */ result SetMinProgressInterval(int percent); diff --git a/inc/FNetBtBluetoothSppAcceptor.h b/inc/FNetBtBluetoothSppAcceptor.h index 3cc96ac..4d0ee93 100755 --- a/inc/FNetBtBluetoothSppAcceptor.h +++ b/inc/FNetBtBluetoothSppAcceptor.h @@ -43,23 +43,26 @@ class _BluetoothSppAcceptorImpl; /** * @class BluetoothSppAcceptor - * @brief This class provides the methods to handle the %Bluetooth Serial Port Profile (SPP) acceptor, such as an + * @brief This class provides methods to handle the %Bluetooth Serial Port Profile (SPP) acceptor, such as an * incoming connection request. * @since 2.0 * - * The %BluetoothSppAcceptor class provides the methods to handle the %Bluetooth Serial Port Profile (SPP) acceptor, such as an + * The %BluetoothSppAcceptor class provides methods to handle the %Bluetooth Serial Port Profile (SPP) acceptor, such as an * incoming connection request. * * For more information on the class features, see * <a href="../org.tizen.native.appprogramming/html/guide/net/bluetooth_namespace.htm">Bluetooth Guide</a>. + * + * The following diagram illustrates the interactions between this class and the application. + * @image html net_bluetooth_sppacceptor_sequence_diagram.png */ class _OSP_EXPORT_ BluetoothSppAcceptor : public Tizen::Base::Object { public: /** - * The object is not fully constructed after this constructor is called. For full construction, the Construct() - * method must be called right after calling this constructor. + * The object is not fully constructed after this constructor is called. @n + * For full construction, the Construct() method must be called right after calling this constructor. * * @since 2.0 */ @@ -79,7 +82,7 @@ public: * @feature %http://tizen.org/feature/network.bluetooth * * @return An error code - * @param[in] listener The event listener for SPP acceptor + * @param[in] listener The event listener for the SPP acceptor * @exception E_SUCCESS The method is successful. * @exception E_OUT_OF_MEMORY The memory is insufficient. * @exception E_UNSUPPORTED_OPERATION The Emulator or target device does not support the required feature. @@ -108,9 +111,9 @@ public: * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified * operation. @n * For example, the service is not started yet or the connection request is - * not yet received from a remote device. + * not yet received from the remote device. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. - * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 * @exception E_FAILURE The method has failed. * @see IBluetoothSppInitiatorEventListener::OnSppConnectionResponded() */ @@ -131,9 +134,9 @@ public: * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified * operation. @n * For example, the service is not started yet or the connection request is - * not yet received from a remote device. + * not yet received from the remote device. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. - * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 * @exception E_FAILURE The method has failed. * @see IBluetoothSppInitiatorEventListener::OnSppConnectionResponded() */ @@ -152,10 +155,10 @@ public: * For example, this instance has not been constructed as yet or %Bluetooth is * not activated. * @exception E_IN_PROGRESS The service has already started. - * @exception E_ALREADY_CONNECTED The connection with an SPP initiator has already been established. + * @exception E_ALREADY_CONNECTED The connection with the SPP initiator has already been established. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. - * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 - * @exception E_SERVICE_UNAVAILABLE The SPP service with the specified UUId is unavailable. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_SERVICE_UNAVAILABLE The SPP service with the specified UUID is unavailable. * @exception E_FAILURE The method has failed. */ result StartService(void); @@ -168,17 +171,17 @@ public: * @privilege %http://tizen.org/privilege/bluetooth.spp * * @return An error code - * @param[in] serviceUuid The UUID of SPP service + * @param[in] serviceUuid The UUID of the SPP service * @exception E_SUCCESS The method is successful. * @exception E_INVALID_STATE This instance is in an invalid state. @n * For example, this instance has not been constructed as yet or %Bluetooth is * not activated. * @exception E_INVALID_ARG The specified input parameter is invalid. * @exception E_IN_PROGRESS The service has already started. - * @exception E_ALREADY_CONNECTED The connection with an SPP initiator has already been established. + * @exception E_ALREADY_CONNECTED The connection with the SPP initiator has already been established. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. - * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 - * @exception E_SERVICE_UNAVAILABLE The SPP service with the specified UUId is unavailable. + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 + * @exception E_SERVICE_UNAVAILABLE The SPP service with the specified UUID is unavailable. * @exception E_FAILURE The method has failed. */ result StartService(const Tizen::Base::UuId& serviceUuid); @@ -200,7 +203,7 @@ public: * operation. @n * For example, the service is not started yet. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. - * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 * @exception E_FAILURE The method has failed. */ result StopService(void); @@ -219,10 +222,10 @@ public: * not activated. * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified * operation. @n - * For example, the service is not started yet or a connection with a remote + * For example, the service is not started yet or a connection with the remote * device is not established. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. - * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 * @exception E_FAILURE The method has failed. * @see IBluetoothSppAcceptorEventListener::OnSppDisconnected() * @see IBluetoothSppInitiatorEventListener::OnSppDisconnected() @@ -245,12 +248,12 @@ public: * not activated. * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified * operation. @n - * For example, the service is not started yet or a connection with a remote + * For example, the service is not started yet or a connection with the remote * device is not established. - * @exception E_INVALID_ARG The specified @c buffer is empty. + * @exception E_INVALID_ARG The specified input parameter is empty. * @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_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 * @exception E_FAILURE The method has failed. * @see IBluetoothSppInitiatorEventListener::OnSppDataReceived() */ diff --git a/inc/FNetBtBluetoothSppInitiator.h b/inc/FNetBtBluetoothSppInitiator.h index 333c585..2c696db 100755 --- a/inc/FNetBtBluetoothSppInitiator.h +++ b/inc/FNetBtBluetoothSppInitiator.h @@ -44,23 +44,26 @@ class _BluetoothSppInitiatorImpl; /** * @class BluetoothSppInitiator - * @brief This class provides the methods to handle the %Bluetooth Serial Port Profile (SPP) initiator, such as the + * @brief This class provides methods to handle the %Bluetooth Serial Port Profile (SPP) initiator, such as the * outgoing connection requests. * @since 2.0 * - * The %BluetoothSppInitiator class provides the methods to handle the %Bluetooth Serial Port Profile (SPP) initiator, such as + * The %BluetoothSppInitiator class provides methods to handle the %Bluetooth Serial Port Profile (SPP) initiator, such as * the outgoing connection requests. * * For more information on the class features, see * <a href="../org.tizen.native.appprogramming/html/guide/net/bluetooth_namespace.htm">Bluetooth Guide</a>. + * + * The following diagram illustrates the interactions between this class and the application. + * @image html net_bluetooth_sppinitiator_sequence_diagram.png */ class _OSP_EXPORT_ BluetoothSppInitiator : public Tizen::Base::Object { public: /** - * The object is not fully constructed after this constructor is called. For full construction, the Construct() - * method must be called right after calling this constructor. + * The object is not fully constructed after this constructor is called. @n + * For full construction, the Construct() method must be called right after calling this constructor. * * @since 2.0 */ @@ -108,9 +111,9 @@ public: * For example, this instance has not been constructed as yet or * %Bluetooth is not activated. * @exception E_IN_PROGRESS The connection process is in progress. - * @exception E_ALREADY_CONNECTED The connection with an SPP acceptor has already been established. + * @exception E_ALREADY_CONNECTED The connection with the SPP acceptor has already been established. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. - * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 * @exception E_SERVICE_UNAVAILABLE The SPP connection is unavailable. * @exception E_REMOTE_DEVICE_NOT_FOUND The input device is not found. @n * This exception is currently not in use. @@ -131,16 +134,16 @@ public: * * @return An error code * @param[in] remoteDevice The remote device to connect - * @param[in] serviceUuid The UUID of SPP service to connect + * @param[in] serviceUuid The UUID of the SPP service to connect * @exception E_SUCCESS The method is successful. * @exception E_INVALID_STATE This instance is in an invalid state. @n * For example, this instance has not been constructed as yet or * %Bluetooth is not activated. * @exception E_INVALID_ARG A specified input parameter is invalid. * @exception E_IN_PROGRESS The connection process is in progress. - * @exception E_ALREADY_CONNECTED The connection with an SPP acceptor has already been established. + * @exception E_ALREADY_CONNECTED The connection with the SPP acceptor has already been established. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. - * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 * @exception E_SERVICE_UNAVAILABLE The SPP connection is unavailable. * @exception E_REMOTE_DEVICE_NOT_FOUND The input device is not found. @n * This exception is currently not in use. @@ -154,9 +157,9 @@ public: /** * Disconnects the current connection. @n * If the %Disconnect() method is called before the SPP acceptor accepts the connection request, the - * IBluetoothSppInitiatorEventListener::OnSppConnectionResponded() method and its result @c E_SYSTEM is thrown. @n - * If this method is called on connection, the IBluetoothSppInitiatorEventListener::OnSppDisconnected() method and - * its result @c E_SUCCESS is thrown. + * IBluetoothSppInitiatorEventListener::OnSppConnectionResponded() method is called and @c E_SYSTEM is thrown. @n + * If this method is called on a connection, the IBluetoothSppInitiatorEventListener::OnSppDisconnected() method is called + * and @c E_SUCCESS is thrown. * * @since 2.0 * @privlevel public @@ -169,10 +172,10 @@ public: * not activated. * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified * operation. @n - * For example, the connection request is not sent or a connection with a + * For example, the connection request is not sent or a connection with the * remote device is not established yet. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. - * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 * @exception E_FAILURE The method has failed. * @see IBluetoothSppAcceptorEventListener::OnSppDisconnected() */ @@ -194,12 +197,12 @@ public: * not activated. * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified * operation. @n - * For example, the connection request is not sent or a connection with a + * For example, the connection request is not sent or a connection with the * remote device is not established yet. - * @exception E_INVALID_ARG The argument has no data. + * @exception E_INVALID_ARG The specified input parameter has no data. * @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_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 + * @exception E_USER_NOT_CONSENTED The user has blocked the application from calling this method. @b Since: @b 2.1 * @exception E_FAILURE The method has failed. * @see IBluetoothSppAcceptorEventListener::OnSppDataReceived() */ diff --git a/inc/FNetBtBluetoothTypes.h b/inc/FNetBtBluetoothTypes.h index 4d82e93..b5c7388 100755 --- a/inc/FNetBtBluetoothTypes.h +++ b/inc/FNetBtBluetoothTypes.h @@ -17,7 +17,7 @@ /** * @file FNetBtBluetoothTypes.h - * @brief This is the header file for the enumerations in the Bluetooth namespace. + * @brief This is the header file for the enumerations in the %Bluetooth namespace. * * This header file contains the declarations and descriptions of the enumerations in the Bluetooth namespace. */ @@ -51,7 +51,7 @@ enum BluetoothDeviceStateType /** * @enum BluetoothDiscoverableMode - * Defines the discoverable mode of the local %Bluetooth device. + * Defines the discoverable modes of the local %Bluetooth device. * * @since 2.0 */ @@ -59,7 +59,7 @@ enum BluetoothDiscoverableMode { BT_DISC_MODE_NOT_DISCOVERABLE, /**< The mode NOT DISCOVERABLE by other devices */ BT_DISC_MODE_DISCOVERABLE, /**< The mode DISCOVERABLE by other devices */ - BT_DISC_MODE_TIME_LIMITED_DISCOVERABLE /**< The mode DISCOVERABLE by other devices during a certain amount of time */ + BT_DISC_MODE_TIME_LIMITED_DISCOVERABLE /**< The mode DISCOVERABLE by other devices for a certain amount of time */ }; /** @@ -70,11 +70,7 @@ enum BluetoothDiscoverableMode */ enum BluetoothConnectionType { - BT_CONNECTION_GENERIC, /**< The GENERIC CONNECTION - * @if OSPDEPREC - * @deprecated This enum field is deprecated. - * @endif - */ + BT_CONNECTION_GENERIC, /**< @if OSPDEPREC The GENERIC CONNECTION @deprecated This enum field is deprecated. @endif */ BT_CONNECTION_SPP_ACCEPTOR, /**< The SPP ACCEPTOR CONNECTION */ BT_CONNECTION_SPP_INITIATOR, /**< The SPP INITIATOR CONNECTION */ BT_CONNECTION_OPP_SERVER, /**< The OPP SERVER CONNECTION */ @@ -84,26 +80,24 @@ enum BluetoothConnectionType /** * @enum BluetoothHealthDataChannelType - * Defines the transmission type of %BluetoothHealth data channel. + * Defines the transmission type of the BluetoothHealth data channel. * * @since 2.0 */ enum BluetoothHealthDataChannelType { - BT_HEALTH_DATA_CHANNEL_NONE, /**< The any type of data channel */ - BT_HEALTH_DATA_CHANNEL_RELIABLE, /**< The data channel type for transmitting data with the reliable manner of - * which the confidence in the exchange is at its highest (for example, measurement - * and alert information) - */ - BT_HEALTH_DATA_CHANNEL_STREAMING /**< The data channel type for transmitting data when the timeliness of the + BT_HEALTH_DATA_CHANNEL_NONE, /**< No type of data channel */ + BT_HEALTH_DATA_CHANNEL_RELIABLE, /**< The data channel type for transmitting data in a reliable manner such + * that the confidence in the exchange is at its highest (for example, measurement + * and alert information) */ + BT_HEALTH_DATA_CHANNEL_STREAMING /**< The data channel type for transmitting data where the timeliness of the * delivery of each frame is more important than the reliable delivery of - * every frame (for example, an ECG waveform, where low latency is critical) - */ + * every frame (for example, an ECG waveform, where low latency is critical) */ }; /** * @enum BluetoothServiceClassType - * Defines the service class type (part of the class of the device), returned from the device discovery. + * Defines the service class types (part of the class of the device) returned by the device discovery. * * @since 2.0 */ @@ -124,7 +118,7 @@ enum BluetoothServiceClassType /** * @enum BluetoothMajorDeviceClassType - * Defines the major device class (part of the class of the device). + * Defines the major device class types (part of the class of the device). * * @since 2.0 */ @@ -142,7 +136,7 @@ enum BluetoothMajorDeviceClassType /** * @enum BluetoothMinorDeviceClassType - * Defines the minor device class (part of the class of the device). + * Defines the minor device class types (part of the class of the device). * * @since 2.0 */ @@ -180,7 +174,7 @@ enum BluetoothMinorDeviceClassType /** * @enum BluetoothServiceType - * Defines the %Bluetooth service type. + * Defines the %Bluetooth service types. * * @since 2.0 */ @@ -215,13 +209,9 @@ enum BluetoothServiceType BT_SVC_DID_SERVICE = 0x04000000, /**< The device identification profile service type */ BT_SVC_HDP_SERVICE = 0x08000000, /**< The health device profile service type */ BT_SVC_MAP_SERVICE = 0x10000000, /**< The message access profile service type */ - BT_SVC_ALL_SERVICE = 0x01FFFFFF, /**< The All-services-supported-by-BTA service type - * @if OSPDEPREC - * @deprecated This enum field is deprecated. - * @endif - - */ - BT_SVC_NONE = 0 /**< The No service or unknown service type */ + BT_SVC_ALL_SERVICE = 0x01FFFFFF, /**< @if OSPDEPREC The All-services-supported-by-BTA service type @deprecated This enum field is deprecated. + @endif */ + BT_SVC_NONE = 0 /**< No service or unknown service type */ }; /** diff --git a/inc/FNetBtIBluetoothDeviceEventListener.h b/inc/FNetBtIBluetoothDeviceEventListener.h index 2f578f1..3050dfd 100755 --- a/inc/FNetBtIBluetoothDeviceEventListener.h +++ b/inc/FNetBtIBluetoothDeviceEventListener.h @@ -35,11 +35,11 @@ class BluetoothDevice; /** * @interface IBluetoothDeviceEventListener - * @brief This interface implements the listener for %Bluetooth remote device events. + * @brief This interface implements the listener for the %Bluetooth remote device events. * * @since 2.0 * - * The %IBluetoothDeviceEventListener interface specifies the methods used to create notifications for the different + * The %IBluetoothDeviceEventListener interface specifies methods used to create notifications for different * kinds of %Bluetooth remote device events, including device discovery, service discovery, and pairing of the devices. * When a %Bluetooth device event is generated, one of these methods is called. * @@ -51,8 +51,8 @@ class _OSP_EXPORT_ IBluetoothDeviceEventListener { public: /** - * 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. + * This polymorphic destructor should be overridden if required. @n + * This way, the destructors of the derived classes are called when the destructor of this interface is called. * * @since 2.0 */ @@ -89,20 +89,20 @@ public: * * @param[in] isCompleted Set to @c true if the device discovery process is successfully completed, @n * else @c false @n - * For example, the discovery is canceled. + * For example, the discovery is cancelled * @see BluetoothManager::CancelDiscovery() */ virtual void OnBluetoothDiscoveryDone(bool isCompleted) = 0; /** - * Called when a service list is received from a remote device using the service discovery process. + * Called when the service list is received from a remote device using the service discovery process. * * @since 2.0 * * @param[in] targetDevice The remote device that sends its service list * @param[in] serviceList The service list that is received @n * The specified service list consists of Bluetooth::BluetoothServiceType - * values which are joined by OR operator. + * values which are joined by the OR operator. * @param[in] r The result of receiving the service list * @exception E_SUCCESS The method is successful. * @exception E_REMOTE_SERVICE_NOT_FOUND The service list of the remote device is not found. @@ -120,19 +120,19 @@ public: * @since 2.0 * * @param[in] pairedDevice The device to pair with the local device @n - * The specified device may have no service list value and elements in the service - * UUID list because retrieving the service list from the remote device fails. @n + * The specified device may have no service list value or elements in the service + * UUID list if retrieving the service list from the remote device fails. @n * In that case, call BluetoothManager::RetrieveServiceList() to get the service * list from the paired device. */ virtual void OnBluetoothPaired(const BluetoothDevice& pairedDevice) = 0; /** - * Called when the already paired device is unpaired with this local device. + * Called when the already paired device is unpaired from this local device. * * @since 2.0 * - * @param[in] unpairedDevice The device to unpair with the local device + * @param[in] unpairedDevice The device to unpair from the local device */ virtual void OnBluetoothUnpaired(const BluetoothDevice& unpairedDevice) = 0; @@ -142,10 +142,10 @@ public: * @since 2.0 * * @param[in] r The error result of the pairing request @n - * One of the following exception is thrown. - * @exception E_OPERATION_CANCELED The pairing operation is canceled explicitly. - * @exception E_TIMEOUT The pairing request has timed out because the remote device does not - * respond within @c 60 seconds. + * One of the following exceptions is thrown. + * @exception E_OPERATION_CANCELED The pairing operation is cancelled explicitly. + * @exception E_TIMEOUT The pairing request has timed out because the remote device has not + * responded within @c 60 seconds. * @exception E_OPERATION_FAILED The operation has failed. * @see BluetoothManager::Pair() * @see BluetoothManager::CancelPair() diff --git a/inc/FNetBtIBluetoothHealthEventListener.h b/inc/FNetBtIBluetoothHealthEventListener.h index 8fbf42f..9c32d9c 100755 --- a/inc/FNetBtIBluetoothHealthEventListener.h +++ b/inc/FNetBtIBluetoothHealthEventListener.h @@ -43,8 +43,8 @@ class BluetoothDevice; * @brief This interface provides a listener for the %BluetoothHealth events. * @since 2.0 * - * The %IBluetoothHealthEventListener interface specifies the methods used for creating notifications about the - * different kinds of BluetoothHealth events. When a %BluetoothHealth event is generated, one of these methods is called. + * The %IBluetoothHealthEventListener interface specifies methods used for creating notifications for + * different kinds of BluetoothHealth events. When a BluetoothHealth event is generated, one of these methods is called. * * For more information on the class features, see * <a href="../org.tizen.native.appprogramming/html/guide/net/bluetooth_namespace.htm">Bluetooth Guide</a>. @@ -54,8 +54,8 @@ class _OSP_EXPORT_ IBluetoothHealthEventListener { public: /** - * 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. + * This polymorphic destructor should be overridden if required. @n + * This way, the destructors of the derived classes are called when the destructor of this interface is called. * * @since 2.0 */ @@ -67,15 +67,15 @@ public: * @since 2.0 * * @param[in] channelId The channel ID of the established connection, @n - * else an invalid ID (@c -1) if the method is not successful + * else an invalid ID (@c -1) if the method fails * @param[in] dataType The type of data used in the established connection which is defined in - * ISO/IEEE 11073-20601 and represents type of health device such as thermometer, - * heart rate monitor, weight scale, and so on + * ISO/IEEE 11073-20601 and represents the type of health device such as a thermometer, + * a heart rate monitor, a weight scale, and so on * @param[in] channelType The data channel type of the established connection * @param[in] pRemoteDevice The remote health device to connect with the local device, @n - * else @c null if the method is not successful + * else @c null if the method fails * @param[in] r The result of the connection request @n - * One of the following exception is thrown. + * One of the following exceptions is thrown. * @exception E_SUCCESS The connection is established successfully. * @exception E_OPERATION_FAILED The connection request has failed. */ @@ -89,18 +89,18 @@ public: * * @param[in] channelId The channel ID of the terminated connection * @param[in] r The disconnection status @n - * One of the following exception is thrown. + * One of the following exceptions is thrown. * @exception E_SUCCESS The specified connection (channel) is terminated successfully. * @exception E_OPERATION_FAILED The method has failed to disconnect. */ virtual void OnHealthDisconnected(int channelId, result r) = 0; /** - * Called to notify when the data has been received on the specified channel. + * Called to notify when the data is received on the specified channel. * * @since 2.0 * - * @param[in] channelId The channel ID of the connection to receive data + * @param[in] channelId The channel ID of the connection on which to receive the data * @param[in] buffer The data to receive */ virtual void OnHealthDataReceived(int channelId, Tizen::Base::ByteBuffer& buffer) = 0; diff --git a/inc/FNetBtIBluetoothManagerEventListener.h b/inc/FNetBtIBluetoothManagerEventListener.h index 43f94eb..0123ce3 100755 --- a/inc/FNetBtIBluetoothManagerEventListener.h +++ b/inc/FNetBtIBluetoothManagerEventListener.h @@ -36,7 +36,7 @@ namespace Tizen { namespace Net { namespace Bluetooth * * @since 2.0 * - * The %IBluetoothManagerEventListener interface specifies the methods used for creating notifications about the + * The %IBluetoothManagerEventListener interface specifies methods used for creating notifications for * different kinds of BluetoothManager events. When a BluetoothManager event is generated, one of these methods is * called. * @@ -48,8 +48,8 @@ class _OSP_EXPORT_ IBluetoothManagerEventListener { public: /** - * 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. + * This polymorphic destructor should be overridden if required. @n + * This way, the destructors of the derived classes are called when the destructor of this interface is called. * * @since 2.0 */ @@ -82,7 +82,7 @@ public: * * @since 2.0 * - * @param[in] mode The new discoverable mode to change + * @param[in] mode The discoverable mode to change */ virtual void OnBluetoothDiscoverableModeChanged(BluetoothDiscoverableMode mode) {} diff --git a/inc/FNetBtIBluetoothOppClientEventListener.h b/inc/FNetBtIBluetoothOppClientEventListener.h index 1284451..6b94855 100755 --- a/inc/FNetBtIBluetoothOppClientEventListener.h +++ b/inc/FNetBtIBluetoothOppClientEventListener.h @@ -36,7 +36,7 @@ namespace Tizen { namespace Net { namespace Bluetooth * * @since 2.0 * - * The %IBluetoothOppClientEventListener interface specifies the methods used for creating notifications about the + * The %IBluetoothOppClientEventListener interface specifies methods used for creating notifications for * different kinds of BluetoothOppClient events. When a BluetoothOppClient event is generated, one of these methods * is called. * @@ -48,15 +48,15 @@ class _OSP_EXPORT_ IBluetoothOppClientEventListener { public: /** - * 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. + * This polymorphic destructor should be overridden if required. @n + * This way, the destructors of the derived classes are called when the destructor of this interface is called. * * @since 2.0 */ virtual ~IBluetoothOppClientEventListener(void) {} /** - * Called when the OPP server responded to the push request. + * Called when the OPP server responds to a push request. * * @since 2.0 * @@ -64,7 +64,7 @@ public: * @exception E_SUCCESS The push request is accepted by the OPP server and the file transfer has begun. * @exception E_REJECTED The push request is rejected by the OPP server. @n * This exception is currently not in use. - * @exception E_TIMEOUT The push request is out of time. + * @exception E_TIMEOUT The push request has timed out. * @exception E_SYSTEM A failure has occurred from the underlying system. @n * This failure includes the rejection by the OPP server. */ diff --git a/inc/FNetBtIBluetoothOppServerEventListener.h b/inc/FNetBtIBluetoothOppServerEventListener.h index e9e051b..3bf6538 100755 --- a/inc/FNetBtIBluetoothOppServerEventListener.h +++ b/inc/FNetBtIBluetoothOppServerEventListener.h @@ -38,7 +38,7 @@ class BluetoothDevice; * * @since 2.0 * - * The %IBluetoothOppServerEventListener interface specifies the methods used for creating notifications about the + * The %IBluetoothOppServerEventListener interface specifies methods used for creating notifications for * different kinds of BluetoothOppServer events. When a BluetoothOppServer event is generated, one of these methods * is called. * @n @@ -50,8 +50,8 @@ class _OSP_EXPORT_ IBluetoothOppServerEventListener { public: /** - * 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. + * This polymorphic destructor should be overridden if required. @n + * This way, the destructors of the derived classes are called when the destructor of this interface is called. * * @since 2.0 */ @@ -62,7 +62,7 @@ public: * * @since 2.0 * - * @param[in] device The remote device to request the connection + * @param[in] device The remote device to request for the connection */ virtual void OnOppPushRequested(const BluetoothDevice& device) = 0; diff --git a/inc/FNetBtIBluetoothSppAcceptorEventListener.h b/inc/FNetBtIBluetoothSppAcceptorEventListener.h index 7298a41..f310977 100755 --- a/inc/FNetBtIBluetoothSppAcceptorEventListener.h +++ b/inc/FNetBtIBluetoothSppAcceptorEventListener.h @@ -40,7 +40,7 @@ class BluetoothDevice; * * @since 2.0 * - * The %IBluetoothSppAcceptorEventListener interface specifies the methods used for creating notifications about the + * The %IBluetoothSppAcceptorEventListener interface specifies methods used for creating notifications for * different kinds of BluetoothSppAcceptor events. When a BluetoothSppAcceptor event is generated, one of these methods * is called. * @@ -52,8 +52,8 @@ class _OSP_EXPORT_ IBluetoothSppAcceptorEventListener { public: /** - * 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. + * This polymorphic destructor should be overridden if required. @n + * This way, the destructors of the derived classes are called when the destructor of this interface is called. * * @since 2.0 */ @@ -64,8 +64,8 @@ public: * * @since 2.0 * - * @param[in] device The remote device to request the connection - * @remarks If BluetoothSppAcceptor::SendData() is invoked in this callback, it does not work as expected. + * @param[in] device The remote device to request for the connection + * @remarks If BluetoothSppAcceptor::SendData() is invoked in this callback, it does not work as expected. * Therefore, it must be invoked outside this callback thread. */ virtual void OnSppConnectionRequested(const BluetoothDevice& device) = 0; diff --git a/inc/FNetBtIBluetoothSppInitiatorEventListener.h b/inc/FNetBtIBluetoothSppInitiatorEventListener.h index 806f22c..32c3579 100755 --- a/inc/FNetBtIBluetoothSppInitiatorEventListener.h +++ b/inc/FNetBtIBluetoothSppInitiatorEventListener.h @@ -36,8 +36,8 @@ namespace Tizen { namespace Net { namespace Bluetooth * * @since 2.0 * - * The %IBluetoothSppInitiatorEventListener interface specifies the methods used for creating notifications about the - * different kinds of BluetoothSppInitiator events. When a %BluetoothSppInitiator event is generated, one of these + * The %IBluetoothSppInitiatorEventListener interface specifies methods used for creating notifications for + * different kinds of BluetoothSppInitiator events. When a BluetoothSppInitiator event is generated, one of these * methods is called. * * For more information on the class features, see @@ -48,15 +48,15 @@ class _OSP_EXPORT_ IBluetoothSppInitiatorEventListener { public: /** - * 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. + * This polymorphic destructor should be overridden if required. @n + * This way, the destructors of the derived classes are called when the destructor of this interface is called. * * @since 2.0 */ virtual ~IBluetoothSppInitiatorEventListener(void) {} /** - * Called to notify when an SPP acceptor responds to the connection request. + * Called to notify when an SPP acceptor responds to a connection request. * * @since 2.0 * diff --git a/osp-bluetooth.pc.in b/osp-bluetooth.pc.in index eb6c3b7..1ad6e07 100755 --- a/osp-bluetooth.pc.in +++ b/osp-bluetooth.pc.in @@ -10,5 +10,5 @@ Description: @PACKAGE_DESCRIPTION@ Version: @VERSION@ Requires: @PC_REQUIRED@ Libs: -L${libdir} @PC_LDFLAGS@ -Cflags: -I${includedir} +Cflags: -I${includedir} -I${includedir}/net diff --git a/packaging/osp-bluetooth.spec b/packaging/osp-bluetooth.spec index 7e96c78..f26403d 100755 --- a/packaging/osp-bluetooth.spec +++ b/packaging/osp-bluetooth.spec @@ -1,9 +1,12 @@ +%define debug_package %{nil} +%define __strip /bin/true + Name: osp-bluetooth Summary: osp bluetooth library -Version: 1.2.1.0 +Version: 1.2.2.0 Release: 2 Group: System/Libraries -License: TO_BE/FILLED_IN +License: Apache-2.0 Source0: %{name}-%{version}.tar.gz BuildRequires: cmake BuildRequires: pkgconfig(chromium) @@ -17,8 +20,8 @@ BuildRequires: pkgconfig(osp-net) BuildRequires: osp-net-internal-devel # runtime requires -Requires: osp-appfw -Requires: osp-net +Requires: osp-appfw +Requires: osp-net %description osp bluetooth library @@ -39,15 +42,34 @@ Requires: %{name} = %{version}-%{release} %description internal-devel osp bluetooth library (Internal-DEV) +%package debug +Summary: osp bluetooth library (Development) +Group: TO_BE/FILLED_IN +Requires: %{name} = %{version}-%{release} + +%description debug +osp bluetooth library (DEV) + %prep %setup -q %build +%if 0%{?tizen_build_binary_release_type_eng} +CXXFLAGS="$CXXFLAGS -D_SECURE_LOG" +%endif MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` %ifarch %{ix86} -CXXFLAGS="$CXXFLAGS -D_OSP_DEBUG_ -D_SECURE_LOG -D_OSP_X86_ -D_OSP_EMUL_" cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DFULLVER=%{version} -DMAJORVER=${MAJORVER} +%if 0%{?simulator} +CXXFLAGS="$CXXFLAGS -D_OSP_DEBUG_ -D_OSP_X86_ -D_OSP_EMUL_" cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DFULLVER=%{version} -DMAJORVER=${MAJORVER} +%else +CXXFLAGS="$CXXFLAGS -D_OSP_DEBUG_ -D_OSP_X86_ " cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DFULLVER=%{version} -DMAJORVER=${MAJORVER} +%endif %else +%if 0%{?tizen_build_binary_release_type_eng} CXXFLAGS="-O2 -g -pipe -Wall -fno-exceptions -Wformat -Wformat-security -Wl,--as-needed -fmessage-length=0 -march=armv7-a -mtune=cortex-a8 -mlittle-endian -mfpu=neon -mfloat-abi=softfp -D__SOFTFP__ -mthumb -Wa,-mimplicit-it=thumb -funwind-tables -D_OSP_DEBUG_ -D_SECURE_LOG -D_OSP_ARMEL_" cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DFULLVER=%{version} -DMAJORVER=${MAJORVER} +%else +CXXFLAGS="-O2 -g -pipe -Wall -fno-exceptions -Wformat -Wformat-security -Wl,--as-needed -fmessage-length=0 -march=armv7-a -mtune=cortex-a8 -mlittle-endian -mfpu=neon -mfloat-abi=softfp -D__SOFTFP__ -mthumb -Wa,-mimplicit-it=thumb -funwind-tables -D_OSP_DEBUG_ -D_OSP_ARMEL_" cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DFULLVER=%{version} -DMAJORVER=${MAJORVER} +%endif %endif # Call make instruction with smp support @@ -75,3 +97,6 @@ cp %{_builddir}/%{name}-%{version}/LICENSE.APLv2.0 %{buildroot}/usr/share/licen %files internal-devel %{_includedir}/osp/net/*.h + +%files debug +%{_libdir}/osp/debug/*.so* diff --git a/src/FNetBt_BluetoothConnectionEvent.cpp b/src/FNetBt_BluetoothConnectionEvent.cpp deleted file mode 100644 index 1bf160c..0000000 --- a/src/FNetBt_BluetoothConnectionEvent.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// -// Open Service Platform -// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. -// -// Licensed under the Apache License, Version 2.0 (the License); -// 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 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// @file FNetBt_BluetoothConnectionEvent.cpp -// @brief This is the implementation file for the _BluetoothDeviceEvent class. -// - -#include <FBaseRtIEventListener.h> -#include <FBaseSysLog.h> -#include <FBaseRtIEventArg.h> -#include "FNetBt_BluetoothConnectionEvent.h" -#include "FNetBt_BluetoothConnectionEventArg.h" -#include "FNetBt_IBluetoothConnectionEventListener.h" - - -using namespace Tizen::Base; - -namespace Tizen { namespace Net { namespace Bluetooth -{ - -_BluetoothConnectionEvent::_BluetoothConnectionEvent(void) - : __listenerCount(0) -{ -} - -_BluetoothConnectionEvent::~_BluetoothConnectionEvent(void) -{ -} - -result -_BluetoothConnectionEvent::Construct(void) -{ - return _Event::Initialize(); -} - -void -_BluetoothConnectionEvent::FireImpl(Tizen::Base::Runtime::IEventListener& listener, const Tizen::Base::Runtime::IEventArg& arg) -{ - _IBluetoothConnectionEventListener* pEventListener = dynamic_cast <_IBluetoothConnectionEventListener*>(&listener); - SysTryReturnVoidResult(NID_NET_BT, pEventListener != null, E_INVALID_ARG, - "[E_INVALID_ARG] The listener argument is invalid."); - - const _BluetoothConnectionEventArg* pEventArg = dynamic_cast <const _BluetoothConnectionEventArg*>(&arg); - SysTryReturnVoidResult(NID_NET_BT, pEventArg != null, E_INVALID_ARG, "[E_INVALID_ARG] The event argument is invalid type."); - - _BluetoothConnectionEventType eventType = pEventArg->GetEventType(); - - switch (eventType) - { - case _BT_CONNECTION_EVENT_CONNECTED: - SysLog(NID_NET_BT, "Firing Bluetooth Connection state changed Event (Type: _BT_CONNECTION_EVENT_CONNECTED)"); - pEventListener->OnBluetoothDeviceConnected(*pEventArg->GetRemoteAddress()); - break; - - case _BT_CONNECTION_EVENT_DISCONNECTED: - SysLog(NID_NET_BT, "Firing Bluetooth Connection state changed Event (Type: _BT_CONNECTION_EVENT_DISCONNECTED)"); - pEventListener->OnBluetoothDeviceDisconnected(*pEventArg->GetRemoteAddress()); - break; - - default: - break; - } -} - -} } } // Tizen::Net::Bluetooth diff --git a/src/FNetBt_BluetoothConnectionEvent.h b/src/FNetBt_BluetoothConnectionEvent.h deleted file mode 100644 index bbeb028..0000000 --- a/src/FNetBt_BluetoothConnectionEvent.h +++ /dev/null @@ -1,84 +0,0 @@ -// -// Open Service Platform -// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. -// -// Licensed under the Apache License, Version 2.0 (the License); -// 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 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -/** - * @file FNetBt_BluetoothConnectionEvent.h - * @brief This is the header file for the _BluetoothConnectionEvent class. - * - * This header file contains the declarations of the _BluetoothConnectionEvent class. - * The _BluetoothConnectionEvent class can call a method of a listener (IBluetoothConnectionEventListener object). - * So, when a device event is occurred, listener instances can handle it appropriately. - */ -#ifndef _FNET_BT_INTERNAL_BLUETOOTH_CONNECTION_EVENT_H_ -#define _FNET_BT_INTERNAL_BLUETOOTH_CONNECTION_EVENT_H_ - -#include <FOspConfig.h> -#include <FBaseResult.h> -#include <FBaseRt_Event.h> - -// Forward declaration -namespace Tizen { namespace Base { namespace Runtime -{ -class IEventListener; -class IEventArg; -} } } - -namespace Tizen { namespace Net { namespace Bluetooth -{ - -// -// @class _BluetoothConnectionEvent -// @brief This class handles Bluetooth connection events. -// -class _BluetoothConnectionEvent - : public Tizen::Base::Runtime::_Event -{ -public: - /** - * This is the default constructor. - */ - _BluetoothConnectionEvent(void); - - /** - * This is the class destructor. - */ - virtual ~_BluetoothConnectionEvent(void); - result Construct(void); - -protected: - /** - * Checks the argument and finds out the type of event. After that, this method calls appropriate pListener's method. - * - * @return A result code. - * @param[in] pListener An event listener related to this Bluetooth device event. - * @param[in] arg An event argument including information to be passed to the event listeners - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG The argument passed to a method contains invalid values. - * @exception E_SYSTEM A system error occurred. - */ - virtual void FireImpl(Tizen::Base::Runtime::IEventListener& listener, const Tizen::Base::Runtime::IEventArg& arg); - -private: - _BluetoothConnectionEvent(const _BluetoothConnectionEvent& value); - _BluetoothConnectionEvent& operator =(const _BluetoothConnectionEvent& rhs); - -private: - int __listenerCount; - -}; // _BluetoothConnectionEvent - -} } } -#endif // _FNET_BT_INTERNAL_BLUETOOTH_CONNECTION_EVENT_H_ diff --git a/src/FNetBt_BluetoothConnectionEventArg.cpp b/src/FNetBt_BluetoothConnectionEventArg.cpp deleted file mode 100644 index 5390071..0000000 --- a/src/FNetBt_BluetoothConnectionEventArg.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// -// Open Service Platform -// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. -// -// Licensed under the Apache License, Version 2.0 (the License); -// 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 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// @file FNetBt_BluetoothConnectionEventArg.cpp -// @brief This is the implementation file for the _BluetoothConnectionEventArg class. -// - -#include <FBaseSysLog.h> -#include "FNetBt_BluetoothConnectionEventArg.h" - - -using namespace Tizen::Base; -using namespace Tizen::Base::Collection; - -namespace Tizen { namespace Net { namespace Bluetooth -{ - -// -// This is a class constructor for _BT_CONNECTION_EVENT_CONNECTED and _BT_CONNECTION_EVENT_DISCONNECTED event. -// -_BluetoothConnectionEventArg::_BluetoothConnectionEventArg(_BluetoothConnectionEventType type, const Tizen::Base::ByteBuffer& address) - : __evtType(type) - , __pRemoteAddress(null) -{ - __pRemoteAddress = new (std::nothrow) ByteBuffer(); - __pRemoteAddress->Construct(address); -} - -_BluetoothConnectionEventArg::~_BluetoothConnectionEventArg(void) -{ - delete __pRemoteAddress; -} - -_BluetoothConnectionEventType -_BluetoothConnectionEventArg::GetEventType(void) const -{ - return __evtType; -} - -const ByteBuffer* -_BluetoothConnectionEventArg::GetRemoteAddress(void) const -{ - return __pRemoteAddress; -} - -} } } // Tizen::Net::Bluetooth diff --git a/src/FNetBt_BluetoothConnectionEventArg.h b/src/FNetBt_BluetoothConnectionEventArg.h deleted file mode 100644 index 154d88d..0000000 --- a/src/FNetBt_BluetoothConnectionEventArg.h +++ /dev/null @@ -1,101 +0,0 @@ -// -// Open Service Platform -// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. -// -// Licensed under the Apache License, Version 2.0 (the License); -// 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 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -/** - * @file FNetBt_BluetoothConnectionEventArg.h - * @brief This is the header file for the _BluetoothConnectionEventArg class. - * - * This header file contains the declarations of the _BluetoothConnectionEventArg class which includes information to be - * passed to the event listeners - */ -#ifndef _FNET_BT_INTERNAL_BLUETOOTH_CONNECTION_EVENT_ARG_H_ -#define _FNET_BT_INTERNAL_BLUETOOTH_CONNECTION_EVENT_ARG_H_ - -#include <FBaseObject.h> -#include <FOspConfig.h> -#include <FBaseRtIEventArg.h> - -namespace Tizen { namespace Base -{ -class ByteBuffer; -} } - -namespace Tizen { namespace Net { namespace Bluetooth -{ - -/** - * @enum _BluetoothConnectionEventType - * Type for specifying the type of _BluetoothConnectionEvent - */ -enum _BluetoothConnectionEventType -{ - _BT_CONNECTION_EVENT_CONNECTED, /**< For notifying that the device is connected */ - _BT_CONNECTION_EVENT_DISCONNECTED, /**< For notifying that the device is disconnected */ -}; - -/** - * @class _BluetoothConnectionEventArg - * @brief This class is used as an argument for callback methods of the _IBluetoothConnectionEventListener class. - * - * When a _BluetoothConnectionEvent occurs, the _BluetoothConnectionEvent finds a _IBluetoothConnectionEventListener instance - * which is registered for the _BluetoothConnectionEvent and calls an appropriate method of the listener. - * @see _IBluetoothConnectionEventListener - */ -class _BluetoothConnectionEventArg - : public Tizen::Base::Object - , public Tizen::Base::Runtime::IEventArg -{ -public: - - /** - * This is a class constructor for _BT_CONNECTION_EVENT_CONNECTED and _BT_CONNECTION_EVENT_DISCONNECTED event. - * - * @param[in] address the remote device address to be observed regarding connection - */ - _BluetoothConnectionEventArg(_BluetoothConnectionEventType type, const Tizen::Base::ByteBuffer& address); - - /** - * This is the class destructor. - */ - ~_BluetoothConnectionEventArg(void); - - /** - * Gets the type of this event. - * - * @return The type of the event - */ - _BluetoothConnectionEventType GetEventType(void) const; - - /** - * Gets the remote device address. - * - * @return the pointer of the remote device address which is a connected or disconnected device - */ - const Tizen::Base::ByteBuffer* GetRemoteAddress(void) const; - -private: - _BluetoothConnectionEventArg(void); - _BluetoothConnectionEventArg(const _BluetoothConnectionEventArg& eventArg); - _BluetoothConnectionEventArg& operator =(const _BluetoothConnectionEventArg& rValue); - -private: - _BluetoothConnectionEventType __evtType; - Tizen::Base::ByteBuffer* __pRemoteAddress; - -}; // _BluetoothConnectionEventArg - -} } } -#endif // _FNET_BT_INTERNAL_BLUETOOTH_CONNECTION_EVENT_ARG_H_ diff --git a/src/FNetBt_BluetoothGapSystemAdapter.cpp b/src/FNetBt_BluetoothGapSystemAdapter.cpp index de5faf3..2adf317 100755 --- a/src/FNetBt_BluetoothGapSystemAdapter.cpp +++ b/src/FNetBt_BluetoothGapSystemAdapter.cpp @@ -18,7 +18,6 @@ // @brief This is the implementation file for the _BluetoothGapSystemAdapter class. // -#include <unique_ptr.h> #include <pthread.h> #include <FBaseByteBuffer.h> #include <FBaseUtilStringUtil.h> @@ -66,27 +65,35 @@ _BluetoothGapSystemAdapter::_BluetoothGapSystemAdapter(void) _BluetoothGapSystemAdapter::~_BluetoothGapSystemAdapter(void) { - // unset all the system callback methods - bt_adapter_unset_state_changed_cb(); - bt_adapter_unset_device_discovery_state_changed_cb(); - bt_adapter_unset_visibility_mode_changed_cb(); - bt_device_unset_bond_created_cb(); - bt_device_unset_bond_destroyed_cb(); - bt_device_unset_service_searched_cb(); - bt_device_unset_connection_state_changed_cb(); } void _BluetoothGapSystemAdapter::InitSingleton(void) { bool isConstructed = false; - static _BluetoothGapSystemAdapter inst; + std::unique_ptr<_BluetoothGapSystemAdapter> pInst; - isConstructed = inst.Construct(); + pInst.reset(new (std::nothrow) _BluetoothGapSystemAdapter()); + isConstructed = pInst->Construct(); SysTryReturnVoidResult(NID_NET_BT, isConstructed == true, E_SYSTEM, "[E_SYSTEM] Construction of _BluetoothGapSystemAdpater fails."); - __pInstance = &inst; + __pInstance = pInst.release(); + + std::atexit(DeinitializeSingleton); +} + +void +_BluetoothGapSystemAdapter::DeinitializeSingleton(void) +{ + // unset all the system callback methods + bt_adapter_unset_state_changed_cb(); + bt_adapter_unset_device_discovery_state_changed_cb(); + bt_adapter_unset_visibility_mode_changed_cb(); + bt_device_unset_bond_created_cb(); + bt_device_unset_bond_destroyed_cb(); + bt_device_unset_service_searched_cb(); + bt_device_unset_connection_state_changed_cb(); } _BluetoothGapSystemAdapter* @@ -493,7 +500,7 @@ _BluetoothGapSystemAdapter::StartDiscovery(void) { result r = E_SYSTEM; - if (bt_adapter_start_device_discovery() == BT_ERROR_NONE) + if (bt_adapter_start_discover_devices(BT_ADAPTER_DEVICE_DISCOVERY_BREDR) == BT_ERROR_NONE) { r = E_SUCCESS; } diff --git a/src/FNetBt_BluetoothGapSystemAdapter.h b/src/FNetBt_BluetoothGapSystemAdapter.h index 68d5798..5f87b08 100644..100755 --- a/src/FNetBt_BluetoothGapSystemAdapter.h +++ b/src/FNetBt_BluetoothGapSystemAdapter.h @@ -23,6 +23,7 @@ #ifndef _FNET_BT_INTERNAL_BLUETOOTH_GAP_SYSTEM_ADAPTER_H_ #define _FNET_BT_INTERNAL_BLUETOOTH_GAP_SYSTEM_ADAPTER_H_ +#include <unique_ptr.h> #include <bluetooth.h> #include <FBaseObject.h> #include <FBaseResult.h> @@ -300,7 +301,6 @@ public: */ static void OnConnectionStateChanged(bool isConnected, const char* pRemoteAddress, void* pUserdata); - private: _BluetoothGapSystemAdapter(void); ~_BluetoothGapSystemAdapter(void); @@ -311,11 +311,13 @@ private: bool Construct(void); static void InitSingleton(void); + static void DeinitializeSingleton(void); private: Tizen::Base::Collection::LinkedListT<_IBluetoothManagerEventListener*> __mgrEvtListenerList; Tizen::Base::Collection::LinkedListT<_IBluetoothDeviceEventListener*> __devEvtListenerList; static _BluetoothGapSystemAdapter* __pInstance; + friend class std::default_delete<_BluetoothGapSystemAdapter>; }; // _BluetoothGapSystemAdapter diff --git a/src/FNetBt_BluetoothHdpSystemAdapter.cpp b/src/FNetBt_BluetoothHdpSystemAdapter.cpp index 8045ae1..287a9fe 100755 --- a/src/FNetBt_BluetoothHdpSystemAdapter.cpp +++ b/src/FNetBt_BluetoothHdpSystemAdapter.cpp @@ -104,24 +104,32 @@ _BluetoothHdpSystemAdapter::_BluetoothHdpSystemAdapter(void) _BluetoothHdpSystemAdapter::~_BluetoothHdpSystemAdapter(void) { - // unregister the callback methods from the underlying layer - int err = bt_hdp_unset_connection_state_changed_cb(); - SysLog(NID_NET_BT, "[0x%x] error in unregistering the connection state change callback method", err); - - err = bt_hdp_unset_data_received_cb(); - SysLog(NID_NET_BT, "[0x%x] error in unregistering the data received state change callback method", err); } void _BluetoothHdpSystemAdapter::InitSingleton(void) { bool r = false; - static _BluetoothHdpSystemAdapter inst; + std::unique_ptr<_BluetoothHdpSystemAdapter> pInst; - r = inst.Construct(); + pInst.reset(new (std::nothrow) _BluetoothHdpSystemAdapter()); + r = pInst->Construct(); SysTryReturnVoidResult(NID_NET_BT, r == true, E_SYSTEM, "[E_SYSTEM] Propagating."); - __pInstance = &inst; + __pInstance = pInst.release(); + + std::atexit(DeinitializeSingleton); +} + +void +_BluetoothHdpSystemAdapter::DeinitializeSingleton(void) +{ + // unregister the callback methods from the underlying layer + int err = bt_hdp_unset_connection_state_changed_cb(); + SysLog(NID_NET_BT, "[0x%x] error in unregistering the connection state change callback method", err); + + err = bt_hdp_unset_data_received_cb(); + SysLog(NID_NET_BT, "[0x%x] error in unregistering the data received state change callback method", err); } _BluetoothHdpSystemAdapter* diff --git a/src/FNetBt_BluetoothHdpSystemAdapter.h b/src/FNetBt_BluetoothHdpSystemAdapter.h index 22a55ad..2bdf2c3 100644..100755 --- a/src/FNetBt_BluetoothHdpSystemAdapter.h +++ b/src/FNetBt_BluetoothHdpSystemAdapter.h @@ -148,6 +148,7 @@ private: bool Construct(void); static void InitSingleton(void); + static void DeinitializeSingleton(void); private: // hash map of HDP applications and the _BluetoothHealthImpl @@ -157,6 +158,7 @@ private: // hash map of HDP channel Ids and the connected device address std::unique_ptr<Tizen::Base::Collection::HashMapT< int, Tizen::Base::String> > __pChannelAddressMap; static _BluetoothHdpSystemAdapter* __pInstance; + friend class std::default_delete<_BluetoothHdpSystemAdapter>; }; // _BluetoothHdpSystemAdapter diff --git a/src/FNetBt_BluetoothIpcProxy.cpp b/src/FNetBt_BluetoothIpcProxy.cpp index c501d53..dd60dcb 100755 --- a/src/FNetBt_BluetoothIpcProxy.cpp +++ b/src/FNetBt_BluetoothIpcProxy.cpp @@ -68,12 +68,13 @@ void _BluetoothIpcProxy::InitSingleton(void) { result r = E_SUCCESS; - static _BluetoothIpcProxy inst; + std::unique_ptr<_BluetoothIpcProxy> pInst; - r = inst.Construct(); + pInst.reset(new (std::nothrow) _BluetoothIpcProxy()); + r = pInst->Construct(); SysTryReturnVoidResult(NID_NET_BT, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); - __pInstance = &inst; + __pInstance = pInst.release(); } _BluetoothIpcProxy* diff --git a/src/FNetBt_BluetoothIpcProxy.h b/src/FNetBt_BluetoothIpcProxy.h index 567399e..9d54ba2 100644..100755 --- a/src/FNetBt_BluetoothIpcProxy.h +++ b/src/FNetBt_BluetoothIpcProxy.h @@ -24,6 +24,7 @@ #ifndef _FNET_BT_INTERNAL_BLUETOOTH_IPC_PROXY_H_ #define _FNET_BT_INTERNAL_BLUETOOTH_IPC_PROXY_H_ +#include <unique_ptr.h> #include <FBaseObject.h> // Forward declaration @@ -70,6 +71,7 @@ private: private: Tizen::Io::_IpcClient* __pIpcClient; static _BluetoothIpcProxy* __pInstance; + friend class std::default_delete<_BluetoothIpcProxy>; }; // _BluetoothIpcProxy diff --git a/src/FNetBt_BluetoothManagerImpl.cpp b/src/FNetBt_BluetoothManagerImpl.cpp index 05b42d5..40f8587 100755 --- a/src/FNetBt_BluetoothManagerImpl.cpp +++ b/src/FNetBt_BluetoothManagerImpl.cpp @@ -33,8 +33,6 @@ #include "FNetBt_BluetoothManagerEventArg.h" #include "FNetBt_BluetoothDeviceEvent.h" #include "FNetBt_BluetoothDeviceEventArg.h" -#include "FNetBt_BluetoothConnectionEvent.h" -#include "FNetBt_BluetoothConnectionEventArg.h" using namespace std; using namespace Tizen::Base; @@ -49,9 +47,7 @@ _BluetoothManagerImpl::_BluetoothManagerImpl(void) , __pGapAdapter(null) , __pMgrEvent(null) , __pDevEvent(null) - , __pConEvent(null) , __pDevEvtListener(null) - , __pConEvtListener(null) , __pLocalDevice(null) , __pairedDeviceList() , __pairedDeviceMap() @@ -78,6 +74,8 @@ _BluetoothManagerImpl::~_BluetoothManagerImpl(void) __pGapAdapter->UnregisterManagerEventListener(*this); __pGapAdapter->UnregisterDeviceEventListener(*this); } + + delete __pLocalDevice; } result @@ -86,7 +84,6 @@ _BluetoothManagerImpl::Construct(IBluetoothManagerEventListener& listener) result r = E_SUCCESS; unique_ptr<_BluetoothManagerEvent> pMgrEvent; unique_ptr<_BluetoothDeviceEvent> pDevEvent; - unique_ptr<_BluetoothConnectionEvent> pConEvent; r = __stateMutex.Create(); SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, E_SYSTEM, "Failed to create the state mutex."); @@ -113,11 +110,6 @@ _BluetoothManagerImpl::Construct(IBluetoothManagerEventListener& listener) r = pDevEvent->Construct(); SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, E_SYSTEM, "Failed to construct the event."); - pConEvent.reset(new (std::nothrow) _BluetoothConnectionEvent()); - SysTryReturnResult(NID_NET_BT, pConEvent != null, E_OUT_OF_MEMORY, "The memory is insufficient."); - r = pConEvent->Construct(); - SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, E_SYSTEM, "Failed to construct the event."); - // add the IBluetoothManagerEventListener instance to a new created _BluetoothManagerEvent. r = pMgrEvent->AddListener(listener, true); SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, E_SYSTEM, @@ -167,7 +159,6 @@ _BluetoothManagerImpl::Construct(IBluetoothManagerEventListener& listener) __pMgrEvent = move(pMgrEvent); __pDevEvent = move(pDevEvent); - __pConEvent = move(pConEvent); return E_SUCCESS; } @@ -394,6 +385,9 @@ _BluetoothManagerImpl::SetDiscoverableMode(BluetoothDiscoverableMode mode, int s { result r = E_SUCCESS; + SysTryReturnResult(NID_NET_BT, (mode != BT_DISC_MODE_TIME_LIMITED_DISCOVERABLE || seconds>0) , E_INVALID_ARG, + "The seconds should be greater than 0"); + // Sets the discoverable mode through osp-connectivity-service. r = __pIpcProxy->SetDiscoverableMode((int)mode, seconds); SysTryReturnResult(NID_NET_BT, r != E_PRIVILEGE_DENIED && r != E_USER_NOT_CONSENTED, r, @@ -707,34 +701,6 @@ _BluetoothManagerImpl::SetBluetoothDeviceListener(IBluetoothDeviceEventListener* } result -_BluetoothManagerImpl::SetBluetoothConnectionListener(_IBluetoothConnectionEventListener* pListener) -{ - result r = E_SUCCESS; - - SysTryReturnResult(NID_NET_BT, __pConEvtListener != pListener, E_SUCCESS, "the listener instance is already registered."); - - if (__pConEvtListener != null) - { - // remove the previous IBluetoothDeviceEventListener instance from the _BluetoothDeviceEvent. - r = __pMgrEvent->RemoveListener(*__pConEvtListener); - SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, E_SYSTEM, "Failed to remove the previous _IBluetoothConnectionEventListener."); - SysLog(NID_NET_BT, "Removing the previous _IBluetoothConnectionEventListener is successful."); - __pConEvtListener = null; - } - - if (pListener != null) - { - // add the specified new IBluetoothDeviceEventListener instance to the _BluetoothDeviceEvent. - r = __pMgrEvent->AddListener(*pListener, true); - SysTryReturnResult(NID_NET_BT, r == E_SUCCESS, E_SYSTEM, "Failed to add the new _IBluetoothConnectionEventListener."); - SysLog(NID_NET_BT, "Adding the new _IBluetoothConnectionEventListener is successful."); - __pConEvtListener = pListener; - } - - return r; -} - -result _BluetoothManagerImpl::StartDiscovery(void) { SysLog(NID_NET_BT, "EntryPoint, [CurrentState:%s]", GetStringOfCurrentState()); @@ -1615,21 +1581,7 @@ _BluetoothManagerImpl::OnBluetoothDeviceConnected(const Tizen::Base::ByteBuffer& { SysLog(NID_NET_BT, "EntryPoint, [CurrentState:%s]", GetStringOfCurrentState()); - bool isFired = false; - - _BluetoothConnectionEventArg* pArg = new (std::nothrow) _BluetoothConnectionEventArg(_BT_CONNECTION_EVENT_CONNECTED, address); - if (pArg == null) - { - SysLogException(NID_NET_BT, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); - } - else - { - __pConEvent->FireAsync(*pArg); - isFired = true; - } - - SysLog(NID_NET_BT, "ExitPoint, [CurrentState:%s], [CONNECTED_Event:%s]", - GetStringOfCurrentState(), isFired ? "Fired" : "NotFired"); + // This callback is reserved for later use } void @@ -1637,21 +1589,7 @@ _BluetoothManagerImpl::OnBluetoothDeviceDisconnected(const Tizen::Base::ByteBuff { SysLog(NID_NET_BT, "EntryPoint, [CurrentState:%s]", GetStringOfCurrentState()); - bool isFired = false; - - _BluetoothConnectionEventArg* pArg = new (std::nothrow) _BluetoothConnectionEventArg(_BT_CONNECTION_EVENT_DISCONNECTED, address); - if (pArg == null) - { - SysLogException(NID_NET_BT, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); - } - else - { - __pConEvent->FireAsync(*pArg); - isFired = true; - } - - SysLog(NID_NET_BT, "ExitPoint, [CurrentState:%s], [DISCONNECTED_Event:%s]", - GetStringOfCurrentState(), isFired ? "Fired" : "NotFired"); + // This callback is reserved for later use } result diff --git a/src/FNetBt_BluetoothOppServerImpl.cpp b/src/FNetBt_BluetoothOppServerImpl.cpp index 814c0ac..91198c5 100755 --- a/src/FNetBt_BluetoothOppServerImpl.cpp +++ b/src/FNetBt_BluetoothOppServerImpl.cpp @@ -18,10 +18,12 @@ // @brief This is the implementation file for the _BluetoothOppServerImpl class. // +#include <unistd.h> #include <FNetBtBluetoothTypes.h> #include <FNetBtBluetoothDevice.h> #include <FNetBtIBluetoothOppServerEventListener.h> #include <FBaseSysLog.h> +#include <FBase_StringConverter.h> #include <FIo_FileImpl.h> #include <FApp_AppInfo.h> #include "FNetBt_BluetoothOppServerImpl.h" @@ -217,25 +219,29 @@ _BluetoothOppServerImpl::SetDestinationPath(const Tizen::Base::String& dstPath) { result r = E_INVALID_OPERATION; String physicalPath; + unique_ptr<char[]> pConvertedDestPath; + int res; if ((__currentState != _BT_OPP_SVR_STATE_ON_TRANSFER) && (__currentState != _BT_OPP_SVR_STATE_ON_STOPPING)) { if (_AppInfo::GetApiVersion() == _API_VERSION_2_0 && _AppInfo::IsOspCompat()) { - if (Tizen::Io::_FileImpl::ConvertVirtualToPhysicalPath(dstPath, physicalPath) != E_SUCCESS) - { - r = E_INACCESSIBLE_PATH; - } - else - { - r = __pOppAdapter->SetOppReceivePath(physicalPath); - } + r = Tizen::Io::_FileImpl::ConvertVirtualToPhysicalPath(dstPath, physicalPath); + SysTryReturn(NID_NET_BT, r == E_SUCCESS, E_INACCESSIBLE_PATH, E_INACCESSIBLE_PATH, + "[E_INACCESSIBLE_PATH] the dstPath is inaccessible."); } else { - r = __pOppAdapter->SetOppReceivePath(dstPath); + physicalPath = dstPath; } + + pConvertedDestPath.reset(_StringConverter::CopyToCharArrayN(physicalPath)); + res = access(pConvertedDestPath.get(), W_OK); + SysTryReturn(NID_NET_BT, res == 0, E_INACCESSIBLE_PATH, E_INACCESSIBLE_PATH, + "[E_INACCESSIBLE_PATH] the dstPath is inaccessible."); + + r = __pOppAdapter->SetOppReceivePath(pConvertedDestPath.get()); } if (r != E_SUCCESS) @@ -271,6 +277,7 @@ _BluetoothOppServerImpl::StartService(const Tizen::Base::String& dstPath) result r = E_FAILURE; String physicalPath; + unique_ptr<char[]> pConvertedDestPath; __stateMutex.Acquire(); @@ -294,7 +301,14 @@ _BluetoothOppServerImpl::StartService(const Tizen::Base::String& dstPath) physicalPath = dstPath; } - r = __pOppAdapter->StartOppServer(*this, physicalPath); + pConvertedDestPath.reset(_StringConverter::CopyToCharArrayN(physicalPath)); + if (access(pConvertedDestPath.get(), W_OK) < 0) + { + r = E_INACCESSIBLE_PATH; + break; + } + + r = __pOppAdapter->StartOppServer(*this, pConvertedDestPath.get()); if (r == E_SUCCESS) { diff --git a/src/FNetBt_BluetoothOppSystemAdapter.cpp b/src/FNetBt_BluetoothOppSystemAdapter.cpp index e3d126d..8da7199 100755 --- a/src/FNetBt_BluetoothOppSystemAdapter.cpp +++ b/src/FNetBt_BluetoothOppSystemAdapter.cpp @@ -58,9 +58,10 @@ _BluetoothOppSystemAdapter::~_BluetoothOppSystemAdapter(void) void _BluetoothOppSystemAdapter::InitSingleton(void) { - static _BluetoothOppSystemAdapter inst = _BluetoothOppSystemAdapter(); + _BluetoothOppSystemAdapter* inst = null; - __pInstance = &inst; + inst = new (std::nothrow) _BluetoothOppSystemAdapter(); + __pInstance = inst; } _BluetoothOppSystemAdapter* @@ -83,11 +84,10 @@ _BluetoothOppSystemAdapter::GetInstance(void) } result -_BluetoothOppSystemAdapter::StartOppServer(const _BluetoothOppServerImpl& impl, const Tizen::Base::String& dstPath) +_BluetoothOppSystemAdapter::StartOppServer(const _BluetoothOppServerImpl& impl, const char* pDstPath) { unique_ptr<char[]> pUuidStr; bool isUsed = false; - unique_ptr<char[]> pConvertedDestPath; result r = E_SUCCESS; int ret = BT_ERROR_NONE; @@ -96,16 +96,17 @@ _BluetoothOppSystemAdapter::StartOppServer(const _BluetoothOppServerImpl& impl, ret = bt_adapter_is_service_used(pUuidStr.get() , &isUsed); SysTryReturnResult(NID_NET_BT, (ret == BT_ERROR_NONE) && !isUsed, E_SERVICE_UNAVAILABLE, "OPP Server is not available. [0x%08X]", ret); - pConvertedDestPath.reset(_StringConverter::CopyToCharArrayN(dstPath)); - SysTryReturnResult(NID_NET_BT, pConvertedDestPath != null, E_INACCESSIBLE_PATH, "The file path is invalid."); - - ret = bt_opp_server_initialize_by_connection_request(pConvertedDestPath.get(), &OnOppServerConnectionRequested, null); + ret = bt_opp_server_initialize_by_connection_request(pDstPath, &OnOppServerConnectionRequested, null); SysLog(NID_NET_BT, "Starting the OPP Server %s. [0x%-04X]", ret == BT_ERROR_NONE ? "is successful" : "fails", ret); if (ret == BT_ERROR_NONE) { __pOppServerImpl = const_cast <_BluetoothOppServerImpl*>(&impl); } + else if (ret == BT_ERROR_INVALID_PARAMETER) + { + r = E_INACCESSIBLE_PATH; + } else { r = E_FAILURE; @@ -132,16 +133,12 @@ _BluetoothOppSystemAdapter::StopOppServer(void) } result -_BluetoothOppSystemAdapter::SetOppReceivePath(const Tizen::Base::String& dstPath) +_BluetoothOppSystemAdapter::SetOppReceivePath(const char* pDstPath) { - char* pConvertedDestPath = NULL; result r = E_FAILURE; int ret = BT_ERROR_NONE; - pConvertedDestPath = _StringConverter::CopyToCharArrayN(dstPath); - SysTryReturnResult(NID_NET_BT, pConvertedDestPath != null, E_INACCESSIBLE_PATH, "The file path is invalid."); - - ret = bt_opp_server_set_destination(pConvertedDestPath); + ret = bt_opp_server_set_destination(pDstPath); SysLog(NID_NET_BT, "Setting the receive path of the OPP Server %s. [0x%08X]", ret == BT_ERROR_NONE ? "is successful" : "fails", ret); @@ -149,8 +146,11 @@ _BluetoothOppSystemAdapter::SetOppReceivePath(const Tizen::Base::String& dstPath { r = E_SUCCESS; } + else if (ret == BT_ERROR_INVALID_PARAMETER) + { + r = E_INACCESSIBLE_PATH; + } - delete[] pConvertedDestPath; return r; } diff --git a/src/FNetBt_BluetoothOppSystemAdapter.h b/src/FNetBt_BluetoothOppSystemAdapter.h index 05ca2d3..b5dafa4 100644..100755 --- a/src/FNetBt_BluetoothOppSystemAdapter.h +++ b/src/FNetBt_BluetoothOppSystemAdapter.h @@ -68,13 +68,13 @@ public: * * @return An error code * @param[in] impl The instance of _BluetoothOppServerImpl to be registered - * @param[in] dstPath The new destination file path + * @param[in] pDstPath The new destination file path * @exception E_SUCCESS The method is successful. * @exception E_SERVICE_UNAVAILABLE OPP Server service is not available because the number of registered instances * are exceeded to the max number. * @exception E_SYSTEM A system error has occurred. */ - result StartOppServer(const _BluetoothOppServerImpl& impl, const Tizen::Base::String& dstPath); + result StartOppServer(const _BluetoothOppServerImpl& impl, const char* pDstPath); /** * Stop the running OPP server and unset the registered instance of _BluetoothOppServerImpl class. @@ -90,12 +90,12 @@ public: * Sets the destination path of the file to be received. * * @return An error code - * @param[in] dstPath The new destination file path + * @param[in] pDstPath The new destination file path * @exception E_SUCCESS The method is successful. * @exception E_INACCESSIBLE_PATH The specified @c path contains an invalid value. * @exception E_FAILURE The method failed. */ - result SetOppReceivePath(const Tizen::Base::String& dstPath); + result SetOppReceivePath(const char* pDstPath); /** * Accepts an OPP Push request from a remote device. diff --git a/src/FNetBt_BluetoothSppSystemAdapter.cpp b/src/FNetBt_BluetoothSppSystemAdapter.cpp index 3358546..9bc582d 100755 --- a/src/FNetBt_BluetoothSppSystemAdapter.cpp +++ b/src/FNetBt_BluetoothSppSystemAdapter.cpp @@ -114,22 +114,30 @@ _BluetoothSppSystemAdapter::_BluetoothSppSystemAdapter(void) _BluetoothSppSystemAdapter::~_BluetoothSppSystemAdapter(void) { - // unregister the callback methods from the underlying layer - (void) bt_socket_unset_connection_state_changed_cb(); - (void) bt_socket_unset_data_received_cb(); - (void) bt_socket_unset_connection_requested_cb(); } void _BluetoothSppSystemAdapter::InitSingleton(void) { bool r = false; - static _BluetoothSppSystemAdapter inst; + std::unique_ptr<_BluetoothSppSystemAdapter> pInst; - r = inst.Construct(); + pInst.reset(new (std::nothrow) _BluetoothSppSystemAdapter()); + r = pInst->Construct(); SysTryReturnVoidResult(NID_NET_BT, r == true, E_SYSTEM, "[E_SYSTEM] Propagating."); - __pInstance = &inst; + __pInstance = pInst.release(); + + std::atexit(DeinitializeSingleton); +} + +void +_BluetoothSppSystemAdapter::DeinitializeSingleton(void) +{ + // unregister the callback methods from the underlying layer + (void) bt_socket_unset_connection_state_changed_cb(); + (void) bt_socket_unset_data_received_cb(); + (void) bt_socket_unset_connection_requested_cb(); } _BluetoothSppSystemAdapter* diff --git a/src/FNetBt_BluetoothSppSystemAdapter.h b/src/FNetBt_BluetoothSppSystemAdapter.h index d741a9c..a2ee53d 100644..100755 --- a/src/FNetBt_BluetoothSppSystemAdapter.h +++ b/src/FNetBt_BluetoothSppSystemAdapter.h @@ -191,12 +191,14 @@ private: bool Construct(void); static void InitSingleton(void); + static void DeinitializeSingleton(void); private: std::unique_ptr< Tizen::Base::Collection::HashMapT<int, _IBluetoothSocketListener*> > __pServerSocketMap; std::unique_ptr< Tizen::Base::Collection::HashMapT<int, _IBluetoothSocketListener*> > __pSocketMap; std::unique_ptr< Tizen::Base::Collection::HashMapT<Tizen::Base::String, _IBluetoothSocketListener*> > __pClientSocketMap; static _BluetoothSppSystemAdapter* __pInstance; + friend class std::default_delete<_BluetoothSppSystemAdapter>; }; // _BluetoothSppSystemAdapter } } } diff --git a/src/inc/FNetBt_BluetoothManagerImpl.h b/src/inc/FNetBt_BluetoothManagerImpl.h index 6602723..39e08bc 100755 --- a/src/inc/FNetBt_BluetoothManagerImpl.h +++ b/src/inc/FNetBt_BluetoothManagerImpl.h @@ -34,7 +34,6 @@ #include <FBaseRtMutex.h> #include "FNetBt_IBluetoothManagerEventListener.h" #include "FNetBt_IBluetoothDeviceEventListener.h" -#include "FNetBt_IBluetoothConnectionEventListener.h" namespace Tizen { namespace Net { namespace Bluetooth @@ -46,7 +45,6 @@ class IBluetoothManagerEventListener; class IBluetoothDeviceEventListener; class _BluetoothManagerEvent; class _BluetoothDeviceEvent; -class _BluetoothConnectionEvent; class _BluetoothIpcProxy; class _BluetoothGapSystemAdapter; @@ -59,7 +57,6 @@ class _OSP_EXPORT_ _BluetoothManagerImpl : public Tizen::Base::Object , public _IBluetoothManagerEventListener , public _IBluetoothDeviceEventListener - , public _IBluetoothConnectionEventListener { /** * @enum _BluetoothManagerStateType @@ -375,16 +372,6 @@ public: result SetBluetoothDeviceListener(IBluetoothDeviceEventListener* pListener); /** - * Sets a Connection event listener. - * - * @return An error code - * @param[in] pListener The Connection event listener to be added - * @exception E_SUCCESS The method is successful. - * @exception E_SYSTEM A system error occurred. - */ - result SetBluetoothConnectionListener(_IBluetoothConnectionEventListener* pListener); - - /** * Starts a device discovery process. * * @return An error code @@ -512,9 +499,7 @@ private: _BluetoothGapSystemAdapter* __pGapAdapter; std::unique_ptr<_BluetoothManagerEvent> __pMgrEvent; std::unique_ptr<_BluetoothDeviceEvent> __pDevEvent; - std::unique_ptr<_BluetoothConnectionEvent> __pConEvent; const IBluetoothDeviceEventListener* __pDevEvtListener; - const _IBluetoothConnectionEventListener* __pConEvtListener; BluetoothDevice* __pLocalDevice; Tizen::Base::Collection::ArrayList __pairedDeviceList; // for APIs prior to 2.0 Tizen::Base::Collection::HashMap __pairedDeviceMap; diff --git a/src/inc/FNetBt_BluetoothOppServerImpl.h b/src/inc/FNetBt_BluetoothOppServerImpl.h index bb26a49..1fca2d9 100644..100755 --- a/src/inc/FNetBt_BluetoothOppServerImpl.h +++ b/src/inc/FNetBt_BluetoothOppServerImpl.h @@ -128,6 +128,9 @@ public: * For example, trying to change the path on Push transition is prohibited. * @exception E_INACCESSIBLE_PATH The specified @c dstPath is inaccessible. * @exception E_FAILURE The method has failed. + * @remarks The destination path is either a media directory or an external storage directory. + * Use Tizen::System::Environment::GetMediaPath() to access the media directory and + * Tizen::System::Environment::GetExternalStoragePath() to access the external storage directory. */ result SetDestinationPath(const Tizen::Base::String& dstPath); @@ -145,6 +148,9 @@ public: * For example, The stop process is in progress. * @exception E_INACCESSIBLE_PATH The specified @c dstPath is inaccessible. * @exception E_SERVICE_UNAVAILABLE OPP service is not available. + * @remarks The destination path is either a media directory or an external storage directory. + * Use Tizen::System::Environment::GetMediaPath() to access the media directory and + * Tizen::System::Environment::GetExternalStoragePath() to access the external storage directory. */ result StartService(const Tizen::Base::String& dstPath); diff --git a/src/inc/FNetBt_IBluetoothConnectionEventListener.h b/src/inc/FNetBt_IBluetoothConnectionEventListener.h deleted file mode 100644 index 7956f2e..0000000 --- a/src/inc/FNetBt_IBluetoothConnectionEventListener.h +++ /dev/null @@ -1,76 +0,0 @@ -// -// Open Service Platform -// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. -// -// Licensed under the Apache License, Version 2.0 (the License); -// 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 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -/** - * @file FNetBt_IBluetoothConnectionEventListener.h - * @brief This is the header file for the _IBluetoothConnectionEventListener interface. - * - * This header file contains the declaration of the _IBluetoothConnectionEventListener interface. - * - */ -#ifndef _FNET_BT_INTERNAL_IBLUETOOTH_CONNECTION_EVENT_LISTENER_H_ -#define _FNET_BT_INTERNAL_IBLUETOOTH_CONNECTION_EVENT_LISTENER_H_ - -#include <FBaseRtIEventListener.h> - -namespace Tizen { namespace Base -{ -class ByteBuffer; -namespace Collection -{ -class IList; -} -} } - -namespace Tizen { namespace Net { namespace Bluetooth -{ - -// forward declaration -class BluetoothDevice; - -/** - * @interface _IBluetoothConnectionEventListener - * @brief This interface specifies the methods used for notifying the change of connection with local device - */ -class _OSP_EXPORT_ _IBluetoothConnectionEventListener - : public Base::Runtime::IEventListener -{ -public: - /** - * This is the virtual destructor for this class. - */ - virtual ~_IBluetoothConnectionEventListener(void) {} - - /** - * Callback used to notify that the paired device is connected. - * - * @param[in] isCompleted @c true, if the transfer is successfully completed @n - * @c false, otherwise. - */ - virtual void OnBluetoothDeviceConnected(const Tizen::Base::ByteBuffer& address) = 0; - - /** - * Callback used to notify that the paired device is disconnected. - * - * @param[in] isCompleted @c true, if the transfer is successfully completed @n - * @c false, otherwise. - */ - virtual void OnBluetoothDeviceDisconnected(const Tizen::Base::ByteBuffer& address) = 0; - -}; // _IBluetoothConnectionEventListener - -} } } -#endif // _FNET_BT_INTERNAL_IBLUETOOTH_CONNECTION_EVENT_LISTENER_H_ |