mirror of
https://github.com/jwetzell/qController.git
synced 2026-08-22 07:29:13 +00:00
Send "/thump" at 5 sec intervals to keep alive
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Net;
|
||||
|
||||
namespace qController
|
||||
{
|
||||
public class IPHelper
|
||||
{
|
||||
public IPHelper()
|
||||
{
|
||||
}
|
||||
|
||||
public static bool IsValidAddress(string ipString){
|
||||
if ((ipString.Split('.').Length - 1) != 3) return false;
|
||||
IPAddress address;
|
||||
return IPAddress.TryParse(ipString, out address);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -72,6 +72,8 @@ namespace qController
|
||||
ParseWorkspaceInfo(msg);
|
||||
else if (msg.Address.Contains("playbackPosition"))
|
||||
ParsePositionUpdateInfo(msg);
|
||||
else if (msg.Address.Contains("thump"))
|
||||
Console.WriteLine("Heartbeat Received");
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Unknown message type");
|
||||
|
||||
@@ -23,21 +23,15 @@ namespace qController
|
||||
public void UpdateLoop()
|
||||
{
|
||||
active = true;
|
||||
Device.StartTimer(TimeSpan.FromSeconds(0.01), () => {
|
||||
UpdateSelected();
|
||||
UpdateLevels();
|
||||
Device.StartTimer(TimeSpan.FromSeconds(5.0), () => {
|
||||
SendThump();
|
||||
return active;
|
||||
});
|
||||
}
|
||||
|
||||
public void UpdateSelected()
|
||||
public void SendThump()
|
||||
{
|
||||
string valuesForKeys = "[\"displayName\",\"number\",\"type\",\"isBroken\",\"isLoaded\",\"isPaused\",\"isRunning\",\"preWait\",\"duration\",\"postWait\",\"translationX\",\"translationY\",\"opacity\",\"scaleX\",\"scaleY\",\"uniqueID\",\"flagged\",\"listName\",\"colorName\",\"name\",\"armed\"]";
|
||||
//qController.qClient.sendAndReceiveStringArgs("/cue/selected/valuesForKeys", valuesForKeys);
|
||||
}
|
||||
public void UpdateLevels()
|
||||
{
|
||||
//qController.qClient.sendAndReceiveString("/cue/selected/levels");
|
||||
qController.qClient.sendStringUDP("/thump");
|
||||
}
|
||||
|
||||
public void Kill(){
|
||||
|
||||
Reference in New Issue
Block a user