Namespace: nimo

nimo

Codec functions for Non-IP Modems based on ORBCOMM protocols

Methods

staticnimo.decodeMessage(payloadRaw, codec, isMo)

nimo/message.js, line 22

Decode a message from its raw payload using a specified codec. The codec may specify a path to a compliant XML or JSON file, or be a compliant string or object conforming to NimoCodec structure.

Name Type Default Description
payloadRaw Array.<number> | Buffer

Decimal bytes or Buffer sent over the air

codec NimoCodec | string

The codec may be a file path, string or object

isMo boolean true optional

Indicates if the message was Mobile-Originated

Returns:
A decoded Message or empty object

staticnimo.encodeMessage(message, codec, isMo){Buffer}

nimo/message.js, line 79

Encode a Message object to a bytes buffer using the specified codec.

Name Type Default Description
message Message

The Message object to encode

codec NimoCodec | String

The NimoCodec or file path to use

isMo boolean false

Set if the message is Mobile-Originated (default false)

Throws:

If unable to process the codec or message

Returns:
Type Description
Buffer The encoded message buffer

staticnimo.exportJson(codec, filepath)

nimo/codeckey.js, line 181

Export to NIM codec key file format

Name Type Description
codec NimoCodec
filepath String

staticnimo.exportXml(codec, filepath)

nimo/codeckey.js, line 192

Expert to IDPMSG/XML format (PLACEHOLDER NOT IMPLEMENTED)

Name Type Description
codec NimoCodec

The codec key object

filepath String

The location/name of the file to output

staticnimo.importCodec(codec){NimoCodec}

nimo/codeckey.js, line 140

Imports and basic sanity on the specified NimCodec key. Accepts valid NimoCodec, string representation in XML or JSON, or the path to a valid XML(.idpmsg) or JSON file.

Name Type Description
codec NimoCodec | string

Codec object, string or file path

Throws:

If unable to parse or validate the codec

Returns:
Type Description
NimoCodec valid Codec object