Skip to content

Home > resol-vbus-core > RecordingDecoder

RecordingDecoder class ​

A decoder of the VBus Recording File Format.

Signature:

typescript
export declare class RecordingDecoder

Constructors ​

Constructor

Modifiers

Description

(constructor)(options)

Construct a recording decoder.

Properties ​

Property

Modifiers

Type

Description

buffer

Uint8Array

The buffer for unprocessed data.

bufferIndex

number

The index into the buffer of unprocessed data.

channel

number

The currently selected VBus channel.

onDatagram?

(dgram: Datagram) => void

(Optional) Callback for datagram records (kind = 0x66 and payload contains datagram).

onEndOfHeaderSet?

(timestamp: Date) => void

(Optional) Callback to signal end of header set.

onJunkData?

(buffer: Uint8Array) => void

(Optional) Callback for buffer parts that do not conform to the file format spec.

onPacket?

(packet: Packet) => void

(Optional) Callback for packet records (kind = 0x66 and payload contains packet).

onRawRecord?

(buffer: Uint8Array) => void

(Optional) Callback for the raw undecoded records.

onStartOfHeaderSet?

(timestamp: Date) => void

(Optional) Callback for Start-Of-Header-Set records (kind = 0x44).

onTelegram?

(tgram: Telegram) => void

(Optional) Callback for telegram records (kind = 0x77 and payload contains telegram).

startOfHeaderSetTimestamp

Date | null

The current active timestamp from the last Start-Of-Header-Set record.

Methods ​

Method

Modifiers

Description

_decodeInternalBuffer(isAtEnd)

Decode as much from the internal buffer as possible.

decode(providedBuffer, start, end)

Decode a chunk of data.

end()

End decoding.

reset()

Reset the recording decoder.