Teltonika SDK Typescript
    Preparing search index...

    Class TeltonikaBaseCommandAbstract

    Abstract base class representing a Teltonika GPRS command. Handles building the command buffer, computing CRC, and formatting for transmission. Subclasses must implement getContent and toBuffer for codec-specific behavior.

    TeltonikaBaseCommand

    export class TeltonikaCodec12Command extends TeltonikaBaseCommand {
    constructor(cmd: string) {
    super({
    codecId: Buffer.from([TeltonikaGPRSCodec.Codec12]),
    type: Buffer.from([0x05]),
    numberOfCmd: Buffer.from([0x01]),
    cmd,
    });
    }

    getContent() {
    return Buffer.concat([
    // Add the codec specification
    ])
    }

    toBuffer() {
    return Buffer.concat([
    // Add the codec specification
    ])
    }
    }

    Hierarchy (View Summary)

    Index

    Accessors

    • get crc(): Buffer<ArrayBuffer>

      Returns the 4-byte CRC-16 checksum buffer for the content.

      Returns Buffer<ArrayBuffer>

    • get dataSize(): Buffer<ArrayBuffer>

      Returns the 4-byte buffer representing the size of the content.

      Returns Buffer<ArrayBuffer>

    Constructors

    Methods

    • Custom inspection for Node.js console to display the command buffer.

      Returns Buffer<ArrayBufferLike>

    • Returns the content buffer of the command. Must be implemented in subclasses.

      Returns Buffer

    • Returns the full command buffer ready for transmission. Must be implemented in subclasses.

      Returns Buffer

    • Returns the command as a hexadecimal string representation.

      Returns string

      Hex string of the command buffer.

    Properties

    cmd: Buffer

    Command as a buffer

    cmdSize: Buffer

    Size of the command string

    codecId: Buffer

    Codec ID for this command

    content: Buffer

    Full content buffer of the command (to be sent)

    imei?: Buffer<ArrayBufferLike>

    IMEI buffer for device-specific commands

    numberOfCmd: Buffer

    Number of commands in the message

    preamble: Buffer

    Command preamble (default 4 zero bytes)

    type: Buffer

    Command type identifier