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
NimoCodecstructure.Name Type Default Description payloadRawArray.<number> | Buffer Decimal bytes or Buffer sent over the air
codecNimoCodec | string The codec may be a file path, string or object
isMoboolean true optional Indicates if the message was Mobile-Originated
Returns:
A decodedMessageor empty object -
staticnimo.encodeMessage(message, codec, isMo){Buffer}
nimo/message.js, line 79 -
Encode a
Messageobject to a bytes buffer using the specified codec.Name Type Default Description messageMessage The
Messageobject to encodecodecNimoCodec | String The
NimoCodecor file path to useisMoboolean 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 codecNimoCodec filepathString -
staticnimo.exportXml(codec, filepath)
nimo/codeckey.js, line 192 -
Expert to IDPMSG/XML format (PLACEHOLDER NOT IMPLEMENTED)
Name Type Description codecNimoCodec The codec key object
filepathString The location/name of the file to output
-
staticnimo.importCodec(codec){NimoCodec}
nimo/codeckey.js, line 140 -
Imports and basic sanity on the specified
NimCodeckey. Accepts validNimoCodec, string representation in XML or JSON, or the path to a valid XML(.idpmsg) or JSON file.Name Type Description codecNimoCodec | string Codec object, string or file path
Throws:
If unable to parse or validate the codec
Returns:
Type Description NimoCodec valid Codec object