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

birddog-http

v0.2.3

Published

Implementation of v2.0 of the BirdDog HTTP API

Downloads

8

Readme

birddog-http

A Node.js package to communicate with BirdDog devices. This implements v2.0.0 of the BirdDog API as described by https://bird-dog.tv/SW/API/index.html Please note that you need to update all devices to the LTS firmware

This is still a work in progress

Confirmed to be working with the P100, P200, Flex Out and Flex In.

Other models have not been confirmed to be working because I don't have access to the hardware but should be more-or-less functional as-is.

This has undergone basic testing but there will likely be uncaught cases. Issues and pull-requests are welcome.

To add a new model, a new file should be added to the models folder and models/index.js should be updated to reflect.

The new BirdDog() constructor attempts to identify the device it's connecting to based on the response to the /version endpoint. For devices that I don't have access to, I'm not currently able to fill in the expected responses in the GenericBirdDog class . If you do, please open an issue or pull request so I can add them in. The name is the value returned from the hwVersion command in the quickstart

If your device is not listed in the GenericBirdDog class you can manually set the model type in the new BirdDog() constructor using the model property. Valid model names can be found in src/models/index.js

This package intends to be a transparent interface between a higher-level implementation and the device and only stops you from making a request that a particular device does not support. Parameter values are not (at least currently) validated. In general, responses are passed straight through from the device. i.e. the property names are not changed from what the device expects. There are some basic formatting fixes like extra " characters removed from strings, and raw string responses shoved into an object before being returned. This does mean, however, that most received property values are string types and must be converted to Numbers if necessary

For devices that are not on a supported firmware, you can still send v1 API commands using the v1Get and v1Set functions on your BirdDog instance. You will also need to set the model type for this method to work (see test/test.js for an example).

TODO:

  • Add A200
  • Add A300
  • Add PF120
  • Add P400
  • Add P4K
  • Add Studio
  • Add Mini
  • Add WPEncode
  • Add WPDecode
  • Add 4KHDMISDI
  • Add Quad

Install

npm install birddog-http

Quick start

NOTE: A more complete usage example can be found in the test folder

const { BirdDog } = require('birddog-http');

let bd;
async function tryCatchWrapper(f, args) {
    return await bd[f](args).catch((err) => '!!!!! ' + err.message);
}

async function testBasicInfo() {
    console.log('about', await tryCatchWrapper('about'));
    console.log('hostname', await tryCatchWrapper('hostname'));
    console.log('hwVersion', await tryCatchWrapper('hwVersion'));
}

(async () => {
    bd = await new BirdDog({ host: '172.16.10.200', debug: true });
    await testBasicInfo();
})();