initial layout for sennheiser wireless

This commit is contained in:
2023-01-05 14:42:59 -06:00
parent 778173b118
commit 7f6e65d87f
6 changed files with 288 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
const Channel = require('./channel');
exports.config = {
defaultName: 'Sennheiser Wireless',
connectionType: 'UDPsocket',
heartbeatInterval: 5000,
heartbeatTimeout: 10000,
defaultPort: 53212,
mayChangePort: false,
searchOptions: {
type: 'UDPsocket',
searchBuffer: Buffer.from('Name\r', 'ascii'),
testPort: 53212,
validateResponse(msg, info) {
return msg.toString().includes('Name');
},
},
};
exports.ready = function ready(_device) {
const device = _device;
// send an immediate request for both types of attributes
_device.send('Push 0 0 1');
_device.send('Push 0 0 2');
device.data.channel = new Channel();
};
exports.data = function data(_device, message) {
console.log(message);
// Parse return message
};
exports.update = function update(device, doc, updateType, data) {};
exports.heartbeat = function heartbeat(device) {
// tell unit to send both attribute updates every 500ms for 5 seconds
device.send('Push 5 500 3');
};