Arendi.BleLibrary  4.5.1.999
Core-Library (PCL)
Arendi.BleLibrary.Extention.IPeripheralManager< TPeripheral > Interface Template Reference

Interface defining the functionality of a manager for peripheral objects. The standard implementation is the PeripheralManager<TPeripheral> class. More...

Inheritance diagram for Arendi.BleLibrary.Extention.IPeripheralManager< TPeripheral >:
Arendi.BleLibrary.Extention.PeripheralManager< TPeripheral >

Public Member Functions

Task ClearAsync ()
 Clear the list with all peripherals. More...
 
Task AddAsync (TPeripheral peripheral)
 Add peripheral to the list of known peripherals. More...
 
Task RemoveAsync (TPeripheral peripheral)
 Remove peripheral from the list of known peripherals. More...
 
Task RemoveAsync (IEnumerable< TPeripheral > peripheralsToRemove)
 Remove peripherals from the list of known peripherals. More...
 
TPeripheral Find (Uuid uuid)
 Find peripheral according to it's UUID. More...
 
void StartScan ()
 Start scan for peripherals. More...
 
void StopScan ()
 Stop scan for peripherals. More...
 

Properties

bool IsScanning [get]
 Check if the peripheral manager is scanning for peripherals or not. More...
 
Uuid [] UuidFilter [get, set]
 Array with service UUID's to check in advertise data. Only peripherals advertising one of the UUID's are added to the peripheral list. If set to null or an empty array all visible peripherals are added to the list. More...
 
int PeripheralInvisibleTimeout [get, set]
 Duration in seconds a device must be invisible (no advertising and not connected) until it gets removed from the peripheral manger. If the value is set to 0 the peripherals are not removed from the list automatically. More...
 
bool DisposePeripheralOnRemove [get, set]
 Enable/Disable the call of the dispose method on removed peripherals. By default this is enabled but if the removed peripherals should be disposed later the automatic Dispose may be disabled. More...
 
bool UpdateNameByAdvertisedData [get, set]
 Enable/Disable that advertised name information is used to update the peripheral name. If disabled the assigned name given by the bluetooth stack is always used. More...
 
bool IsBluetoothDisabled [get]
 Check if the bluetooth interface is disabled. Because there are more state of the bluetooth adapter than disabled and enabled, IsBluetoothDisabled is not equal to !IsBluetoothEnabled at any time More...
 
bool IsBluetoothEnabled [get]
 Check if the bluetooth interface is enabled. Because there are more state of the bluetooth adapter than disabled and enabled, IsBluetoothDisabled is not equal to !IsBluetoothEnabled at any time More...
 
IEnumerable< TPeripheral > Peripherals [get]
 Get a list with all managed peripherals. The returned list is a copy of the internal peripheral list. More...
 
bool IsDisposed [get]
 Check if the peripheral manager is already disposed. More...
 

Events

EventHandler< PeripheralAddedEventArgs< TPeripheral > > PeripheralAdded
 Occurs when a new peripheral was added to the peripherals list More...
 
EventHandler< PeripheralRemovedEventArgs< TPeripheral > > PeripheralRemoved
 Occurs when a peripheral removed from the peripherals list More...
 
EventHandler BluetoothDisabled
 Event triggered, when the bluetooth interface gets disabled More...
 
EventHandler BluetoothEnabled
 Event triggered, when the bluetooth interface gets enabled On iOS, the bluetooth interface needs some time until it is ready. At this time, his state is not enabled and neither disabled. Wait for the BluetoothEnabled event before accessing the stack. More...
 

Detailed Description

Interface defining the functionality of a manager for peripheral objects. The standard implementation is the PeripheralManager<TPeripheral> class.

Template Parameters
TPeripheralType the peripheral manager manages. If multiple class types are handled the type can be set to IManagedPeripheral.
Type Constraints
TPeripheral :IManagedPeripheral 

Member Function Documentation

§ AddAsync()

Task Arendi.BleLibrary.Extention.IPeripheralManager< TPeripheral >.AddAsync ( TPeripheral  peripheral)

Add peripheral to the list of known peripherals.

Parameters
peripheralPeripheral to add.

Implemented in Arendi.BleLibrary.Extention.PeripheralManager< TPeripheral >.

§ ClearAsync()

Task Arendi.BleLibrary.Extention.IPeripheralManager< TPeripheral >.ClearAsync ( )

Clear the list with all peripherals.

Implemented in Arendi.BleLibrary.Extention.PeripheralManager< TPeripheral >.

§ Find()

TPeripheral Arendi.BleLibrary.Extention.IPeripheralManager< TPeripheral >.Find ( Uuid  uuid)

Find peripheral according to it's UUID.

The UUID is a unique number for each discovered device.

Parameters
uuidUUID to search.
Returns
Peripheral found with given UUID or null if no peripheral with this UUID is found.

Implemented in Arendi.BleLibrary.Extention.PeripheralManager< TPeripheral >.

§ RemoveAsync() [1/2]

