Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Logging

Hierarchy

  • EventEmitter
    • Logging

Index

Constructors

constructor

Properties

blocks

blocks: Block[] = []

Private crazyflie

crazyflie: Crazyflie

data

data: EventEmitter = new EventEmitter()

Private nextBlockId

nextBlockId: number = 0

tocFetcher

tocFetcher: TOCFetcher = new TOCFetcher(this.crazyflie, TOC_TYPES.LOG)

Static defaultMaxListeners

defaultMaxListeners: number

Methods

addListener

  • addListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

appendToBlock

  • appendToBlock(blockId: number, variables: TOCItem[]): Promise<void>

createBlock

  • createBlock(block: Block): Promise<void>

deleteBlock

  • deleteBlock(blockId: number): Promise<void>

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

eventNames

  • eventNames(): Array<string | symbol>
  • Returns Array<string | symbol>

getBlock

  • getBlock(id: number): Block
  • Gets a block with a specified id from the block array. Not Crazyflie.

    Parameters

    • id: number

    Returns Block

getMaxListeners

  • getMaxListeners(): number
  • Returns number

getTOC

  • getTOC(): Promise<TOC>
  • Retrieve logging TOC from the Crazyflie. Required before getting any logging data!

    Returns Promise<TOC>

Private handleBlock

  • handleBlock(data: Buffer): void

Private handleLogData

  • handleLogData(data: Buffer): void

listenerCount

  • listenerCount(type: string | symbol): number
  • Parameters

    • type: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

on

  • on(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

once

  • once(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependListener

  • prependListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

rawListeners

  • rawListeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

removeAllListeners

  • removeAllListeners(event?: string | symbol): this
  • Parameters

    • Optional event: string | symbol

    Returns this

removeListener

  • removeListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

reset

  • reset(): Promise<void>

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

start

  • start(variables: TOCItem[], millisecondInterval?: number): Promise<void>
  • Start receiving data of TOC items. Creates a block of variables and activates it. You can access these variables using various events; check the documentation. You can optionally specify the interval in milliseconds for the Crazyflie to ping data back to the computer. (Floors to the nearest 10ms interval)

    Parameters

    • variables: TOCItem[]
    • Default value millisecondInterval: number = 100

    Returns Promise<void>

startBlock

  • startBlock(blockId: number, interval: number): Promise<void>

stopBlock

  • stopBlock(blockId: number): Promise<void>

Static listenerCount

  • listenerCount(emitter: EventEmitter, event: string | symbol): number
  • Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Generated using TypeDoc