Home Reference Source Repository
public class | source

IcarusParser

Extends:

Parser → IcarusParser

The parser for Team Icarus' CanSat.

Member Summary

Private Members
private

_raw: *

Method Summary

Public Methods
public

parse(rawPacket: Buffer): Object

Implementation of Parser#parse.

Inherited Summary

From class Parser
public

Raw packet byte endianess (Little Endian (LE) for the Arduino).

public

Parsed output container.

protected

Current position in the packet being parsed.

protected

Current packet being parsed.

public

parse(rawPacket: Buffer): Object

Parses a packet.

public

readBoolean(key: String, converter: Function): Boolean

Reads a boolean.

public

readChar(key: String, converter: Function): String

Reads a char.

public

readFloat(key: String, converter: Function): Number

Reads a 32-bit float.

public

readInt(key: String, size: Number, converter: Function): Number

Reads a signed integer of 1-6 bytes.

public

readUInt(key: String, size: Number, converter: Function): Number

Reads an unsigned integer of 1-6 bytes.

public

setValue(key: String, val: mixed, converter: Function): mixed

The value setter called by read* helper functions.

Private Members

private _raw: * source

Current packet being parsed.

Override:

Parser#_raw

Public Methods

public parse(rawPacket: Buffer): Object source

Implementation of Parser#parse. Automatically decodes the quasi-binary packet with decode. Supports telemetry, info and settings packets. Also converts sensor values to standard units and attaches text representations of module names and messages.

Override:

Parser#parse

Params:

NameTypeAttributeDescription
rawPacket Buffer

Packet to parse.

Return:

Object

Parsed packet.