6.12.1 • Published 5 months ago

@tzmedical/trident-sdk v6.12.1

Weekly downloads
224
License
MIT
Repository
bitbucket
Last release
5 months ago

Trident Software Development Kit

npm version npm downloads CircleCI

This repository contains a collection of programs written in C++ and Javascript to help speed development of programs for interacting with the binary files generated and consumed by TZ Medical Trident devices.

Trident File Specifications

To expedite development of software this repository also includes specifications for the File Formats used by the Trident devices, including the Actions, Events, and Settings generated and consumed by TZ Medical Trident devices. These specifications can be found at the following locations:

Use in Node.js

The programs in the repository are published as an NPM package to simplify deployment.

Javascript Usage

Each file type is encapsulated as a class, with functions for each class available according to the following table:

File TypetoText()fromText()toJson()fromJson()find()metaJson()parse()
tzeXXXX
tzrXXXX
tzaXXXX
tzsXXXXX
tzgXX
scpXXX
bakXX
errorX
queueX

Here is a simple usage example for parsing an *.tze file into JSON. See the file cli.js for more detailed usage examples.

const {tze, tzr, tza, tzs, scp} = require('@tzmedical/trident-sdk');
const fs = require("fs");

function parseTze(inFile) {
  const buffer = fs.readFileSync(inFile);

  return tze.toJson(buffer)
    .then(result => {
      console.log(JSON.stringify(result));
    });
}

Command-line Usage

When installed using npm install -g @tzmedical/trident-sdk or when git cloned and linked using npm install && npm link, a cli tool is available with the following commands.

Usage: trident-sdk [options] [command]

Options:
  -V, --version                                 output the version number
  -h, --help                                    display help for command

Commands:
  toText [options] <inPath> [outPath]           Parse a binary file into a text format, based on the suffix of the file.
  fromText [options] <inPath> <outPath>         Generate a binary file from a text format, based on the suffix of the output file.
  toJson [options] <inPath> [outPath]           Parse a binary file into a JSON format, based on the suffix of the file.
  fromJson [options] <inPath> <outPath>         Generate a binary file from a JSON format, based on the suffix of the file.
  metaJson [options] <deviceType>               Output metadata for the filetype in a JSON format.
  find [options] <directory> [outPath]          Search a directory.
  parse [options] <directory> [outPath]         Find and parse wireless files into a JSON format from the tmp folder.
  retrieveFile [options] <directory> <outPath>  Find an SCP file in a directory given a sequence number.
  help [command]                                display help for command

Each command will try to automatically detect the file format based on file suffixes, but this detection can also be overridden with an options flag as shown below:

Usage: trident-sdk toText [options] <inFile> [outFile]

Parse a binary file into a text format, based on the suffix of the file.

Options:
  -f, --format <type>        the format of file to parse: tze, tzr, tza, tzs, scp, or bak
  -e, --epoch-ms <offset>    the starting ms epoch for HR calculations in tzr files
  -t, --tag <tag>            event tag number to search for in tzr or tze files
  --skip-crc                 ignore the crc value in the file and print the parsing results
  --no-file-header           don't print out the file header, just the entries
  --device-type <device>     type of device that created this backup file
  -h, --help                 display help for command

Contributing

To contribute to this NPM package, you will need Python 3.7 or later available on your system before installing. For Windows PCs, we recommend installing Node.js LTS. When asked if you would like to install build tools, select yes to ensure the required dependencies are also installed.

When developing in VS Code, add the following line to your settings file to make include warnings from Intellisense go away:

{
  "local.node-gyp.node-cache": "C:/Users/<UserName>/AppData/Local/node-gyp/Cache/<NodeVersion>"
}

Standalone Executables

It is also possible to build standalone executables for each of the programs by cloning the repository and then running the shell script scripts/compile.sh. Running this script will require the use of bash, make, and clang. In general, it is usually preferable to use the CLI executable provided by the Node.js packaging system, rather than compiling standalone executables.

