-/*
+/*
* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the License);
/// <summary>
/// A property to check whether Bluetooth is enabled.
/// </summary>
- /// <exception cref="System.NotSupportedException">Thrown when the BT/BTLE is not Supported.</exception>
- /// <exception cref="System.InvalidOperationException">Thrown when the BT/BTLE is not Enabled.</exception>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not Enabled.</exception>
static public bool IsBluetoothEnabled
{
get
/// <remarks>
/// The Bluetooth must be enabled.
/// </remarks>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not Enabled.</exception>
static public string Address
{
get
/// <remarks>
/// The Bluetooth must be enabled.
/// </remarks>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not Enabled.</exception>
static public string Name
{
get
/// <remarks>
/// The Bluetooth must be enabled.
/// </remarks>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not Enabled.</exception>
static public VisibilityMode Visibility
{
get
/// <remarks>
/// The Bluetooth must be enabled.
/// </remarks>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not Enabled.</exception>
static public bool IsDiscoveryInProgress
{
get
/// <remarks>
/// The Bluetooth must be enabled.
/// </remarks>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not Enabled.</exception>
static public int RemainingTimeAsVisible
{
get
/// The Bluetooth must be enabled and device discovery can be stopped by StopDiscovery().
/// If this succeeds, DiscoveryStateChanged event will be invoked.
/// </remarks>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not Enabled
+ /// or the start discovery fails.</exception>
static public void StartDiscovery()
{
if (IsBluetoothEnabled)
/// The device discovery must be in progress with StartDiscovery().
/// If this succeeds, DiscoveryStateChanged event will be invoked.
/// </remarks>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not Enabled
+ /// the Discovery is not is prpgress </exception>
static public void StopDiscovery()
{
if (IsDiscoveryInProgress)
/// The Bluetooth must be enabled.
/// </remarks>
/// <returns> List of Bonded BluetoothDeviceInfo objects.</returns>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not Enabled
+ /// or reading the Bonded devices list is failed.</exception>
static public IEnumerable<BluetoothDevice> GetBondedDevices()
{
if (IsBluetoothEnabled)
/// The Bluetooth must be enabled.
/// </remarks>
/// <returns> Information of bonded BluetoothDeviceInfo object.</returns>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not Enabled
+ /// or reading the bonded device information fails.</exception>
static public BluetoothDevice GetBondedDevice(string address)
{
if (IsBluetoothEnabled)
/// </summary>
/// <returns><c>true</c> if the specified serviceUuid is used; otherwise, <c>false</c>.</returns>
/// <param name="serviceUuid">The UUID of Service.</param>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not Enabled.</exception>
static public bool IsServiceUsed(string serviceUuid)
{
return BluetoothAdapterImpl.Instance.IsServiceUsed(serviceUuid);
/// The Bluetooth must be enabled.
/// </remarks>
/// <returns>The BluetoothOobData object.</returns>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not Enabled
+ /// or the read OObData procedure is failed</exception>
static public BluetoothOobData GetLocalOobData()
{
if (IsBluetoothEnabled && Globals.IsInitialize)
/// </remarks>
/// <param name="address">Remote Device address.</param>
/// <param name="oobData">BluetoothOobData object.</param>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not Enabled
+ /// or the set Oobdata procedure is failed.</exception>
static public void SetRemoteOobData(string address, BluetoothOobData oobData)
{
if (IsBluetoothEnabled && Globals.IsInitialize)
/// The Bluetooth must be enabled.
/// </remarks>
/// <param name="address">Remote Device address.</param>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not Enabled
+ /// or if the Remove Oobdata procedure is failed.</exception>
static public void RemoveRemoteOobData(string address)
{
if (IsBluetoothEnabled && Globals.IsInitialize)
/// <remarks>
/// Bluetooth must be enabled.
/// </remarks>the result of the operation StartLeScan
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not Enabled
+ /// or the Start LE Scan is failed.</exception>
static public void StartLeScan()
{
if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
/// <remarks>
/// The Bluetooth must be enabled.
/// </remarks>the result of the operation stopLescan
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not Enabled
+ /// or Stop LE Scan is failed.</exception>
static public void StopLeScan()
{
if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
/// </remarks>
/// <returns>The BluetoothServerSocket instance.</returns>
/// <param name="serviceUuid">The UUID of service to provide.</param>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not Enabled
+ /// or Socket create error happens.</exception>
static public BluetoothServerSocket CreateServerSocket(string serviceUuid)
{
if (IsBluetoothEnabled && Globals.IsInitialize)
/// The socket must be created with CreateServerSocket(). ConnectionStateChanged event is raised after this API is called.
/// </remarks>
/// <param name="socket">The server socket instance which is created using CreateServerSocket().</param>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not Enabled
+ /// or socket destroy error happens.</exception>
static public void DestroyServerSocket(BluetoothServerSocket socket)
{
if (IsBluetoothEnabled && Globals.IsInitialize)
-/*
+/*
* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the License);
/// and AdvancedAudioDistribution is connected.
/// </remarks>
/// <param name="profileType">Type of audio profile.</param>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not Enabled
+ /// or when the connection attempt fails.</exception>
public void Connect(BluetoothAudioProfileType profileType)
{
if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
/// and AdvancedAudioDistribution is disconnected.
/// </remarks>
/// <param name="type">Type of audio profile.</param>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not Enabled
+ /// or when Disconnection attempt fails.</exception>
public void Disconnect(BluetoothAudioProfileType type)
{
if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
-/*
+/*
* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the License);
/// The remote device must be connected.
/// </remarks>
/// <param name="state">Equalizer state.</param>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not Enabled
+ /// or when Notifying the equalizer state to remote device fails.</exception>
public void NotifyEqualizerState(EqualizerState state)
{
if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
/// The remote device must be connected.
/// </remarks>
/// <param name="mode">Repeat mode.</param>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not Enabled
+ /// or when Notifying the repeat mode state to remote device fails.</exception>
+ /// </exception>
public void NotifyRepeatMode(RepeatMode mode)
{
if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
/// The remote device must be connected.
/// </remarks>
/// <param name="mode">Shuffle mode.</param>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not Enabled
+ /// or when Notifying the shuffle mode state to remote device fails.</exception>
public void NotifyShuffleMode(ShuffleMode mode)
{
if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
/// The remote device must be connected.
/// </remarks>
/// <param name="mode">Scan mode.</param>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not Enabled
+ /// or when Notifying the Scan mode state to remote device fails.</exception>
public void NotifyScanMode(ScanMode mode)
{
if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
/// The remote device must be connected.
/// </remarks>
/// <param name="state">Player state.</param>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not Enabled
+ /// or when Notifying the player state to remote device fails.</exception>
public void NotifyPlayerState(PlayerState state)
{
if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
/// The remote device must be connected.
/// </remarks>
/// <param name="position">Current position in milliseconds.</param>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not Enabled
+ /// or when Notifying the current position state to remote device fails.</exception>
public void NotifyCurrentPosition(uint position)
{
if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
/// The remote device must be connected.
/// </remarks>
/// <param name="trackData">Data of the track.</param>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not Enabled
+ /// or when Notifying the shuffle Track state to remote device fails.</exception>
public void NotifyTrack(Track trackData)
{
if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
-/*
+/*
* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the License);
/// 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.
/// </remarks>
+ /// <exception cref="System.InvalidOperationException">Thrown when the BT/BTLE is not Enabled
+ /// or when create bond to remote device fails.</exception>
public void CreateBond()
{
if (BluetoothAdapter.IsBluetoothEnabled)
/// <remarks>
/// Bonding must be in progress by CreateBond().
/// </remarks>
+ /// <exception cref="System.InvalidOperationException">Thrown when the BT/BTLE is not Enabled
+ /// or when cancel bonding procedure to remote device fails.</exception>
public void CancelBonding()
{
int ret = Interop.Bluetooth.CancelBonding();
/// The Bluetooth must be enabled and the bond must be created by CreateBond().
/// If this succeeds, BondDestroyed event will be invoked.
/// </remarks>
+ /// <exception cref="System.InvalidOperationException">Thrown when the BT/BTLE is not Enabled
+ /// or when destroy bond procedure fails.</exception>
public void DestroyBond()
{
if (BluetoothAdapter.IsBluetoothEnabled)
/// The Bluetooth must be enabled and the bond must be created by CreateBond().
/// </remarks>
/// <param name="aliasName">Alias name of remote device.</param>
+ /// <exception cref="System.InvalidOperationException">Thrown when the BT/BTLE is not Enabled
+ /// or when set alias name to remote device fails.</exception>
public void SetAlias(string aliasName)
{
if (BluetoothAdapter.IsBluetoothEnabled)
/// If this succeeds, AuthorizationChanged event will be invoked.
/// </remarks>
/// <param name="authorizationState">Authorization state.</param>
+ /// <exception cref="System.InvalidOperationException">Thrown when the BT/BTLE is not Enabled
+ /// or when Set authorization to remote device fails.</exception>
public void SetAuthorization(BluetoothAuthorizationType authorizationState)
{
if (BluetoothAdapter.IsBluetoothEnabled)
/// </summary>
/// <returns>The service mask list converted from the given UUID list.</returns>
/// <param name="uuids">Uuid list of the device.</param>
+ /// <exception cref="System.InvalidOperationException">Thrown when the BT/BTLE is not Enabled
+ /// or when get Mask from UUID fails.</exception>
public BluetoothServiceClassType GetMaskFromUuid(string[] uuids)
{
BluetoothServiceClassType serviceMask;
/// 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.
/// </remarks>
+ /// <exception cref="System.InvalidOperationException">Thrown when the BT/BTLE is not Enabled
+ /// or when remote device service search fails.</exception>
public void StartServiceSearch()
{
Log.Info(Globals.LogTag, "startservicesearch entry");
/// The Bluetooth must be enabled.
/// </remarks>
/// <returns>The connected Bluetooth profiles.</returns>
+ /// <exception cref="System.InvalidOperationException">Thrown when the BT/BTLE is not Enabled
+ /// or when there is no BT connection.</exception>
public IEnumerable<BluetoothProfileType> GetConnectedProfiles()
{
if (BluetoothAdapter.IsBluetoothEnabled)
/// </remarks>
/// <returns><c>true</c> if profile is connected; otherwise, <c>false</c>.</returns>
/// <param name="profileType">Bluetooth Profile type.</param>
+ /// <exception cref="System.InvalidOperationException">Thrown when the BT/BTLE is not Enabled
+ /// or when there is no BT connection.</exception>
public bool IsProfileConnected(BluetoothProfileType profileType)
{
if (BluetoothAdapter.IsBluetoothEnabled)
-/*
+/*
* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the License);
-/*
+/*
* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the License);
/// Creates bluetooth gatt server
/// </summary>
/// <returns></returns>
+ /// <exception cref="System.NotSupportedException">Thrown when the BT/BTLE is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when create gatt server fails.</exception>
public static BluetoothGattServer CreateServer()
{
if (_instance == null)
/// <summary>
/// Registers the server along with the GATT services of the application it is hosting
/// </summary>
+ /// <exception cref="System.NotSupportedException">Thrown when the BT/BTLE is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when register server application fails.</exception>
public void Start()
{
_impl.Start();
/// Registers a specified service to this server
/// </summary>
/// <param name="service">service, which needs to be registered with this server</param>
+ /// <exception cref="System.NotSupportedException">Thrown when the BT/BTLE is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when register service fails.</exception>
public void RegisterGattService(BluetoothGattService service)
{
if (service.IsRegistered())
/// <remarks>
/// Once unregistered, service object will become invalid and should not be used to access sevices's or any children attribute's methods/ members.
/// </remarks>
+ /// <exception cref="System.NotSupportedException">Thrown when the BT/BTLE is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when unregister service fails.</exception>
public void UnregisterGattService(BluetoothGattService service)
{
if (service.GetGattServer() != this)
/// <remarks>
/// Once unregistered, servicees will become invalid and should not be used to access sevices's or any children attribute's methods/ members.
/// </remarks>
+ /// <exception cref="System.NotSupportedException">Thrown when the BT/BTLE is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when unregister all services fail.</exception>
public void UnregisterGattServices()
{
_impl.UnregisterAllGattServices(this);
/// </summary>
/// <param name="characteristic">characteristic whose value is changes</param>
/// <param name="clientAddress">Remote device address to send notify or indicate and if set to NULL then notify/indicate all is enabled.</param>
+ /// <exception cref="System.InvalidOperationException">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.</exception>
public async Task<bool> SendIndicationAsync(BluetoothGattCharacteristic characteristic, string clientAddress)
{
return await _impl.SendIndicationAsync(this, characteristic, clientAddress);
/// </summary>
/// <param name="characteristic">characteristic The characteristic which has a changed value</param>
/// <param name="clientAddress">Remote device address to send notify or indicate and if set to NULL then notify/indicate all is enabled.</param>
+ /// <exception cref="System.InvalidOperationException">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.</exception>
public void SendNotification(BluetoothGattCharacteristic characteristic, string clientAddress)
{
_impl.SendNotification(characteristic, clientAddress);
/// <param name="status">error value in case of failure, 0 for success</param>
/// <param name="value">Value to be sent</param>
/// <param name="offset">Fffset from where the value is read</param>
+ /// <exception cref="System.InvalidOperationException">Thrown when the BT/BTLE is not Enabled
+ /// or when remote device is disconnected or send response procedure fails.</exception>
public void SendResponse(int requestId, BluetoothGattRequestType type, int status, byte[] value, int offset)
{
_impl.SendResponse(requestId, (int)type, status, value, offset);
/// <summary>
/// Address of remote device.
/// </summary>
+ /// <exception cref="System.InvalidOperationException">Thrown when the BT/BTLE is not Enabled
+ /// or when remote device is disconnected.</exception>
public string RemoteAddress
{
get
/// </summary>
/// <param name="uuid">UUID for the service to get</param>
/// <returns>service with given uuid if it exists, null otherwise</returns>
+ /// <exception cref="System.InvalidOperationException">Thrown when the BT/BTLE is not Enabled
+ /// or when remote device is disconnected or when get service fails.</exception>
public BluetoothGattService GetService(string uuid)
{
return _impl.GetService(this, uuid);
/// Gets list of services that belongs to the remote device.
/// </summary>
/// <returns>list of services that belongs to the remote device</returns>
+ /// <exception cref="System.InvalidOperationException">Thrown when the BT/BTLE is not Enabled
+ /// or when remote device is disconnected or when get services fails.</exception>
public IEnumerable<BluetoothGattService> GetServices()
{
return _impl.GetServices(this);
/// </summary>
/// <param name="characteristic">characteristic to be read</param>
/// <returns>true on success, false otherwise</returns>
+ /// <exception cref="System.InvalidOperationException">Thrown when the BT/BTLE is not Enabled
+ /// or when remote device is disconnected or when read attribute value fails.</exception>
public async Task<bool> ReadValueAsync(BluetoothGattCharacteristic characteristic)
{
return await _impl.ReadValueAsyncTask(characteristic.GetHandle());
/// </summary>
/// <param name="descriptor">descriptor to be read</param>
/// <returns>true on success, false otherwise</returns>
+ /// <exception cref="System.InvalidOperationException">Thrown when the BT/BTLE is not Enabled
+ /// or when remote device is disconnected or when read attribute value fails.</exception>
public async Task<bool> ReadValueAsync(BluetoothGattDescriptor descriptor)
{
return await _impl.ReadValueAsyncTask(descriptor.GetHandle());
/// </summary>
/// <param name="characteristic">characteristic to be written</param>
/// <returns>true on success, false otherwise</returns>
+ /// <exception cref="System.InvalidOperationException">Thrown when the BT/BTLE is not Enabled
+ /// or when remote device is disconnected or when write attribute value fails.</exception>
public async Task<bool> WriteValueAsync(BluetoothGattCharacteristic characteristic)
{
return await _impl.WriteValueAsyncTask(characteristic.GetHandle());
/// </summary>
/// <param name="descriptor">descriptor to be written</param>
/// <returns>true on success, false otherwise</returns>
+ /// <exception cref="System.InvalidOperationException">Thrown when the BT/BTLE is not Enabled
+ /// or when remote device is disconnected or when write attribute value fails.</exception>
public async Task<bool> WriteValueAsync(BluetoothGattDescriptor descriptor)
{
return await _impl.WriteValueAsyncTask(descriptor.GetHandle());
/// </summary>
/// <param name="uuid">UUID of the service</param>
/// <param name="type">type of service</param>
+ /// <exception cref="System.InvalidOperationException">Thrown create gatt service procedure fails.</exception>
public BluetoothGattService(string uuid, BluetoothGattServiceType type)
{
Uuid = uuid;
/// </summary>
/// <param name="characteristic">characteristic to be added</param>
/// <returns>true on success, false otherwise</returns>
+ /// <exception cref="System.InvalidOperationException">Thrown add gatt characteristic procedure fails.</exception>
public void AddCharacteristic(BluetoothGattCharacteristic characteristic)
{
if (GetGattClient() != null)
/// </summary>
/// <param name="service">service to be included</param>
/// <returns>true on success, false otherwise</returns>
+ /// <exception cref="System.InvalidOperationException">Thrown add gatt service procedure fails.</exception>///
public void AddService(BluetoothGattService service)
{
if (GetGattClient() != null)
/// <param name="properties">Properties set for the characterstic</param>
/// <param name="value">Value associated with the characterstic</param>
/// <remarks>throws in case of internal error</remarks>
+ /// <exception cref="System.InvalidOperationException">Thrown create gatt characteristics procedure fails.</exception>
public BluetoothGattCharacteristic(string uuid, BluetoothGattPermission permissions, BluetoothGattProperty properties, byte[] value) : base(uuid, permissions)
{
_impl = new BluetoothGattCharacteristicImpl(uuid, permissions, properties, value);
/// </summary>
/// <param name="descriptor">descriptor to be added</param>
/// <returns>true on success, false otherwise</returns>
+ /// <exception cref="System.InvalidOperationException">Thrown add gatt descriptor procedure fails.</exception>
public void AddDescriptor(BluetoothGattDescriptor descriptor)
{
if (Client != null)
/// <param name="permisions">Permissions for the descriptor</param>
/// <param name="value">Value associated with the descriptor</param>
/// <remarks>throws in case of internal error</remarks>
+ /// <exception cref="System.InvalidOperationException">Thrown create gatt descriptor procedure fails.</exception>
public BluetoothGattDescriptor(string uuid, BluetoothGattPermission permisions, byte[] value) : base (uuid, permisions)
{
_impl = new BluetoothGattDescriptorImpl(uuid, permisions, value);
/// <summary>
/// Event called when client request to read value of a characteristic or descriptor
/// </summary>
+ /// <exception cref="System.InvalidOperationException">Thrown when set read value requested callback procedure fails.</exception>
public event EventHandler<ReadRequestedEventArgs> ReadRequested
{
add
/// <summary>
/// Event called when a value of a characteristic or descriptor has been changed by a client
/// </summary>
+ /// <exception cref="System.InvalidOperationException">Thrown when set write value requested callback procedure fails.</exception>
public event EventHandler<WriteRequestedEventArgs> WriteRequested
{
add
-/*
+/*
* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the License);
/// The device must be bonded with remote device by CreateBond().
/// If connection request succeeds, HidConnectionStateChanged event will be invoked.
/// </remarks>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not Enabled
+ /// or when connection attempt to remote device fails.</exception>
public void Connect()
{
if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
/// <summary>
/// Disconnects the remote device with the Hid service.
/// </summary>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not Enabled
+ /// or when disconnection attempt to remote device fails.</exception>
public void Disconnect()
{
if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
-/*
+/*
* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the License);
-/*
+/*
* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the License);
/// Bluetooth must be enabled.
/// </remarks>
/// <param name="advertiseData">The advertiser object carrying information of the advertising.</param>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not Enabled.</exception>
public void StartAdvertising(BluetoothLeAdvertiseData advertiseData)
{
if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
/// Bluetooth must be enabled.
/// </remarks>
/// <param name="advertiseData">The advertiser object carrying information of the advertising.</param>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not Enabled.</exception>
public void StopAdvertising(BluetoothLeAdvertiseData advertiseData)
{
if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
/// <remarks>
/// The Bluetooth must be enabled.
/// </remarks>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not Enabled.</exception>
public IEnumerable<string> ServiceUuid
{
get
/// <remarks>
/// The Bluetooth must be enabled.
/// </remarks>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not Enabled.</exception>
public string DeviceName
{
get
/// <remarks>
/// The Bluetooth must be enabled.
/// </remarks>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not Enabled.</exception>
public int TxPowerLevel
{
get
/// <remarks>
/// The Bluetooth must be enabled.
/// </remarks>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not Enabled.</exception>
public IEnumerable<string> ServiceSolictationUuid
{
get
/// <remarks>
/// The Bluetooth must be enabled.
/// </remarks>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not Enabled.</exception>
public int Appearance
{
get
/// <remarks>
/// The Bluetooth must be enabled.
/// </remarks>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not Enabled.</exception>///
public ManufacturerData ManufacturerData
{
get
/// The Bluetooth must be enabled.
/// </remarks>
/// <returns> Returns the service data list.</returns>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not Enabled.</exception>
public IEnumerable<BluetoothLeServiceData> GetServiceDataList()
{
int serviceCount = 0;
/// </remarks>
/// <param name="autoConnect"> The auto connect flag</param>
/// <returns>client instance</returns>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not Enabled
+ /// or when gatt connection attempt to remote device fails.</exception>
public BluetoothGattClient GattConnect(bool autoConnect)
{
BluetoothGattClient client = null;
/// <remarks>
/// The Bluetooth must be enabled.
/// </remarks>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not Enabled
+ /// or when gatt disconnection attempt to remote device fails.</exception>
public void GattDisconnect()
{
if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
/// <summary>
/// Default Constructor.Initializes an object of BluetoothLeAdvertiseData
/// </summary>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not Enabled
+ /// or when create advertiser fails.</exception>
public BluetoothLeAdvertiseData()
{
if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
/// <remarks>
/// The Bluetooth must be enabled.
/// </remarks>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not Enabled
+ /// or when set advertising mode fails.</exception>
public BluetoothLeAdvertisingMode AdvertisingMode
{
get
/// <remarks>
/// The Bluetooth must be enabled.
/// </remarks>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not Enabled
+ /// or when set advertising connectable mode fails.</exception>
public bool AdvertisingConnectable
{
get
/// <remarks>
/// The Bluetooth must be enabled.
/// </remarks>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not Enabled
+ /// or when set appearance fails.</exception>
public int Appearance
{
get
/// <remarks>
/// The Bluetooth must be enabled.
/// </remarks>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not Enabled
+ /// or when set advertising device name fails.</exception>
public bool IncludeDeviceName
{
get
/// <remarks>
/// The Bluetooth must be enabled.
/// </remarks>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not Enabled
+ /// or when set advertising TC power level fails.</exception>
public bool IncludeTxPowerLevel
{
get
/// </remarks>
/// <param name="packetType">The packet type </param>
/// <param name="serviceUuid"> The service uuid to add to advertise data</param>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not Enabled
+ /// or when add advertising service uuid procedure fails.</exception>
public void AddAdvertisingServiceUuid(BluetoothLePacketType packetType, string serviceUuid)
{
if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
/// </remarks>
/// <param name="packetType">The packet type </param>
/// <param name="serviceSolicitationUuid"> The service solicitation uuid to add to advertise data</param>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not Enabled
+ /// or when add advertising service solicitation uuid procedure fails.</exception>
public void AddAdvertisingServiceSolicitationUuid(BluetoothLePacketType packetType,
string serviceSolicitationUuid)
{
/// </remarks>
/// <param name="packetType">The packet type </param>
/// <param name="data"> The service data to be added to advertising</param>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not Enabled
+ /// or when add advertising data procedure fails.</exception>
public void AddAdvertisingServiceData(BluetoothLePacketType packetType, BluetoothServiceData data)
{
if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
/// </remarks>
/// <param name="packetType">The packet type</param>
/// <param name="manufacturerData"> The manufacturer specific data</param>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not Enabled
+ /// or when add advertising manufacturer data procedure fails.</exception>
public void AddAdvertisingManufacturerData(BluetoothLePacketType packetType,
ManufacturerData manufacturerData)
{
/// The Bluetooth must be enabled.
/// </remarks>
/// <param name="packetType">The packet type to be cleared</param>
+ /// <exception cref="System.NotSupportedException">Thrown when the Bluetooth LE is not supported.</exception>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth LE is not Enabled
+ /// or when clear advertising data procedure fails.</exception>
internal void ClearAdvertisingData(BluetoothLePacketType packetType)
{
if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize)
/// <summary>
/// (event) AcceptStateChanged is raised when socket connection state is changed.
/// </summary>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not Enabled
+ /// or when register accpet state changed callback fails.</exception>
public event EventHandler<AcceptStateChangedEventArgs> AcceptStateChanged
{
add
/// <remarks>
/// The socket must be created with CreateServerSocket(). This API invokes ConnectionStateChanged event.
/// </remarks>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not Enabled
+ /// or when listen on socket procedure fails.</exception>
public void Listen()
{
int ret = Interop.Bluetooth.Listen(socketFd, 1);
/// <summary>
/// This event occurs when socket server received data from client.
/// </summary>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not Enabled
+ /// or when register data received callback fails.</exception>
public event EventHandler<SocketDataReceivedEventArgs> DataReceived
{
add
/// <summary>
/// This event occurs when connection state between two devices is changed.
/// </summary>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not Enabled
+ /// or when register connection changed callback fails.</exception>
public event EventHandler<SocketConnectionStateChangedEventArgs> ConnectionStateChanged
{
add
/// </remarks>
/// <param name="address">The address of the remote Bluetooth device.</param>
/// <param name="serviceUuid">The UUID of service provided by the remote Bluetooth device.</param>
+ /// <exception cref="System.InvalidOperationException">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.</exception>
void IBluetoothClientSocket.Connect()
{
int ret = Interop.Bluetooth.ConnectSocket(remoteAddress, serviceUuid);
/// The connection must be established.
/// </remarks>
/// <param name="socketFd">The file descriptor of socket to close.</param>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not Enabled
+ /// or when socket disconnect to remote device fails.</exception>
void IBluetoothClientSocket.Disconnect()
{
int ret = Interop.Bluetooth.DisconnectSocket(connectedSocket);
/// </remarks>
/// <param name="socketFd">The file descriptor of connected socket.</param>
/// <param name="data">The data to be sent.</param>
+ /// <exception cref="System.InvalidOperationException">Thrown when the Bluetooth is not Enabled
+ /// or when remote device is not connected or send data procedure fails.</exception>
public int SendData(string data)
{
int ret = Interop.Bluetooth.SendData(connectedSocket, data, data.Length);