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

rotelctl

v1.1.6

Published

Control Rotel amplifiers with RS232 connection

Downloads

3

Readme

Build Status

Control Rotel amplifiers with RS232 connection

So far, this library has been tested with

  • Rotel RA-12 V02

http://rotel.com/en-gb/manuals-resources/rs232-protocols lists several other Rotel components with a RS232 interface, so if you find that it works with, or you want to add support for, any of these devices, please let me know.

Usage

With callbacks

var RotelCtl = require('rotelctl').RotelCtl;
var rctl = new RotelCtl('/dev/ttyUSB0');

rctl.open(function(err) {
  if (err) {
    return console.error(err);
  }
  rctl.getDisplay(function(err, response) {
    if (err) {
      return console.error(err);
    }
    console.log(response);
    rctl.close(function(err) {
      if (err) {
        return console.error(err);
      }
    });
  });
});

Without callbacks

var RotelCtl = require('rotelctl').RotelCtl;
var rctl = new RotelCtl('/dev/ttyUSB0');

rctl.on('open', function() {
  console.log('open');
  rctl.getDisplay();
});
rctl.on('close', function() {
  console.log('close');
});
rctl.on('error', function(err) {
  console.log('error', err);
});
rctl.on('data', function(data) {
  console.log('data', data);
});

rctl.open();

API

Events

  • open: when the serial connection has been opened

  • close: when the serial connection has been closed

  • error: on error

  • data: when receiving data. The format of data is always

      {
        "name": "<name of data item>"
        "value": "<value of event>"
      }

    The name of the different data items is described below.

RotelCtl(port)

Create a new RotelCtl.

  • port: the serial port device. E.g. /dev/ttyUSB0

open([callback])

Open the serial connection.

  • callback(err): optional callback, called when the serial port is opened.

close([callback])

Close the serial connection.

  • callback(err): optional callback, called when the serial port is closed.

isOpen()

Returns true when the serial port has been opened.

Rotel commands

All commands below take an optional callback(err, data). data is always the same value as the value part of event triggered by the command.

Also see the Rotal documentation PDF in the docs directory.

powerOn([callback])

Power on.

  • event: {name:"power", value: power value}

powerOff([callback])

Power off.

  • event: {name:"power", value: power value}

powerToggle([callback])

Toggle power.

  • event: {name:"power", value: power value}

volumeUp([callback])

Increase volume a bit.

  • event: {name:"volume", value: volume value}

volumeDown([callback])

Decrease volume a bit.

  • event: {name:"volume", value: volume value}

volumeMax([callback])

Set volume to maximum.

  • event: {name:"volume", value: volume value}

volumeMin([callback])

Set volume to minimum.

  • event: {name:"volume", value: volume value}

volume(amount, [callback])

Set volume to amount.

  • event: {name:"volume", value: volume value}

muteToggle([callback])

Toggle mute state.

  • event: {name:"mute", value: mute value}

muteOn([callback])

Mute.

  • event: {name:"mute", value: mute value}

muteOff([callback])

Unmute.

  • event: {name:"mute", value: mute value}

rcd([callback])

Set source to Rotel CD.

  • event: {name:"source", value: source value}

cd([callback])

Set source to CD.

  • event: {name:"source", value: source value}

coax1([callback])

Set source to coax 1.

  • event: {name:"source", value: source value}

coax2([callback])

Set source to coax 2.

  • event: {name:"source", value: source value}

optical1([callback])

Set source to optical 1.

  • event: {name:"source", value: source value}

optical2([callback])

Set source to optical 2.

  • event: {name:"source", value: source value}

aux1([callback])

Set source to auxiliary 1.

  • event: {name:"source", value: source value}

aux2([callback])

Set source to auxiliary 2.

  • event: {name:"source", value: source value}

tuner([callback])

Set source to tuner.

  • event: {name:"source", value: source value}

phono([callback])

Set source to phono.

  • event: {name:"source", value: source value}

