npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

abeeway-asset-tracker-driver

v3.7.2

Published

abeeway asset tracker js driver

Downloads

6

Readme

Abeeway Asset Tracker Driver Package

Description

The IoT Flow Abeeway Asset Tracker driver implements the specification of javascript IoT flow drivers as described in the chapter below.

To use in javascript

First install the package: npm install abeeway-asset-tracker-driver

Then:

//import the module
var driver = require("abeeway-asset-tracker-driver");

//common functions
//convert a hex string to a hex array
function parseHexString(str){
    var result = [];
    while (str.length >= 2) { 
        result.push(parseInt(str.substring(0, 2), 16));

        str = str.substring(2, str.length);
    }
    return result;
}
  • To decode an uplink
var input = {
    bytes: parseHexString(uplinkPayloadString),
    fPort: 18 
}

var result = driver.decodeUplink(input)
  • To decode a downlink
var input = {
    bytes: parseHexString(downlinkPayloadString),
}
var result = driver.decodeDownlink(input)
  • To encode a downlink
/*
input is the "data" object without "payload" as presented in the downlink example files
for example
{
    "downMessageType": "DEBUG_COMMAND",
    "ackToken": 2,
    "debugCommandType": "RESET"
}
*/
var result = driver.encodeDownlink(input).bytes

To update this package:

  1. Clone this repo: https://github.com/actility/device-catalog
  2. Go to ./vendors/abeeway/drivers/asset-tracker. I suggest duplicating the folder somewhere safe and isolated in order to avoid any potential external file dependencies when testing
  3. Change the package.json's "name" property from "asset-tracker" to "abeeway-asset-tracker-driver" and its "main" property from "./main.js" to "./src/index.js", make sure the version property is up-to-date (NPM will not accept the same package version twice)
  4. In the .npmignore file, remove "src", so it's uploaded with the npm package
  5. Create a README.md file and copy-paste the raw contents from this README file
  6. Run npm link in the asset-tracker folder
  7. Test that all the functions are correctly exported by creating a local tmp project, running npm link abeeway-asset-tracker-driver in it and running your JS test file (example: node ./tmp/index.js) to see if all exported functions are available
  8. Publish as an unscoped package onto npmjs (refer to the official npmjs documentation: https://docs.npmjs.com/creating-and-publishing-unscoped-public-packages)
  9. Test that everything works as expected with the published package
  10. Discard all changes (if on the main branch)