6.12.1

5 months ago

6.12.0

7 months ago

6.11.1

8 months ago

6.11.0

8 months ago

6.10.0

12 months ago

6.9.1

12 months ago

6.8.1

1 year ago

6.9.0

1 year ago

6.7.5-alpha.1

1 year ago

6.7.4

1 year ago

6.7.3

1 year ago

6.7.5

1 year ago

6.8.0

1 year ago

6.7.4-alpha.1

1 year ago

6.7.2

1 year ago

6.7.0

2 years ago

6.7.1

2 years ago

6.7.1-alpha.1

2 years ago

6.5.0

2 years ago

6.6.1

2 years ago

6.6.0

2 years ago

6.3.1-alpha.4

2 years ago

6.3.1-alpha.3

2 years ago

6.3.1-alpha.6

2 years ago

6.3.1-alpha.5

2 years ago

6.3.1-alpha.2

2 years ago

6.3.1-alpha.1

2 years ago

6.3.0

2 years ago

6.3.1

2 years ago

6.4.3

2 years ago

6.4.2

2 years ago

6.4.1

2 years ago

6.4.0

2 years ago

6.2.0

2 years ago

6.1.0

2 years ago

6.0.1

2 years ago

6.0.2

2 years ago

6.0.0

2 years ago

6.0.0-alpha.3

2 years ago

6.0.0-alpha.4

2 years ago

6.0.0-alpha.1

2 years ago

6.0.0-alpha.2

2 years ago

5.1.1

3 years ago

5.1.0

3 years ago

5.0.3-alpha.2

3 years ago

4.2.0

3 years ago

5.0.3-alpha.1

3 years ago

5.0.2

3 years ago

5.0.1

3 years ago

4.1.1

3 years ago

5.0.0-alpha.1

3 years ago

5.0.0

3 years ago

4.1.0

3 years ago

4.0.3

3 years ago

4.0.2

3 years ago

4.0.1

3 years ago

4.0.0

3 years ago

4.0.1-alpha.1

3 years ago

3.13.4

3 years ago

3.13.3

3 years ago

3.13.2

3 years ago

3.13.1

3 years ago

3.13.0

3 years ago

3.12.0

3 years ago

3.11.0

3 years ago

3.9.9

3 years ago

3.10.0

3 years ago

3.9.8

3 years ago

3.9.7

3 years ago

3.9.6

3 years ago

3.9.5

3 years ago

3.9.4

3 years ago

3.9.3

3 years ago

3.9.2

3 years ago

3.9.1

3 years ago

3.9.0

3 years ago

3.7.2

4 years ago

3.8.0

3 years ago

3.8.1

3 years ago

3.7.1

4 years ago

3.7.0

4 years ago

3.4.3

4 years ago

3.6.0

4 years ago

3.4.2

4 years ago

3.4.1

4 years ago

3.5.0

4 years ago

3.4.0

4 years ago

3.3.1

4 years ago

3.3.0

4 years ago

3.2.6

4 years ago

3.2.5

4 years ago

3.2.4

4 years ago

3.2.3

4 years ago

3.2.2

4 years ago

3.2.1

4 years ago

3.2.0

4 years ago

3.1.1

4 years ago

3.1.0

4 years ago

3.0.7

4 years ago

3.0.4

4 years ago

3.0.3

4 years ago

3.0.2

4 years ago

3.0.1

4 years ago

3.0.6

4 years ago

3.0.5

4 years ago

3.0.0

4 years ago

1.11.3

4 years ago

1.11.2

4 years ago

1.11.1

4 years ago

1.9.1

4 years ago

1.9.0

4 years ago

1.7.0

4 years ago

1.6.1

4 years ago

1.6.0

4 years ago

2.1.0

4 years ago

2.0.0

4 years ago

1.11.0

4 years ago

1.10.0

4 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.4.0

4 years ago

1.3.0

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago