From 5373f8b2ac091704a0e449d1ce7bbcae5a2ea467 Mon Sep 17 00:00:00 2001 From: "h.sandeep" Date: Wed, 2 Aug 2017 10:53:14 +0530 Subject: [PATCH] [C#][Bluetooth]: Update exception description for all applicable APIs Change-Id: I89fe2ca738fd30b8dc539c9eb64a1912725d0ebe Signed-off-by: h.sandeep --- .../Tizen.Network.Bluetooth/BluetoothAdapter.cs | 51 +++++++++++++++++-- .../BluetoothAdapterImpl.cs | 2 +- .../Tizen.Network.Bluetooth/BluetoothAudio.cs | 6 +++ .../Tizen.Network.Bluetooth/BluetoothAudioImpl.cs | 2 +- .../Tizen.Network.Bluetooth/BluetoothAvrcp.cs | 22 ++++++++ .../Tizen.Network.Bluetooth/BluetoothAvrcpImpl.cs | 2 +- .../Tizen.Network.Bluetooth/BluetoothData.cs | 0 .../Tizen.Network.Bluetooth/BluetoothDevice.cs | 18 +++++++ .../BluetoothEnumerations.cs | 2 +- .../Tizen.Network.Bluetooth/BluetoothEventArgs.cs | 2 +- .../Tizen.Network.Bluetooth/BluetoothGatt.cs | 38 ++++++++++++++ .../Tizen.Network.Bluetooth/BluetoothGattImpl.cs | 2 +- .../Tizen.Network.Bluetooth/BluetoothHid.cs | 4 ++ .../Tizen.Network.Bluetooth/BluetoothHidImpl.cs | 2 +- .../Tizen.Network.Bluetooth/BluetoothLeAdapter.cs | 59 +++++++++++++++++++++- .../BluetoothLeAdapterImpl.cs | 0 .../BluetoothServerSocket.cs | 4 ++ .../Tizen.Network.Bluetooth/BluetoothSocket.cs | 10 ++++ .../Tizen.Network.Bluetooth/BluetoothStructs.cs | 0 19 files changed, 215 insertions(+), 11 deletions(-) mode change 100755 => 100644 src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothData.cs mode change 100755 => 100644 src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothEnumerations.cs mode change 100755 => 100644 src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothEventArgs.cs mode change 100755 => 100644 src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothGattImpl.cs mode change 100755 => 100644 src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothLeAdapterImpl.cs mode change 100755 => 100644 src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothServerSocket.cs mode change 100755 => 100644 src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothSocket.cs mode change 100755 => 100644 src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothStructs.cs diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAdapter.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAdapter.cs index f15a767..612d214 100644 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAdapter.cs +++ b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAdapter.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the License); @@ -29,8 +29,8 @@ namespace Tizen.Network.Bluetooth /// /// A property to check whether Bluetooth is enabled. /// - /// Thrown when the BT/BTLE is not Supported. - /// Thrown when the BT/BTLE is not Enabled. + /// Thrown when the Bluetooth is not supported. + /// Thrown when the Bluetooth is not Enabled. static public bool IsBluetoothEnabled { get @@ -45,6 +45,8 @@ namespace Tizen.Network.Bluetooth /// /// The Bluetooth must be enabled. /// + /// Thrown when the Bluetooth is not supported. + /// Thrown when the Bluetooth is not Enabled. static public string Address { get @@ -66,6 +68,8 @@ namespace Tizen.Network.Bluetooth /// /// The Bluetooth must be enabled. /// + /// Thrown when the Bluetooth is not supported. + /// Thrown when the Bluetooth is not Enabled. static public string Name { get @@ -91,6 +95,8 @@ namespace Tizen.Network.Bluetooth /// /// The Bluetooth must be enabled. /// + /// Thrown when the Bluetooth is not supported. + /// Thrown when the Bluetooth is not Enabled. static public VisibilityMode Visibility { get @@ -112,6 +118,8 @@ namespace Tizen.Network.Bluetooth /// /// The Bluetooth must be enabled. /// + /// Thrown when the Bluetooth is not supported. + /// Thrown when the Bluetooth is not Enabled. static public bool IsDiscoveryInProgress { get @@ -133,6 +141,8 @@ namespace Tizen.Network.Bluetooth /// /// The Bluetooth must be enabled. /// + /// Thrown when the Bluetooth is not supported. + /// Thrown when the Bluetooth is not Enabled. static public int RemainingTimeAsVisible { get @@ -244,6 +254,9 @@ namespace Tizen.Network.Bluetooth /// The Bluetooth must be enabled and device discovery can be stopped by StopDiscovery(). /// If this succeeds, DiscoveryStateChanged event will be invoked. /// + /// Thrown when the Bluetooth is not supported. + /// Thrown when the Bluetooth is not Enabled + /// or the start discovery fails. static public void StartDiscovery() { if (IsBluetoothEnabled) @@ -259,6 +272,9 @@ namespace Tizen.Network.Bluetooth /// The device discovery must be in progress with StartDiscovery(). /// If this succeeds, DiscoveryStateChanged event will be invoked. /// + /// Thrown when the Bluetooth is not supported. + /// Thrown when the Bluetooth is not Enabled + /// the Discovery is not is prpgress static public void StopDiscovery() { if (IsDiscoveryInProgress) @@ -274,6 +290,9 @@ namespace Tizen.Network.Bluetooth /// The Bluetooth must be enabled. /// /// List of Bonded BluetoothDeviceInfo objects. + /// Thrown when the Bluetooth is not supported. + /// Thrown when the Bluetooth is not Enabled + /// or reading the Bonded devices list is failed. static public IEnumerable GetBondedDevices() { if (IsBluetoothEnabled) @@ -293,6 +312,9 @@ namespace Tizen.Network.Bluetooth /// The Bluetooth must be enabled. /// /// Information of bonded BluetoothDeviceInfo object. + /// Thrown when the Bluetooth is not supported. + /// Thrown when the Bluetooth is not Enabled + /// or reading the bonded device information fails. static public BluetoothDevice GetBondedDevice(string address) { if (IsBluetoothEnabled) @@ -310,6 +332,8 @@ namespace Tizen.Network.Bluetooth /// /// true if the specified serviceUuid is used; otherwise, false. /// The UUID of Service. + /// Thrown when the Bluetooth is not supported. + /// Thrown when the Bluetooth is not Enabled. static public bool IsServiceUsed(string serviceUuid) { return BluetoothAdapterImpl.Instance.IsServiceUsed(serviceUuid); @@ -322,6 +346,9 @@ namespace Tizen.Network.Bluetooth /// The Bluetooth must be enabled. /// /// The BluetoothOobData object. + /// Thrown when the Bluetooth is not supported. + /// Thrown when the Bluetooth is not Enabled + /// or the read OObData procedure is failed static public BluetoothOobData GetLocalOobData() { if (IsBluetoothEnabled && Globals.IsInitialize) @@ -342,6 +369,9 @@ namespace Tizen.Network.Bluetooth /// /// Remote Device address. /// BluetoothOobData object. + /// Thrown when the Bluetooth is not supported. + /// Thrown when the Bluetooth is not Enabled + /// or the set Oobdata procedure is failed. static public void SetRemoteOobData(string address, BluetoothOobData oobData) { if (IsBluetoothEnabled && Globals.IsInitialize) @@ -357,6 +387,9 @@ namespace Tizen.Network.Bluetooth /// The Bluetooth must be enabled. /// /// Remote Device address. + /// Thrown when the Bluetooth is not supported. + /// Thrown when the Bluetooth is not Enabled + /// or if the Remove Oobdata procedure is failed. static public void RemoveRemoteOobData(string address) { if (IsBluetoothEnabled && Globals.IsInitialize) @@ -371,6 +404,9 @@ namespace Tizen.Network.Bluetooth /// /// Bluetooth must be enabled. /// the result of the operation StartLeScan + /// Thrown when the Bluetooth LE is not supported. + /// Thrown when the Bluetooth LE is not Enabled + /// or the Start LE Scan is failed. static public void StartLeScan() { if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) @@ -394,6 +430,9 @@ namespace Tizen.Network.Bluetooth /// /// The Bluetooth must be enabled. /// the result of the operation stopLescan + /// Thrown when the Bluetooth LE is not supported. + /// Thrown when the Bluetooth LE is not Enabled + /// or Stop LE Scan is failed. static public void StopLeScan() { if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) @@ -431,6 +470,9 @@ namespace Tizen.Network.Bluetooth /// /// The BluetoothServerSocket instance. /// The UUID of service to provide. + /// Thrown when the Bluetooth is not supported. + /// Thrown when the Bluetooth is not Enabled + /// or Socket create error happens. static public BluetoothServerSocket CreateServerSocket(string serviceUuid) { if (IsBluetoothEnabled && Globals.IsInitialize) @@ -450,6 +492,9 @@ namespace Tizen.Network.Bluetooth /// The socket must be created with CreateServerSocket(). ConnectionStateChanged event is raised after this API is called. /// /// The server socket instance which is created using CreateServerSocket(). + /// Thrown when the Bluetooth is not supported. + /// Thrown when the Bluetooth is not Enabled + /// or socket destroy error happens. static public void DestroyServerSocket(BluetoothServerSocket socket) { if (IsBluetoothEnabled && Globals.IsInitialize) diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAdapterImpl.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAdapterImpl.cs index 92c4b0a..7adcffe 100644 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAdapterImpl.cs +++ b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAdapterImpl.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the License); diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAudio.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAudio.cs index d66a401..c6d6f1a 100644 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAudio.cs +++ b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAudio.cs @@ -53,6 +53,9 @@ namespace Tizen.Network.Bluetooth /// and AdvancedAudioDistribution is connected. /// /// Type of audio profile. + /// Thrown when the Bluetooth is not supported. + /// Thrown when the Bluetooth is not Enabled + /// or when the connection attempt fails. public void Connect(BluetoothAudioProfileType profileType) { if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) @@ -79,6 +82,9 @@ namespace Tizen.Network.Bluetooth /// and AdvancedAudioDistribution is disconnected. /// /// Type of audio profile. + /// Thrown when the Bluetooth is not supported. + /// Thrown when the Bluetooth is not Enabled + /// or when Disconnection attempt fails. public void Disconnect(BluetoothAudioProfileType type) { if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAudioImpl.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAudioImpl.cs index eeb1977..6570dc9 100644 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAudioImpl.cs +++ b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAudioImpl.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the License); diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAvrcp.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAvrcp.cs index f83ad82..dc6afa2 100644 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAvrcp.cs +++ b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAvrcp.cs @@ -110,6 +110,9 @@ namespace Tizen.Network.Bluetooth /// The remote device must be connected. /// /// Equalizer state. + /// Thrown when the Bluetooth is not supported. + /// Thrown when the Bluetooth is not Enabled + /// or when Notifying the equalizer state to remote device fails. public void NotifyEqualizerState(EqualizerState state) { if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) @@ -129,6 +132,10 @@ namespace Tizen.Network.Bluetooth /// The remote device must be connected. /// /// Repeat mode. + /// Thrown when the Bluetooth is not supported. + /// Thrown when the Bluetooth is not Enabled + /// or when Notifying the repeat mode state to remote device fails. + /// public void NotifyRepeatMode(RepeatMode mode) { if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) @@ -148,6 +155,9 @@ namespace Tizen.Network.Bluetooth /// The remote device must be connected. /// /// Shuffle mode. + /// Thrown when the Bluetooth is not supported. + /// Thrown when the Bluetooth is not Enabled + /// or when Notifying the shuffle mode state to remote device fails. public void NotifyShuffleMode(ShuffleMode mode) { if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) @@ -167,6 +177,9 @@ namespace Tizen.Network.Bluetooth /// The remote device must be connected. /// /// Scan mode. + /// Thrown when the Bluetooth is not supported. + /// Thrown when the Bluetooth is not Enabled + /// or when Notifying the Scan mode state to remote device fails. public void NotifyScanMode(ScanMode mode) { if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) @@ -186,6 +199,9 @@ namespace Tizen.Network.Bluetooth /// The remote device must be connected. /// /// Player state. + /// Thrown when the Bluetooth is not supported. + /// Thrown when the Bluetooth is not Enabled + /// or when Notifying the player state to remote device fails. public void NotifyPlayerState(PlayerState state) { if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) @@ -205,6 +221,9 @@ namespace Tizen.Network.Bluetooth /// The remote device must be connected. /// /// Current position in milliseconds. + /// Thrown when the Bluetooth is not supported. + /// Thrown when the Bluetooth is not Enabled + /// or when Notifying the current position state to remote device fails. public void NotifyCurrentPosition(uint position) { if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) @@ -224,6 +243,9 @@ namespace Tizen.Network.Bluetooth /// The remote device must be connected. /// /// Data of the track. + /// Thrown when the Bluetooth is not supported. + /// Thrown when the Bluetooth is not Enabled + /// or when Notifying the shuffle Track state to remote device fails. public void NotifyTrack(Track trackData) { if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAvrcpImpl.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAvrcpImpl.cs index b9606bd..28abda8 100644 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAvrcpImpl.cs +++ b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAvrcpImpl.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the License); diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothData.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothData.cs old mode 100755 new mode 100644 diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothDevice.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothDevice.cs index 503861e..a5350f2 100644 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothDevice.cs +++ b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothDevice.cs @@ -436,6 +436,8 @@ namespace Tizen.Network.Bluetooth /// The Bluetooth must be enabled and remote device must be discoverable by StartDiscovery().The bond can be destroyed by DestroyBond(). /// The bonding request can be cancelled by CancelBonding().If this succeeds, BondCreated event will be invoked. /// + /// Thrown when the BT/BTLE is not Enabled + /// or when create bond to remote device fails. public void CreateBond() { if (BluetoothAdapter.IsBluetoothEnabled) @@ -455,6 +457,8 @@ namespace Tizen.Network.Bluetooth /// /// Bonding must be in progress by CreateBond(). /// + /// Thrown when the BT/BTLE is not Enabled + /// or when cancel bonding procedure to remote device fails. public void CancelBonding() { int ret = Interop.Bluetooth.CancelBonding(); @@ -472,6 +476,8 @@ namespace Tizen.Network.Bluetooth /// The Bluetooth must be enabled and the bond must be created by CreateBond(). /// If this succeeds, BondDestroyed event will be invoked. /// + /// Thrown when the BT/BTLE is not Enabled + /// or when destroy bond procedure fails. public void DestroyBond() { if (BluetoothAdapter.IsBluetoothEnabled) @@ -492,6 +498,8 @@ namespace Tizen.Network.Bluetooth /// The Bluetooth must be enabled and the bond must be created by CreateBond(). /// /// Alias name of remote device. + /// Thrown when the BT/BTLE is not Enabled + /// or when set alias name to remote device fails. public void SetAlias(string aliasName) { if (BluetoothAdapter.IsBluetoothEnabled) @@ -513,6 +521,8 @@ namespace Tizen.Network.Bluetooth /// If this succeeds, AuthorizationChanged event will be invoked. /// /// Authorization state. + /// Thrown when the BT/BTLE is not Enabled + /// or when Set authorization to remote device fails. public void SetAuthorization(BluetoothAuthorizationType authorizationState) { if (BluetoothAdapter.IsBluetoothEnabled) @@ -531,6 +541,8 @@ namespace Tizen.Network.Bluetooth /// /// The service mask list converted from the given UUID list. /// Uuid list of the device. + /// Thrown when the BT/BTLE is not Enabled + /// or when get Mask from UUID fails. public BluetoothServiceClassType GetMaskFromUuid(string[] uuids) { BluetoothServiceClassType serviceMask; @@ -551,6 +563,8 @@ namespace Tizen.Network.Bluetooth /// The Bluetooth must be enabled and remote device must be discoverable by StartDiscovery().The bond must be created by CreateBond(). /// If this succeeds, ServiceSearched will be invoked. /// + /// Thrown when the BT/BTLE is not Enabled + /// or when remote device service search fails. public void StartServiceSearch() { Log.Info(Globals.LogTag, "startservicesearch entry"); @@ -572,6 +586,8 @@ namespace Tizen.Network.Bluetooth /// The Bluetooth must be enabled. /// /// The connected Bluetooth profiles. + /// Thrown when the BT/BTLE is not Enabled + /// or when there is no BT connection. public IEnumerable GetConnectedProfiles() { if (BluetoothAdapter.IsBluetoothEnabled) @@ -607,6 +623,8 @@ namespace Tizen.Network.Bluetooth /// /// true if profile is connected; otherwise, false. /// Bluetooth Profile type. + /// Thrown when the BT/BTLE is not Enabled + /// or when there is no BT connection. public bool IsProfileConnected(BluetoothProfileType profileType) { if (BluetoothAdapter.IsBluetoothEnabled) diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothEnumerations.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothEnumerations.cs old mode 100755 new mode 100644 index b49775c..23ec408 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothEnumerations.cs +++ b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothEnumerations.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the License); diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothEventArgs.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothEventArgs.cs old mode 100755 new mode 100644 index 563ba87..96f3458 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothEventArgs.cs +++ b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothEventArgs.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the License); diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothGatt.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothGatt.cs index 98c5218..ac038b5 100644 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothGatt.cs +++ b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothGatt.cs @@ -53,6 +53,8 @@ namespace Tizen.Network.Bluetooth /// Creates bluetooth gatt server /// /// + /// Thrown when the BT/BTLE is not supported. + /// Thrown when create gatt server fails. public static BluetoothGattServer CreateServer() { if (_instance == null) @@ -69,6 +71,8 @@ namespace Tizen.Network.Bluetooth /// /// Registers the server along with the GATT services of the application it is hosting /// + /// Thrown when the BT/BTLE is not supported. + /// Thrown when register server application fails. public void Start() { _impl.Start(); @@ -78,6 +82,8 @@ namespace Tizen.Network.Bluetooth /// Registers a specified service to this server /// /// service, which needs to be registered with this server + /// Thrown when the BT/BTLE is not supported. + /// Thrown when register service fails. public void RegisterGattService(BluetoothGattService service) { if (service.IsRegistered()) @@ -94,6 +100,8 @@ namespace Tizen.Network.Bluetooth /// /// Once unregistered, service object will become invalid and should not be used to access sevices's or any children attribute's methods/ members. /// + /// Thrown when the BT/BTLE is not supported. + /// Thrown when unregister service fails. public void UnregisterGattService(BluetoothGattService service) { if (service.GetGattServer() != this) @@ -110,6 +118,8 @@ namespace Tizen.Network.Bluetooth /// /// Once unregistered, servicees will become invalid and should not be used to access sevices's or any children attribute's methods/ members. /// + /// Thrown when the BT/BTLE is not supported. + /// Thrown when unregister all services fail. public void UnregisterGattServices() { _impl.UnregisterAllGattServices(this); @@ -139,6 +149,8 @@ namespace Tizen.Network.Bluetooth /// /// characteristic whose value is changes /// Remote device address to send notify or indicate and if set to NULL then notify/indicate all is enabled. + /// Thrown when the BT/BTLE is not Enabled + /// or when remote device is disconnected or when service is not registered or when cccd is not enabled. public async Task SendIndicationAsync(BluetoothGattCharacteristic characteristic, string clientAddress) { return await _impl.SendIndicationAsync(this, characteristic, clientAddress); @@ -149,6 +161,8 @@ namespace Tizen.Network.Bluetooth /// /// characteristic The characteristic which has a changed value /// Remote device address to send notify or indicate and if set to NULL then notify/indicate all is enabled. + /// Thrown when the BT/BTLE is not Enabled + /// or when remote device is disconnected or when service is not registered or when cccd is not enabled. public void SendNotification(BluetoothGattCharacteristic characteristic, string clientAddress) { _impl.SendNotification(characteristic, clientAddress); @@ -162,6 +176,8 @@ namespace Tizen.Network.Bluetooth /// error value in case of failure, 0 for success /// Value to be sent /// Fffset from where the value is read + /// Thrown when the BT/BTLE is not Enabled + /// or when remote device is disconnected or send response procedure fails. public void SendResponse(int requestId, BluetoothGattRequestType type, int status, byte[] value, int offset) { _impl.SendResponse(requestId, (int)type, status, value, offset); @@ -201,6 +217,8 @@ namespace Tizen.Network.Bluetooth /// /// Address of remote device. /// + /// Thrown when the BT/BTLE is not Enabled + /// or when remote device is disconnected. public string RemoteAddress { get @@ -218,6 +236,8 @@ namespace Tizen.Network.Bluetooth /// /// UUID for the service to get /// service with given uuid if it exists, null otherwise + /// Thrown when the BT/BTLE is not Enabled + /// or when remote device is disconnected or when get service fails. public BluetoothGattService GetService(string uuid) { return _impl.GetService(this, uuid); @@ -227,6 +247,8 @@ namespace Tizen.Network.Bluetooth /// Gets list of services that belongs to the remote device. /// /// list of services that belongs to the remote device + /// Thrown when the BT/BTLE is not Enabled + /// or when remote device is disconnected or when get services fails. public IEnumerable GetServices() { return _impl.GetServices(this); @@ -237,6 +259,8 @@ namespace Tizen.Network.Bluetooth /// /// characteristic to be read /// true on success, false otherwise + /// Thrown when the BT/BTLE is not Enabled + /// or when remote device is disconnected or when read attribute value fails. public async Task ReadValueAsync(BluetoothGattCharacteristic characteristic) { return await _impl.ReadValueAsyncTask(characteristic.GetHandle()); @@ -247,6 +271,8 @@ namespace Tizen.Network.Bluetooth /// /// descriptor to be read /// true on success, false otherwise + /// Thrown when the BT/BTLE is not Enabled + /// or when remote device is disconnected or when read attribute value fails. public async Task ReadValueAsync(BluetoothGattDescriptor descriptor) { return await _impl.ReadValueAsyncTask(descriptor.GetHandle()); @@ -257,6 +283,8 @@ namespace Tizen.Network.Bluetooth /// /// characteristic to be written /// true on success, false otherwise + /// Thrown when the BT/BTLE is not Enabled + /// or when remote device is disconnected or when write attribute value fails. public async Task WriteValueAsync(BluetoothGattCharacteristic characteristic) { return await _impl.WriteValueAsyncTask(characteristic.GetHandle()); @@ -267,6 +295,8 @@ namespace Tizen.Network.Bluetooth /// /// descriptor to be written /// true on success, false otherwise + /// Thrown when the BT/BTLE is not Enabled + /// or when remote device is disconnected or when write attribute value fails. public async Task WriteValueAsync(BluetoothGattDescriptor descriptor) { return await _impl.WriteValueAsyncTask(descriptor.GetHandle()); @@ -293,6 +323,7 @@ namespace Tizen.Network.Bluetooth /// /// UUID of the service /// type of service + /// Thrown create gatt service procedure fails. public BluetoothGattService(string uuid, BluetoothGattServiceType type) { Uuid = uuid; @@ -315,6 +346,7 @@ namespace Tizen.Network.Bluetooth /// /// characteristic to be added /// true on success, false otherwise + /// Thrown add gatt characteristic procedure fails. public void AddCharacteristic(BluetoothGattCharacteristic characteristic) { if (GetGattClient() != null) @@ -355,6 +387,7 @@ namespace Tizen.Network.Bluetooth /// /// service to be included /// true on success, false otherwise + /// Thrown add gatt service procedure fails./// public void AddService(BluetoothGattService service) { if (GetGattClient() != null) @@ -475,6 +508,7 @@ namespace Tizen.Network.Bluetooth /// Properties set for the characterstic /// Value associated with the characterstic /// throws in case of internal error + /// Thrown create gatt characteristics procedure fails. public BluetoothGattCharacteristic(string uuid, BluetoothGattPermission permissions, BluetoothGattProperty properties, byte[] value) : base(uuid, permissions) { _impl = new BluetoothGattCharacteristicImpl(uuid, permissions, properties, value); @@ -620,6 +654,7 @@ namespace Tizen.Network.Bluetooth /// /// descriptor to be added /// true on success, false otherwise + /// Thrown add gatt descriptor procedure fails. public void AddDescriptor(BluetoothGattDescriptor descriptor) { if (Client != null) @@ -689,6 +724,7 @@ namespace Tizen.Network.Bluetooth /// Permissions for the descriptor /// Value associated with the descriptor /// throws in case of internal error + /// Thrown create gatt descriptor procedure fails. public BluetoothGattDescriptor(string uuid, BluetoothGattPermission permisions, byte[] value) : base (uuid, permisions) { _impl = new BluetoothGattDescriptorImpl(uuid, permisions, value); @@ -764,6 +800,7 @@ namespace Tizen.Network.Bluetooth /// /// Event called when client request to read value of a characteristic or descriptor /// + /// Thrown when set read value requested callback procedure fails. public event EventHandler ReadRequested { add @@ -790,6 +827,7 @@ namespace Tizen.Network.Bluetooth /// /// Event called when a value of a characteristic or descriptor has been changed by a client /// + /// Thrown when set write value requested callback procedure fails. public event EventHandler WriteRequested { add diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothGattImpl.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothGattImpl.cs old mode 100755 new mode 100644 index e1a8508..39530db --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothGattImpl.cs +++ b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothGattImpl.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the License); diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothHid.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothHid.cs index e546dd1..4d4ea8f 100644 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothHid.cs +++ b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothHid.cs @@ -34,6 +34,8 @@ namespace Tizen.Network.Bluetooth /// The device must be bonded with remote device by CreateBond(). /// If connection request succeeds, HidConnectionStateChanged event will be invoked. /// + /// Thrown when the Bluetooth is not Enabled + /// or when connection attempt to remote device fails. public void Connect() { if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) @@ -54,6 +56,8 @@ namespace Tizen.Network.Bluetooth /// /// Disconnects the remote device with the Hid service. /// + /// Thrown when the Bluetooth is not Enabled + /// or when disconnection attempt to remote device fails. public void Disconnect() { if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothHidImpl.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothHidImpl.cs index b8a9122..6a1401e 100644 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothHidImpl.cs +++ b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothHidImpl.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the License); diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothLeAdapter.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothLeAdapter.cs index 9d7da13..67b051c 100644 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothLeAdapter.cs +++ b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothLeAdapter.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the License); @@ -62,6 +62,8 @@ namespace Tizen.Network.Bluetooth { /// Bluetooth must be enabled. /// /// The advertiser object carrying information of the advertising. + /// Thrown when the Bluetooth LE is not supported. + /// Thrown when the Bluetooth LE is not Enabled. public void StartAdvertising(BluetoothLeAdvertiseData advertiseData) { if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) @@ -85,6 +87,8 @@ namespace Tizen.Network.Bluetooth { /// Bluetooth must be enabled. /// /// The advertiser object carrying information of the advertising. + /// Thrown when the Bluetooth LE is not supported. + /// Thrown when the Bluetooth LE is not Enabled. public void StopAdvertising(BluetoothLeAdvertiseData advertiseData) { if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) @@ -246,6 +250,8 @@ namespace Tizen.Network.Bluetooth { /// /// The Bluetooth must be enabled. /// + /// Thrown when the Bluetooth LE is not supported. + /// Thrown when the Bluetooth LE is not Enabled. public IEnumerable ServiceUuid { get @@ -266,6 +272,8 @@ namespace Tizen.Network.Bluetooth { /// /// The Bluetooth must be enabled. /// + /// Thrown when the Bluetooth LE is not supported. + /// Thrown when the Bluetooth LE is not Enabled. public string DeviceName { get @@ -285,6 +293,8 @@ namespace Tizen.Network.Bluetooth { /// /// The Bluetooth must be enabled. /// + /// Thrown when the Bluetooth LE is not supported. + /// Thrown when the Bluetooth LE is not Enabled. public int TxPowerLevel { get @@ -304,6 +314,8 @@ namespace Tizen.Network.Bluetooth { /// /// The Bluetooth must be enabled. /// + /// Thrown when the Bluetooth LE is not supported. + /// Thrown when the Bluetooth LE is not Enabled. public IEnumerable ServiceSolictationUuid { get @@ -322,6 +334,8 @@ namespace Tizen.Network.Bluetooth { /// /// The Bluetooth must be enabled. /// + /// Thrown when the Bluetooth LE is not supported. + /// Thrown when the Bluetooth LE is not Enabled. public int Appearance { get @@ -340,6 +354,8 @@ namespace Tizen.Network.Bluetooth { /// /// The Bluetooth must be enabled. /// + /// Thrown when the Bluetooth LE is not supported. + /// Thrown when the Bluetooth LE is not Enabled./// public ManufacturerData ManufacturerData { get @@ -359,6 +375,8 @@ namespace Tizen.Network.Bluetooth { /// The Bluetooth must be enabled. /// /// Returns the service data list. + /// Thrown when the Bluetooth LE is not supported. + /// Thrown when the Bluetooth LE is not Enabled. public IEnumerable GetServiceDataList() { int serviceCount = 0; @@ -379,6 +397,9 @@ namespace Tizen.Network.Bluetooth { /// /// The auto connect flag /// client instance + /// Thrown when the Bluetooth LE is not supported. + /// Thrown when the Bluetooth LE is not Enabled + /// or when gatt connection attempt to remote device fails. public BluetoothGattClient GattConnect(bool autoConnect) { BluetoothGattClient client = null; @@ -406,6 +427,9 @@ namespace Tizen.Network.Bluetooth { /// /// The Bluetooth must be enabled. /// + /// Thrown when the Bluetooth LE is not supported. + /// Thrown when the Bluetooth LE is not Enabled + /// or when gatt disconnection attempt to remote device fails. public void GattDisconnect() { if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) @@ -438,6 +462,9 @@ namespace Tizen.Network.Bluetooth { /// /// Default Constructor.Initializes an object of BluetoothLeAdvertiseData /// + /// Thrown when the Bluetooth LE is not supported. + /// Thrown when the Bluetooth LE is not Enabled + /// or when create advertiser fails. public BluetoothLeAdvertiseData() { if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) @@ -479,6 +506,9 @@ namespace Tizen.Network.Bluetooth { /// /// The Bluetooth must be enabled. /// + /// Thrown when the Bluetooth LE is not supported. + /// Thrown when the Bluetooth LE is not Enabled + /// or when set advertising mode fails. public BluetoothLeAdvertisingMode AdvertisingMode { get @@ -505,6 +535,9 @@ namespace Tizen.Network.Bluetooth { /// /// The Bluetooth must be enabled. /// + /// Thrown when the Bluetooth LE is not supported. + /// Thrown when the Bluetooth LE is not Enabled + /// or when set advertising connectable mode fails. public bool AdvertisingConnectable { get @@ -557,6 +590,9 @@ namespace Tizen.Network.Bluetooth { /// /// The Bluetooth must be enabled. /// + /// Thrown when the Bluetooth LE is not supported. + /// Thrown when the Bluetooth LE is not Enabled + /// or when set appearance fails. public int Appearance { get @@ -582,6 +618,9 @@ namespace Tizen.Network.Bluetooth { /// /// The Bluetooth must be enabled. /// + /// Thrown when the Bluetooth LE is not supported. + /// Thrown when the Bluetooth LE is not Enabled + /// or when set advertising device name fails. public bool IncludeDeviceName { get @@ -610,6 +649,9 @@ namespace Tizen.Network.Bluetooth { /// /// The Bluetooth must be enabled. /// + /// Thrown when the Bluetooth LE is not supported. + /// Thrown when the Bluetooth LE is not Enabled + /// or when set advertising TC power level fails. public bool IncludeTxPowerLevel { get @@ -639,6 +681,9 @@ namespace Tizen.Network.Bluetooth { /// /// The packet type /// The service uuid to add to advertise data + /// Thrown when the Bluetooth LE is not supported. + /// Thrown when the Bluetooth LE is not Enabled + /// or when add advertising service uuid procedure fails. public void AddAdvertisingServiceUuid(BluetoothLePacketType packetType, string serviceUuid) { if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) @@ -665,6 +710,9 @@ namespace Tizen.Network.Bluetooth { /// /// The packet type /// The service solicitation uuid to add to advertise data + /// Thrown when the Bluetooth LE is not supported. + /// Thrown when the Bluetooth LE is not Enabled + /// or when add advertising service solicitation uuid procedure fails. public void AddAdvertisingServiceSolicitationUuid(BluetoothLePacketType packetType, string serviceSolicitationUuid) { @@ -693,6 +741,9 @@ namespace Tizen.Network.Bluetooth { /// /// The packet type /// The service data to be added to advertising + /// Thrown when the Bluetooth LE is not supported. + /// Thrown when the Bluetooth LE is not Enabled + /// or when add advertising data procedure fails. public void AddAdvertisingServiceData(BluetoothLePacketType packetType, BluetoothServiceData data) { if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) @@ -726,6 +777,9 @@ namespace Tizen.Network.Bluetooth { /// /// The packet type /// The manufacturer specific data + /// Thrown when the Bluetooth LE is not supported. + /// Thrown when the Bluetooth LE is not Enabled + /// or when add advertising manufacturer data procedure fails. public void AddAdvertisingManufacturerData(BluetoothLePacketType packetType, ManufacturerData manufacturerData) { @@ -756,6 +810,9 @@ namespace Tizen.Network.Bluetooth { /// The Bluetooth must be enabled. /// /// The packet type to be cleared + /// Thrown when the Bluetooth LE is not supported. + /// Thrown when the Bluetooth LE is not Enabled + /// or when clear advertising data procedure fails. internal void ClearAdvertisingData(BluetoothLePacketType packetType) { if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothLeAdapterImpl.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothLeAdapterImpl.cs old mode 100755 new mode 100644 diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothServerSocket.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothServerSocket.cs old mode 100755 new mode 100644 index b7bed91..781688b --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothServerSocket.cs +++ b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothServerSocket.cs @@ -33,6 +33,8 @@ namespace Tizen.Network.Bluetooth /// /// (event) AcceptStateChanged is raised when socket connection state is changed. /// + /// Thrown when the Bluetooth is not Enabled + /// or when register accpet state changed callback fails. public event EventHandler AcceptStateChanged { add @@ -98,6 +100,8 @@ namespace Tizen.Network.Bluetooth /// /// The socket must be created with CreateServerSocket(). This API invokes ConnectionStateChanged event. /// + /// Thrown when the Bluetooth is not Enabled + /// or when listen on socket procedure fails. public void Listen() { int ret = Interop.Bluetooth.Listen(socketFd, 1); diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothSocket.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothSocket.cs old mode 100755 new mode 100644 index a44fd31..57e189a --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothSocket.cs +++ b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothSocket.cs @@ -53,6 +53,8 @@ namespace Tizen.Network.Bluetooth /// /// This event occurs when socket server received data from client. /// + /// Thrown when the Bluetooth is not Enabled + /// or when register data received callback fails. public event EventHandler DataReceived { add @@ -76,6 +78,8 @@ namespace Tizen.Network.Bluetooth /// /// This event occurs when connection state between two devices is changed. /// + /// Thrown when the Bluetooth is not Enabled + /// or when register connection changed callback fails. public event EventHandler ConnectionStateChanged { add @@ -167,6 +171,8 @@ namespace Tizen.Network.Bluetooth /// /// The address of the remote Bluetooth device. /// The UUID of service provided by the remote Bluetooth device. + /// Thrown when the Bluetooth is not Enabled + /// or when connect socket attempt to remote device fails or when the service uuid is not supported by the remote device. void IBluetoothClientSocket.Connect() { int ret = Interop.Bluetooth.ConnectSocket(remoteAddress, serviceUuid); @@ -184,6 +190,8 @@ namespace Tizen.Network.Bluetooth /// The connection must be established. /// /// The file descriptor of socket to close. + /// Thrown when the Bluetooth is not Enabled + /// or when socket disconnect to remote device fails. void IBluetoothClientSocket.Disconnect() { int ret = Interop.Bluetooth.DisconnectSocket(connectedSocket); @@ -203,6 +211,8 @@ namespace Tizen.Network.Bluetooth /// /// The file descriptor of connected socket. /// The data to be sent. + /// Thrown when the Bluetooth is not Enabled + /// or when remote device is not connected or send data procedure fails. public int SendData(string data) { int ret = Interop.Bluetooth.SendData(connectedSocket, data, data.Length); diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothStructs.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothStructs.cs old mode 100755 new mode 100644 -- 2.7.4