Appearance
Home > resol-vbus-core > LiveEncoder
LiveEncoder class
A live VBus protocol encoder.
Signature:
typescript
export declare class LiveEncoder
Constructors
Constructor | Modifiers | Description |
---|---|---|
Construct a live encoder. |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
number | The baudrate. | ||
Uint8Array | The internal buffer. | ||
number | The index inside the buffer up to which data has been read. | ||
number | The index inside the buffer up to which data has been written. | ||
number | The current energy level. | ||
number | The energy gain per millisecond without transmission. | ||
number | The energy loss per byte transmitted. | ||
number | The maximum energy level. | ||
(() => void) | undefined | Callback that informs when the encoder is idle. | ||
((buffer: Uint8Array) => void) | undefined | Callback that informs when data must be transmitted. | ||
The phase of the internal state machine. | |||
any | null | The timeout of the current phase. | ||
number | The timestamp when the current phase times out. | ||
(() => void) | undefined | Callback that inform when the suspend timed out. | ||
boolean | Whether the encoder was requested to suspend without timeout after completing the current transmission. | ||
number | The suspend timeout. | ||
boolean | Whether the encoder was requested to suspend with timeout after completing the current transmission. |
Methods
Method | Modifiers | Description |
---|---|---|
Determine whether the encoder is currently idle. | ||
Queue data for transmission. | ||
Resume a suspended encoder. | ||
Set the timeout for the current phase. | ||
Suspend the encoder without timeout. | ||
Suspend the encoder with timeout and optional callback. |