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

@shgbit/biamp-client

v1.0.5

Published

node telnet client for biamp server

Downloads

8

Readme

node-biamp-client

Quick Start

  1. install package
npm install @shgbit/biamp-client
  1. add require
const biampClient = require('@shgbit/biamp-client');

const { DeviceBlock } = biampClient;
  1. use biampClient
const client = new biampClient('172.16.13.52','main');
    console.log("<<<<<<< begin connect biamp >>>>>>>");
    let connect = await client.makeConnect();
    console.log(`<<<<<<< end connect biamp,result${connect} >>>>>>>`);
    if( connect ){
        console.log("<<<<<<< begin get serial number >>>>>>>");
        let sn = await client.sendTTPSimple( DeviceBlock.getSerialNumber());
        console.log(`serial number is ${sn}`);
    }

Batch TTP performence improvement

for example:I need to query MatrixMixer is 16 ✖️ 10 all CrosspointLevelState. so I use 160 ttp command to excute.

/**
 * 
 * @param {BiampClient} client 
 * @param {MatrixMixerBlock} mixer 
 * @param {number} inputNum 
 * @param {number} outputNum 
 */
async function normalQueryCrosspointLevelState(client,mixer,inputNum,outputNum){
    const start = process.hrtime.bigint();
    for( let i=1;i<= inputNum;i++ ){
        for( let j=1;j <= outputNum;j++ ){
            let state = await client.sendTTPSimple( mixer.getCrosspointLevelState( i ,j ) );
            console.log(`input:${i} output:${j} queryMixerState result:${state}`);
        }
    }
    const end = process.hrtime.bigint();
    const elapsedTime = end - start;
    const elapsedMilliseconds = Number(elapsedTime) / 1_000_000;
    console.log(`normal query CrosspointLevelState timming: ${elapsedMilliseconds} ms`);
}

result

nput:1 output:1 queryMixerState result:true
input:1 output:2 queryMixerState result:true
input:1 output:3 queryMixerState result:true
input:1 output:4 queryMixerState result:true
input:1 output:5 queryMixerState result:true
input:1 output:6 queryMixerState result:true
input:1 output:7 queryMixerState result:true
input:1 output:8 queryMixerState result:true
input:1 output:9 queryMixerState result:true
input:1 output:10 queryMixerState result:true
input:2 output:1 queryMixerState result:true
input:2 output:2 queryMixerState result:false
input:2 output:3 queryMixerState result:true
...
...
normal query CrosspointLevelState timming: 4649.550167 ms

timming is 4649.550167 ms

so I combine these ttp command send togeter.

/**
 * 
 * @param {BiampClient} client 
 * @param {MatrixMixerBlock} mixer 
 * @param {number} inputNum 
 * @param {number} outputNum 
 */
async function batchQueryCrosspointLevelState(client,mixer,inputNum,outputNum) {
    const start = process.hrtime.bigint();
    let requests = [];
    for( let i=1;i<= inputNum;i++ ){
        for( let j=1;j <= outputNum;j++ ){
            let request = mixer.getCrosspointLevelState( i ,j );
            requests.push( request );
        }
    }
    console.log(`client request count:${requests.length}`);
    let results =  await client.sendTTPSimple(...requests);
    console.log(results)
    const end = process.hrtime.bigint();
    const elapsedTime = end - start;
    const elapsedMilliseconds = Number(elapsedTime) / 1_000_000;
    console.log(`batch query CrosspointLevelState timming: ${elapsedMilliseconds} ms`);
}

result

client request count:160
info:BatchTtpRequest BatchTtpRequest finish
[
  true,  true, true,  true, true,  true,  true,  true,  true,
  true,  true, false, true, true,  true,  true,  true,  true,
  true,  true, true,  true, true,  true,  true,  true,  true,
  true,  true, true,  true, true,  true,  true,  true,  true,
  true,  true, true,  true, true,  true,  true,  true,  true,
  true,  true, true,  true, true,  true,  true,  true,  true,
  true,  true, true,  true, false, false, true,  true,  true,
  true,  true, true,  true, true,  false, false, true,  true,
  true,  true, true,  true, true,  true,  false, false, true,
  true,  true, true,  true, true,  true,  true,  false, false,
  true,  true, true,  true, true,  true,  true,  true,  false,
  false,
  ... 60 more items
]
batch query CrosspointLevelState timming: 3266.358083 ms

timming is 3266.358083 ms

less than expected:(,A little bit of acceleration is better than nothing

More performence test

Query 36 ✖️ 36 all CrosspointLevelState

normal query CrosspointLevelState timming: 22890.746916 ms
batch query CrosspointLevelState timming: 11128.11425 ms

22890.746916 ms -> 11128.11425 ms 100% acceleration

direct excute ttp

you can direct excute ttp when you are familiar with TTP command.

for example

let mute = await client.sendTTPSimple( common.buildCommand('Mixer1',BiampBlock.get,'inputMute',BiampBlock.boolean,1) );
        let label = await client.sendTTPSimple( common.buildCommand('Mixer1',BiampBlock.get,'inputLabel',BiampBlock.string,1) );
        console.log(`MatrixMixer mute:${mute}  label:${label}`);

result

MatrixMixer mute:false  label:1-104

Related Links

Biamp-Client-Demo

just a demo to use

Biamp Website