Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Protocol

Hierarchy

  • Protocol

Index

Constructors

constructor

Properties

__MSG_BYTE__

__MSG_BYTE__: number = 64

__MSG_DATA_START__

__MSG_DATA_START__: number = 9

__MSG_FLAG_BYTE__

__MSG_FLAG_BYTE__: number = 2

__MSG_FLAG_START__

__MSG_FLAG_START__: number = 1

__MSG_FLAG_STRING__

__MSG_FLAG_STRING__: string = "##"

__MSG_HEAD_STRING__

__MSG_HEAD_STRING__: string = "$"

__MSG_SIZE_BYTE__

__MSG_SIZE_BYTE__: number = 4

__MSG_SIZE_START__

__MSG_SIZE_START__: number = 5

__MSG_TYPE_BYTE__

__MSG_TYPE_BYTE__: number = 2

__MSG_TYPE_START__

__MSG_TYPE_START__: number = 3

__PROTOBUF__

__PROTOBUF__: Protobuf

__TYPES__

__TYPES__: any

Methods

decode

  • decode(arrBuf: Array<Buffer>): Promise<undefined | { data: any; type: string }>
  • Parameters

    • arrBuf: Array<Buffer>

    Returns Promise<undefined | { data: any; type: string }>

encode

  • encode(type: string, data: any): Promise<Buffer[]>
  • Parameters

    • type: string
    • data: any

    Returns Promise<Buffer[]>

hasFlag

  • hasFlag(buffer: Buffer): boolean

hasHead

  • hasHead(buffer: Buffer): boolean

msgPages

  • msgPages(buffer: Buffer): number

msgSize

  • msgSize(buffer: Buffer): number

Object literals

__OPTIONS__

__OPTIONS__: object

enumname

enumname: string = "Types"

flagString

flagString: string = "##"

headString

headString: string = "$"

Generated using TypeDoc