ecue-programmer-stream
Low level protocol connector for e:cue lighting application suite
Last updated 3 years ago by rubyrubenstahl .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install ecue-programmer-stream 
SYNC missed versions from official npm registry.

Basic Usage


const ecuePogrammerStream = require('../src/ecue-programmer-stream')

// Create a socket that we will talk through. 
const dgram = require('dgram');
const socket = dgram.createSocket('udp4', {address: '192.168.123.19'});
socket.bind(4000);

// Set an rxjs stream of state changes coming from Programmer
const stateStream = ecuePogrammerStream.StateStream(socket);

stateStream.all.subscribe(
    packet=>console.log(packet)
);

// Create a command dispatcher to send commands to Programmer. We can use the same socket we
// used for the input stream, although you don't have to.
// There is an optional 3rd argument that takes an rxjs stream to pipe commands from a websocket
// or any other source. 
const commandDispatcher = ecuePogrammerStream.CommandDispatcher(socket, {address:'192.168.123.11'});

// Send a CUELIST_PLAY command to the server. 
setInterval(()=>{
    console.log(commandDispatcher);
    commandDispatcher.send({command: 'CUELIST_PLAY', params:[1,3]});
},2000);

Current Tags

  • 0.0.3                                ...           latest (3 years ago)

3 Versions

  • 0.0.3                                ...           3 years ago
  • 0.0.2                                ...           3 years ago
  • 0.0.1                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 11
Dependencies (3)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |