Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Packet

Hierarchy

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • new Packet(data?: Buffer): Packet
  • Represents a packet to send to the Crazyflie

    Parameters

    • Optional data: Buffer

    Returns Packet

Properties

channel

channel: number = 0

data

data: Buffer = Buffer.alloc(MAX_PAYLOAD_SIZE)

length

length: number = 0

port

port: number = 0

Accessors

header

  • get header(): number

Methods

equals

  • equals(other: Packet): boolean
  • Determine of two packets are equal to each other

    Parameters

    Returns boolean

export

  • export(): Buffer

exportHexCodes

  • exportHexCodes(): string[]
  • Return an array of hex codes for debugging

    Returns string[]

write

  • write(type: Type, value: number): this
  • Write a type onto the packet payload

    Parameters

    • type: Type
    • value: number

    Returns this

Static parseHeader

  • parseHeader(header: number): object
  • You take the header... then you parse it

    Parameters

    • header: number

    Returns object

    • channel: number
    • port: number

Generated using TypeDoc