extron-sis
v1.0.0
Published
Extron audio device encoder/decoder based on Simple Instruction Set (SIS) protocol
Maintainers
Readme
Introduction
extron-sis is Node module to encode or decode commands for Extron audio devices using Simple Instruction Set (SIS) protocol.
Main features
- no external dependencies
- regardless of connection type (tcp/serial)
- just encode and decode functions
- no flow control
- helper constans and functions
- easy extensible, dynamically loaded SIS command modules
Usage
let extron = require('extron-sis')
extron.load('./DMPplus.js', 'DMP128Plus') //use to load Extron DMP 128 Plus commands
//extron.load('./MVC121.js', 'MVC121Plus') //use to load Extron MVC 121 Plus commands
let socket = net.createConnection(23, '192.168.4.201', () => {
//socket.write('apassword\n') //use only in TCP mode, when password for device is set
socket.write(extron.encode('verbose 3').encoded) //use only if you want to process responses from device
})
socket.on('data', data => {
let decoded = extron.decode(data);
console.log('<', decoded);
})
setTimeout(() => {
let enc = extron.encode('audioMute MicLineInp3,unmute');
console.log('>', enc)
socket.write(enc.encoded);
}, 1000)
/* expected output
< {
raw: <Buffer 0d 0a 28 63 29 20 43 6f 70 79 72 69 67 68 74 20 32 30 31 36 2d 32 30 32 35 2c 20 45 78 74 72 6f 6e 20 45 6c 65 63 74 72 6f 6e 69 63 73 2c 20 44 4d 50 ... 64 more bytes>,
rawStr: '\r\n' +
'(c) Copyright 2016-2025, Extron Electronics, DMP 128 Plus C V AT, V1.11, 60-1513-10\r\n' +
'Tue, 02 Dec 2025 21:02:32\r\n',
status: 'Decode warning ',
more: 'Can not decode response'
}
< {
raw: <Buffer 56 72 62 33 0d 0a>,
rawStr: 'Vrb3\r\n',
req: 'verbose',
extra: [ '3' ],
value: '3'
}
> {
command: 'audioMute MicLineInp3,unmute',
duration: 700,
encodedStr: '\x1BM40002*0AU\r',
encoded: <Buffer 1b 4d 34 30 30 30 32 2a 30 41 55 0d>
}
< {
raw: <Buffer 44 73 4d 34 30 30 30 32 2a 30 0d 0a>,
rawStr: 'DsM40002*0\r\n',
req: 'audioMute',
extra: [ '40002', '0' ],
value: { target: 'MicLineInp3', value: 'unmute' }
}
*/Commands
SIS protocol uses a set of commands. Supported commands are defined in arrays in module files.
You can find command syntax and accepted values there.
Commands can accept multiple parameters and return a single value or object of values.
Command syntax is command_name[?][ val1[,val2[...]]], but most common commands have only one or two parameters.
Sample commands: verbose 3, model?, gain MicLineInp1,20.
By default, common SIS commands are loaded. You can load additional commands set using load() function.
encode(cmd) function
Encodes human friendly command to bytes according to Extron SIS.
cmd <string>- required. The cmd is a human friendly command which corresponds to single SIS command. To read a value you must provide a question mark '?' directly after the name (no space between). Example:model?
Return value is cmdObj <Object>. The most important property is encoded which contains encoded command as Buffer. This buffer must be send to device. Other properties are helper ones.
decode(data) function
Decodes response from Extron device into JS primitive or object.
data <Buffer|string>- data read from TCP socket or serial port
Returns response <Object> - an response object containing properties:
raw <Buffer>- same as data if it contains valid protocol responserawStr <string>- raw as stringreq <string>- a command name (request). Used to identify a responsevalue <string|number|Object>- decoded value. Return type depends on commandextra <Array>- some pre-decoded values, specific for SIS protocol.
The function does not control completeness of data. It verifies if data is a valid protocol response and tries to decode it. If data is not a valid response, a undefined value is returned.
load(module, ...consts) function
Loads additional SIS commands for specific device.
module <string>- a filename for node JS moduleconsts <...string>- a set of canst names containing an array of command objects.
Returns loaded command arrays as single, concated array.