Task Arendi.BleLibrary.Extention.IPeripheralManager< TPeripheral >.RemoveAsync ( TPeripheral  peripheral)

Remove peripheral from the list of known peripherals.

Parameters
peripheralPeripheral to remove.

Implemented in Arendi.BleLibrary.Extention.PeripheralManager< TPeripheral >.

§ RemoveAsync() [2/2]

Task Arendi.BleLibrary.Extention.IPeripheralManager< TPeripheral >.RemoveAsync ( IEnumerable< TPeripheral >  peripheralsToRemove)

Remove peripherals from the list of known peripherals.

Parameters
peripheralsToRemoveList with peripherals to remove.

Implemented in Arendi.BleLibrary.Extention.PeripheralManager< TPeripheral >.

§ StartScan()

void Arendi.BleLibrary.Extention.IPeripheralManager< TPeripheral >.StartScan ( )

Start scan for peripherals.

Implemented in Arendi.BleLibrary.Extention.PeripheralManager< TPeripheral >.

§ StopScan()

void Arendi.BleLibrary.Extention.IPeripheralManager< TPeripheral >.StopScan ( )

Stop scan for peripherals.

Implemented in Arendi.BleLibrary.Extention.PeripheralManager< TPeripheral >.

Property Documentation

§ DisposePeripheralOnRemove

bool Arendi.BleLibrary.Extention.IPeripheralManager< TPeripheral >.DisposePeripheralOnRemove
getset

Enable/Disable the call of the dispose method on removed peripherals. By default this is enabled but if the removed peripherals should be disposed later the automatic Dispose may be disabled.

Default: true

§ IsBluetoothDisabled

bool Arendi.BleLibrary.Extention.IPeripheralManager< TPeripheral >.IsBluetoothDisabled
get

Check if the bluetooth interface is disabled. Because there are more state of the bluetooth adapter than disabled and enabled, IsBluetoothDisabled is not equal to !IsBluetoothEnabled at any time

§ IsBluetoothEnabled

bool Arendi.BleLibrary.Extention.IPeripheralManager< TPeripheral >.IsBluetoothEnabled
get

Check if the bluetooth interface is enabled. Because there are more state of the bluetooth adapter than disabled and enabled, IsBluetoothDisabled is not equal to !IsBluetoothEnabled at any time

§ IsDisposed

bool Arendi.BleLibrary.Extention.IPeripheralManager< TPeripheral >.IsDisposed
get

Check if the peripheral manager is already disposed.

§ IsScanning

bool Arendi.BleLibrary.Extention.IPeripheralManager< TPeripheral >.IsScanning
get

Check if the peripheral manager is scanning for peripherals or not.

§ PeripheralInvisibleTimeout

int Arendi.BleLibrary.Extention.IPeripheralManager< TPeripheral >.PeripheralInvisibleTimeout
getset

Duration in seconds a device must be invisible (no advertising and not connected) until it gets removed from the peripheral manger. If the value is set to 0 the peripherals are not removed from the list automatically.

Default: 10

§ Peripherals

IEnumerable<TPeripheral> Arendi.BleLibrary.Extention.IPeripheralManager< TPeripheral >.Peripherals
get

Get a list with all managed peripherals. The returned list is a copy of the internal peripheral list.

§ UpdateNameByAdvertisedData

bool Arendi.BleLibrary.Extention.IPeripheralManager< TPeripheral >.UpdateNameByAdvertisedData
getset

Enable/Disable that advertised name information is used to update the peripheral name. If disabled the assigned name given by the bluetooth stack is always used.

Default: true

§ UuidFilter

Uuid [] Arendi.BleLibrary.Extention.IPeripheralManager< TPeripheral >.UuidFilter
getset

Array with service UUID's to check in advertise data. Only peripherals advertising one of the UUID's are added to the peripheral list. If set to null or an empty array all visible peripherals are added to the list.

Default: null

Event Documentation

§ BluetoothDisabled

EventHandler Arendi.BleLibrary.Extention.IPeripheralManager< TPeripheral >.BluetoothDisabled

Event triggered, when the bluetooth interface gets disabled

§ BluetoothEnabled

EventHandler Arendi.BleLibrary.Extention.IPeripheralManager< TPeripheral >.BluetoothEnabled

Event triggered, when the bluetooth interface gets enabled On iOS, the bluetooth interface needs some time until it is ready. At this time, his state is not enabled and neither disabled. Wait for the BluetoothEnabled event before accessing the stack.

§ PeripheralAdded

EventHandler<PeripheralAddedEventArgs<TPeripheral> > Arendi.BleLibrary.Extention.IPeripheralManager< TPeripheral >.PeripheralAdded

Occurs when a new peripheral was added to the peripherals list

§ PeripheralRemoved

EventHandler<PeripheralRemovedEventArgs<TPeripheral> > Arendi.BleLibrary.Extention.IPeripheralManager< TPeripheral >.PeripheralRemoved

Occurs when a peripheral removed from the peripherals list