usb([callback])

Set source to usb (or bluetooth if dongle is installed).

  • event: {name:"source", value: source value}

toneOn([callback])

Switch tone controls on.

  • event: {name:"tone", value: tone value}

toneOff([callback])

Switch tone controls off.

  • event: {name:"tone", value: tone value}

bassUp([callback])

Increase bass a bit.

  • event: {name:"bass", value: bass value}

bassDown([callback])

Decrease bass a bit.

  • event: {name:"bass", value: bass value}

bassMin([callback])

Set bass to minimum.

  • event: {name:"bass", value: bass value}

bassNeutral([callback])

Set bass to neutral.

  • event: {name:"bass", value: bass value}

BassMax([callback])

Set bass to maximum.

  • event: {name:"bass", value: bass value}

trebleUp([callback])

Increase treble a bit.

  • event: {name:"treble", value: treble value}

trebleDown([callback])

Decrease treble a bit.

  • event: {name:"treble", value: treble value}

trebleMin([callback])

Set treble to minimum.

  • event: {name:"treble", value: treble value}

trebleNeutral([callback])

Set treble to neutral.

  • event: {name:"treble", value: treble value}

trebleMax([callback])

Set treble to maximum.

  • event: {name:"treble", value: treble value}

balanceRight([callback])

Set balance a bit more to the right.

  • event: {name:"balance", value: balance value}

balanceLeft([callback])

Set balance a bit more to the left.

  • event: {name:"balance", value: balance value}

balanceLeftMax([callback])

Set balance fully left.

  • event: {name:"balance", value: balance value}

balanceMiddle([callback])

Set balance in the middle.

  • event: {name:"balance", value: balance value}

balanceRightMax([callback])

Set balance fully right.

  • event: {name:"balance", value: balance value}

displayUpdateAuto([callback])

Set display update to auto.

  • event: {name:"display_update", value: display_update value}

displayUpdateManual([callback])

Set display update to manual.

  • event: {name:"display_update", value: display_update value}

getDisplay([callback])

Get what the display is currently showing.

  • event: {name:"display", value: display value}

getDisplay1([callback])

Get line 1 of display.

  • event: {name:"display1", value: display1 value}

getDisplay2([callback])

Get line 2 of the display.

  • event: {name:"display2", value: display2 value}

getProductType([callback])

Get the product type.

  • event: {name:"product_type", value: product_type value}

getProductVersion([callback])

Get the product version.

  • event: {name:"product_version", value: product_version value}

getTcVersion([callback])

Get the TC version.

  • event: {name:"tc_version", value: tc_version value}

getDisplaySize([callback])

Get the display size.

  • event: {name:"display_size", value: display_size value}

getDisplayUpdate([callback])

Get the display update strategy.

  • event: {name:"display_update", value: display_update value}

getCurrentPower([callback])

Get the power status.

  • event: {name:"power", value: power value}

getCurrentSource([callback])

Get the selected source.

  • event: {name:"source", value: source value}

getTone([callback])

Get the tone control status.

  • event: {name:"tone", value: tone value}

getBass([callback])

Get the bass value.

  • event: {name:"bass", value: bass value}

getTreble([callback])

Get the treble value.

  • event: {name:"treble", value: treble value}

getBalance([callback])

Get the balance.

  • event: {name:"balance", value: balance value}

getCurrentFrequency([callback])

Get the sampling frequency.

  • event: {name:"freq", value: freq value}

getPlayStatus([callback])

Get the play status.

  • event: {name:"play_status", value: play_status value}

getVolumeMax([callback])

Get the maximum volume.

  • event: {name:"volume_max", value: volume_max value}

getVolumeMin([callback])

Get the minimum volume.

  • event: {name:"volume_min", value: volume_min value}

getVolume([callback])

Get the volume.

  • event: {name:"volume", value: volume value}

getToneMax([callback])

Get the maximum tone value.

  • event: {name:"tone_max", value: tone_max value}