mirror of
https://github.com/stagehacks/Cue-View.git
synced 2026-08-21 05:08:59 +00:00
groundwork for posistagenet protocol
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
@@ -0,0 +1 @@
|
||||
<p><em>PosiStageNet</em> requires no configuration.</p>
|
||||
@@ -0,0 +1,51 @@
|
||||
const { Decoder } = require('@jwetzell/posistagenet');
|
||||
|
||||
exports.config = {
|
||||
defaultName: 'PosiStageNet',
|
||||
connectionType: 'multicast',
|
||||
port: 56565,
|
||||
remotePort: 56565,
|
||||
mayChangePorts: false,
|
||||
heartbeatInterval: 5000,
|
||||
heartbeatTimeout: 15000,
|
||||
searchOptions: {
|
||||
type: 'multicast',
|
||||
address: getMulticastGroup(1),
|
||||
port: 56565,
|
||||
validateResponse(msg, info) {
|
||||
return true;
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
exports.ready = function ready(_device) {
|
||||
console.log('posistagenet is ready');
|
||||
const device = _device;
|
||||
device.psn = new Decoder();
|
||||
|
||||
const networkInterfaces = device.getNetworkInterfaces();
|
||||
|
||||
Object.keys(networkInterfaces).forEach((networkInterfaceID) => {
|
||||
const networkInterface = networkInterfaces[networkInterfaceID];
|
||||
device.connection.addMembership(getMulticastGroup(1), networkInterface[0].address);
|
||||
});
|
||||
};
|
||||
|
||||
exports.data = function data(_device, buf) {
|
||||
const device = _device;
|
||||
if (device.psn) {
|
||||
device.psn.decode(buf);
|
||||
device.data = {
|
||||
data: device.psn.data,
|
||||
info: device.psn.info,
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
exports.heartbeat = function heartbeat(device) {};
|
||||
|
||||
exports.update = function update(_device, doc, updateType, updateData) {};
|
||||
|
||||
function getMulticastGroup(universe) {
|
||||
return `236.10.10.10`;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
[id^='tracker-'] {
|
||||
color: white;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<header>
|
||||
<h1><%= data.info.system_name ? data.info.system_name : '' %> PosiStageNet</h1>
|
||||
</header>
|
||||
|
||||
<div>
|
||||
<h2>Tracker Count: <%= Object.keys(data.data.trackers).length %></h2>
|
||||
<% Object.entries(data.info.trackers).forEach(([trackerId,trackerInfo]) => {
|
||||
|
||||
%>
|
||||
|
||||
<div id="tracker-<%= trackerId %>">
|
||||
<%= trackerInfo.name %>
|
||||
</div>
|
||||
|
||||
<% }); %>
|
||||
</div>
|
||||
Reference in New Issue
Block a user