Interface IButton
- Namespace
- Jabra.NET.Sdk.ButtonCustomization
- Assembly
- Jabra.NET.Sdk.ButtonCustomization.dll
Represents a button on the device that can be controlled. A button can be opened to listen for interactions, such as presses. Some buttons may also have an LED that can be controlled.
public interface IButton : IControllable
- Inherited Members
Properties
Id
The ID of the button.
ButtonId Id { get; }
Property Value
Methods
ListenForAsync(ButtonInteraction)
This will cause the device to emit events for the specified interaction with this button. An observable is returned that emits events when the interaction occurs.
Task<IObservable<ButtonEvent>> ListenForAsync(ButtonInteraction interaction)
Parameters
interactionButtonInteractionThe interaction to listen for.
Returns
- Task<IObservable<ButtonEvent>>
A task that represents the registration of the interaction with the device. The result is an observable that emits a ButtonEvent each time the interaction occurs.
OpenAsync(params ButtonInteraction[])
Open the button for control. When the button is opened for control, any other functionality assigned to the button will be disabled until control is released again through CloseAsync().
Task OpenAsync(params ButtonInteraction[] interactions)
Parameters
interactionsButtonInteraction[]An optional list of button interactions. The button will start emitting events for these interactions. Use ListenForAsync(ButtonInteraction) to get an IObservable of the individual interactions.
Returns
- Task
A task that completes on the successful opening of the control.
Remarks
If interactions are not specified in the open request, ListenForAsync(ButtonInteraction) will still register them correctly. However, specifying interactions when the button is opened can be more efficient when setting up multiple interactions. Open will only send a request to the device once with all the interactions. This will prevent ListenForAsync(ButtonInteraction) from sending a message about each interaction individually to the device, as it will only register new interactions with the device.
StopListeningForAsync(ButtonInteraction)
This will cause the device to stop emitting events for the specified interaction with this button.
Task StopListeningForAsync(ButtonInteraction interaction)
Parameters
interactionButtonInteractionThe interaction to stop listening for.
Returns
- Task
A task that completes when the interaction has been unregistered on the device.