refactor: Heavy refactoring to modern code style
This commit is contained in:
Vendored
+2
-1
@@ -15,5 +15,6 @@
|
||||
"idf.toolsPathWin": "C:\\Tools\\ESP",
|
||||
"idf.flashType": "UART",
|
||||
"C_Cpp.autoAddFileAssociations": false,
|
||||
"project.deviceIp": "172.16.17.56"
|
||||
"project.deviceIp": "172.16.17.56",
|
||||
"sonarlint.pathToCompileCommands": "${workspaceFolder}\\build\\compile_commands.json",
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
# SPIT
|
||||
|
||||
Original implementation from Hag seem to be not suited for Embedded devices.
|
||||
|
||||
- Supports IPv4 only
|
||||
- Reduced Threads to a minimum
|
||||
- Then reduced usage of Mutexes to a minimum
|
||||
- Reduced Sockets to a minimum
|
||||
- Introduced containers and removed plain new and delete
|
||||
- Removed UUID-Generation because SPIT-Types never change on embedded devices
|
||||
- Callbacks instead of interfaces where suitable
|
||||
Binary file not shown.
@@ -1,39 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
class SAD_DetectedServer;
|
||||
class I_SAD_Client {
|
||||
public:
|
||||
/**
|
||||
* If a new server was found by the ServerAutoDetect mechanism, this function is called.<br>
|
||||
* To do so the SAD_Client ServerAutoDetect has to be startet - see SAD_Client::startServerAutoDetect.<br>
|
||||
* If a server can be reached via several IP addresses, the IP address is selected according to the following preference:<br>
|
||||
* 1.) If a loopback address is available, it is used.<br>
|
||||
* 2.) If an IP4 address is available, it is used.<br>
|
||||
* 3.) In the other cases the IP6 address is used.<br>
|
||||
* @param p_ID the id of the server (every started server should generate an id)
|
||||
* @param p_Name the name of the SPIT server
|
||||
* @param p_ComputerName the Hostname of the cpmputer on which the SPIT server is running
|
||||
* @param p_IP the selected ip address of the SPIT server
|
||||
* @param p_Port the port of the SPIT server
|
||||
* @param p_Addition sometimes server may have additional informations
|
||||
* @param p_IsIP4 the server ip is a ip4 address
|
||||
*/
|
||||
virtual void eventServerDetected(SAD_DetectedServer &server) = 0;
|
||||
/**
|
||||
* If a SPITServer is not more found, this function is called.
|
||||
* To do so the SAD_Client ServerAutoDetect has to be startet - see SAD_Client::startServerAutoDetect.<br>
|
||||
* @param p_ID the id of the server (every started server should generate an id)
|
||||
* @param p_Name the name of the SPIT server
|
||||
* @param p_ComputerName the Hostname of the cpmputer on which the SPIT server is running
|
||||
* @param p_IP the selected ip address of the SPIT server
|
||||
* @param p_Port the port of the SPIT server
|
||||
* @param p_Addition sometimes server may have additional informations
|
||||
* @param p_IsIP4 the server ip is a ip4 address
|
||||
*/
|
||||
virtual void eventServerChanged(SAD_DetectedServer &server) = 0;
|
||||
|
||||
virtual void eventServerLost(SAD_DetectedServer &server) = 0;
|
||||
};
|
||||
@@ -1,39 +1,47 @@
|
||||
#pragma once
|
||||
|
||||
#include "I_SAD_Client.hpp"
|
||||
#include <list>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class SAD_DetectedServer {
|
||||
|
||||
class SAD_DetectedServer;
|
||||
class I_SAD_Client {
|
||||
public:
|
||||
SAD_DetectedServer();
|
||||
SAD_DetectedServer(const SAD_DetectedServer &orig) {
|
||||
m_ID = orig.getID();
|
||||
m_Name = orig.getName();
|
||||
m_ComputerName = orig.getComputerName();
|
||||
m_IP = orig.getIP();
|
||||
m_ClientIP = orig.getClientIP();
|
||||
m_Port = orig.getPort();
|
||||
m_Additions = orig.getAdditions();
|
||||
virtual void eventServerDetected(SAD_DetectedServer &server) = 0;
|
||||
virtual void eventServerChanged(SAD_DetectedServer &server) = 0;
|
||||
virtual void eventServerLost(SAD_DetectedServer &server) = 0;
|
||||
};
|
||||
|
||||
class SAD_DetectedServer {
|
||||
public:
|
||||
SAD_DetectedServer(string p_Name, string p_ID, string p_ComputerName,
|
||||
string p_IP, string p_Port, string p_ClientIP,
|
||||
string p_Additions, string projName)
|
||||
: m_Name(p_Name),
|
||||
m_ID(p_ID),
|
||||
m_ComputerName(p_ComputerName),
|
||||
m_IP(p_IP),
|
||||
m_Port(p_Port),
|
||||
m_ClientIP(p_ClientIP),
|
||||
m_Additions(p_Additions),
|
||||
m_ServerProjectName(projName) {
|
||||
}
|
||||
~SAD_DetectedServer();
|
||||
|
||||
private:
|
||||
string m_ID;
|
||||
string m_Name;
|
||||
string m_ComputerName;
|
||||
string m_IP;
|
||||
string m_ClientIP;
|
||||
string m_Port;
|
||||
string m_Additions;
|
||||
string m_ServerProjectName;
|
||||
bool m_New;
|
||||
bool m_Changed;
|
||||
bool m_FoundAgain;
|
||||
string m_Name{};
|
||||
string m_ID{};
|
||||
string m_ComputerName{};
|
||||
string m_IP{};
|
||||
string m_Port{};
|
||||
string m_ClientIP{};
|
||||
string m_Additions{};
|
||||
string m_ServerProjectName{};
|
||||
bool m_New{true};
|
||||
bool m_Changed{};
|
||||
bool m_FoundAgain{};
|
||||
|
||||
public:
|
||||
string getID() const { return m_ID; }
|
||||
@@ -44,70 +52,91 @@ class SAD_DetectedServer {
|
||||
string getClientIP() const { return m_ClientIP; }
|
||||
string getAdditions() const { return m_Additions; }
|
||||
string getProjectName() const { return m_ServerProjectName; }
|
||||
|
||||
private:
|
||||
void setID(string p_ID) { m_ID = p_ID; }
|
||||
void setName(string p_Name) { m_Name = p_Name; }
|
||||
void setComputerName(string p_ComputerName) { m_ComputerName = p_ComputerName; }
|
||||
void setIP(string p_IP) { m_IP = p_IP; }
|
||||
void setClientIP(string p_IP) { m_ClientIP = p_IP; }
|
||||
void setPort(string p_Port) { m_Port = p_Port; }
|
||||
void setAdditions(string p_Additions) { m_Additions = p_Additions; }
|
||||
void setProjectName(string p_ServerProjectName);
|
||||
|
||||
bool getNew() const { return m_New; }
|
||||
bool getChanged() const { return m_Changed; }
|
||||
bool getFoundAgain() const { return m_FoundAgain; }
|
||||
|
||||
void setChanged() { m_Changed = true; }
|
||||
void setNew(bool p_New) { m_New = p_New; }
|
||||
void setKnown() { m_New = false; }
|
||||
void setFoundAgain() { m_FoundAgain = true; }
|
||||
void updateProjectName(string newProjectName) {
|
||||
m_ServerProjectName = newProjectName;
|
||||
if (m_ServerProjectName != newProjectName) {
|
||||
m_Changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
// SAD_Client m_ThreadSend will send to Multicast addresses
|
||||
void startCycleSAD() {
|
||||
void resetFlags() {
|
||||
m_Changed = false;
|
||||
m_FoundAgain = false;
|
||||
m_New = false;
|
||||
}
|
||||
|
||||
private:
|
||||
static unordered_map<string, SAD_DetectedServer *> s_DetectedServers;
|
||||
static unordered_map<string, unique_ptr<SAD_DetectedServer>> sKnownServers;
|
||||
|
||||
public:
|
||||
static const int PARAMINDEX_PRECODE = 0;
|
||||
static const int PARAMINDEX_SPITTASKID = 1;
|
||||
static const int PARAMINDEX_NAME = 2;
|
||||
static const int PARAMINDEX_ID = 3;
|
||||
static const int PARAMINDEX_COMPUTERNAME = 4;
|
||||
static const int PARAMINDEX_PORT = 5;
|
||||
static const int PARAMINDEX_CLIENTIP = 6;
|
||||
static const int PARAMINDEX_ADDITIONS = 7;
|
||||
static const int PARAMINDEX_SERVERPROJECTNAME = 8;
|
||||
static const int PARAMINDEX_IP = 9;
|
||||
static constexpr int PARAMINDEX_PRECODE = 0;
|
||||
static constexpr int PARAMINDEX_SPITTASKID = 1;
|
||||
static constexpr int PARAMINDEX_NAME = 2;
|
||||
static constexpr int PARAMINDEX_ID = 3;
|
||||
static constexpr int PARAMINDEX_COMPUTERNAME = 4;
|
||||
static constexpr int PARAMINDEX_PORT = 5;
|
||||
static constexpr int PARAMINDEX_CLIENTIP = 6;
|
||||
static constexpr int PARAMINDEX_ADDITIONS = 7;
|
||||
static constexpr int PARAMINDEX_SERVERPROJECTNAME = 8;
|
||||
static constexpr int PARAMINDEX_IP = 9;
|
||||
|
||||
/**
|
||||
* Used by SAD_Client to add a found SPITServer - don't use this manually
|
||||
* @param p_IsIP4 true = the server is reached via a IP4 address<br>false = the server is reahed via a IP6 address
|
||||
* @param p_ServerID the id of the server, every instance of a SPITServer has an own id
|
||||
* @param id the id of the server, every instance of a SPITServer has an own id
|
||||
* @param p_ServerParams the server's parameter
|
||||
*/
|
||||
static void addDetectedServer(string p_ServerID, string p_ServerParams[]);
|
||||
/**
|
||||
* Used by SAD_Client to remove a SPITServer - don't use this manually
|
||||
* @param p_DetectedServer
|
||||
*/
|
||||
static void removeDetectedServer(SAD_DetectedServer &server);
|
||||
/**
|
||||
* Used by SAD_Client to clear all found SPITServers - don't use this manually
|
||||
*/
|
||||
static void clearDetectedServers();
|
||||
/**
|
||||
* Used by SAD_Client internally - don't use this manually
|
||||
*/
|
||||
static void cycleStart();
|
||||
static void addDetectedServer(unique_ptr<SAD_DetectedServer> detected) {
|
||||
if (auto i = sKnownServers.find(detected->getID()); i != sKnownServers.end()) {
|
||||
auto &known = *(i->second.get());
|
||||
known.setFoundAgain();
|
||||
if (detected->getProjectName() != known.getProjectName()) {
|
||||
known.updateProjectName(detected->getProjectName());
|
||||
}
|
||||
return;
|
||||
}
|
||||
sKnownServers[detected->getID()] = move(detected);
|
||||
}
|
||||
static void removeDetectedServer(SAD_DetectedServer &server) {
|
||||
auto i = sKnownServers.find(server.getID());
|
||||
if (i != sKnownServers.end()) {
|
||||
sKnownServers.erase(i);
|
||||
}
|
||||
}
|
||||
static void clearDetectedServers() {
|
||||
sKnownServers.clear();
|
||||
}
|
||||
|
||||
static void resetServerFlags() {
|
||||
for (auto &srv : sKnownServers) {
|
||||
srv.second->resetFlags();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Used by SAD_Client internally -don't use this manually
|
||||
* @param p_SADClientInterface
|
||||
*/
|
||||
static void cycleEnd(I_SAD_Client &p_SADClientInterface);
|
||||
static void evaluateDetectedServers(I_SAD_Client &sadClient) {
|
||||
for (auto &srv : sKnownServers) {
|
||||
SAD_DetectedServer &known = *srv.second;
|
||||
if (known.getNew()) {
|
||||
known.setKnown();
|
||||
sadClient.eventServerDetected(known);
|
||||
} else if (known.getChanged()) {
|
||||
sadClient.eventServerChanged(known);
|
||||
} else if (known.getFoundAgain() == false) {
|
||||
sadClient.eventServerLost(known);
|
||||
removeDetectedServer(known);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a reference of the DetectedServer with the id p_ServerID.<br>
|
||||
@@ -115,5 +144,7 @@ class SAD_DetectedServer {
|
||||
* @param p_ServerID the id of the SPITServer
|
||||
* @return the reference of the SAD_DetectedServer instance with getID() == p_ServerID
|
||||
*/
|
||||
static const SAD_DetectedServer &getRefDetectedServer(string p_ServerID);
|
||||
static const SAD_DetectedServer &getRefDetectedServer(const string &id) {
|
||||
return *sKnownServers.at(id);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -16,76 +16,47 @@
|
||||
|
||||
#include "SPITType.h"
|
||||
#include "SPIT_Message.h"
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include "SpitRepo.hpp"
|
||||
|
||||
using namespace std;
|
||||
|
||||
class SPITObjectListener;
|
||||
|
||||
class SPITObject {
|
||||
private:
|
||||
static unordered_map<string, SPITObject *> s_SPITObjects;
|
||||
static unordered_map<string, SPITObject *> s_SPITObjectsRemote;
|
||||
|
||||
public:
|
||||
static SPITObject *getSPITObject(string p_ID);
|
||||
static const SPITObject &getSPITObjectRef(string p_ID);
|
||||
static bool addSPITObject(SPITObject *p_ptrSpitObject);
|
||||
static bool removeSPITObject(SPITObject *p_ptrSpitObject);
|
||||
static bool removeSPITObject(string p_SpitObjectID);
|
||||
static int getSPITObjectCount();
|
||||
static SPITObject *getSPITObject(int p_Index);
|
||||
static const SPITObject &getSPITObjectRef(int p_Index);
|
||||
static void clearSPITObjects();
|
||||
static void clearUnconfirmedSPITObjects();
|
||||
static void setConfirmedFalse();
|
||||
static void clearUnconfirmedSPITObjects(SpitRepo<SPITObject> &repo);
|
||||
static void setConfirmedFalse(SpitRepo<SPITObject> &repo);
|
||||
static void eventProjectClosed(SpitRepo<SPITObject> &repo, SpitRepo<SPITObject> &remoteRepo);
|
||||
|
||||
static SPITObject *getSPITObjectRemote(string p_ID);
|
||||
static const SPITObject &getSPITObjectRemoteRef(string p_ID);
|
||||
static bool addSPITObjectRemote(SPITObject *p_ptrSpitObject);
|
||||
static bool removeSPITObjectRemote(SPITObject *p_ptrSpitObject);
|
||||
static bool removeSPITObjectRemote(string p_SpitObjectID);
|
||||
static int getSPITObjectRemoteCount();
|
||||
static SPITObject *getSPITObjectRemote(int p_Index);
|
||||
static const SPITObject &getSPITObjectRemoteRef(int p_Index);
|
||||
static void clearSPITObjectsRemote();
|
||||
|
||||
static void eventProjectClosed();
|
||||
|
||||
SPITObject();
|
||||
// SPITObject(const SPITObject& orig);
|
||||
~SPITObject();
|
||||
SPITObject(string p_ID);
|
||||
|
||||
private:
|
||||
string m_ID;
|
||||
string m_Name;
|
||||
string m_SPITTypeID;
|
||||
string m_ServerParams;
|
||||
string m_Remark;
|
||||
bool m_Confirmed;
|
||||
bool m_Fixed;
|
||||
bool m_CreatedByClient;
|
||||
bool m_ServerRemote;
|
||||
bool m_ActionAssigned;
|
||||
bool m_ActionAssignedType; // Virtual construct
|
||||
long long m_FrameStart;
|
||||
long long m_FrameLength;
|
||||
long long m_FrameFadeInLength;
|
||||
long long m_FrameFadeOutLength;
|
||||
char m_ValueUse;
|
||||
int m_ValueFactor;
|
||||
int m_Track;
|
||||
long long m_Delay;
|
||||
long long m_Duration;
|
||||
string m_Name{};
|
||||
string m_SPITTypeID{};
|
||||
string m_ServerParams{};
|
||||
string m_Remark{};
|
||||
bool m_Confirmed{};
|
||||
bool m_Fixed{};
|
||||
bool m_CreatedByClient{};
|
||||
bool m_ServerRemote{};
|
||||
bool m_ActionAssigned{};
|
||||
bool m_ActionAssignedType{}; // Virtual construct
|
||||
long long m_FrameStart{};
|
||||
long long m_FrameLength{};
|
||||
long long m_FrameFadeInLength{};
|
||||
long long m_FrameFadeOutLength{};
|
||||
char m_ValueUse{0x01};
|
||||
int m_ValueFactor{1000000}; // Values are given in ppm -> 1000000 = 1/1;
|
||||
int m_Track{};
|
||||
long long m_Delay{};
|
||||
long long m_Duration{};
|
||||
|
||||
bool m_PlayPrePosition;
|
||||
long long m_PlayTimeInsideFrames;
|
||||
int m_PlayValue;
|
||||
char m_PlayValueFlag;
|
||||
|
||||
void initMembers();
|
||||
|
||||
public:
|
||||
string getID() const { return m_ID; }
|
||||
string getName() const { return m_Name; }
|
||||
@@ -95,7 +66,7 @@ class SPITObject {
|
||||
|
||||
/**
|
||||
* Returns if the SPITType triggers an action on the Server or on the client.
|
||||
* @return false = the action is triggered on the client The client waits for the server to play objects of this SPITType<br>
|
||||
* @return false = the action is triggered on the client The client waits for the server to play objects of this SPITType
|
||||
* true = the action is triggered on the server. The server waits for the client to play objects of this SPITType.
|
||||
*/
|
||||
bool getServerRemote() const { return m_ServerRemote; }
|
||||
@@ -106,16 +77,16 @@ class SPITObject {
|
||||
*/
|
||||
bool getConfirmed() const { return m_Confirmed; }
|
||||
bool getFixed() const { return m_Fixed; }
|
||||
bool getCreatedByClient() { return m_CreatedByClient; }
|
||||
bool getCreatedByClient() const { return m_CreatedByClient; }
|
||||
/**
|
||||
* This is a virtual construct - ActionAssignedType is not implemented in the SPITProtocol.<br>
|
||||
* This is used when an action is associated with a SPITType. <br>
|
||||
* This is a virtual construct - ActionAssignedType is not implemented in the SPITProtocol.
|
||||
* This is used when an action is associated with a SPITType.
|
||||
* Then this action is done for every SPITObject with the SPITType.
|
||||
* @return true = an action is assigned for the SPITType.
|
||||
*/
|
||||
bool getActionAssignedType() const { return m_ActionAssignedType; }
|
||||
/** Returns if this SPITObject has an associated action or not.<br>
|
||||
* @return true = the user has asscociated an action with this SPITObject or <br>
|
||||
/** Returns if this SPITObject has an associated action or not.
|
||||
* @return true = the user has asscociated an action with this SPITObject or
|
||||
* the user has asscociated an action with the SPITType of this SPITObject
|
||||
*/
|
||||
bool getActionAssigned() const { return m_ActionAssigned || m_ActionAssignedType; }
|
||||
@@ -132,24 +103,23 @@ class SPITObject {
|
||||
long long getDelay() const { return m_Delay; }
|
||||
long long getDuration() const { return m_Duration; }
|
||||
|
||||
bool getProjectIndepended() const {
|
||||
bool getProjectIndepended(SpitRepo<SPITType> &repo, SpitRepo<SPITType> &remoteRepo) const {
|
||||
SPITType *ptrSPITType;
|
||||
if (m_ServerRemote == false) {
|
||||
ptrSPITType = SPITType::getSPITType(m_SPITTypeID);
|
||||
if (ptrSPITType == NULL)
|
||||
ptrSPITType = repo.getEntry(m_SPITTypeID);
|
||||
if (ptrSPITType == nullptr)
|
||||
return true;
|
||||
return ptrSPITType->getProjectIndepended();
|
||||
} else {
|
||||
ptrSPITType = SPITType::getSPITTypeRemote(m_SPITTypeID);
|
||||
if (ptrSPITType == NULL)
|
||||
ptrSPITType = remoteRepo.getEntry(m_SPITTypeID);
|
||||
if (ptrSPITType == nullptr)
|
||||
return true;
|
||||
return ptrSPITType->getProjectIndepended();
|
||||
}
|
||||
};
|
||||
|
||||
void setID(string p_ID);
|
||||
bool setConfirmed(bool p_Confirmed);
|
||||
void setCreatedByClient(bool p_CreatedByClient);
|
||||
void setCreatedByClient(bool p_CreatedByClient) { m_CreatedByClient = p_CreatedByClient; }
|
||||
bool setName(string p_Name);
|
||||
bool setRemark(string p_Remark);
|
||||
bool setServerParams(string p_ServerParams);
|
||||
@@ -169,8 +139,8 @@ class SPITObject {
|
||||
bool setDuration(long long p_Duration);
|
||||
|
||||
bool setMessageOP(SPIT_Message::ReportSPITObject *p_ReportSPITObject);
|
||||
void fillMessageOP(SPIT_Message::ReportSPITObject *p_ReportSPITObject);
|
||||
void fillMessageOP(SPIT_Message::RemoveSPITObject *p_RemoveSPITObject);
|
||||
void fillMessageOP(SPIT_Message::ReportSPITObject &p_ReportSPITObject);
|
||||
void fillMessageOP(SPIT_Message::RemoveSPITObject &p_RemoveSPITObject);
|
||||
};
|
||||
|
||||
#endif /* SPITOBJECT_H */
|
||||
|
||||
@@ -23,13 +23,10 @@ class SPITPlayer {
|
||||
public:
|
||||
class PlaySPITType {
|
||||
public:
|
||||
PlaySPITType();
|
||||
PlaySPITType(SPITPlayer *p_SPITPlayer, string p_SPITObjectID);
|
||||
PlaySPITType(const PlaySPITType &orig);
|
||||
|
||||
string getSPITTypeID() const {
|
||||
return m_SPITTypeID;
|
||||
}
|
||||
string getSPITTypeID() const { return m_SPITTypeID; }
|
||||
|
||||
void startPlaySequence();
|
||||
bool getIsNew() const { return m_IsNew; }
|
||||
@@ -57,9 +54,9 @@ class SPITPlayer {
|
||||
//----- SPITPlayer ------
|
||||
public:
|
||||
// list the SPITPlayers
|
||||
static unordered_map<string, SPITPlayer *> s_SPITPlayers; // all actual played objects
|
||||
static SPITPlayer *getSPITPlayer(string p_PlayerID); // if a player does not exist creates a new one
|
||||
static void clearPlayers();
|
||||
static unordered_map<string, unique_ptr<SPITPlayer>> s_SPITPlayers; // all actual played objects
|
||||
static SPITPlayer &getSPITPlayer(string p_PlayerID); // if a player does not exist creates a new one
|
||||
static void clearPlayers() { s_SPITPlayers.clear(); }
|
||||
|
||||
SPITPlayer(string p_PlayerID);
|
||||
virtual ~SPITPlayer();
|
||||
@@ -72,21 +69,22 @@ class SPITPlayer {
|
||||
return m_ID;
|
||||
}
|
||||
|
||||
unordered_map<string, PlaySPITType *> *getPlaySPITTypes();
|
||||
unordered_map<string, unique_ptr<PlaySPITType>> &getPlaySPITTypes() { return m_PlaySPITTypes; }
|
||||
void setIsRunning(bool p_IsRunning) { m_IsRunning = p_IsRunning; }
|
||||
void setName(string p_Name) { m_Name = p_Name; }
|
||||
void setType(char p_Type) { m_Type = p_Type; }
|
||||
void setTime(long long p_Frames) { m_TimeFrames = p_Frames; }
|
||||
bool getIsRunning() { return m_IsRunning; }
|
||||
string getName() { return m_Name; }
|
||||
char getType() { return m_Type; }
|
||||
long long getTime() { return m_TimeFrames; }
|
||||
bool getIsRunning() const { return m_IsRunning; }
|
||||
string getName() const { return m_Name; }
|
||||
char getType() const { return m_Type; }
|
||||
long long getTime() const { return m_TimeFrames; }
|
||||
|
||||
private:
|
||||
string m_ID;
|
||||
string m_Name;
|
||||
char m_Type;
|
||||
unordered_map<string, PlaySPITType *> m_PlaySPITTypes;
|
||||
unordered_map<string, unique_ptr<PlaySPITType>> m_PlaySPITTypes;
|
||||
|
||||
bool m_IsRunning;
|
||||
long long m_TimeFrames;
|
||||
};
|
||||
|
||||
@@ -79,14 +79,6 @@ class SPITSocket {
|
||||
//-------- class --------------
|
||||
SPITSocket(IPAddress ip) : mOwnIp(ip) {
|
||||
m_UDPSocketIP4 = INVALID_SOCKET;
|
||||
|
||||
m_ServerIP = "";
|
||||
m_ServerPort = "";
|
||||
m_ClientIP = "";
|
||||
m_ClientPort = "";
|
||||
m_BoundClientPort = "";
|
||||
m_BoundClientFamily = 0;
|
||||
m_IsBound = false;
|
||||
createSocket_UDP();
|
||||
}
|
||||
virtual ~SPITSocket() {
|
||||
@@ -102,65 +94,56 @@ class SPITSocket {
|
||||
}
|
||||
|
||||
private:
|
||||
string m_ServerIP;
|
||||
string m_ServerPort;
|
||||
string m_ClientIP;
|
||||
string m_ClientPort; // port given by the user maybe "0"
|
||||
string m_BoundClientPort; // port set after bind
|
||||
int m_BoundClientFamily;
|
||||
bool m_IsBound;
|
||||
string m_ServerIP{};
|
||||
string m_ServerPort{};
|
||||
string m_ClientIP{};
|
||||
string m_ClientPort{}; // port given by the user maybe "0"
|
||||
string m_BoundClientPort{}; // port set after bind
|
||||
bool m_IsBound{};
|
||||
|
||||
public:
|
||||
/**
|
||||
* Sets the ip address and port for server and client.
|
||||
* @param p_ServerIP
|
||||
* @param p_ServerPort
|
||||
* @param p_ClientIP
|
||||
* @param p_ClientPort
|
||||
*/
|
||||
void setConnectionParams(string p_ServerIP, string p_ServerPort, string p_ClientIP, string p_ClientPort) {
|
||||
m_ServerIP = p_ServerIP;
|
||||
m_ServerPort = p_ServerPort;
|
||||
m_ClientIP = p_ClientIP;
|
||||
m_ClientPort = p_ClientPort;
|
||||
// Sets the ip address and port for server and client.
|
||||
void setConnectionParams(const string &serverIp, const string &serverPort, const string &clientIp, const string &clientPort) {
|
||||
m_ServerIP = serverIp;
|
||||
m_ServerPort = serverPort;
|
||||
m_ClientIP = clientIp;
|
||||
m_ClientPort = clientPort;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a message to the server as set by setConnectionParams
|
||||
* @param p_MessageBytes byte buffer containing the message
|
||||
* @param p_MessageLength length of the messaeg
|
||||
* @param message byte buffer containing the message
|
||||
* @param length length of the message
|
||||
* @return
|
||||
*/
|
||||
int sendMessage(const char *p_MessageBytes, int p_MessageLength) {
|
||||
if (m_ServerPort.length() <= 0)
|
||||
int sendMessage(const char *message, int length) {
|
||||
if (m_ServerPort.length() <= 0) {
|
||||
return -1;
|
||||
int intResult;
|
||||
{
|
||||
if (m_IsBound == false)
|
||||
return -1;
|
||||
intResult = sendMessageTo(m_BoundClientFamily, m_ServerIP, m_ServerPort, p_MessageBytes, p_MessageLength);
|
||||
}
|
||||
|
||||
if (m_IsBound == false) {
|
||||
return -1;
|
||||
}
|
||||
int intResult = sendMessageTo(m_ServerIP, m_ServerPort, message, length);
|
||||
return intResult;
|
||||
}
|
||||
|
||||
int receiveMessage(int p_InetFamily, char *p_Buffer, int p_BufferLength, string *p_ServerIP);
|
||||
int setBroadcast(bool p_Broadcast);
|
||||
int bindSocket(string p_ServerIP, string p_ClientIP, string p_ClientPort);
|
||||
int receiveMessage(char *p_Buffer, int p_BufferLength, string *serverIp) const;
|
||||
int setBroadcast(bool p_Broadcast) const;
|
||||
int bindSocket(string clientIp, string clientPort);
|
||||
|
||||
// * Internal usage - don't use this manually
|
||||
// * Use sendMessage instead
|
||||
int sendMessageTo(int p_InetFamily, string p_ServerIP, string p_Port, const char *p_MessageBytes, int p_MessageLength);
|
||||
int sendMessageTo(const string &ip, const string &port, const char *message, int msgLength);
|
||||
|
||||
string getServerIP() { return m_ServerIP; }
|
||||
string getServerPort() { return m_ServerPort; }
|
||||
string getClientIP() { return m_ClientIP; }
|
||||
string getClientPort() { return m_ClientPort; }
|
||||
string getBoundClientPort() { return m_BoundClientPort; }
|
||||
void setBoundClientPort(string p_Port) { m_BoundClientPort = p_Port; }
|
||||
void setBoundClientFamily(int p_Family) { m_BoundClientFamily = p_Family; }
|
||||
int getBoundClientFamily() { return m_BoundClientFamily; }
|
||||
string getServerIP() const { return m_ServerIP; }
|
||||
string getServerPort() const { return m_ServerPort; }
|
||||
string getClientIP() const { return m_ClientIP; }
|
||||
string getClientPort() const { return m_ClientPort; }
|
||||
string getBoundClientPort() const { return m_BoundClientPort; }
|
||||
void setBoundClientPort(const string &p_Port) { m_BoundClientPort = p_Port; }
|
||||
void setIsBound(bool p_IsBound) { m_IsBound = p_IsBound; }
|
||||
bool getIsBound() { return m_IsBound; }
|
||||
bool getIsBound() const { return m_IsBound; }
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
#endif /* SPITSOCKET_H */
|
||||
|
||||
@@ -16,55 +16,30 @@
|
||||
|
||||
#include "SPITSocket.h"
|
||||
#include "SPIT_Message.h"
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include "SpitRepo.hpp"
|
||||
|
||||
using namespace std;
|
||||
|
||||
class SPITTypeListener;
|
||||
|
||||
class SPITType {
|
||||
private:
|
||||
static unordered_map<string, SPITType *> s_SPITTypes;
|
||||
static unordered_map<string, SPITType *> s_SPITTypesRemote;
|
||||
|
||||
public:
|
||||
static SPITType *getSPITType(string p_ID);
|
||||
static const SPITType &getSPITTypeRef(string p_ID);
|
||||
static bool addSPITType(SPITType *p_ptrSpitType);
|
||||
static bool removeSPITType(SPITType *p_ptrSpitType);
|
||||
static int getSPITTypeCount();
|
||||
static SPITType *getSPITType(int p_Index);
|
||||
static const SPITType &getSPITTypeRef(int p_Index);
|
||||
static void clearSPITTypes();
|
||||
static void setConfirmedFalse();
|
||||
static void setConfirmedFalse(SpitRepo<SPITType> &repo);
|
||||
static void eventProjectClosed(SpitRepo<SPITType> &repo, SpitRepo<SPITType> &remoteRepo);
|
||||
|
||||
static SPITType *getSPITTypeRemote(string p_ID);
|
||||
static const SPITType &getSPITTypeRemoteRef(string p_ID);
|
||||
static bool addSPITTypeRemote(SPITType *p_ptrSpitType);
|
||||
static bool removeSPITTypeRemote(SPITType *p_ptrSpitType);
|
||||
static int getSPITTypeRemoteCount();
|
||||
static SPITType *getSPITTypeRemote(int p_Index);
|
||||
static const SPITType &getSPITTypeRemoteRef(int p_Index);
|
||||
static void clearSPITTypesRemote();
|
||||
|
||||
static void eventProjectClosed();
|
||||
|
||||
SPITType();
|
||||
SPITType(string p_ID);
|
||||
SPITType(string p_ID, string p_GroupName, string p_Name, bool p_Fixed, bool p_ProjectIndepended, long long p_DefaultDelay, long long p_DefaultDuration);
|
||||
// SPITType(const SPITType& orig);
|
||||
~SPITType();
|
||||
|
||||
private:
|
||||
bool m_Confirmed;
|
||||
bool m_Confirmed{};
|
||||
string m_ID;
|
||||
bool m_Fixed;
|
||||
bool m_ServerRemote;
|
||||
bool m_ServerProjectIndepended;
|
||||
string m_GroupName;
|
||||
string m_Name;
|
||||
long long m_DefaultDelay;
|
||||
long long m_DefaultDuration;
|
||||
bool m_Fixed{};
|
||||
bool m_ServerRemote{};
|
||||
bool m_ServerProjectIndepended{};
|
||||
string m_GroupName{};
|
||||
string m_Name{};
|
||||
long long m_DefaultDelay{};
|
||||
long long m_DefaultDuration{};
|
||||
|
||||
bool m_CreatedByClient; // flag true = the SPITTyype is created by the client
|
||||
// false = the SPITType is received from the server
|
||||
@@ -72,24 +47,17 @@ class SPITType {
|
||||
bool m_ActionAssigned; // This is a virtual flag if user associates an action with a SPITType.
|
||||
// Can be used to setActionAssigned for all SPITObjects with this SPITType
|
||||
|
||||
void initMembers();
|
||||
|
||||
public:
|
||||
string getID() const { return m_ID; }
|
||||
string getGroupName() const { return m_GroupName; }
|
||||
string getName() const { return m_Name; }
|
||||
/**
|
||||
* Returns if the SPITType triggers an action on the Server or on the client.
|
||||
* @return false = the action is triggered on the client The client waits for the server to play objects of this SPITType<br>
|
||||
* @return false = the action is triggered on the client The client waits for the server to play objects of this SPITType
|
||||
* true = the action is triggered on the server. The server waits for the client to play objects of this SPITType.
|
||||
*/
|
||||
bool getServerRemote() const {
|
||||
return m_ServerRemote;
|
||||
}
|
||||
|
||||
bool getProjectIndepended() const {
|
||||
return m_ServerProjectIndepended;
|
||||
}
|
||||
bool getServerRemote() const { return m_ServerRemote; }
|
||||
bool getProjectIndepended() const { return m_ServerProjectIndepended; }
|
||||
/**
|
||||
* This is used by the server and client to tell if the other side has registered the changes.
|
||||
* @return true = other side has registered the changes.
|
||||
@@ -101,40 +69,36 @@ class SPITType {
|
||||
bool getCreatedByClient() const { return m_CreatedByClient; }
|
||||
|
||||
/**
|
||||
* Virtual construct - means ActionAssigned for SPITTypes is is not implemented in SPITProtocol.<br>
|
||||
* This can used to setActionAssigned to all SPITObjects with this SPITType.<br>
|
||||
* This may be used in the case when the same action should be done for every SPITObject with this SPITType associated.<br>
|
||||
* Virtual construct - means ActionAssigned for SPITTypes is is not implemented in SPITProtocol.
|
||||
* This can used to setActionAssigned to all SPITObjects with this SPITType.
|
||||
* This may be used in the case when the same action should be done for every SPITObject with this SPITType associated.
|
||||
* @return true = the user has associated an action with this SPITType.
|
||||
*/
|
||||
bool getActionAssigned() const {
|
||||
return m_ActionAssigned;
|
||||
}
|
||||
|
||||
public:
|
||||
void setID(string p_ID);
|
||||
bool setGroupName(string p_GroupName);
|
||||
bool setName(string p_Name);
|
||||
bool setGroupName(const string &p_GroupName);
|
||||
bool setName(const string &p_Name);
|
||||
bool setServerRemote(bool p_BelongstoServer);
|
||||
bool setProjectIndepended(bool p_ProjectIndepeneded);
|
||||
bool setConfirmed(bool p_Confirmed);
|
||||
bool setFixed(bool p_Fixed);
|
||||
bool setDefaultDelay(long long p_Delay);
|
||||
bool setDefaultDuration(long long p_Duration);
|
||||
|
||||
void setCreatedByClient(bool p_CreatedByClient);
|
||||
|
||||
/**
|
||||
* Virtual construct - means ActionAssigned for SPITTypes is is not implemented in SPITProtocol.<br>
|
||||
* This can used to setActionAssigned to all SPITObjects with this SPITType.<br>
|
||||
* This may be used in the case when the same action should be done for every SPITObject with this SPITType associated.<br>
|
||||
* Virtual construct - means ActionAssigned for SPITTypes is is not implemented in SPITProtocol.
|
||||
* This can used to setActionAssigned to all SPITObjects with this SPITType.
|
||||
* This may be used in the case when the same action should be done for every SPITObject with this SPITType associated.
|
||||
* @return true = the m_ActionAssigned has changed.
|
||||
*/
|
||||
bool setActionAssigned(bool p_ActionAssigned);
|
||||
|
||||
bool setMessageOP(SPIT_Message::ReportSPITType *p_ReportSPITType);
|
||||
void fillMessageOP(SPIT_Message::ReportSPITType *p_ReportSPITType);
|
||||
void fillMessageOP(SPIT_Message::RemoveSPITType *p_RemoveSPITType);
|
||||
// static char* stringCopy(const char* p_String);
|
||||
bool setMessageOP(SPIT_Message::ReportSPITType &reportSpitType);
|
||||
void fillMessageOP(SPIT_Message::ReportSPITType &smReportSpitType) const;
|
||||
void fillMessageOP(SPIT_Message::RemoveSPITType &smRemoveSpitType) const;
|
||||
};
|
||||
|
||||
#endif /* SPITTYPE_H */
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "SPITSocket.h"
|
||||
#include "SPITType.h"
|
||||
#include "SPIT_Message.h"
|
||||
#include "SpitRepo.hpp"
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
@@ -32,10 +33,10 @@ class SPIT_Client : I_SAD_Client {
|
||||
static const int MAXSPITMESSAGEBYTECOUNT = 512;
|
||||
|
||||
enum class ProjUpdate {
|
||||
ServerLoaded,
|
||||
StartTransfer,
|
||||
EndTransfer,
|
||||
ServerClosed,
|
||||
ServerLoaded,
|
||||
StartTransfer,
|
||||
EndTransfer,
|
||||
ServerClosed,
|
||||
};
|
||||
enum class ServerEvent {
|
||||
Detect,
|
||||
@@ -47,69 +48,60 @@ class SPIT_Client : I_SAD_Client {
|
||||
Changed,
|
||||
Deleted
|
||||
};
|
||||
enum class Connection {
|
||||
None = 0, // No Connection established.<br>Either no connect tried or disconnected
|
||||
NoneServer = 1, // Server has disconnected
|
||||
Lost = 2, // The connection is lost<br>Either because of a network crash or because the server no longer responds.
|
||||
Ok = 3, // Connection to the serv er is established.
|
||||
TryConnection = 4, // A connection to the server is tried.
|
||||
};
|
||||
|
||||
struct Callbacks {
|
||||
void (*onServerEvent)(ServerEvent event, const SAD_DetectedServer &p_DetectedServer){};
|
||||
void (*onConnectionStatus)(string p_ServerID, string p_ServerComputerName, string p_ServerName, int p_ServerStepTime, int p_ConnectionStatus, int p_OldConnectionStatus){};
|
||||
void (*onConnectionStatus)(string p_ServerID, string p_ServerComputerName, string p_ServerName, int p_ServerStepTime, Connection p_ConnectionStatus, Connection p_OldConnectionStatus){};
|
||||
void (*onProjectUpdate)(ProjUpdate state, string projectId){};
|
||||
|
||||
void (*onSpitType)(ObjectEvent event, const SPITType &p_SPITType){};
|
||||
void (*onSpitTypeRemote)(ObjectEvent event, const SPITType &p_SPITType){};
|
||||
void (*onSpitObject)(ObjectEvent event, const SPITType &p_SPITType, const SPITObject &p_SPITObject){};
|
||||
void (*onSpitObjectRemote)(ObjectEvent event, const SPITType &p_SPITType, const SPITObject &p_SPITObject){};
|
||||
void (*onSpitType)(ObjectEvent event, bool isRemote, const SPITType &p_SPITType){};
|
||||
void (*onSpitObject)(ObjectEvent event, bool isRemote, const SPITType &p_SPITType, const SPITObject &p_SPITObject){};
|
||||
|
||||
void (*onPlay)(string p_PlayerID, string p_PlayerName, char p_PlayerType, bool p_PlayerIsRunning, long long p_TimeFrames){};
|
||||
void (*onPlaySpitType)(string p_PlayerID, string p_SPITTypeID, bool p_PlayerIsRunning, bool p_Started, bool p_Ended, double p_Value){};
|
||||
void (*onPlayRemoteObjectStatus)(const SPITType &p_SPITType, const SPITObject &p_SPITObject, long long p_FrameInsideObject, int p_Value){};
|
||||
bool (*onCheckSpitTypeVeto)(SPIT_Message::ReportSPITType *p_ReportSPITType){};
|
||||
bool (*onCheckSpitObjectVeto)(SPIT_Message::ReportSPITObject *p_ReportSPITObject){};
|
||||
bool (*onCheckSpitTypeVeto)(bool knownType, bool createdByClient){};
|
||||
bool (*onCheckSpitObjectVeto)(bool knownType){};
|
||||
};
|
||||
|
||||
//----- Connection Status -----
|
||||
public:
|
||||
/** No Connection established.<br>Either no connect tried or disconnected*/
|
||||
static const int CONNECTION_NONE = 0;
|
||||
/** Server has disconnected*/
|
||||
static const int CONNECTION_NONESERVER = 1;
|
||||
/** The connection is lost<br>Either because of a network crash or because the server no longer responds.*/
|
||||
static const int CONNECTION_LOST = 2;
|
||||
/** Connection to the serv er is established.*/
|
||||
static const int CONNECTION_OK = 3;
|
||||
/** A connection to the server is tried.*/
|
||||
static const int CONNECTION_TRYCONNECTION = 4;
|
||||
|
||||
//------ PlayerType ------
|
||||
public:
|
||||
/** continous main player, time value can be used like a timecode.<br>The time value is the position in server's project.<br>A server should use only one main player.*/
|
||||
static const char PLAYERTYPE_MAIN = 0x02;
|
||||
static constexpr char PLAYERTYPE_MAIN = 0x02;
|
||||
/** continous player. This player plays SPIT objects sometime during the project.*/
|
||||
static const char PLAYERTYPE_CONTINOUS = 0x01;
|
||||
static constexpr char PLAYERTYPE_CONTINOUS = 0x01;
|
||||
/** diescrete player. This player is used to transmit single discrete values.*/
|
||||
static const char PLAYERTYPE_DISCRETE = 0x00;
|
||||
static constexpr char PLAYERTYPE_DISCRETE = 0x00;
|
||||
|
||||
//------ Value Flag ------
|
||||
//------ used by sendRemoteObject
|
||||
public:
|
||||
/**Set the given value directly*/
|
||||
static const char VALUEFLAG_DIRECT = 0x00;
|
||||
static constexpr char VALUEFLAG_DIRECT = 0x00;
|
||||
/**Increase the existing value by the given value.<br>This is usefull e.g. when instead of a fader a endless wheel is used*/
|
||||
static const char VALUEFLAG_INCREASE = 0x01;
|
||||
static constexpr char VALUEFLAG_INCREASE = 0x01;
|
||||
/**Decrease the existing value by the given value.<br>This is usefull e.g. when instead of a fader a endless wheel is used*/
|
||||
static const char VALUEFLAG_DECREASE = 0x02;
|
||||
static constexpr char VALUEFLAG_DECREASE = 0x02;
|
||||
static constexpr int MAX_OVERTAKING_SPIT_MESSAGES = 10;
|
||||
|
||||
//----- SPIT_Client -----
|
||||
public:
|
||||
SPIT_Client(string name, string projName, Callbacks calls);
|
||||
virtual ~SPIT_Client();
|
||||
static int s_MAX_OVERTAKING_SPIT_MESSAGES;
|
||||
|
||||
private:
|
||||
Callbacks mCallbacks;
|
||||
|
||||
fos::TaskT<SPIT_Client &> *m_ThreadReceive{};
|
||||
bool m_StopReceiveSPITMessages;
|
||||
bool m_StopReceiveSPITMessages{};
|
||||
|
||||
int m_ConnectionStatus;
|
||||
Connection m_ConnectionStatus{Connection::None};
|
||||
bool m_DisconnectedByServer{}; // flag true = when server disconnects
|
||||
string m_ID;
|
||||
string m_Name;
|
||||
@@ -118,9 +110,9 @@ class SPIT_Client : I_SAD_Client {
|
||||
|
||||
string m_ClientProjectName;
|
||||
|
||||
unsigned char m_MessageNumber_Send;
|
||||
int m_MessageNumber_Received;
|
||||
vector<SPIT_Message *> m_OvertakingSPIT_Messages;
|
||||
uint8_t m_MessageNumber_Send{1};
|
||||
int m_MessageNumber_Received{-1}; // set to -1 because the first received message will set the number (1..255)
|
||||
vector<unique_ptr<SPIT_Message>> m_OvertakingSPIT_Messages;
|
||||
|
||||
// Server's info filled by parseConnectAnswer
|
||||
string m_ServerID{};
|
||||
@@ -181,8 +173,7 @@ class SPIT_Client : I_SAD_Client {
|
||||
// Reconnect to the server when connection is lost see eventConnectionStatus and eventServerDetected
|
||||
bool _doReconnect{}; // true = on eventServerDetected connect to the server identified by m_ServerID
|
||||
public:
|
||||
void fillHeader(SPIT_Message::Header *p_Header);
|
||||
int sendSPITMessage(SPIT_Message::OPPart &p_SPITMessageOPPart);
|
||||
int sendSPITMessage(SPIT_Message::OPPart & spitMessageOPPart);
|
||||
|
||||
//--------------- ServerAutoDetection SAD ---------------
|
||||
public:
|
||||
@@ -216,15 +207,15 @@ class SPIT_Client : I_SAD_Client {
|
||||
void disconnect();
|
||||
|
||||
private:
|
||||
void disconnectInternal(int p_Cause);
|
||||
void disconnectInternal(Connection p_Cause);
|
||||
void resetMessageNumberReceived();
|
||||
void parseSPIT_Message(unique_ptr<SPIT_Message> p_SPITMessage);
|
||||
void checkParseSPIT_Message(unique_ptr<SPIT_Message> p_SPITMessage);
|
||||
void addOvertakingSPIT_Message(SPIT_Message *p_SPIT_Message);
|
||||
void parseConnectAnswer(SPIT_Message::ConnectAnswer *p_ConnectAnswer);
|
||||
void parseDisconnect(SPIT_Message::Disconnect *p_Disconnect);
|
||||
void parseWatchdog(SPIT_Message::Watchdog *p_Watchdog);
|
||||
void parseWatchdogAnswer(SPIT_Message::WatchdogAnswer *p_WatchdogAnswer);
|
||||
void addOvertakingSPIT_Message(unique_ptr<SPIT_Message> p_SPIT_Message);
|
||||
void parseConnectAnswer(SPIT_Message::ConnectAnswer &p_ConnectAnswer);
|
||||
void parseDisconnect(SPIT_Message::Disconnect &p_Disconnect);
|
||||
void parseWatchdog(SPIT_Message::Watchdog &p_Watchdog);
|
||||
void parseWatchdogAnswer(SPIT_Message::WatchdogAnswer &p_WatchdogAnswer);
|
||||
|
||||
public:
|
||||
/** Used internally*/
|
||||
@@ -233,8 +224,8 @@ class SPIT_Client : I_SAD_Client {
|
||||
void eventWatchdogLost();
|
||||
//--------------- SPIT Project ---------------
|
||||
private:
|
||||
void parseReportSPITProject(SPIT_Message::ReportSPITProject *p_ReportSPITProject);
|
||||
void parseCloseSPITProject(SPIT_Message::CloseSPITProject *p_CloseSPITProject);
|
||||
void parseReportSPITProject(SPIT_Message::ReportSPITProject &p_ReportSPITProject);
|
||||
void parseCloseSPITProject(SPIT_Message::CloseSPITProject &p_CloseSPITProject);
|
||||
|
||||
public:
|
||||
/** Returns the SPITServer's project ID - may be the same as the project's name*/
|
||||
@@ -245,9 +236,9 @@ class SPIT_Client : I_SAD_Client {
|
||||
int getServerFramesPerSecond();
|
||||
|
||||
private:
|
||||
void parseRequestProjectTransfer(SPIT_Message::RequestProjectTransfer *p_RequestProjectTransfer);
|
||||
void parseStartProjectTransfer(SPIT_Message::StartProjectTransfer *p_StartProjectTransfer);
|
||||
void parseEndProjectTransfer(SPIT_Message::EndProjectTransfer *p_EndProjectTransfer);
|
||||
void parseRequestProjectTransfer(SPIT_Message::RequestProjectTransfer &p_RequestProjectTransfer);
|
||||
void parseStartProjectTransfer(SPIT_Message::StartProjectTransfer &p_StartProjectTransfer);
|
||||
void parseEndProjectTransfer(SPIT_Message::EndProjectTransfer &p_EndProjectTransfer);
|
||||
|
||||
public:
|
||||
static void sendProject(SPIT_Client *p_PtrSPIT_Client);
|
||||
@@ -283,9 +274,9 @@ class SPIT_Client : I_SAD_Client {
|
||||
|
||||
private:
|
||||
// receive SPITTypes
|
||||
void parseReportSPITType(SPIT_Message::ReportSPITType *p_ReportSPITType);
|
||||
void parseRemoveSPITType(SPIT_Message::RemoveSPITType *p_RemoveSPITType);
|
||||
int sendSPITTypeInternal(SPITType *p_SPITType);
|
||||
void parseReportSPITType(SPIT_Message::ReportSPITType &p_ReportSPITType);
|
||||
void parseRemoveSPITType(SPIT_Message::RemoveSPITType &p_RemoveSPITType);
|
||||
int sendSPITTypeInternal(SPITType &p_SPITType);
|
||||
|
||||
public:
|
||||
/**
|
||||
@@ -306,8 +297,8 @@ class SPIT_Client : I_SAD_Client {
|
||||
public:
|
||||
//--------------- SPIT Objects ---------------
|
||||
private:
|
||||
void parseReportSPITObject(SPIT_Message::ReportSPITObject *p_ReportSPITObject);
|
||||
void parseRemoveSPITObject(SPIT_Message::RemoveSPITObject *p_RemoveSPITObject);
|
||||
void parseReportSPITObject(SPIT_Message::ReportSPITObject &p_ReportSPITObject);
|
||||
void parseRemoveSPITObject(SPIT_Message::RemoveSPITObject &p_RemoveSPITObject);
|
||||
int sendSPITObjectInternal(SPITObject *ptrSPITObject);
|
||||
|
||||
public:
|
||||
@@ -329,10 +320,10 @@ class SPIT_Client : I_SAD_Client {
|
||||
public:
|
||||
//--------------- Play SPIT Objects ---------------
|
||||
private:
|
||||
void parsePlaySPITStart(SPIT_Message::PlaySPITStart *p_PlaySPITStart);
|
||||
void parsePlaySPITObject(SPIT_Message::PlaySPITObject *p_PlaySPITObject);
|
||||
void parsePlaySPITEnd(SPIT_Message::PlaySPITEnd *p_PlaySPITEnd);
|
||||
void parseReportPlayStatus(SPIT_Message::ReportPlayStatus *p_ReportPlayStatus);
|
||||
void parsePlaySPITStart(SPIT_Message::PlaySPITStart &p_PlaySPITStart);
|
||||
void parsePlaySPITObject(SPIT_Message::PlaySPITObject &p_PlaySPITObject);
|
||||
void parsePlaySPITEnd(SPIT_Message::PlaySPITEnd &p_PlaySPITEnd);
|
||||
void parseReportPlayStatus(SPIT_Message::ReportPlayStatus &p_ReportPlayStatus);
|
||||
|
||||
public:
|
||||
//--------- Remote ----------
|
||||
@@ -341,13 +332,18 @@ class SPIT_Client : I_SAD_Client {
|
||||
private:
|
||||
static void processSocketTask(SPIT_Client &instance);
|
||||
fos::TaskT<SPIT_Client &> *sThread{};
|
||||
bool abortSearch{};
|
||||
bool mAbortSearch{};
|
||||
bool sAnswered{};
|
||||
static fos::Semaphore sStartSad;
|
||||
SPITSocket *mSPITSocket;
|
||||
void answerWatchdog() {
|
||||
sAnswered = true;
|
||||
}
|
||||
|
||||
SpitRepo<SPITObject> mSpitObjects;
|
||||
SpitRepo<SPITObject> mRemoteSpitObjects;
|
||||
SpitRepo<SPITType> mSpitTypes;
|
||||
SpitRepo<SPITType> mRemoteSpitTypes;
|
||||
};
|
||||
|
||||
#endif /* SPIT_CLIENT_H */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,68 @@
|
||||
#pragma once
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
template <typename T>
|
||||
class SpitRepo {
|
||||
public:
|
||||
bool hasEntry(const string &id) {
|
||||
return mEntries.contains(id);
|
||||
}
|
||||
|
||||
T *getEntry(const string &id) {
|
||||
auto i = mEntries.find(id);
|
||||
if (i == mEntries.end()) {
|
||||
return nullptr;
|
||||
}
|
||||
return i->second.get();
|
||||
}
|
||||
|
||||
const T &getEntryRef(const string &id) {
|
||||
return *mEntries.at(id);
|
||||
}
|
||||
|
||||
T *getEntry(int index) {
|
||||
if (index >= 0 && index < mEntries.size()) {
|
||||
return next(mEntries.begin(), index)->second.get();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
const T &getEntryRef(int index) {
|
||||
if (index >= 0 && index < mEntries.size()) {
|
||||
auto i = next(mEntries.begin(), index);
|
||||
return *i->second;
|
||||
} else {
|
||||
throw "SPITObject index out of range";
|
||||
}
|
||||
}
|
||||
|
||||
void addEntry(unique_ptr<T> entry) {
|
||||
mEntries[entry->getID()] = move(entry);
|
||||
}
|
||||
bool removeEntry(const T &entry) {
|
||||
return removeEntry(entry.getID());
|
||||
}
|
||||
bool removeEntry(const string &id) {
|
||||
auto i = mEntries.find(id);
|
||||
if (i == mEntries.end()) {
|
||||
return false;
|
||||
}
|
||||
mEntries.erase(i);
|
||||
return true;
|
||||
}
|
||||
int getEntryCount() {
|
||||
return mEntries.size();
|
||||
}
|
||||
|
||||
unordered_map<string, unique_ptr<T>> &getRepo() {
|
||||
return mEntries;
|
||||
}
|
||||
|
||||
void clearEntries() {
|
||||
mEntries.clear();
|
||||
}
|
||||
|
||||
private:
|
||||
unordered_map<string, unique_ptr<T>> mEntries;
|
||||
};
|
||||
@@ -1,133 +0,0 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
/*
|
||||
* SAD_DetectedServer holds information about SPIT Server detected by ServerAutoDetection (SAD).
|
||||
* File: SAD_DetectedServer.cpp
|
||||
* Author: Hagi
|
||||
*
|
||||
* Created on 4. Mai 2019, 13:51
|
||||
*/
|
||||
|
||||
#include "SAD_DetectedServer.hpp"
|
||||
#include "esp_log.h"
|
||||
|
||||
static const char *TAG = "SpitSrv";
|
||||
|
||||
unordered_map<string, SAD_DetectedServer *> SAD_DetectedServer::s_DetectedServers;
|
||||
|
||||
SAD_DetectedServer::~SAD_DetectedServer() {
|
||||
}
|
||||
//----- Detected Server -----
|
||||
SAD_DetectedServer::SAD_DetectedServer() {
|
||||
m_ID = "";
|
||||
m_Name = "";
|
||||
m_ComputerName = "";
|
||||
m_ClientIP = "";
|
||||
m_Port = "";
|
||||
m_Additions = "";
|
||||
}
|
||||
|
||||
void SAD_DetectedServer::setProjectName(string p_ServerProjectName) {
|
||||
if (m_ServerProjectName.compare(p_ServerProjectName) != 0) {
|
||||
if (m_New == false) {
|
||||
m_Changed = true;
|
||||
}
|
||||
}
|
||||
m_ServerProjectName = p_ServerProjectName;
|
||||
}
|
||||
|
||||
void SAD_DetectedServer::cycleStart() {
|
||||
for (auto i = s_DetectedServers.begin(); i != s_DetectedServers.end(); i++) {
|
||||
i->second->startCycleSAD();
|
||||
}
|
||||
}
|
||||
void SAD_DetectedServer::cycleEnd(I_SAD_Client &sadClient) {
|
||||
for (auto &srv : s_DetectedServers) {
|
||||
SAD_DetectedServer *ptrDetectedServer = srv.second;
|
||||
if (ptrDetectedServer->getFoundAgain() == false) {
|
||||
sadClient.eventServerLost(*ptrDetectedServer);
|
||||
removeDetectedServer(*ptrDetectedServer);
|
||||
} else if (ptrDetectedServer->getNew()) {
|
||||
ptrDetectedServer->setNew(false);
|
||||
sadClient.eventServerDetected(*ptrDetectedServer);
|
||||
} else if (ptrDetectedServer->getChanged()) {
|
||||
sadClient.eventServerChanged(*ptrDetectedServer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Used by SAD_Client to add a found SPITServer - don't use this manually
|
||||
* @param p_IsIP4 true = the server is reached via a IP4 address<br>false = the server is reahed via a IP6 address
|
||||
* @param p_ServerID the id of the server, every instance of a SPITServer has an own id
|
||||
* @param p_ServerParams the server's parameter
|
||||
*/
|
||||
void SAD_DetectedServer::addDetectedServer(string p_ServerID, string p_ServerParams[]) {
|
||||
SAD_DetectedServer *ptrDetectedServer;
|
||||
{
|
||||
auto i = s_DetectedServers.find(p_ServerID);
|
||||
if (i != s_DetectedServers.end()) {
|
||||
ptrDetectedServer = i->second;
|
||||
} else {
|
||||
ptrDetectedServer = new SAD_DetectedServer();
|
||||
ptrDetectedServer->setID(p_ServerParams[PARAMINDEX_ID]);
|
||||
ptrDetectedServer->setNew(true);
|
||||
}
|
||||
ptrDetectedServer->setFoundAgain();
|
||||
|
||||
// second prefer IP4
|
||||
ptrDetectedServer->setIP(p_ServerParams[PARAMINDEX_IP]);
|
||||
ptrDetectedServer->setClientIP(p_ServerParams[PARAMINDEX_CLIENTIP]);
|
||||
ptrDetectedServer->setName(p_ServerParams[PARAMINDEX_NAME]);
|
||||
ptrDetectedServer->setComputerName(p_ServerParams[PARAMINDEX_COMPUTERNAME]);
|
||||
ptrDetectedServer->setPort(p_ServerParams[PARAMINDEX_PORT]);
|
||||
ptrDetectedServer->setAdditions(p_ServerParams[PARAMINDEX_ADDITIONS]);
|
||||
ptrDetectedServer->setProjectName(p_ServerParams[PARAMINDEX_SERVERPROJECTNAME]);
|
||||
|
||||
s_DetectedServers[ptrDetectedServer->getID()] = ptrDetectedServer;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Used by SAD_Client to remove a SPITServer - don't use this manually
|
||||
* @param p_DetectedServer
|
||||
*/
|
||||
void SAD_DetectedServer::removeDetectedServer(SAD_DetectedServer &server) {
|
||||
auto i = s_DetectedServers.find(server.getID());
|
||||
if (i != s_DetectedServers.end()) {
|
||||
SAD_DetectedServer *o_DetectedServer = i->second;
|
||||
i = s_DetectedServers.erase(i);
|
||||
delete o_DetectedServer;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Used by SAD_Client to clear all found SPITServers - don't use this manually
|
||||
*/
|
||||
void SAD_DetectedServer::clearDetectedServers() {
|
||||
for (auto i = s_DetectedServers.begin(); i != s_DetectedServers.end(); i++) {
|
||||
SAD_DetectedServer *ptrDetectedServer = i->second;
|
||||
i = s_DetectedServers.erase(i);
|
||||
delete ptrDetectedServer;
|
||||
if (i == s_DetectedServers.end()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const SAD_DetectedServer &SAD_DetectedServer::getRefDetectedServer(string p_ServerID) {
|
||||
SAD_DetectedServer *ptrDetectedServer = nullptr;
|
||||
|
||||
auto i = s_DetectedServers.find(p_ServerID);
|
||||
if (i != s_DetectedServers.end()) {
|
||||
ptrDetectedServer = i->second;
|
||||
}
|
||||
if (ptrDetectedServer != NULL) {
|
||||
return *ptrDetectedServer;
|
||||
}
|
||||
|
||||
throw new exception();
|
||||
}
|
||||
@@ -14,280 +14,50 @@
|
||||
|
||||
#include "SPITObject.h"
|
||||
#include "SPITSocket.h"
|
||||
|
||||
unordered_map<string, SPITObject *> SPITObject::s_SPITObjects;
|
||||
unordered_map<string, SPITObject *> SPITObject::s_SPITObjectsRemote;
|
||||
|
||||
SPITObject *SPITObject::getSPITObject(string p_ID) {
|
||||
{
|
||||
auto i = s_SPITObjects.find(p_ID);
|
||||
if (i == s_SPITObjects.end()) {
|
||||
return NULL;
|
||||
}
|
||||
return i->second;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Returns the reference of the SPITObject with ID == p_ID.<br>
|
||||
* Throws an exception if no SPITObject is not found.<br>
|
||||
* @param p_ID the ID
|
||||
* @return reference of the SPITType with ID == p_ID
|
||||
*/
|
||||
const SPITObject &SPITObject::getSPITObjectRef(string p_ID) {
|
||||
{
|
||||
auto i = s_SPITObjects.find(p_ID);
|
||||
if (i == s_SPITObjects.end()) {
|
||||
throw "SPITObject no SPITObject with given id";
|
||||
}
|
||||
return *(i->second);
|
||||
}
|
||||
}
|
||||
|
||||
SPITObject *SPITObject::getSPITObjectRemote(string p_ID) {
|
||||
{
|
||||
auto i = s_SPITObjectsRemote.find(p_ID);
|
||||
if (i == s_SPITObjectsRemote.end()) {
|
||||
return NULL;
|
||||
}
|
||||
return i->second;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Returns the reference of the remote SPITObject with ID == p_ID.<br>
|
||||
* Throws an exception if no SPITObject is not found.<br>
|
||||
* @param p_ID the ID
|
||||
* @return reference of the SPITType with ID == p_ID
|
||||
*/
|
||||
const SPITObject &SPITObject::getSPITObjectRemoteRef(string p_ID) {
|
||||
{
|
||||
auto i = s_SPITObjectsRemote.find(p_ID);
|
||||
if (i == s_SPITObjectsRemote.end()) {
|
||||
throw "Remote SPITObject no SPITObject with given id";
|
||||
}
|
||||
return *(i->second);
|
||||
}
|
||||
}
|
||||
|
||||
bool SPITObject::addSPITObject(SPITObject *p_ptrSPITObject) {
|
||||
if (p_ptrSPITObject == NULL)
|
||||
return false;
|
||||
{
|
||||
s_SPITObjects[p_ptrSPITObject->getID()] = p_ptrSPITObject;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
bool SPITObject::addSPITObjectRemote(SPITObject *p_ptrSPITObject) {
|
||||
if (p_ptrSPITObject == NULL)
|
||||
return false;
|
||||
{
|
||||
s_SPITObjectsRemote[p_ptrSPITObject->getID()] = p_ptrSPITObject;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
bool SPITObject::removeSPITObject(SPITObject *p_ptrSPITObject) {
|
||||
if (p_ptrSPITObject == NULL)
|
||||
return false;
|
||||
return removeSPITObject(p_ptrSPITObject->getID());
|
||||
}
|
||||
bool SPITObject::removeSPITObject(string p_SPITObjectID) {
|
||||
{
|
||||
auto i = s_SPITObjects.find(p_SPITObjectID);
|
||||
if (i == s_SPITObjects.end()) {
|
||||
return false;
|
||||
}
|
||||
i = s_SPITObjects.erase(i);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
bool SPITObject::removeSPITObjectRemote(SPITObject *p_ptrSPITObject) {
|
||||
if (p_ptrSPITObject == NULL)
|
||||
return false;
|
||||
return removeSPITObjectRemote(p_ptrSPITObject->getID());
|
||||
}
|
||||
bool SPITObject::removeSPITObjectRemote(string p_ptrSPITObject) {
|
||||
{
|
||||
auto i = s_SPITObjectsRemote.find(p_ptrSPITObject);
|
||||
if (i == s_SPITObjectsRemote.end()) {
|
||||
return false;
|
||||
}
|
||||
i = s_SPITObjectsRemote.erase(i);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
int SPITObject::getSPITObjectCount() {
|
||||
return s_SPITObjects.size();
|
||||
}
|
||||
int SPITObject::getSPITObjectRemoteCount() {
|
||||
return s_SPITObjectsRemote.size();
|
||||
}
|
||||
SPITObject *SPITObject::getSPITObject(int p_Index) {
|
||||
SPITObject *ptrSPITObject = NULL;
|
||||
{
|
||||
if (p_Index >= 0 && p_Index < s_SPITObjects.size()) {
|
||||
unordered_map<string, SPITObject *>::iterator i = next(s_SPITObjects.begin(), p_Index);
|
||||
ptrSPITObject = i->second;
|
||||
return ptrSPITObject;
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Returns a reference to the SPITObject at position p_Index.<br>
|
||||
* Throws an exception if p_Index is out of range.<br>
|
||||
* @param p_Index position
|
||||
* @return the reference of the SPITObject at position.
|
||||
*/
|
||||
const SPITObject &SPITObject::getSPITObjectRef(int p_Index) {
|
||||
SPITObject *ptrSPITObject = NULL;
|
||||
{
|
||||
if (p_Index >= 0 && p_Index < s_SPITObjects.size()) {
|
||||
unordered_map<string, SPITObject *>::iterator i = next(s_SPITObjects.begin(), p_Index);
|
||||
ptrSPITObject = i->second;
|
||||
return *ptrSPITObject;
|
||||
} else {
|
||||
throw "SPITObject index out of range";
|
||||
}
|
||||
}
|
||||
}
|
||||
SPITObject *SPITObject::getSPITObjectRemote(int p_Index) {
|
||||
SPITObject *ptrSPITObject = NULL;
|
||||
{
|
||||
if (p_Index >= 0 && p_Index < s_SPITObjectsRemote.size()) {
|
||||
unordered_map<string, SPITObject *>::iterator i = next(s_SPITObjectsRemote.begin(), p_Index);
|
||||
ptrSPITObject = i->second;
|
||||
return ptrSPITObject;
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Returns a reference to the remote SPITObject at position p_Index.<br>
|
||||
* Throws an exception if p_Index is out of range.<br>
|
||||
* @param p_Index position
|
||||
* @return the reference of the SPITObject at position.
|
||||
*/
|
||||
const SPITObject &SPITObject::getSPITObjectRemoteRef(int p_Index) {
|
||||
SPITObject *ptrSPITObject = NULL;
|
||||
{
|
||||
if (p_Index >= 0 && p_Index < s_SPITObjectsRemote.size()) {
|
||||
unordered_map<string, SPITObject *>::iterator i = next(s_SPITObjectsRemote.begin(), p_Index);
|
||||
ptrSPITObject = i->second;
|
||||
return *ptrSPITObject;
|
||||
} else {
|
||||
throw "Remote SPITObject index out of range";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SPITObject::clearSPITObjects() {
|
||||
SPITObject *ptrSPITObject;
|
||||
{
|
||||
for (auto i = s_SPITObjects.begin(); i != s_SPITObjects.end(); i++) {
|
||||
ptrSPITObject = i->second;
|
||||
i = s_SPITObjects.erase(i);
|
||||
delete ptrSPITObject;
|
||||
if (i == s_SPITObjects.end()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
void SPITObject::clearSPITObjectsRemote() {
|
||||
SPITObject *ptrSPITObject;
|
||||
{
|
||||
for (auto i = s_SPITObjectsRemote.begin(); i != s_SPITObjectsRemote.end(); i++) {
|
||||
ptrSPITObject = i->second;
|
||||
i = s_SPITObjectsRemote.erase(i);
|
||||
delete ptrSPITObject;
|
||||
if (i == s_SPITObjectsRemote.end()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#include "esp_log.h"
|
||||
|
||||
/**
|
||||
* clears all unconfirmed SPITObjects not created by this SPIT_Client.
|
||||
*/
|
||||
void SPITObject::clearUnconfirmedSPITObjects() {
|
||||
for (auto i = s_SPITObjects.begin(); i != s_SPITObjects.end(); i++) {
|
||||
SPITObject *ptrSPITObject = i->second;
|
||||
void SPITObject::clearUnconfirmedSPITObjects(SpitRepo<SPITObject> &repo) {
|
||||
auto &entries = repo.getRepo();
|
||||
for (auto i = entries.begin(); i != entries.end();) {
|
||||
SPITObject *ptrSPITObject = i->second.get();
|
||||
if (ptrSPITObject->getCreatedByClient() == false && ptrSPITObject->getConfirmed() == false) {
|
||||
i = s_SPITObjects.erase(i);
|
||||
delete ptrSPITObject;
|
||||
}
|
||||
if (i == s_SPITObjects.end()) {
|
||||
break;
|
||||
i = entries.erase(i);
|
||||
} else {
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SPITObject::eventProjectClosed() {
|
||||
for (auto i = s_SPITObjects.begin(); i != s_SPITObjects.end(); i++) {
|
||||
SPITObject *ptrSPITObject = i->second;
|
||||
void SPITObject::eventProjectClosed(SpitRepo<SPITObject> &repo, SpitRepo<SPITObject> &remoteRepo) {
|
||||
auto &entries = repo.getRepo();
|
||||
for (auto i = entries.begin(); i != entries.end(); ) {
|
||||
SPITObject *ptrSPITObject = i->second.get();
|
||||
if (ptrSPITObject->getCreatedByClient() == true) {
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
i = s_SPITObjects.erase(i);
|
||||
delete ptrSPITObject;
|
||||
if (i == s_SPITObjects.end()) {
|
||||
break;
|
||||
}
|
||||
i = entries.erase(i);
|
||||
}
|
||||
// Remote
|
||||
for (auto i = s_SPITObjectsRemote.begin(); i != s_SPITObjectsRemote.end(); i++) {
|
||||
SPITObject *ptrSPITObject = i->second;
|
||||
i = s_SPITObjectsRemote.erase(i);
|
||||
delete ptrSPITObject;
|
||||
if (i == s_SPITObjectsRemote.end()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
remoteRepo.clearEntries();
|
||||
}
|
||||
/**
|
||||
* sets confirmed = false for all SPITObjects.<br>
|
||||
* This should be called when the client has loaded a project.<br>
|
||||
* sets confirmed = false for all SPITObjects.
|
||||
* This should be called when the client has loaded a project.
|
||||
*/
|
||||
void SPITObject::setConfirmedFalse() {
|
||||
SPITObject *ptrSPITObject;
|
||||
{
|
||||
for (auto i = s_SPITObjects.begin(); i != s_SPITObjects.end(); i++) {
|
||||
ptrSPITObject = i->second;
|
||||
ptrSPITObject->setConfirmed(false);
|
||||
}
|
||||
void SPITObject::setConfirmedFalse(SpitRepo<SPITObject> &repo) {
|
||||
auto &entries = repo.getRepo();
|
||||
for (auto i = entries.begin(); i != entries.end(); i++) {
|
||||
i->second->setConfirmed(false);
|
||||
}
|
||||
}
|
||||
|
||||
SPITObject::SPITObject() {
|
||||
initMembers();
|
||||
SPITObject::SPITObject(string p_ID) {
|
||||
m_ID = p_ID;
|
||||
}
|
||||
void SPITObject::initMembers() {
|
||||
m_ActionAssigned = false;
|
||||
m_ActionAssignedType = false;
|
||||
m_Confirmed = false;
|
||||
m_Delay = 0;
|
||||
m_Duration = 0;
|
||||
m_Fixed = false;
|
||||
m_CreatedByClient = false;
|
||||
m_FrameFadeInLength = 0;
|
||||
m_FrameFadeOutLength = 0;
|
||||
m_FrameLength = 0;
|
||||
m_FrameStart = 0;
|
||||
m_Remark = "";
|
||||
m_ID = createGUID();
|
||||
m_Name = "";
|
||||
m_SPITTypeID = "";
|
||||
m_ServerParams = "";
|
||||
m_ServerRemote = false;
|
||||
m_Track = 0;
|
||||
m_ValueFactor = 1000000; // Values are given in ppm -> 1000000 = 1/1;
|
||||
m_ValueUse = 0x01;
|
||||
}
|
||||
|
||||
SPITObject::~SPITObject() {}
|
||||
|
||||
bool SPITObject::setMessageOP(SPIT_Message::ReportSPITObject *p_ReportSPITObject) {
|
||||
bool boolChangeAllowed;
|
||||
@@ -309,133 +79,142 @@ bool SPITObject::setMessageOP(SPIT_Message::ReportSPITObject *p_ReportSPITObject
|
||||
}
|
||||
|
||||
if (m_Delay != p_ReportSPITObject->getDelay()) {
|
||||
if (boolChangeAllowed == false)
|
||||
throw new exception();
|
||||
if (boolChangeAllowed == false) {
|
||||
return false;
|
||||
}
|
||||
m_Delay = p_ReportSPITObject->getDelay();
|
||||
boolChanged = true;
|
||||
}
|
||||
if (m_Duration != p_ReportSPITObject->getDuration()) {
|
||||
if (boolChangeAllowed == false)
|
||||
throw new exception();
|
||||
if (boolChangeAllowed == false) {
|
||||
return false;
|
||||
}
|
||||
m_Duration = p_ReportSPITObject->getDuration();
|
||||
boolChanged = true;
|
||||
}
|
||||
if (m_Fixed != p_ReportSPITObject->getFixed()) {
|
||||
if (boolChangeAllowed == false)
|
||||
throw new exception();
|
||||
if (boolChangeAllowed == false) {
|
||||
return false;
|
||||
}
|
||||
m_Fixed = p_ReportSPITObject->getFixed();
|
||||
boolChanged = true;
|
||||
}
|
||||
if (m_FrameFadeInLength != p_ReportSPITObject->getFrameFadeInLength()) {
|
||||
if (boolChangeAllowed == false)
|
||||
throw new exception();
|
||||
if (boolChangeAllowed == false) {
|
||||
return false;
|
||||
}
|
||||
m_FrameFadeInLength = p_ReportSPITObject->getFrameFadeInLength();
|
||||
boolChanged = true;
|
||||
}
|
||||
if (m_FrameFadeOutLength != p_ReportSPITObject->getFrameFadeOutLength()) {
|
||||
if (boolChangeAllowed == false)
|
||||
throw new exception();
|
||||
if (boolChangeAllowed == false) {
|
||||
return false;
|
||||
}
|
||||
m_FrameFadeOutLength = p_ReportSPITObject->getFrameFadeOutLength();
|
||||
boolChanged = true;
|
||||
}
|
||||
if (m_FrameLength != p_ReportSPITObject->getFrameLength()) {
|
||||
if (boolChangeAllowed == false)
|
||||
throw new exception();
|
||||
if (boolChangeAllowed == false) {
|
||||
return false;
|
||||
}
|
||||
m_FrameLength = p_ReportSPITObject->getFrameLength();
|
||||
boolChanged = true;
|
||||
}
|
||||
if (m_FrameStart != p_ReportSPITObject->getFrameStart()) {
|
||||
if (boolChangeAllowed == false)
|
||||
throw new exception();
|
||||
if (boolChangeAllowed == false) {
|
||||
return false;
|
||||
}
|
||||
m_FrameStart = p_ReportSPITObject->getFrameStart();
|
||||
boolChanged = true;
|
||||
}
|
||||
if (m_Remark != p_ReportSPITObject->getRemark()) {
|
||||
if (boolChangeAllowed == false)
|
||||
throw new exception();
|
||||
if (boolChangeAllowed == false) {
|
||||
return false;
|
||||
}
|
||||
m_Remark = p_ReportSPITObject->getRemark();
|
||||
boolChanged = true;
|
||||
}
|
||||
if (m_ID != p_ReportSPITObject->getID()) {
|
||||
if (boolChangeAllowed == false)
|
||||
throw new exception();
|
||||
if (boolChangeAllowed == false) {
|
||||
return false;
|
||||
}
|
||||
m_ID = p_ReportSPITObject->getID();
|
||||
boolChanged = true;
|
||||
}
|
||||
if (m_Name != p_ReportSPITObject->getName()) {
|
||||
if (boolChangeAllowed == false)
|
||||
throw new exception();
|
||||
if (boolChangeAllowed == false) {
|
||||
return false;
|
||||
}
|
||||
m_Name = p_ReportSPITObject->getName();
|
||||
boolChanged = true;
|
||||
}
|
||||
if (m_SPITTypeID != p_ReportSPITObject->getSPITTypeID()) {
|
||||
if (boolChangeAllowed == false)
|
||||
throw new exception();
|
||||
if (boolChangeAllowed == false) {
|
||||
return false;
|
||||
}
|
||||
m_SPITTypeID = p_ReportSPITObject->getSPITTypeID();
|
||||
boolChanged = true;
|
||||
}
|
||||
if (m_ServerParams != p_ReportSPITObject->getServerParams()) {
|
||||
if (boolChangeAllowed == false)
|
||||
throw new exception();
|
||||
if (boolChangeAllowed == false) {
|
||||
return false;
|
||||
}
|
||||
m_ServerParams = p_ReportSPITObject->getServerParams();
|
||||
boolChanged = true;
|
||||
}
|
||||
if (m_ServerRemote != p_ReportSPITObject->getServerRemote()) {
|
||||
if (boolChangeAllowed == false)
|
||||
throw new exception();
|
||||
if (boolChangeAllowed == false) {
|
||||
return false;
|
||||
}
|
||||
m_ServerRemote = p_ReportSPITObject->getServerRemote();
|
||||
boolChanged = true;
|
||||
}
|
||||
if (m_Track != p_ReportSPITObject->getTrack()) {
|
||||
if (boolChangeAllowed == false)
|
||||
throw new exception();
|
||||
if (boolChangeAllowed == false) {
|
||||
return false;
|
||||
}
|
||||
m_Track = p_ReportSPITObject->getTrack();
|
||||
boolChanged = true;
|
||||
}
|
||||
if (m_ValueFactor != p_ReportSPITObject->getValueFactor()) {
|
||||
if (boolChangeAllowed == false)
|
||||
throw new exception();
|
||||
if (boolChangeAllowed == false) {
|
||||
return false;
|
||||
}
|
||||
m_ValueFactor = p_ReportSPITObject->getValueFactor();
|
||||
boolChanged = true;
|
||||
}
|
||||
if (m_ValueUse != p_ReportSPITObject->getValueUse()) {
|
||||
if (boolChangeAllowed == false)
|
||||
throw new exception();
|
||||
if (boolChangeAllowed == false) {
|
||||
return false;
|
||||
}
|
||||
m_ValueUse = p_ReportSPITObject->getValueUse();
|
||||
boolChanged = true;
|
||||
}
|
||||
return boolChanged;
|
||||
}
|
||||
|
||||
void SPITObject::fillMessageOP(SPIT_Message::ReportSPITObject *p_ReportSPITObject) {
|
||||
p_ReportSPITObject->setActionAssigned(getActionAssigned()); // Action can be assigned to type or to this object
|
||||
p_ReportSPITObject->setConfirmed(m_Confirmed);
|
||||
p_ReportSPITObject->setDelay(m_Delay);
|
||||
p_ReportSPITObject->setDuration(m_Duration);
|
||||
p_ReportSPITObject->setFixed(m_Fixed);
|
||||
p_ReportSPITObject->setFrameFadeInLength(m_FrameFadeInLength);
|
||||
p_ReportSPITObject->setFrameFadeOutLength(m_FrameFadeOutLength);
|
||||
p_ReportSPITObject->setFrameLength(m_FrameLength);
|
||||
p_ReportSPITObject->setFrameStart(m_FrameStart);
|
||||
p_ReportSPITObject->setID(m_ID);
|
||||
p_ReportSPITObject->setName(m_Name);
|
||||
p_ReportSPITObject->setRemark(m_Remark);
|
||||
p_ReportSPITObject->setSPITTypeID(m_SPITTypeID);
|
||||
p_ReportSPITObject->setServerParams(m_ServerParams);
|
||||
p_ReportSPITObject->setServerRemote(m_ServerRemote);
|
||||
p_ReportSPITObject->setTrack(m_Track);
|
||||
p_ReportSPITObject->setValueFactor(m_ValueFactor);
|
||||
p_ReportSPITObject->setValueUse(m_ValueUse);
|
||||
void SPITObject::fillMessageOP(SPIT_Message::ReportSPITObject &p_ReportSPITObject) {
|
||||
p_ReportSPITObject.setActionAssigned(getActionAssigned()); // Action can be assigned to type or to this object
|
||||
p_ReportSPITObject.setConfirmed(m_Confirmed);
|
||||
p_ReportSPITObject.setDelay(m_Delay);
|
||||
p_ReportSPITObject.setDuration(m_Duration);
|
||||
p_ReportSPITObject.setFixed(m_Fixed);
|
||||
p_ReportSPITObject.setFrameFadeInLength(m_FrameFadeInLength);
|
||||
p_ReportSPITObject.setFrameFadeOutLength(m_FrameFadeOutLength);
|
||||
p_ReportSPITObject.setFrameLength(m_FrameLength);
|
||||
p_ReportSPITObject.setFrameStart(m_FrameStart);
|
||||
p_ReportSPITObject.setID(m_ID);
|
||||
p_ReportSPITObject.setName(m_Name);
|
||||
p_ReportSPITObject.setRemark(m_Remark);
|
||||
p_ReportSPITObject.setSPITTypeID(m_SPITTypeID);
|
||||
p_ReportSPITObject.setServerParams(m_ServerParams);
|
||||
p_ReportSPITObject.setServerRemote(m_ServerRemote);
|
||||
p_ReportSPITObject.setTrack(m_Track);
|
||||
p_ReportSPITObject.setValueFactor(m_ValueFactor);
|
||||
p_ReportSPITObject.setValueUse(m_ValueUse);
|
||||
}
|
||||
void SPITObject::fillMessageOP(SPIT_Message::RemoveSPITObject *p_RemoveSPITObject) {
|
||||
p_RemoveSPITObject->setID(m_ID);
|
||||
}
|
||||
|
||||
void SPITObject::setID(string p_ID) {
|
||||
m_ID = p_ID;
|
||||
}
|
||||
void SPITObject::setCreatedByClient(bool p_CreatedByClient) {
|
||||
m_CreatedByClient = p_CreatedByClient;
|
||||
void SPITObject::fillMessageOP(SPIT_Message::RemoveSPITObject &p_RemoveSPITObject) {
|
||||
p_RemoveSPITObject.setID(m_ID);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -486,8 +265,8 @@ bool SPITObject::setServerRemote(bool p_BelongstoServer) {
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* This is a virtual construct - ActionAssignedType is not implemented in the SPITProtocol.<br>
|
||||
* This is used when an action is associated with a SPITType. <br>
|
||||
* This is a virtual construct - ActionAssignedType is not implemented in the SPITProtocol.
|
||||
* This is used when an action is associated with a SPITType.
|
||||
* Then this action is done for every SPITObject with the SPITType.
|
||||
* @return true = an action is assigned for the SPITType.
|
||||
*/
|
||||
|
||||
@@ -13,57 +13,30 @@
|
||||
*/
|
||||
|
||||
#include "SPITPlayer.h"
|
||||
#include "esp_log.h"
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
unordered_map<string, SPITPlayer *> SPITPlayer::s_SPITPlayers;
|
||||
using namespace std;
|
||||
|
||||
SPITPlayer *SPITPlayer::getSPITPlayer(string p_PlayerID) {
|
||||
{
|
||||
auto i = s_SPITPlayers.find(p_PlayerID);
|
||||
if (i == s_SPITPlayers.end()) {
|
||||
s_SPITPlayers[p_PlayerID] = new SPITPlayer(p_PlayerID);
|
||||
}
|
||||
i = s_SPITPlayers.find(p_PlayerID);
|
||||
if (i == s_SPITPlayers.end())
|
||||
return NULL;
|
||||
return i->second;
|
||||
}
|
||||
}
|
||||
unordered_map<string, unique_ptr<SPITPlayer>> SPITPlayer::s_SPITPlayers;
|
||||
|
||||
void SPITPlayer::clearPlayers() {
|
||||
;
|
||||
vector<SPITPlayer *> o_SPITPlayers;
|
||||
for (auto i = s_SPITPlayers.begin(); i != s_SPITPlayers.end(); i++) {
|
||||
SPITPlayer *ptrSPITPlayer = i->second;
|
||||
o_SPITPlayers.push_back(ptrSPITPlayer);
|
||||
SPITPlayer &SPITPlayer::getSPITPlayer(string p_PlayerID) {
|
||||
auto i = s_SPITPlayers.find(p_PlayerID);
|
||||
if (i == s_SPITPlayers.end()) {
|
||||
s_SPITPlayers[p_PlayerID] = make_unique<SPITPlayer>(p_PlayerID);
|
||||
}
|
||||
for (auto i = o_SPITPlayers.begin(); i != o_SPITPlayers.end(); i++) {
|
||||
SPITPlayer *ptrSPITPlayer = *i;
|
||||
delete ptrSPITPlayer;
|
||||
}
|
||||
o_SPITPlayers.clear();
|
||||
return *s_SPITPlayers.at(p_PlayerID);
|
||||
}
|
||||
|
||||
SPITPlayer::SPITPlayer(string p_PlayerID) {
|
||||
m_ID = p_PlayerID;
|
||||
s_SPITPlayers[p_PlayerID] = this;
|
||||
}
|
||||
|
||||
SPITPlayer::~SPITPlayer() {
|
||||
PlaySPITType *ptrPlaySPITType;
|
||||
for (auto i = m_PlaySPITTypes.begin(); i != m_PlaySPITTypes.end(); i++) {
|
||||
ptrPlaySPITType = i->second;
|
||||
i = m_PlaySPITTypes.erase(i);
|
||||
delete ptrPlaySPITType;
|
||||
if (i == m_PlaySPITTypes.end()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
m_PlaySPITTypes.clear();
|
||||
}
|
||||
|
||||
unordered_map<string, SPITPlayer::PlaySPITType *> *SPITPlayer::getPlaySPITTypes() {
|
||||
return &m_PlaySPITTypes;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param p_SPITObjectID
|
||||
@@ -72,46 +45,38 @@ unordered_map<string, SPITPlayer::PlaySPITType *> *SPITPlayer::getPlaySPITTypes(
|
||||
*/
|
||||
SPITPlayer::PlaySPITType *SPITPlayer::addSPITType_Playing(string p_SPITTypeID) {
|
||||
PlaySPITType *ptrPlaySPITType;
|
||||
|
||||
auto i = m_PlaySPITTypes.find(p_SPITTypeID);
|
||||
if (i == m_PlaySPITTypes.end()) {
|
||||
ptrPlaySPITType = new PlaySPITType(this, p_SPITTypeID);
|
||||
ptrPlaySPITType->setIsPlayed(true);
|
||||
ptrPlaySPITType->setIsNew(true);
|
||||
m_PlaySPITTypes[p_SPITTypeID] = ptrPlaySPITType;
|
||||
auto playSpitType = make_unique<PlaySPITType>(this, p_SPITTypeID);
|
||||
ptrPlaySPITType = playSpitType.get();
|
||||
m_PlaySPITTypes[p_SPITTypeID] = move(playSpitType);
|
||||
} else {
|
||||
ptrPlaySPITType = i->second;
|
||||
ptrPlaySPITType->setIsPlayed(true);
|
||||
ptrPlaySPITType = i->second.get();
|
||||
}
|
||||
ptrPlaySPITType->setIsPlayed(true);
|
||||
return ptrPlaySPITType;
|
||||
}
|
||||
|
||||
void SPITPlayer::startPlaySequence() {
|
||||
PlaySPITType *ptrPlaySPITType;
|
||||
for (auto i = m_PlaySPITTypes.begin(); i != m_PlaySPITTypes.end(); i++) {
|
||||
ptrPlaySPITType = i->second;
|
||||
PlaySPITType *ptrPlaySPITType = i->second.get();
|
||||
ptrPlaySPITType->startPlaySequence();
|
||||
}
|
||||
}
|
||||
|
||||
void SPITPlayer::endPlaySequence() {
|
||||
PlaySPITType *ptrPlaySPITType;
|
||||
|
||||
for (auto i = m_PlaySPITTypes.begin(); i != m_PlaySPITTypes.end(); i++) {
|
||||
ptrPlaySPITType = i->second;
|
||||
if (ptrPlaySPITType->getIsPlayed() == false) {
|
||||
for (auto i = m_PlaySPITTypes.begin(); i != m_PlaySPITTypes.end();) {
|
||||
if (i->second.get()->getIsPlayed() == false) {
|
||||
i = m_PlaySPITTypes.erase(i);
|
||||
delete ptrPlaySPITType;
|
||||
if (i == m_PlaySPITTypes.end()) {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
++i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SPITPlayer::PlaySPITType::PlaySPITType() {
|
||||
}
|
||||
SPITPlayer::PlaySPITType::PlaySPITType(SPITPlayer *p_SPITPlayer, string p_SPITTypeID) {
|
||||
m_IsNew = true;
|
||||
|
||||
m_SPITTypeID = p_SPITTypeID;
|
||||
m_PlayerID = p_SPITPlayer->getID();
|
||||
m_PlayerName = p_SPITPlayer->getName();
|
||||
|
||||
@@ -27,27 +27,25 @@ using namespace std;
|
||||
* @return
|
||||
*/
|
||||
bool SPITSocket::createSocket_UDP() {
|
||||
bool boolSuccess = true;
|
||||
int intResult = -1;
|
||||
int intOptionValue4 = 1;
|
||||
|
||||
// ip4
|
||||
if (m_UDPSocketIP4 != INVALID_SOCKET) {
|
||||
close(m_UDPSocketIP4);
|
||||
m_UDPSocketIP4 = INVALID_SOCKET;
|
||||
}
|
||||
|
||||
m_UDPSocketIP4 = socket(AF_INET, SOCK_DGRAM, 0);
|
||||
int intResult = -1;
|
||||
bool success = true;
|
||||
if (m_UDPSocketIP4 == INVALID_SOCKET) {
|
||||
boolSuccess = false;
|
||||
success = false;
|
||||
} else {
|
||||
int intOptionValue4 = 1;
|
||||
intResult = setsockopt(m_UDPSocketIP4, SOL_SOCKET, SO_REUSEADDR, (void *)&intOptionValue4, sizeof(intOptionValue4));
|
||||
}
|
||||
if (intResult < 0) {
|
||||
boolSuccess = false;
|
||||
success = false;
|
||||
}
|
||||
|
||||
if (boolSuccess == true) {
|
||||
if (success == true) {
|
||||
struct timeval tv;
|
||||
tv.tv_sec = 1; // seconds
|
||||
tv.tv_usec = 0; // microseconds (0.0 sec)
|
||||
@@ -64,138 +62,99 @@ bool SPITSocket::createSocket_UDP() {
|
||||
// intResult = setsockopt(m_UDPSocketIP4, SOL_SOCKET, SO_RCVBUF, (void*)&intBufferSize, sizeof(intBufferSize));
|
||||
// intResult = setsockopt(m_UDPSocketIP4, SOL_SOCKET, SO_SNDBUF, (void*)&intBufferSize, sizeof(intBufferSize));
|
||||
}
|
||||
return boolSuccess;
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* Binds the socket to the client's ip address and port. The socket option SO_REUSEADDR is set to true.
|
||||
* @param p_ClientIP ip address of the client
|
||||
* @param p_ClientPort port of the client.
|
||||
* @param clientIp ip address of the client
|
||||
* @param clientPort port of the client.
|
||||
* if p_Port == "0" any free port will be used
|
||||
* @return -1 id bind fails, o if bind is ok
|
||||
*
|
||||
*/
|
||||
int SPITSocket::bindSocket(string p_ServerIP, string p_ClientIP, string p_ClientPort) {
|
||||
addrinfo *clientAI;
|
||||
struct sockaddr_in *ptrIP4SocketAddress;
|
||||
struct sockaddr_in o_IP4SocketAddress;
|
||||
int intSocklen;
|
||||
int SPITSocket::bindSocket(string clientIp, string clientPort) {
|
||||
string stringClientPort;
|
||||
if (p_ClientPort.length() <= 0)
|
||||
if (clientPort.length() <= 0)
|
||||
stringClientPort = "0";
|
||||
else
|
||||
stringClientPort = p_ClientPort;
|
||||
// int intResult = SOCKET_ERROR;
|
||||
int intResult = 0;
|
||||
if (getaddrinfo(p_ClientIP.data(), p_ClientPort.data(), NULL, &clientAI) != 0) {
|
||||
stringClientPort = clientPort;
|
||||
addrinfo *clientAI;
|
||||
if (getaddrinfo(clientIp.data(), clientPort.data(), nullptr, &clientAI) != 0) {
|
||||
return -1;
|
||||
}
|
||||
switch (clientAI->ai_family) {
|
||||
case AF_INET:
|
||||
if (m_UDPSocketIP4 == INVALID_SOCKET) {
|
||||
break;
|
||||
}
|
||||
ptrIP4SocketAddress = reinterpret_cast<sockaddr_in *>(clientAI->ai_addr);
|
||||
intSocklen = sizeof(*ptrIP4SocketAddress);
|
||||
// copy the ptrIP4SocketAddress, may be not filled correct by getaddrinfo
|
||||
memset(&o_IP4SocketAddress, 0, intSocklen);
|
||||
o_IP4SocketAddress.sin_addr = ptrIP4SocketAddress->sin_addr;
|
||||
o_IP4SocketAddress.sin_family = ptrIP4SocketAddress->sin_family;
|
||||
// o_IP4SocketAddress.sin_zero = ptrIP4SocketAddress->sin_zero;
|
||||
o_IP4SocketAddress.sin_port = ptrIP4SocketAddress->sin_port;
|
||||
intResult = bind(m_UDPSocketIP4, (const sockaddr *)(ptrIP4SocketAddress), (socklen_t)intSocklen);
|
||||
if (intResult < 0) {
|
||||
break;
|
||||
}
|
||||
setBoundClientFamily(AF_INET);
|
||||
if (intResult == 0) {
|
||||
if (getsockname(m_UDPSocketIP4, (sockaddr *)ptrIP4SocketAddress, (socklen_t *)&intSocklen) != -1) {
|
||||
setBoundClientPort(to_string((int)ptrIP4SocketAddress->sin_port));
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
setBoundClientFamily(0);
|
||||
intResult = -1;
|
||||
break;
|
||||
if (m_UDPSocketIP4 == INVALID_SOCKET) {
|
||||
return -1;
|
||||
}
|
||||
auto *socketAdr = (sockaddr_in *)(clientAI->ai_addr);
|
||||
int intSocklen = sizeof(*socketAdr);
|
||||
// copy the socketAdr, may be not filled correct by getaddrinfo
|
||||
sockaddr_in o_IP4SocketAddress;
|
||||
memset(&o_IP4SocketAddress, 0, intSocklen);
|
||||
o_IP4SocketAddress.sin_addr = socketAdr->sin_addr;
|
||||
o_IP4SocketAddress.sin_family = socketAdr->sin_family;
|
||||
o_IP4SocketAddress.sin_port = socketAdr->sin_port;
|
||||
int intResult = bind(m_UDPSocketIP4, (const sockaddr *)(socketAdr), (socklen_t)intSocklen);
|
||||
if (intResult < 0) {
|
||||
return intResult;
|
||||
}
|
||||
if ((intResult == 0) &&
|
||||
(getsockname(m_UDPSocketIP4, (sockaddr *)socketAdr, (socklen_t *)&intSocklen) != -1)) {
|
||||
setBoundClientPort(to_string((int)socketAdr->sin_port));
|
||||
}
|
||||
freeaddrinfo(clientAI);
|
||||
|
||||
if (intResult == -1) {
|
||||
setIsBound(false);
|
||||
} else {
|
||||
setIsBound(true);
|
||||
}
|
||||
setIsBound(intResult != -1);
|
||||
return intResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set whether the sockat are brodcast sockets or not. Set the sockopt SO_BROADCAST to 0 or 1
|
||||
* Set whether the socket are broadcast sockets or not. Set the sockopt SO_BROADCAST to 0 or 1
|
||||
* @param p_Broadcast true SO_BROADCAST is set
|
||||
* false = SO_BROADCAST is not set
|
||||
* @return 0 = ok, -1 = error
|
||||
*/
|
||||
int SPITSocket::setBroadcast(bool p_Broadcast) {
|
||||
int intResult;
|
||||
int intOptionValue = 1;
|
||||
u_char charOptionValue = 0x01;
|
||||
// IP4
|
||||
if (p_Broadcast) {
|
||||
intOptionValue = 1;
|
||||
} else {
|
||||
intOptionValue = 0;
|
||||
}
|
||||
intResult = setsockopt(m_UDPSocketIP4, SOL_SOCKET, SO_BROADCAST, &intOptionValue, sizeof(int));
|
||||
// intResult = setsockopt(m_UDPSocketIP4, IPPROTO_IP, IP_MULTICAST_LOOP, (void*)&charOptionValue, sizeof(charOptionValue));
|
||||
|
||||
int SPITSocket::setBroadcast(bool broadcast) const {
|
||||
int intOptionValue = broadcast ? 1 : 0;
|
||||
int intResult = setsockopt(m_UDPSocketIP4, SOL_SOCKET, SO_BROADCAST, &intOptionValue, sizeof(int));
|
||||
return intResult;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param p_InetFamily AF_INET or AF_INET6
|
||||
* @param p_ServerIP the ip address of the server
|
||||
* @param p_ServerPort the port of the server
|
||||
* @param p_MessageBytes buffer containing the message
|
||||
* @param p_MessageLength the length of the message
|
||||
* @param ip the ip address of the server
|
||||
* @param port the port of the server
|
||||
* @param msg buffer containing the message
|
||||
* @param msgLength the length of the message
|
||||
* @return -1 send fails
|
||||
* 0 send is done
|
||||
*/
|
||||
int SPITSocket::sendMessageTo(int p_InetFamily, string p_ServerIP, string p_ServerPort, const char *p_MessageBytes, int p_MessageLength) {
|
||||
if (m_UDPSocketIP4 == INVALID_SOCKET)
|
||||
int SPITSocket::sendMessageTo(const string &ip, const string &port, const char *message, int msgLength) {
|
||||
if (m_UDPSocketIP4 == INVALID_SOCKET) {
|
||||
return -1;
|
||||
struct addrinfo *ptrAddressInfo;
|
||||
struct sockaddr_in *ptrIP4SocketAddress;
|
||||
struct sockaddr_in o_IP4SocketAddress;
|
||||
int intSocklen;
|
||||
int intResult = -1;
|
||||
}
|
||||
|
||||
// prepare AddressInfo
|
||||
if (getaddrinfo(p_ServerIP.data(), p_ServerPort.data(), NULL, &ptrAddressInfo) != 0) {
|
||||
return -1;
|
||||
}
|
||||
switch (ptrAddressInfo->ai_family) {
|
||||
case AF_INET:
|
||||
ptrIP4SocketAddress = reinterpret_cast<sockaddr_in *>(ptrAddressInfo->ai_addr);
|
||||
intSocklen = sizeof(*ptrIP4SocketAddress);
|
||||
if (m_UDPSocketIP4 != INVALID_SOCKET) {
|
||||
// copy the ptrIP4SocketAddress, may be not filled correct by getaddrinfo
|
||||
memset(&o_IP4SocketAddress, 0, intSocklen);
|
||||
o_IP4SocketAddress.sin_addr = ptrIP4SocketAddress->sin_addr;
|
||||
o_IP4SocketAddress.sin_family = ptrIP4SocketAddress->sin_family;
|
||||
o_IP4SocketAddress.sin_port = ptrIP4SocketAddress->sin_port;
|
||||
intResult = sendto(m_UDPSocketIP4, p_MessageBytes, p_MessageLength, 0, (const sockaddr *)&o_IP4SocketAddress, (socklen_t)intSocklen);
|
||||
if (intResult < 0) {
|
||||
printf("UnixSocket::sendMessageTo IP4 sendto %s FAILED %s\n", p_ServerIP.data(), strerror(errno));
|
||||
printf("UnixSocket::sendMessageTo ret=%d %s / %s / %d\n", intResult,
|
||||
p_ServerPort.data(), p_MessageBytes, p_MessageLength);
|
||||
}
|
||||
freeaddrinfo(ptrAddressInfo);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
intResult = -1;
|
||||
int intResult = -1;
|
||||
addrinfo *ptrAddressInfo;
|
||||
if (getaddrinfo(ip.data(), port.data(), nullptr, &ptrAddressInfo) != 0) {
|
||||
return intResult;
|
||||
}
|
||||
|
||||
auto *ptrIP4SocketAddress = (sockaddr_in *)(ptrAddressInfo->ai_addr);
|
||||
int intSocklen = sizeof(*ptrIP4SocketAddress);
|
||||
if (m_UDPSocketIP4 != INVALID_SOCKET) {
|
||||
// copy the ptrIP4SocketAddress, may be not filled correct by getaddrinfo
|
||||
sockaddr_in o_IP4SocketAddress;
|
||||
memset(&o_IP4SocketAddress, 0, intSocklen);
|
||||
o_IP4SocketAddress.sin_addr = ptrIP4SocketAddress->sin_addr;
|
||||
o_IP4SocketAddress.sin_family = ptrIP4SocketAddress->sin_family;
|
||||
o_IP4SocketAddress.sin_port = ptrIP4SocketAddress->sin_port;
|
||||
intResult = sendto(m_UDPSocketIP4, message, msgLength, 0, (const sockaddr *)&o_IP4SocketAddress, (socklen_t)intSocklen);
|
||||
if (intResult < 0) {
|
||||
ESP_LOGE("SPIT", "sendMessageTo IP4 sendto %s FAILED %s\n", ip.data(), strerror(errno));
|
||||
ESP_LOGE("SPIT", "sendMessageTo ret=%d %s / %s / %d\n", intResult, port.data(), message, msgLength);
|
||||
}
|
||||
freeaddrinfo(ptrAddressInfo);
|
||||
}
|
||||
if (intResult < 0) {
|
||||
return -1;
|
||||
}
|
||||
@@ -204,52 +163,39 @@ int SPITSocket::sendMessageTo(int p_InetFamily, string p_ServerIP, string p_Serv
|
||||
/**
|
||||
* Call this for receiving a message
|
||||
* This will block until a message is received or the underlying socket is closed
|
||||
* @param p_InetFamily either AF_INET or AF_INET6<br>
|
||||
* The SPITSocket creates two udp sockets, one for IP4 and one for IP6
|
||||
* This parameter decides from which socket should a message recieved
|
||||
* @param p_Buffer the buffer containing the received message later.
|
||||
* @param p_BufferLength the size of the buffer
|
||||
* @param p_ServerIP a pointer to a string, when a messages is received the string will contain the ip address of the sender/server
|
||||
* if p_ServerIP is NULL - no detection of the server will be done.
|
||||
* @return
|
||||
*/
|
||||
int SPITSocket::receiveMessage(int p_InetFamily, char *p_Buffer, int p_BufferLength, string *p_ServerIP) {
|
||||
int SPITSocket::receiveMessage(char *p_Buffer, int p_BufferLength, string *serverIp) const {
|
||||
int intResult = -1;
|
||||
// ADDRINFO *AI;
|
||||
struct sockaddr_in o_IP4SocketAddress;
|
||||
int intSocklen;
|
||||
|
||||
switch (p_InetFamily) {
|
||||
case AF_INET:
|
||||
if (m_UDPSocketIP4 == INVALID_SOCKET) {
|
||||
break;
|
||||
}
|
||||
intSocklen = sizeof(o_IP4SocketAddress);
|
||||
memset(&o_IP4SocketAddress, 0, intSocklen);
|
||||
intResult = recvfrom(m_UDPSocketIP4, (void *)p_Buffer, p_BufferLength, 0, (sockaddr *)&o_IP4SocketAddress, (socklen_t *)&intSocklen);
|
||||
if (intResult >= 0) {
|
||||
if (p_ServerIP != NULL) {
|
||||
char bufferIP4[INET_ADDRSTRLEN];
|
||||
inet_ntop(AF_INET, &(o_IP4SocketAddress.sin_addr), bufferIP4, intSocklen);
|
||||
*p_ServerIP = bufferIP4;
|
||||
}
|
||||
}
|
||||
break;
|
||||
if (m_UDPSocketIP4 == INVALID_SOCKET) {
|
||||
return intResult;
|
||||
}
|
||||
sockaddr_in o_IP4SocketAddress;
|
||||
int intSocklen = sizeof(o_IP4SocketAddress);
|
||||
memset(&o_IP4SocketAddress, 0, intSocklen);
|
||||
intResult = recvfrom(m_UDPSocketIP4, (void *)p_Buffer, p_BufferLength, 0, (sockaddr *)&o_IP4SocketAddress, (socklen_t *)&intSocklen);
|
||||
if (intResult >= 0 && serverIp != nullptr) {
|
||||
char bufferIP4[INET_ADDRSTRLEN];
|
||||
inet_ntop(AF_INET, &(o_IP4SocketAddress.sin_addr), bufferIP4, intSocklen);
|
||||
*serverIp = bufferIP4;
|
||||
}
|
||||
return intResult;
|
||||
}
|
||||
|
||||
SPITSocket::IPAddress SPITSocket::getAdaptersInfo() {
|
||||
// iterate over active interfaces, and print out IPs
|
||||
esp_netif_t *netif = NULL;
|
||||
while ((netif = esp_netif_next_unsafe(netif)) != NULL) {
|
||||
esp_netif_t *netif = nullptr;
|
||||
if ((netif = esp_netif_next_unsafe(netif)) != nullptr) {
|
||||
ESP_LOGI("SPIT", "Connected to %s", esp_netif_get_desc(netif));
|
||||
esp_netif_ip_info_t ip;
|
||||
ESP_ERROR_CHECK(esp_netif_get_ip_info(netif, &ip));
|
||||
ESP_LOGI("SPIT", "- IPv4 address: " IPSTR ",", IP2STR(&ip.ip));
|
||||
ESP_LOGI("SPIT", "- IPv4 netmask: " IPSTR ",", IP2STR(&ip.netmask));
|
||||
char buffer[64];
|
||||
|
||||
sprintf(buffer, IPSTR, IP2STR(&ip.ip));
|
||||
string stringIP4 = buffer;
|
||||
sprintf(buffer, IPSTR, IP2STR(&ip.netmask));
|
||||
@@ -260,29 +206,18 @@ SPITSocket::IPAddress SPITSocket::getAdaptersInfo() {
|
||||
}
|
||||
|
||||
string createGUID() {
|
||||
// uuid_t id;
|
||||
// uuid_generate(id);
|
||||
// char *guid_string = new char[100];
|
||||
// uuid_unparse(id, guid_string);
|
||||
// string stringGUID = guid_string;
|
||||
// return stringGUID;
|
||||
|
||||
uuid_t uu;
|
||||
char uu_str[UUID_STR_LEN];
|
||||
|
||||
uuid_generate(uu);
|
||||
char uu_str[UUID_STR_LEN];
|
||||
uuid_unparse(uu, uu_str);
|
||||
string stringGUID = uu_str;
|
||||
return stringGUID;
|
||||
return {uu_str};
|
||||
}
|
||||
/** The name of the client's host computer*/
|
||||
|
||||
string getClientHostName() {
|
||||
string stringHostName = "";
|
||||
const char *hostname;
|
||||
esp_netif_get_hostname(esp_netif_get_default_netif(), &hostname);
|
||||
if (hostname != nullptr) {
|
||||
stringHostName = hostname;
|
||||
return {hostname};
|
||||
}
|
||||
return stringHostName;
|
||||
;
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -17,280 +17,51 @@
|
||||
|
||||
static const char *TAG = "SPIT";
|
||||
|
||||
unordered_map<string, SPITType *> SPITType::s_SPITTypes;
|
||||
unordered_map<string, SPITType *> SPITType::s_SPITTypesRemote;
|
||||
|
||||
SPITType *SPITType::getSPITType(string p_ID) {
|
||||
{
|
||||
auto i = s_SPITTypes.find(p_ID);
|
||||
if (i == s_SPITTypes.end()) {
|
||||
return NULL;
|
||||
}
|
||||
return i->second;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Returns the reference of the SPITType with ID == p_ID.<br>
|
||||
* Throws an exception if no SPITType is not found.<br>
|
||||
* @param p_ID the ID
|
||||
* @return reference of the SPITType with ID == p_ID
|
||||
*/
|
||||
const SPITType &SPITType::getSPITTypeRef(string p_ID) {
|
||||
{
|
||||
auto i = s_SPITTypes.find(p_ID);
|
||||
if (i == s_SPITTypes.end()) {
|
||||
throw "SPITType no SPITType with given ID";
|
||||
}
|
||||
return *(i->second);
|
||||
}
|
||||
}
|
||||
|
||||
SPITType *SPITType::getSPITTypeRemote(string p_ID) {
|
||||
{
|
||||
auto i = s_SPITTypesRemote.find(p_ID);
|
||||
if (i == s_SPITTypesRemote.end()) {
|
||||
return NULL;
|
||||
}
|
||||
return i->second;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Returns the reference of the remote SPITType with ID == p_ID.<br>
|
||||
* Throws an exception if no SPITType is not found.<br>
|
||||
* @param p_ID the ID
|
||||
* @return reference of the SPITType with ID == p_ID
|
||||
*/
|
||||
const SPITType &SPITType::getSPITTypeRemoteRef(string p_ID) {
|
||||
{
|
||||
auto i = s_SPITTypesRemote.find(p_ID);
|
||||
if (i == s_SPITTypesRemote.end()) {
|
||||
throw "Remote SPITType no SPITType with given ID";
|
||||
}
|
||||
return *(i->second);
|
||||
}
|
||||
}
|
||||
|
||||
bool SPITType::addSPITType(SPITType *p_ptrSpitType) {
|
||||
if (p_ptrSpitType == NULL)
|
||||
return false;
|
||||
{
|
||||
s_SPITTypes[p_ptrSpitType->getID()] = p_ptrSpitType;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
bool SPITType::addSPITTypeRemote(SPITType *p_ptrSpitType) {
|
||||
if (p_ptrSpitType == NULL)
|
||||
return false;
|
||||
{
|
||||
s_SPITTypesRemote[p_ptrSpitType->getID()] = p_ptrSpitType;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
bool SPITType::removeSPITType(SPITType *p_ptrSpitType) {
|
||||
if (p_ptrSpitType == NULL)
|
||||
return false;
|
||||
{
|
||||
auto i = s_SPITTypes.find(p_ptrSpitType->getID());
|
||||
if (i == s_SPITTypes.end()) {
|
||||
return false;
|
||||
}
|
||||
i = s_SPITTypes.erase(i);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
bool SPITType::removeSPITTypeRemote(SPITType *p_ptrSpitType) {
|
||||
if (p_ptrSpitType == NULL)
|
||||
return false;
|
||||
{
|
||||
auto i = s_SPITTypesRemote.find(p_ptrSpitType->getID());
|
||||
if (i == s_SPITTypesRemote.end()) {
|
||||
return false;
|
||||
}
|
||||
i = s_SPITTypesRemote.erase(i);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
int SPITType::getSPITTypeCount() {
|
||||
return s_SPITTypes.size();
|
||||
}
|
||||
int SPITType::getSPITTypeRemoteCount() {
|
||||
return s_SPITTypesRemote.size();
|
||||
}
|
||||
SPITType *SPITType::getSPITType(int p_Index) {
|
||||
SPITType *ptrSPITType = NULL;
|
||||
{
|
||||
if (p_Index < s_SPITTypes.size()) {
|
||||
unordered_map<string, SPITType *>::iterator i = next(s_SPITTypes.begin(), p_Index);
|
||||
ptrSPITType = i->second;
|
||||
}
|
||||
return ptrSPITType;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Returns a reference to the SPITType at position p_Index.<br>
|
||||
* Throws an exception if p_Index is out of range.<br>
|
||||
* @param p_Index position
|
||||
* @return the reference of the SPITType at position.
|
||||
*/
|
||||
const SPITType &SPITType::getSPITTypeRef(int p_Index) {
|
||||
SPITType *ptrSPITType = NULL;
|
||||
{
|
||||
if (p_Index >= 0 && p_Index < s_SPITTypes.size()) {
|
||||
unordered_map<string, SPITType *>::iterator i = next(s_SPITTypes.begin(), p_Index);
|
||||
ptrSPITType = i->second;
|
||||
return *ptrSPITType;
|
||||
} else {
|
||||
throw "SPITType index out of range";
|
||||
}
|
||||
}
|
||||
}
|
||||
SPITType *SPITType::getSPITTypeRemote(int p_Index) {
|
||||
SPITType *ptrSPITType = NULL;
|
||||
{
|
||||
if (p_Index < s_SPITTypesRemote.size()) {
|
||||
unordered_map<string, SPITType *>::iterator i = next(s_SPITTypesRemote.begin(), p_Index);
|
||||
ptrSPITType = i->second;
|
||||
}
|
||||
return ptrSPITType;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Returns a reference to the remote SPITType at position p_Index.<br>
|
||||
* Throws an exception if p_Index is out of range.<br>
|
||||
* @param p_Index position
|
||||
* @return the reference of the SPITType at position.
|
||||
*/
|
||||
const SPITType &SPITType::getSPITTypeRemoteRef(int p_Index) {
|
||||
SPITType *ptrSPITType = NULL;
|
||||
{
|
||||
if (p_Index >= 0 && p_Index < s_SPITTypesRemote.size()) {
|
||||
unordered_map<string, SPITType *>::iterator i = next(s_SPITTypesRemote.begin(), p_Index);
|
||||
ptrSPITType = i->second;
|
||||
return *ptrSPITType;
|
||||
} else {
|
||||
throw "Remote SPITType index out of range";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SPITType::clearSPITTypes() {
|
||||
SPITType *ptrSPITType;
|
||||
{
|
||||
for (auto i = s_SPITTypes.begin(); i != s_SPITTypes.end(); i++) {
|
||||
ptrSPITType = i->second;
|
||||
i = s_SPITTypes.erase(i);
|
||||
delete ptrSPITType;
|
||||
if (i == s_SPITTypes.end()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
void SPITType::clearSPITTypesRemote() {
|
||||
SPITType *ptrSPITType;
|
||||
{
|
||||
for (auto i = s_SPITTypesRemote.begin(); i != s_SPITTypesRemote.end(); i++) {
|
||||
ptrSPITType = i->second;
|
||||
i = s_SPITTypesRemote.erase(i);
|
||||
delete ptrSPITType;
|
||||
if (i == s_SPITTypesRemote.end()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SPITType::eventProjectClosed() {
|
||||
SPITType *ptrSPITType;
|
||||
for (auto i = s_SPITTypes.begin(); i != s_SPITTypes.end(); i++) {
|
||||
ptrSPITType = i->second;
|
||||
void SPITType::eventProjectClosed(SpitRepo<SPITType> &repo, SpitRepo<SPITType> &remoteRepo) {
|
||||
auto &entries = repo.getRepo();
|
||||
for (auto i = entries.begin(); i != entries.end();) {
|
||||
SPITType *ptrSPITType = i->second.get();
|
||||
if (ptrSPITType->getCreatedByClient() == true) {
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
i = s_SPITTypes.erase(i);
|
||||
delete ptrSPITType;
|
||||
if (i == s_SPITTypes.end()) {
|
||||
break;
|
||||
}
|
||||
i = entries.erase(i);
|
||||
}
|
||||
// Remote
|
||||
for (auto i = s_SPITTypesRemote.begin(); i != s_SPITTypesRemote.end(); i++) {
|
||||
ptrSPITType = i->second;
|
||||
i = s_SPITTypesRemote.erase(i);
|
||||
delete ptrSPITType;
|
||||
if (i == s_SPITTypesRemote.end()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
remoteRepo.clearEntries();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets confirmed = false for all SPITTypes.<br>
|
||||
* This should be called when the client has loaded a project.<br>
|
||||
* Sets confirmed = false for all SPITTypes.
|
||||
* This should be called when the client has loaded a project.
|
||||
*/
|
||||
void SPITType::setConfirmedFalse() {
|
||||
SPITType *ptrSPITType;
|
||||
{
|
||||
for (auto i = s_SPITTypes.begin(); i != s_SPITTypes.end(); i++) {
|
||||
ptrSPITType = i->second;
|
||||
ptrSPITType->setConfirmed(false);
|
||||
}
|
||||
void SPITType::setConfirmedFalse(SpitRepo<SPITType> &repo) {
|
||||
auto &entries = repo.getRepo();
|
||||
for (auto i = entries.begin(); i != entries.end(); i++) {
|
||||
i->second->setConfirmed(false);
|
||||
}
|
||||
}
|
||||
|
||||
SPITType::SPITType() {
|
||||
initMembers();
|
||||
SPITType::SPITType(string p_ID) {
|
||||
m_ID = p_ID;
|
||||
}
|
||||
/*
|
||||
SPITType::SPITType(const SPITType& orig) {
|
||||
m_Confirmed = orig.getConfirmed();
|
||||
m_DefaultDelay = orig.getDefaultDelay();
|
||||
m_DefaultDuration = orig.getDefaultDuration();
|
||||
m_Fixed = orig.getFixed();
|
||||
m_GroupName = orig.getGroupName();
|
||||
m_ID = orig.getID();
|
||||
m_Name = orig.getName();
|
||||
m_ServerProjectIndepended = orig.getProjectIndepended();
|
||||
m_ServerRemote = orig.getServerRemote();
|
||||
}
|
||||
*/
|
||||
SPITType::SPITType(string p_ID, string p_GroupName, string p_Name, bool p_Fixed, bool p_ProjectIndepended, long long p_DefaultDelay, long long p_DefaultDuration) {
|
||||
initMembers();
|
||||
|
||||
SPITType::SPITType(string id, string grpName, string name, bool fixed, bool projectIndependent, long long defaultDelay, long long defaultDuration) {
|
||||
m_ActionAssigned = false;
|
||||
m_Confirmed = false;
|
||||
m_ID = p_ID;
|
||||
m_GroupName = p_GroupName;
|
||||
m_Name = p_Name;
|
||||
m_Fixed = p_Fixed;
|
||||
m_ServerProjectIndepended = p_ProjectIndepended;
|
||||
m_DefaultDelay = p_DefaultDelay;
|
||||
m_DefaultDuration = p_DefaultDuration;
|
||||
}
|
||||
|
||||
SPITType::~SPITType() {
|
||||
}
|
||||
|
||||
void SPITType::initMembers() {
|
||||
m_Confirmed = false;
|
||||
m_DefaultDelay = 0;
|
||||
m_DefaultDuration = 0;
|
||||
m_Fixed = false;
|
||||
m_GroupName = "";
|
||||
m_ID = createGUID();
|
||||
m_Name = "";
|
||||
m_ServerProjectIndepended = false;
|
||||
m_ServerRemote = false;
|
||||
m_ID = id;
|
||||
m_GroupName = grpName;
|
||||
m_Name = name;
|
||||
m_Fixed = fixed;
|
||||
m_ServerProjectIndepended = projectIndependent;
|
||||
m_DefaultDelay = defaultDelay;
|
||||
m_DefaultDuration = defaultDuration;
|
||||
}
|
||||
|
||||
void SPITType::setCreatedByClient(bool p_CreatedByClient) {
|
||||
m_CreatedByClient = p_CreatedByClient;
|
||||
}
|
||||
|
||||
void SPITType::setID(string p_ID) {
|
||||
m_ID = p_ID;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is used by the server and client to tell if the other side has registered the changes.
|
||||
* @param p_Confirmed
|
||||
@@ -303,14 +74,14 @@ bool SPITType::setConfirmed(bool p_Confirmed) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SPITType::setGroupName(string p_GroupName) {
|
||||
bool SPITType::setGroupName(const string &p_GroupName) {
|
||||
if (m_GroupName == p_GroupName)
|
||||
return false;
|
||||
m_GroupName = p_GroupName;
|
||||
m_Confirmed = false;
|
||||
return true;
|
||||
}
|
||||
bool SPITType::setName(string p_Name) {
|
||||
bool SPITType::setName(const string &p_Name) {
|
||||
if (m_Name == p_Name)
|
||||
return false;
|
||||
m_Name = p_Name;
|
||||
@@ -354,9 +125,9 @@ bool SPITType::setDefaultDuration(long long p_Duration) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Virtual construct - means ActionAssigned for SPITTypes is is not implemented in SPITProtocol.<br>
|
||||
* This can used to setActionAssigned to all SPITObjects with this SPITType.<br>
|
||||
* This may be used in the case when the same action should be done for every SPITObject with this SPITType associated.<br>
|
||||
* Virtual construct - means ActionAssigned for SPITTypes is is not implemented in SPITProtocol.
|
||||
* This can used to setActionAssigned to all SPITObjects with this SPITType.
|
||||
* This may be used in the case when the same action should be done for every SPITObject with this SPITType associated.
|
||||
* @return true = the m_ActionAssigned has changed.
|
||||
*/
|
||||
bool SPITType::setActionAssigned(bool p_ActionAssigned) {
|
||||
@@ -370,10 +141,10 @@ bool SPITType::setActionAssigned(bool p_ActionAssigned) {
|
||||
/**
|
||||
* Set the content of the SPITType as received from the server
|
||||
* @param p_ReportSPITType
|
||||
* @return true = the SPITType is changed<br>
|
||||
* @return true = the SPITType is changed
|
||||
* false = the SPITType is NOT changed, because it is not allowed to change.
|
||||
*/
|
||||
bool SPITType::setMessageOP(SPIT_Message::ReportSPITType *p_ReportSPITType) {
|
||||
bool SPITType::setMessageOP(SPIT_Message::ReportSPITType &reportSpitType) {
|
||||
bool boolChangeAllowed;
|
||||
bool boolChanged = false;
|
||||
|
||||
@@ -383,76 +154,84 @@ bool SPITType::setMessageOP(SPIT_Message::ReportSPITType *p_ReportSPITType) {
|
||||
boolChangeAllowed = true;
|
||||
}
|
||||
|
||||
// Confirmation should be changable
|
||||
// Confirmation should be changeable
|
||||
if (m_CreatedByClient) {
|
||||
// Server reports a client created SPITType -> the type is confirmed
|
||||
m_Confirmed = true;
|
||||
} else {
|
||||
// type is NOT client created -> the client has to confirm the SPITtype
|
||||
m_Confirmed = p_ReportSPITType->getConfirmed();
|
||||
m_Confirmed = reportSpitType.getConfirmed();
|
||||
}
|
||||
if (m_DefaultDelay != p_ReportSPITType->getDelay()) {
|
||||
if (boolChangeAllowed == false)
|
||||
throw new exception();
|
||||
m_DefaultDelay = p_ReportSPITType->getDelay();
|
||||
if (m_DefaultDelay != reportSpitType.getDelay()) {
|
||||
if (boolChangeAllowed == false) {
|
||||
return false;
|
||||
}
|
||||
m_DefaultDelay = reportSpitType.getDelay();
|
||||
boolChanged = true;
|
||||
}
|
||||
if (m_DefaultDuration != p_ReportSPITType->getDuration()) {
|
||||
if (boolChangeAllowed == false)
|
||||
throw new exception();
|
||||
m_DefaultDuration = p_ReportSPITType->getDuration();
|
||||
if (m_DefaultDuration != reportSpitType.getDuration()) {
|
||||
if (boolChangeAllowed == false) {
|
||||
return false;
|
||||
}
|
||||
m_DefaultDuration = reportSpitType.getDuration();
|
||||
boolChanged = true;
|
||||
}
|
||||
if (m_Fixed != p_ReportSPITType->getFixed()) {
|
||||
if (boolChangeAllowed == false)
|
||||
throw new exception();
|
||||
m_Fixed = p_ReportSPITType->getFixed();
|
||||
if (m_Fixed != reportSpitType.getFixed()) {
|
||||
if (boolChangeAllowed == false) {
|
||||
return false;
|
||||
}
|
||||
m_Fixed = reportSpitType.getFixed();
|
||||
boolChanged = true;
|
||||
}
|
||||
if (m_GroupName != p_ReportSPITType->getGroupName()) {
|
||||
if (boolChangeAllowed == false)
|
||||
throw new exception();
|
||||
m_GroupName = p_ReportSPITType->getGroupName();
|
||||
if (m_GroupName != reportSpitType.getGroupName()) {
|
||||
if (boolChangeAllowed == false) {
|
||||
return false;
|
||||
}
|
||||
m_GroupName = reportSpitType.getGroupName();
|
||||
boolChanged = true;
|
||||
}
|
||||
if (m_ID != p_ReportSPITType->getID()) {
|
||||
if (boolChangeAllowed == false)
|
||||
throw new exception();
|
||||
m_ID = p_ReportSPITType->getID();
|
||||
if (m_ID != reportSpitType.getID()) {
|
||||
if (boolChangeAllowed == false) {
|
||||
return false;
|
||||
}
|
||||
m_ID = reportSpitType.getID();
|
||||
boolChanged = true;
|
||||
}
|
||||
if (m_Name != p_ReportSPITType->getName()) {
|
||||
if (boolChangeAllowed == false)
|
||||
throw new exception();
|
||||
m_Name = p_ReportSPITType->getName();
|
||||
if (m_Name != reportSpitType.getName()) {
|
||||
if (boolChangeAllowed == false) {
|
||||
return false;
|
||||
}
|
||||
m_Name = reportSpitType.getName();
|
||||
boolChanged = true;
|
||||
}
|
||||
if (m_ServerProjectIndepended != p_ReportSPITType->getServerProjectIndepended()) {
|
||||
if (boolChangeAllowed == false)
|
||||
throw new exception();
|
||||
m_ServerProjectIndepended = p_ReportSPITType->getServerProjectIndepended();
|
||||
if (m_ServerProjectIndepended != reportSpitType.getServerProjectIndepended()) {
|
||||
if (boolChangeAllowed == false) {
|
||||
return false;
|
||||
}
|
||||
m_ServerProjectIndepended = reportSpitType.getServerProjectIndepended();
|
||||
boolChanged = true;
|
||||
}
|
||||
if (m_ServerRemote != p_ReportSPITType->getServerRemote()) {
|
||||
if (boolChangeAllowed == false)
|
||||
throw new exception();
|
||||
m_ServerRemote = p_ReportSPITType->getServerRemote();
|
||||
if (m_ServerRemote != reportSpitType.getServerRemote()) {
|
||||
if (boolChangeAllowed == false) {
|
||||
return false;
|
||||
}
|
||||
m_ServerRemote = reportSpitType.getServerRemote();
|
||||
boolChanged = true;
|
||||
}
|
||||
return boolChanged;
|
||||
}
|
||||
|
||||
void SPITType::fillMessageOP(SPIT_Message::ReportSPITType *ptrSMReportSPITType) {
|
||||
ptrSMReportSPITType->setConfirmed(m_Confirmed);
|
||||
ptrSMReportSPITType->setDelay(m_DefaultDelay);
|
||||
ptrSMReportSPITType->setDuration(m_DefaultDuration);
|
||||
ptrSMReportSPITType->setFixed(m_Fixed);
|
||||
ptrSMReportSPITType->setGroupName(m_GroupName);
|
||||
ptrSMReportSPITType->setID(m_ID);
|
||||
ptrSMReportSPITType->setName(m_Name);
|
||||
ptrSMReportSPITType->setServerProjectIndepended(m_ServerProjectIndepended);
|
||||
ptrSMReportSPITType->setServerRemote(m_ServerRemote);
|
||||
void SPITType::fillMessageOP(SPIT_Message::ReportSPITType &smReportSpitType) const {
|
||||
smReportSpitType.setConfirmed(m_Confirmed);
|
||||
smReportSpitType.setDelay(m_DefaultDelay);
|
||||
smReportSpitType.setDuration(m_DefaultDuration);
|
||||
smReportSpitType.setFixed(m_Fixed);
|
||||
smReportSpitType.setGroupName(m_GroupName);
|
||||
smReportSpitType.setID(m_ID);
|
||||
smReportSpitType.setName(m_Name);
|
||||
smReportSpitType.setServerProjectIndepended(m_ServerProjectIndepended);
|
||||
smReportSpitType.setServerRemote(m_ServerRemote);
|
||||
}
|
||||
void SPITType::fillMessageOP(SPIT_Message::RemoveSPITType *ptrSMRemoveSPITType) {
|
||||
ptrSMRemoveSPITType->setID(m_ID);
|
||||
void SPITType::fillMessageOP(SPIT_Message::RemoveSPITType &smRemoveSpitType) const {
|
||||
smRemoveSpitType.setID(m_ID);
|
||||
}
|
||||
|
||||
+550
-769
File diff suppressed because it is too large
Load Diff
+607
-1148
File diff suppressed because it is too large
Load Diff
+175
-299
@@ -11,302 +11,178 @@ I (57) boot: 0 nvs WiFi data 01 02 00009000 00006000
|
||||
I (64) boot: 1 phy_init RF data 01 01 0000f000 00001000
|
||||
I (72) boot: 2 factory factory app 00 00 00010000 00100000
|
||||
I (79) boot: End of partition table
|
||||
I (83) esp_image: segment 0: paddr=00010020 vaddr=42070020 size=29b54h (170836) map
|
||||
I (127) esp_image: segment 1: paddr=00039b7c vaddr=40800000 size=0649ch ( 25756) load
|
||||
I (134) esp_image: segment 2: paddr=00040020 vaddr=42000020 size=6a434h (435252) map
|
||||
I (225) esp_image: segment 3: paddr=000aa45c vaddr=4080649c size=07d28h ( 32040) load
|
||||
I (233) esp_image: segment 4: paddr=000b218c vaddr=4080e1d0 size=01c00h ( 7168) load
|
||||
I (239) boot: Loaded app from partition at offset 0x10000
|
||||
I (239) boot: Disabling RNG early entropy source...
|
||||
I (253) cpu_start: Unicore app
|
||||
I (262) cpu_start: Pro cpu start user code
|
||||
I (262) cpu_start: cpu freq: 160000000 Hz
|
||||
I (263) app_init: Application information:
|
||||
I (265) app_init: Project name: X_WatchController_FW
|
||||
I (271) app_init: App version: 3ec39a2-dirty
|
||||
I (277) app_init: Compile time: Mar 29 2025 16:21:16
|
||||
I (283) app_init: ELF file SHA256: c5ad318a2...
|
||||
I (288) app_init: ESP-IDF: v5.3
|
||||
I (292) efuse_init: Min chip rev: v0.0
|
||||
I (297) efuse_init: Max chip rev: v0.99
|
||||
I (302) efuse_init: Chip rev: v0.0
|
||||
I (307) heap_init: Initializing. RAM available for dynamic allocation:
|
||||
I (314) heap_init: At 40812190 len 0006A480 (425 KiB): RAM
|
||||
I (320) heap_init: At 4087C610 len 00002F54 (11 KiB): RAM
|
||||
I (326) heap_init: At 50000000 len 00003FE8 (15 KiB): RTCRAM
|
||||
I (334) spi_flash: detected chip: generic
|
||||
I (337) spi_flash: flash io: dio
|
||||
I (343) sleep: Configure to isolate all GPIO pins in sleep state
|
||||
I (348) sleep: Enable automatic switching of GPIO sleep configuration
|
||||
I (355) coexist: coex firmware version: dab85ae96
|
||||
I (383) coexist: coexist rom version 5b8dcfa
|
||||
I (383) main_task: Started on CPU0
|
||||
I (383) main_task: Calling app_main()
|
||||
I (393) esp_eth.netif.netif_glue: 42:4c:ca:ff:fe:4e
|
||||
I (393) esp_eth.netif.netif_glue: ethernet attached to netif
|
||||
I (403) Watch: Ethernet Started
|
||||
I (403) Watch: Start Lighting
|
||||
I (403) gpio: GPIO[10]| InputEn: 1| OutputEn: 1| OpenDrain: 1| Pullup: 1| Pulldown: 0| Intr:0
|
||||
I (413) gpio: GPIO[11]| InputEn: 1| OutputEn: 1| OpenDrain: 1| Pullup: 1| Pulldown: 0| Intr:0
|
||||
I (423) Watch: Start Stepper
|
||||
I (423) gpio: GPIO[18]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
|
||||
I (433) gpio: GPIO[8]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
|
||||
I (443) gpio: GPIO[15]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
|
||||
I (453) TMR: Create timer handle
|
||||
I (453) TMR: Setup timer
|
||||
I (453) Stepper: Find Home
|
||||
I (463) Stepper: Homing ...
|
||||
I (463) Stepper: Fast find right side of home sensor
|
||||
I (483) gpio: GPIO[1]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
|
||||
I (2133) Stepper: Find right side of home sensor
|
||||
I (2313) Stepper: Find end of sensor
|
||||
I (2403) Watch: Ethernet Link Up
|
||||
I (2403) Watch: Ethernet Link Up
|
||||
I (2403) Watch: Ethernet HW Addr 00:00:00:00:00:00
|
||||
I (3403) esp_netif_handlers: eth ip: 172.16.17.56, mask: 255.255.0.0, gw: 172.16.0.1
|
||||
I (3403) Watch: Ethernet Got IP Address
|
||||
I (3403) Watch: ~~~~~~~~~~~
|
||||
I (3403) Watch: ETHIP:172.16.17.56
|
||||
I (3413) Watch: ETHMASK:255.255.0.0
|
||||
I (3413) Watch: ETHGW:172.16.0.1
|
||||
I (3413) Watch: ~~~~~~~~~~~
|
||||
I (3423) Watch: Start net services
|
||||
I (3423) Watch: Starting Telnet task
|
||||
I (3423) Watch: Starting ArtNet task
|
||||
I (3423) Watch: Starting SPIT task
|
||||
I (3433) SPIT: Connected to eth
|
||||
I (3443) SPIT: - IPv4 address: 172.16.17.56,
|
||||
I (3443) SPIT: - IPv4 netmask: 255.255.0.0,
|
||||
I (3423) UDP: Starting syslog session to 172.16.16.10
|
||||
I (3433) TCP: Socket created
|
||||
I (3433) UDP: Socket bound, port 6454
|
||||
I (3453) Watch: NEW SPIT-Type ID: ActionStartShuffle GroupName: CatasWatchMovement Name: ActionStartShuffle confirmed: 0
|
||||
I (3453) SysLog: Starting Syslog Task
|
||||
I (3463) TCP: Socket bound, port 23
|
||||
I (3473) Watch: NEW SPIT-Type ID: ActionMoveTo1 GroupName: CatasWatchMovement Name: ActionMoveTo1 confirmed: 0
|
||||
I (3493) Watch: NEW SPIT-Type ID: ActionMoveTo2 GroupName: CatasWatchMovement Name: ActionMoveTo2 confirmed: 0
|
||||
I (3483) Telnet: Socket waiting for connect
|
||||
I (3483) UDP: Socket bound, port 514
|
||||
I (3503) Watch: NEW SPIT-Type ID: ActionMoveTo3 GroupName: CatasWatchMovement Name: ActionMoveTo3 confirmed: 0
|
||||
I (3523) Watch: NEW SPIT-Type ID: ActionMoveTo4 GroupName: CatasWatchMovement Name: ActionMoveTo4 confirmed: 0
|
||||
I (3533) Watch: NEW SPIT-Type ID: ActionMoveTo5 GroupName: CatasWatchMovement Name: ActionMoveTo5 confirmed: 0
|
||||
I (3543) Watch: NEW SPIT-Type ID: ActionMoveTo6 GroupName: CatasWatchMovement Name: ActionMoveTo6 confirmed: 0
|
||||
I (3553) SPIT: Starting Socket managing
|
||||
I (5713) Stepper: Find left side of home sensor
|
||||
I (6183) Stepper: Move back to mid position 145
|
||||
I (7633) Stepper: Reset position
|
||||
I (7633) Watch: Fist Position is 0.000000.2
|
||||
I (7663) Watch: SERVER DETECTED
|
||||
I (7663) Watch: Name: liveShowSPIT
|
||||
I (7663) Watch: ID: 698a3e4f-1ae9-4dd8-9015-29332d29629e
|
||||
I (7663) Watch: Computer: GgP17
|
||||
I (7663) Watch: IP: 172.16.16.10
|
||||
I (7673) Watch: Port: 15120
|
||||
I (7673) Watch: Addition:
|
||||
I (7673) Watch: ClientIP: 172.16.17.56
|
||||
I (7683) SPIT: connect to 172.16.16.10
|
||||
I (7683) Watch: MySPITApp: eventConnectionStatus 0
|
||||
I (7663) Watch: Changing picto-Illum to pos = 1
|
||||
I (7693) Watch: Current color set r128 g128 b128
|
||||
I (7693) Watch: MySPITApp: eventConnectionStatus 4
|
||||
I (8203) Watch: eventProjectReport ID: CatasWatchProject Name: CatasWatchProject FramesPerSecond: 44100
|
||||
I (8203) Watch: eventStartProjectTransfer
|
||||
I (8283) Watch: SPIT-Type CHANGED ID: ActionMoveTo5 GroupName: CatasWatchMovement Name: ActionMoveTo5 confirmed: 1
|
||||
I (8283) Watch: SPIT-Type CHANGED ID: ActionMoveTo4 GroupName: CatasWatchMovement Name: ActionMoveTo4 confirmed: 1
|
||||
I (8293) Watch: SPIT-Type CHANGED ID: ActionMoveTo3 GroupName: CatasWatchMovement Name: ActionMoveTo3 confirmed: 1
|
||||
I (8303) Watch: SPIT-Type CHANGED ID: ActionMoveTo6 GroupName: CatasWatchMovement Name: ActionMoveTo6 confirmed: 1
|
||||
I (8313) Watch: NEW SPIT-REMOTE-Type ID: playControlStart GroupName: Playcontrol Name: start confirmed: 1
|
||||
I (8323) Watch: NEW SPIT-REMOTE-Type ID: playControlPause GroupName: Playcontrol Name: pause confirmed: 1
|
||||
I (8343) Watch: NEW SPIT-REMOTE-Type ID: nextSceneBridge GroupName: Playcontrol Name: next scene confirmed: 1
|
||||
I (8353) Watch: NEW SPIT-REMOTE-Type ID: nextMainSceneBridge GroupName: Playcontrol Name: next main scene confirmed: 1
|
||||
I (8373) Watch: NEW SPIT-REMOTE-Type ID: previuosSceneBridge GroupName: Playcontrol Name: previous scene confirmed: 1
|
||||
I (8383) Watch: NEW SPIT-REMOTE-Type ID: previousMainSceneBridge GroupName: Playcontrol Name: previous main scene confirmed: 1
|
||||
I (8403) Watch: NEW SPIT-REMOTE-Type ID: mainmixerSound_Volume00 GroupName: Main Mixer Name: Sound confirmed: 1
|
||||
I (8423) Watch: NEW SPIT-REMOTE-Type ID: mainmixerDMX_Dimmer00 GroupName: Main Mixer Name: confirmed: 1
|
||||
I (8433) Watch: NEW SPIT-REMOTE-Type ID: mainmixerDMX_RGB00 GroupName: Main Mixer Name: confirmed: 1
|
||||
I (8453) Watch: NEW SPIT-REMOTE-Type ID: mainmixerDMX_RGB10 GroupName: Main Mixer Name: confirmed: 1
|
||||
I (8463) Watch: NEW SPIT-REMOTE-Type ID: mainmixerDMX_RGB20 GroupName: Main Mixer Name: confirmed: 1
|
||||
I (8483) Watch: NEW SPIT-REMOTE-Type ID: mainmixerDMX_RGB30 GroupName: Main Mixer Name: confirmed: 1
|
||||
I (8503) Watch: NEW SPIT-REMOTE-Type ID: mainmixerDMX_RGB40 GroupName: Main Mixer Name: confirmed: 1
|
||||
I (8513) Watch: NEW SPIT-REMOTE-Type ID: mainmixerDMX_RGB50 GroupName: Main Mixer Name: confirmed: 1
|
||||
I (8533) Watch: NEW SPIT-REMOTE-Type ID: mainmixerMedia_SoundVolume00 GroupName: Main Mixer Name: Media confirmed: 1
|
||||
I (8543) Watch: NEW SPIT-REMOTE-Type ID: mainmixerMedia_Transparency00 GroupName: Main Mixer Name: Media confirmed: 1
|
||||
I (8563) Watch: NEW SPIT-REMOTE-Type ID: selectedJingles GroupName: Playcontrol Name: selected Jingles confirmed: 1
|
||||
I (8573) Watch: NEW SPIT-REMOTE-Type ID: selectedJingleGroups GroupName: Playcontrol Name: selected Jinglegroups confirmed: 1
|
||||
I (8593) Watch: NEW SPIT-REMOTE-Type ID: 00000m8uedyyt0000000000000000lo0va8bom GroupName: MainScene Name: ChangingPositionScene confirmed: 1
|
||||
I (8603) Watch: NEW SPIT-REMOTE-Type ID: 00000m8uedyyt0000000000000000m70va8bom GroupName: MainScene Name: InPosition1Scene confirmed: 1
|
||||
I (8623) Watch: NEW SPIT-REMOTE-Type ID: 00000m8uedyyt0000000000000000mh0va8bom GroupName: MainScene Name: InPosition2Scene confirmed: 1
|
||||
I (8633) Watch: NEW SPIT-REMOTE-Type ID: 00000m8uedyyt0000000000000000mr0va8bom GroupName: MainScene Name: InPosition3Scene confirmed: 1
|
||||
I (8653) Watch: NEW SPIT-REMOTE-Type ID: 00000m8uedyyt0000000000000000nk0va8bom GroupName: MainScene Name: InPosition4Scene confirmed: 1
|
||||
I (8673) Watch: NEW SPIT-REMOTE-Type ID: 00000m8uedyyt0000000000000000nu0va8bom GroupName: MainScene Name: InPosition5Scene confirmed: 1
|
||||
I (8683) Watch: NEW SPIT-REMOTE-Type ID: 00000m8uedyyt0000000000000000o40va8bom GroupName: MainScene Name: InPosition6Scene confirmed: 1
|
||||
I (8703) Watch: NEW SPIT-REMOTE-Object ID: playControlStart Name: start -> SPITType: start
|
||||
I (8703) Watch: eventPlayRemoteObjectStatus RemoteSPITType: start RemoteSPITObject: start Position: 0 Value: 0
|
||||
I (8713) Watch: NEW SPIT-REMOTE-Object ID: playControlPause Name: pause -> SPITType: pause
|
||||
I (8723) Watch: eventPlayRemoteObjectStatus RemoteSPITType: pause RemoteSPITObject: pause Position: 0 Value: 0
|
||||
I (8733) Watch: NEW SPIT-REMOTE-Object ID: nextSceneBridge Name: next scene -> SPITType: next scene
|
||||
I (8743) Watch: eventPlayRemoteObjectStatus RemoteSPITType: next scene RemoteSPITObject: next scene Position: 0 Value: 0
|
||||
I (8753) Watch: NEW SPIT-REMOTE-Object ID: nextMainSceneBridge Name: next main scene -> SPITType: next main scene
|
||||
I (8763) Watch: eventPlayRemoteObjectStatus RemoteSPITType: next main scene RemoteSPITObject: next main scene Position: 0 Value: 0
|
||||
I (8773) Watch: NEW SPIT-REMOTE-Object ID: previuosSceneBridge Name: previous scene -> SPITType: previous scene
|
||||
I (8783) Watch: eventPlayRemoteObjectStatus RemoteSPITType: previous scene RemoteSPITObject: previous scene Position: 0 Value: 0
|
||||
I (8793) Watch: NEW SPIT-REMOTE-Object ID: previousMainSceneBridge Name: previous main scene -> SPITType: previous main scene
|
||||
I (8813) Watch: eventPlayRemoteObjectStatus RemoteSPITType: previous main scene RemoteSPITObject: previous main scene Position: 0 Value: 0
|
||||
I (8823) Watch: NEW SPIT-REMOTE-Object ID: mainmixerSound_Volume00 Name: Sound Volume -> SPITType: Sound
|
||||
I (8833) Watch: eventPlayRemoteObjectStatus RemoteSPITType: Sound RemoteSPITObject: Sound Volume Position: 0 Value: 500000
|
||||
I (8843) Watch: NEW SPIT-REMOTE-Object ID: mainmixerDMX_Dimmer00 Name: Dimmer -> SPITType:
|
||||
I (8853) Watch: eventPlayRemoteObjectStatus RemoteSPITType: RemoteSPITObject: Dimmer Position: 0 Value: 1000000
|
||||
I (8863) Watch: NEW SPIT-REMOTE-Object ID: mainmixerDMX_RGB00 Name: Red -> SPITType:
|
||||
I (8873) Watch: eventPlayRemoteObjectStatus RemoteSPITType: RemoteSPITObject: Red Position: 0 Value: 1000000
|
||||
I (8883) Watch: NEW SPIT-REMOTE-Object ID: mainmixerDMX_RGB10 Name: Green -> SPITType:
|
||||
I (8893) Watch: eventPlayRemoteObjectStatus RemoteSPITType: RemoteSPITObject: Green Position: 0 Value: 1000000
|
||||
I (8903) Watch: NEW SPIT-REMOTE-Object ID: mainmixerDMX_RGB20 Name: Blue -> SPITType:
|
||||
I (8913) Watch: eventPlayRemoteObjectStatus RemoteSPITType: RemoteSPITObject: Blue Position: 0 Value: 1000000
|
||||
I (8923) Watch: NEW SPIT-REMOTE-Object ID: mainmixerDMX_RGB30 Name: Cyan -> SPITType:
|
||||
I (8933) Watch: NEW SPIT-REMOTE-Object ID: mainmixerDMX_RGB40 Name: Magenta -> SPITType:
|
||||
I (8943) Watch: eventPlayRemoteObjectStatus RemoteSPITType: RemoteSPITObject: Magenta Position: 0 Value: 0
|
||||
I (8953) Watch: NEW SPIT-REMOTE-Object ID: mainmixerDMX_RGB50 Name: Yellow -> SPITType:
|
||||
I (8963) Watch: eventPlayRemoteObjectStatus RemoteSPITType: RemoteSPITObject: Yellow Position: 0 Value: 0
|
||||
I (8973) Watch: NEW SPIT-REMOTE-Object ID: mainmixerMedia_SoundVolume00 Name: Sound Volume -> SPITType: Media
|
||||
I (8983) Watch: NEW SPIT-REMOTE-Object ID: mainmixerMedia_Transparency00 Name: Media Transparency -> SPITType: Media
|
||||
I (8993) Watch: eventPlayRemoteObjectStatus RemoteSPITType: Media RemoteSPITObject: Media Transparency Position: 0 Value: 1000000
|
||||
I (9003) Watch: NEW SPIT-REMOTE-Object ID: selectedJinglesps Name: Play / Stop -> SPITType: selected Jingles
|
||||
I (9013) Watch: eventPlayRemoteObjectStatus RemoteSPITType: selected Jingles RemoteSPITObject: Play / Stop Position: 0 Value: 0
|
||||
I (9023) Watch: NEW SPIT-REMOTE-Object ID: selectedJinglespf Name: Play / Fade Out -> SPITType: selected Jingles
|
||||
I (9033) Watch: NEW SPIT-REMOTE-Object ID: selectedJingleGroupsps Name: Play / Stop -> SPITType: selected Jinglegroups
|
||||
I (9053) Watch: eventPlayRemoteObjectStatus RemoteSPITType: selected Jinglegroups RemoteSPITObject: Play / Stop Position: 0 Value: 0
|
||||
I (9063) Watch: NEW SPIT-REMOTE-Object ID: selectedJingleGroupspf Name: Play / Fade Out -> SPITType: selected Jinglegroups
|
||||
I (9073) Watch: NEW SPIT-REMOTE-Object ID: 00000m8uedyyt0000000000000000lo0va8bom Name: play -> SPITType: ChangingPositionScene
|
||||
I (9083) Watch: NEW SPIT-REMOTE-Object ID: 00000m8uedyyt0000000000000000m70va8bom Name: play -> SPITType: InPosition1Scene
|
||||
I (9093) Watch: eventPlayRemoteObjectStatus RemoteSPITType: InPosition1Scene RemoteSPITObject: play Position: 0 Value: 0
|
||||
I (9103) Watch: NEW SPIT-REMOTE-Object ID: 00000m8uedyyt0000000000000000mh0va8bom Name: play -> SPITType: InPosition2Scene
|
||||
I (9123) Watch: NEW SPIT-REMOTE-Object ID: 00000m8uedyyt0000000000000000mr0va8bom Name: play -> SPITType: InPosition3Scene
|
||||
I (9133) Watch: NEW SPIT-REMOTE-Object ID: 00000m8uedyyt0000000000000000nk0va8bom Name: play -> SPITType: InPosition4Scene
|
||||
I (9143) Watch: eventPlayRemoteObjectStatus RemoteSPITType: InPosition4Scene RemoteSPITObject: play Position: 0 Value: 0
|
||||
I (9153) Watch: NEW SPIT-REMOTE-Object ID: 00000m8uedyyt0000000000000000nu0va8bom Name: play -> SPITType: InPosition5Scene
|
||||
I (9163) Watch: NEW SPIT-REMOTE-Object ID: 00000m8uedyyt0000000000000000o40va8bom Name: play -> SPITType: InPosition6Scene
|
||||
I (9183) Watch: eventEndProjectTransfer
|
||||
W (9203) SPIT: Finished searching
|
||||
W (9203) SPIT: Start working
|
||||
I (9253) Watch: SPIT-Type CHANGED ID: ActionMoveTo5 GroupName: CatasWatchMovement Name: ActionMoveTo5 confirmed: 1
|
||||
I (9253) Watch: SPIT-Type CHANGED ID: ActionMoveTo4 GroupName: CatasWatchMovement Name: ActionMoveTo4 confirmed: 1
|
||||
I (9263) Watch: SPIT-Type CHANGED ID: ActionMoveTo3 GroupName: CatasWatchMovement Name: ActionMoveTo3 confirmed: 1
|
||||
I (9273) Watch: SPIT-Type CHANGED ID: ActionMoveTo6 GroupName: CatasWatchMovement Name: ActionMoveTo6 confirmed: 1
|
||||
I (9283) Watch: SPIT-Type CHANGED ID: ActionMoveTo2 GroupName: CatasWatchMovement Name: ActionMoveTo2 confirmed: 1
|
||||
I (9293) Watch: SPIT-Type CHANGED ID: ActionMoveTo1 GroupName: CatasWatchMovement Name: ActionMoveTo1 confirmed: 1
|
||||
I (459853) Watch: SPIT-Type CHANGED ID: ActionMoveTo1 GroupName: CatasWatchMovement Name: ActionMoveTo1 confirmed: 1
|
||||
I (459853) Watch: SPIT-Type CHANGED ID: ActionMoveTo1 GroupName: CatasWatchMovement Name: ActionMoveTo1 confirmed: 1
|
||||
I (459863) Watch: SPIT-Type CHANGED ID: ActionMoveTo6 GroupName: CatasWatchMovement Name: ActionMoveTo6 confirmed: 1
|
||||
I (459883) Watch: SPIT-Type CHANGED ID: ActionMoveTo6 GroupName: CatasWatchMovement Name: ActionMoveTo6 confirmed: 1
|
||||
I (459893) Watch: SPIT-Type CHANGED ID: ActionMoveTo4 GroupName: CatasWatchMovement Name: ActionMoveTo4 confirmed: 1
|
||||
I (459903) Watch: SPIT-Type CHANGED ID: ActionMoveTo4 GroupName: CatasWatchMovement Name: ActionMoveTo4 confirmed: 1
|
||||
I (466093) Watch: NEW SPIT-Object ID: 00000m8uedyyt0000000000000000zq0va8bom Name: -> SPITType: ActionStartShuffle
|
||||
I (466733) Watch: SPIT-Object CHANGED ID: 00000m8uedyyt0000000000000000zq0va8bom Name: -> SPITType: ActionStartShuffle
|
||||
I (468643) Watch: SPIT-Object CHANGED ID: 00000m8uedyyt0000000000000000zq0va8bom Name: -> SPITType: ActionStartShuffle
|
||||
I (471243) Watch: NEW SPIT-Object ID: 00000m8uedyyt00000000000000010u0va8bom Name: -> SPITType: ActionMoveTo1
|
||||
I (472153) Watch: SPIT-Object CHANGED ID: 00000m8uedyyt00000000000000010u0va8bom Name: -> SPITType: ActionMoveTo1
|
||||
I (473403) Watch: NEW SPIT-Object ID: 00000m8uedyyt00000000000000011a0va8bom Name: -> SPITType: ActionMoveTo2
|
||||
I (474763) Watch: SPIT-Object CHANGED ID: 00000m8uedyyt00000000000000011a0va8bom Name: -> SPITType: ActionMoveTo2
|
||||
I (483183) Watch: NEW SPIT-Object ID: 00000m8uedyyt00000000000000011s0va8bom Name: -> SPITType: ActionMoveTo3
|
||||
I (483283) Watch: SPIT-Object CHANGED ID: 00000m8uedyyt00000000000000011s0va8bom Name: -> SPITType: ActionMoveTo3
|
||||
I (483333) Watch: SPIT-Object CHANGED ID: 00000m8uedyyt00000000000000011s0va8bom Name: -> SPITType: ActionMoveTo3
|
||||
I (483703) Watch: SPIT-Object CHANGED ID: 00000m8uedyyt00000000000000011s0va8bom Name: -> SPITType: ActionMoveTo3
|
||||
I (484613) Watch: SPIT-Object CHANGED ID: 00000m8uedyyt00000000000000011s0va8bom Name: -> SPITType: ActionMoveTo3
|
||||
I (485993) Watch: NEW SPIT-Object ID: 00000m8uedyyt00000000000000012m0va8bom Name: -> SPITType: ActionMoveTo4
|
||||
I (486063) Watch: SPIT-Object CHANGED ID: 00000m8uedyyt00000000000000012m0va8bom Name: -> SPITType: ActionMoveTo4
|
||||
I (486593) Watch: SPIT-Object CHANGED ID: 00000m8uedyyt00000000000000012m0va8bom Name: -> SPITType: ActionMoveTo4
|
||||
I (488103) Watch: NEW SPIT-Object ID: 00000m8uedyyt0000000000000001330va8bom Name: -> SPITType: ActionMoveTo5
|
||||
I (489273) Watch: SPIT-Object CHANGED ID: 00000m8uedyyt0000000000000001330va8bom Name: -> SPITType: ActionMoveTo5
|
||||
I (490913) Watch: NEW SPIT-Object ID: 00000m8uedyyt00000000000000013r0va8bom Name: -> SPITType: ActionMoveTo6
|
||||
I (491043) Watch: SPIT-Object CHANGED ID: 00000m8uedyyt00000000000000013r0va8bom Name: -> SPITType: ActionMoveTo6
|
||||
I (491083) Watch: SPIT-Object CHANGED ID: 00000m8uedyyt00000000000000013r0va8bom Name: -> SPITType: ActionMoveTo6
|
||||
I (493163) Watch: NEW SPIT-Object ID: 00000m8uedyyt0000000000000001470va8bom Name: -> SPITType: ActionMoveTo6
|
||||
I (493243) Watch: SPIT-Object CHANGED ID: 00000m8uedyyt0000000000000001470va8bom Name: -> SPITType: ActionMoveTo6
|
||||
I (493353) Watch: SPIT-Object CHANGED ID: 00000m8uedyyt0000000000000001470va8bom Name: -> SPITType: ActionMoveTo6
|
||||
I (493883) Watch: SPIT-Object CHANGED ID: 00000m8uedyyt0000000000000001470va8bom Name: -> SPITType: ActionMoveTo6
|
||||
I (503223) Watch: eventProjectReport ID: CatasWatchProject Name: CatasWatchProject FramesPerSecond: 44100
|
||||
I (503373) Watch: eventStartProjectTransfer
|
||||
I (503373) Watch: SPIT-Type CHANGED ID: ActionStartShuffle GroupName: CatasWatchMovement Name: ActionStartShuffle confirmed: 1
|
||||
I (503373) Watch: SPIT-Type CHANGED ID: ActionMoveTo5 GroupName: CatasWatchMovement Name: ActionMoveTo5 confirmed: 1
|
||||
I (503383) Watch: SPIT-Type CHANGED ID: ActionMoveTo4 GroupName: CatasWatchMovement Name: ActionMoveTo4 confirmed: 1
|
||||
I (503393) Watch: SPIT-Type CHANGED ID: ActionMoveTo1 GroupName: CatasWatchMovement Name: ActionMoveTo1 confirmed: 1
|
||||
I (503413) Watch: SPIT-Type CHANGED ID: ActionMoveTo3 GroupName: CatasWatchMovement Name: ActionMoveTo3 confirmed: 1
|
||||
I (503423) Watch: SPIT-Object CHANGED ID: 00000m8uedyyt00000000000000011s0va8bom Name: -> SPITType: ActionMoveTo3
|
||||
I (503433) Watch: SPIT-Object CHANGED ID: 00000m8uedyyt00000000000000012m0va8bom Name: -> SPITType: ActionMoveTo4
|
||||
I (503443) Watch: SPIT-Object CHANGED ID: 00000m8uedyyt0000000000000001330va8bom Name: -> SPITType: ActionMoveTo5
|
||||
I (503453) Watch: SPIT-Object CHANGED ID: 00000m8uedyyt0000000000000001470va8bom Name: -> SPITType: ActionMoveTo6
|
||||
I (503463) Watch: SPIT-REMOTE-Type CHANGED ID: playControlStart GroupName: Playcontrol Name: start confirmed: 1
|
||||
I (503473) Watch: SPIT-REMOTE-Type CHANGED ID: playControlPause GroupName: Playcontrol Name: pause confirmed: 1
|
||||
I (503483) Watch: SPIT-REMOTE-Type CHANGED ID: nextSceneBridge GroupName: Playcontrol Name: next scene confirmed: 1
|
||||
I (503493) Watch: SPIT-REMOTE-Type CHANGED ID: nextMainSceneBridge GroupName: Playcontrol Name: next main scene confirmed: 1
|
||||
I (503513) Watch: SPIT-REMOTE-Type CHANGED ID: previuosSceneBridge GroupName: Playcontrol Name: previous scene confirmed: 1
|
||||
I (503523) Watch: SPIT-REMOTE-Type CHANGED ID: previousMainSceneBridge GroupName: Playcontrol Name: previous main scene confirmed: 1
|
||||
I (503543) Watch: SPIT-REMOTE-Type CHANGED ID: mainmixerSound_Volume00 GroupName: Main Mixer Name: Sound confirmed: 1
|
||||
I (503553) Watch: SPIT-REMOTE-Type CHANGED ID: mainmixerDMX_Dimmer00 GroupName: Main Mixer Name: confirmed: 1
|
||||
I (503573) Watch: SPIT-REMOTE-Type CHANGED ID: mainmixerDMX_RGB00 GroupName: Main Mixer Name: confirmed: 1
|
||||
I (503583) Watch: SPIT-REMOTE-Type CHANGED ID: mainmixerDMX_RGB10 GroupName: Main Mixer Name: confirmed: 1
|
||||
I (503603) Watch: SPIT-REMOTE-Type CHANGED ID: mainmixerDMX_RGB20 GroupName: Main Mixer Name: confirmed: 1
|
||||
I (503613) Watch: SPIT-REMOTE-Type CHANGED ID: mainmixerDMX_RGB30 GroupName: Main Mixer Name: confirmed: 1
|
||||
I (503633) Watch: SPIT-REMOTE-Type CHANGED ID: mainmixerDMX_RGB40 GroupName: Main Mixer Name: confirmed: 1
|
||||
I (503653) Watch: SPIT-REMOTE-Type CHANGED ID: mainmixerDMX_RGB50 GroupName: Main Mixer Name: confirmed: 1
|
||||
I (503663) Watch: SPIT-REMOTE-Type CHANGED ID: mainmixerMedia_SoundVolume00 GroupName: Main Mixer Name: Media confirmed: 1
|
||||
I (503683) Watch: SPIT-REMOTE-Type CHANGED ID: mainmixerMedia_Transparency00 GroupName: Main Mixer Name: Media confirmed: 1
|
||||
I (503693) Watch: SPIT-REMOTE-Type CHANGED ID: selectedJingles GroupName: Playcontrol Name: selected Jingles confirmed: 1
|
||||
I (503713) Watch: SPIT-REMOTE-Type CHANGED ID: selectedJingleGroups GroupName: Playcontrol Name: selected Jinglegroups confirmed: 1
|
||||
I (503723) Watch: SPIT-REMOTE-Type CHANGED ID: 00000m8uedyyt0000000000000000lo0va8bom GroupName: MainScene Name: ChangingPositionScene confirmed: 1
|
||||
I (503743) Watch: SPIT-REMOTE-Type CHANGED ID: 00000m8uedyyt0000000000000000m70va8bom GroupName: MainScene Name: InPosition1Scene confirmed: 1
|
||||
I (503753) Watch: SPIT-REMOTE-Type CHANGED ID: 00000m8uedyyt0000000000000000mh0va8bom GroupName: MainScene Name: InPosition2Scene confirmed: 1
|
||||
I (503773) Watch: SPIT-REMOTE-Type CHANGED ID: 00000m8uedyyt0000000000000000mr0va8bom GroupName: MainScene Name: InPosition3Scene confirmed: 1
|
||||
I (503793) Watch: SPIT-REMOTE-Type CHANGED ID: 00000m8uedyyt0000000000000000nk0va8bom GroupName: MainScene Name: InPosition4Scene confirmed: 1
|
||||
I (503803) Watch: SPIT-REMOTE-Type CHANGED ID: 00000m8uedyyt0000000000000000nu0va8bom GroupName: MainScene Name: InPosition5Scene confirmed: 1
|
||||
I (503823) Watch: SPIT-REMOTE-Type CHANGED ID: 00000m8uedyyt0000000000000000o40va8bom GroupName: MainScene Name: InPosition6Scene confirmed: 1
|
||||
I (503833) Watch: SPIT-REMOTE-Object CHANGED ID: playControlStart Name: start -> SPITType: start
|
||||
I (503833) Watch: eventPlayRemoteObjectStatus RemoteSPITType: start RemoteSPITObject: start Position: 0 Value: 0
|
||||
I (503853) Watch: SPIT-REMOTE-Object CHANGED ID: playControlPause Name: pause -> SPITType: pause
|
||||
I (503853) Watch: eventPlayRemoteObjectStatus RemoteSPITType: pause RemoteSPITObject: pause Position: 0 Value: 0
|
||||
I (503863) Watch: SPIT-REMOTE-Object CHANGED ID: nextSceneBridge Name: next scene -> SPITType: next scene
|
||||
I (503873) Watch: eventPlayRemoteObjectStatus RemoteSPITType: next scene RemoteSPITObject: next scene Position: 0 Value: 0
|
||||
I (503883) Watch: SPIT-REMOTE-Object CHANGED ID: nextMainSceneBridge Name: next main scene -> SPITType: next main scene
|
||||
I (503903) Watch: eventPlayRemoteObjectStatus RemoteSPITType: next main scene RemoteSPITObject: next main scene Position: 0 Value: 0
|
||||
I (503913) Watch: SPIT-REMOTE-Object CHANGED ID: previuosSceneBridge Name: previous scene -> SPITType: previous scene
|
||||
I (503923) Watch: eventPlayRemoteObjectStatus RemoteSPITType: previous scene RemoteSPITObject: previous scene Position: 0 Value: 0
|
||||
I (503933) Watch: SPIT-REMOTE-Object CHANGED ID: previousMainSceneBridge Name: previous main scene -> SPITType: previous main scene
|
||||
I (503953) Watch: eventPlayRemoteObjectStatus RemoteSPITType: previous main scene RemoteSPITObject: previous main scene Position: 0 Value: 0
|
||||
I (503963) Watch: SPIT-REMOTE-Object CHANGED ID: mainmixerSound_Volume00 Name: Sound Volume -> SPITType: Sound
|
||||
I (503973) Watch: eventPlayRemoteObjectStatus RemoteSPITType: Sound RemoteSPITObject: Sound Volume Position: 0 Value: 500000
|
||||
I (503983) Watch: SPIT-REMOTE-Object CHANGED ID: mainmixerDMX_Dimmer00 Name: Dimmer -> SPITType:
|
||||
I (503993) Watch: eventPlayRemoteObjectStatus RemoteSPITType: RemoteSPITObject: Dimmer Position: 0 Value: 1000000
|
||||
I (504003) Watch: SPIT-REMOTE-Object CHANGED ID: mainmixerDMX_RGB00 Name: Red -> SPITType:
|
||||
I (504013) Watch: eventPlayRemoteObjectStatus RemoteSPITType: RemoteSPITObject: Red Position: 0 Value: 1000000
|
||||
I (504023) Watch: SPIT-REMOTE-Object CHANGED ID: mainmixerDMX_RGB10 Name: Green -> SPITType:
|
||||
I (504033) Watch: eventPlayRemoteObjectStatus RemoteSPITType: RemoteSPITObject: Green Position: 0 Value: 1000000
|
||||
I (504043) Watch: SPIT-REMOTE-Object CHANGED ID: mainmixerDMX_RGB20 Name: Blue -> SPITType:
|
||||
I (504053) Watch: SPIT-REMOTE-Object CHANGED ID: mainmixerDMX_RGB30 Name: Cyan -> SPITType:
|
||||
I (504063) Watch: eventPlayRemoteObjectStatus RemoteSPITType: RemoteSPITObject: Cyan Position: 0 Value: 0
|
||||
I (504073) Watch: SPIT-REMOTE-Object CHANGED ID: mainmixerDMX_RGB40 Name: Magenta -> SPITType:
|
||||
I (504083) Watch: SPIT-REMOTE-Object CHANGED ID: mainmixerDMX_RGB50 Name: Yellow -> SPITType:
|
||||
I (504093) Watch: eventPlayRemoteObjectStatus RemoteSPITType: RemoteSPITObject: Yellow Position: 0 Value: 0
|
||||
I (504103) Watch: SPIT-REMOTE-Object CHANGED ID: mainmixerMedia_SoundVolume00 Name: Sound Volume -> SPITType: Media
|
||||
I (504113) Watch: eventPlayRemoteObjectStatus RemoteSPITType: Media RemoteSPITObject: Sound Volume Position: 0 Value: 500000
|
||||
I (504123) Watch: SPIT-REMOTE-Object CHANGED ID: mainmixerMedia_Transparency00 Name: Media Transparency -> SPITType: Media
|
||||
I (504133) Watch: SPIT-REMOTE-Object CHANGED ID: selectedJinglesps Name: Play / Stop -> SPITType: selected Jingles
|
||||
I (504143) Watch: eventPlayRemoteObjectStatus RemoteSPITType: selected Jingles RemoteSPITObject: Play / Stop Position: 0 Value: 0
|
||||
I (504163) Watch: SPIT-REMOTE-Object CHANGED ID: selectedJinglespf Name: Play / Fade Out -> SPITType: selected Jingles
|
||||
I (504173) Watch: SPIT-REMOTE-Object CHANGED ID: selectedJingleGroupsps Name: Play / Stop -> SPITType: selected Jinglegroups
|
||||
I (504183) Watch: eventPlayRemoteObjectStatus RemoteSPITType: selected Jinglegroups RemoteSPITObject: Play / Stop Position: 0 Value: 0
|
||||
I (504193) Watch: SPIT-REMOTE-Object CHANGED ID: selectedJingleGroupspf Name: Play / Fade Out -> SPITType: selected Jinglegroups
|
||||
I (504213) Watch: SPIT-REMOTE-Object CHANGED ID: 00000m8uedyyt0000000000000000lo0va8bom Name: play -> SPITType: ChangingPositionScene
|
||||
I (504223) Watch: eventPlayRemoteObjectStatus RemoteSPITType: ChangingPositionScene RemoteSPITObject: play Position: 0 Value: 0
|
||||
I (504233) Watch: SPIT-REMOTE-Object CHANGED ID: 00000m8uedyyt0000000000000000m70va8bom Name: play -> SPITType: InPosition1Scene
|
||||
I (504243) Watch: SPIT-REMOTE-Object CHANGED ID: 00000m8uedyyt0000000000000000mh0va8bom Name: play -> SPITType: InPosition2Scene
|
||||
I (504253) Watch: SPIT-REMOTE-Object CHANGED ID: 00000m8uedyyt0000000000000000mr0va8bom Name: play -> SPITType: InPosition3Scene
|
||||
I (504273) Watch: SPIT-REMOTE-Object CHANGED ID: 00000m8uedyyt0000000000000000nk0va8bom Name: play -> SPITType: InPosition4Scene
|
||||
I (504283) Watch: SPIT-REMOTE-Object CHANGED ID: 00000m8uedyyt0000000000000000nu0va8bom Name: play -> SPITType: InPosition5Scene
|
||||
I (504293) Watch: SPIT-REMOTE-Object CHANGED ID: 00000m8uedyyt0000000000000000o40va8bom Name: play -> SPITType: InPosition6Scene
|
||||
I (504303) Watch: eventEndProjectTransfer
|
||||
I (504433) Watch: SPIT-Type CHANGED ID: ActionMoveTo5 GroupName: CatasWatchMovement Name: ActionMoveTo5 confirmed: 1
|
||||
I (504433) Watch: SPIT-Type CHANGED ID: ActionMoveTo4 GroupName: CatasWatchMovement Name: ActionMoveTo4 confirmed: 1
|
||||
I (504443) Watch: SPIT-Type CHANGED ID: ActionMoveTo3 GroupName: CatasWatchMovement Name: ActionMoveTo3 confirmed: 1
|
||||
I (504453) Watch: SPIT-Type CHANGED ID: ActionMoveTo6 GroupName: CatasWatchMovement Name: ActionMoveTo6 confirmed: 1
|
||||
I (504463) Watch: SPIT-Type CHANGED ID: ActionMoveTo2 GroupName: CatasWatchMovement Name: ActionMoveTo2 confirmed: 1
|
||||
I (504473) Watch: SPIT-Type CHANGED ID: ActionMoveTo1 GroupName: CatasWatchMovement Name: ActionMoveTo1 confirmed: 1
|
||||
I (83) esp_image: segment 0: paddr=00010020 vaddr=42070020 size=2b2e0h (176864) map
|
||||
I (128) esp_image: segment 1: paddr=0003b308 vaddr=40800000 size=04d10h ( 19728) load
|
||||
I (134) esp_image: segment 2: paddr=00040020 vaddr=42000020 size=6bfe0h (442336) map
|
||||
I (226) esp_image: segment 3: paddr=000ac008 vaddr=40804d10 size=094b0h ( 38064) load
|
||||
I (235) esp_image: segment 4: paddr=000b54c0 vaddr=4080e1c0 size=01bd0h ( 7120) load
|
||||
I (241) boot: Loaded app from partition at offset 0x10000
|
||||
I (242) boot: Disabling RNG early entropy source...
|
||||
I (256) cpu_start: Unicore app
|
||||
I (265) cpu_start: Pro cpu start user code
|
||||
I (265) cpu_start: cpu freq: 160000000 Hz
|
||||
I (265) app_init: Application information:
|
||||
I (268) app_init: Project name: X_WatchController_FW
|
||||
I (274) app_init: App version: 858b7d8-dirty
|
||||
I (279) app_init: Compile time: Apr 8 2025 22:42:59
|
||||
I (285) app_init: ELF file SHA256: ab11b461f...
|
||||
I (290) app_init: ESP-IDF: v5.3
|
||||
I (295) efuse_init: Min chip rev: v0.0
|
||||
I (300) efuse_init: Max chip rev: v0.99
|
||||
I (305) efuse_init: Chip rev: v0.0
|
||||
I (309) heap_init: Initializing. RAM available for dynamic allocation:
|
||||
I (317) heap_init: At 40812120 len 0006A4F0 (425 KiB): RAM
|
||||
I (323) heap_init: At 4087C610 len 00002F54 (11 KiB): RAM
|
||||
I (329) heap_init: At 50000000 len 00003FE8 (15 KiB): RTCRAM
|
||||
I (336) spi_flash: detected chip: generic
|
||||
I (340) spi_flash: flash io: dio
|
||||
I (345) sleep: Configure to isolate all GPIO pins in sleep state
|
||||
I (351) sleep: Enable automatic switching of GPIO sleep configuration
|
||||
I (358) coexist: coex firmware version: dab85ae96
|
||||
I (385) coexist: coexist rom version 5b8dcfa
|
||||
I (386) main_task: Started on CPU0
|
||||
I (386) main_task: Calling app_main()
|
||||
I (396) esp_eth.netif.netif_glue: 42:4c:ca:ff:fe:4e
|
||||
I (396) esp_eth.netif.netif_glue: ethernet attached to netif
|
||||
I (406) Watch: Ethernet Started
|
||||
I (406) Watch: Start Lighting
|
||||
I (406) gpio: GPIO[10]| InputEn: 1| OutputEn: 1| OpenDrain: 1| Pullup: 1| Pulldown: 0| Intr:0
|
||||
I (416) gpio: GPIO[11]| InputEn: 1| OutputEn: 1| OpenDrain: 1| Pullup: 1| Pulldown: 0| Intr:0
|
||||
I (426) Watch: Start Stepper
|
||||
I (426) gpio: GPIO[18]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
|
||||
I (436) gpio: GPIO[8]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
|
||||
I (446) gpio: GPIO[15]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
|
||||
I (456) TMR: Create timer handle
|
||||
I (456) TMR: Setup timer
|
||||
I (456) Stepper: Find Home
|
||||
I (466) Stepper: Homing ...
|
||||
I (466) Stepper: Fast find right side of home sensor
|
||||
I (486) gpio: GPIO[1]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
|
||||
I (2206) Stepper: Find right side of home sensor
|
||||
I (2376) Stepper: Find end of sensor
|
||||
I (2406) Watch: Ethernet Link Up
|
||||
I (2406) Watch: Ethernet Link Up
|
||||
I (2406) Watch: Ethernet HW Addr 00:00:00:00:00:00
|
||||
I (3406) esp_netif_handlers: eth ip: 172.16.17.56, mask: 255.255.0.0, gw: 172.16.0.1
|
||||
I (3406) Watch: Ethernet Got IP Address
|
||||
I (3406) Watch: ~~~~~~~~~~~
|
||||
I (3406) Watch: ETHIP:172.16.17.56
|
||||
I (3416) Watch: ETHMASK:255.255.0.0
|
||||
I (3416) Watch: ETHGW:172.16.0.1
|
||||
I (3416) Watch: ~~~~~~~~~~~
|
||||
I (5186) Stepper: Find left side of home sensor
|
||||
I (5646) Stepper: Move back to mid position 116
|
||||
I (6806) Stepper: Reset position
|
||||
I (7086) Stepper: Got to 1
|
||||
I (7086) Watch: Fist Position is 0.03
|
||||
I (7106) Watch: Changing picto-Illum to pos = 0
|
||||
I (7106) Watch: Current color set r128 g128 b128
|
||||
I (13426) Watch: Start net services
|
||||
I (13426) Watch: Starting Telnet task
|
||||
I (13426) TCP: Socket created
|
||||
I (13426) Watch: Starting ArtNet task
|
||||
I (13426) TCP: Socket bound, port 23
|
||||
I (13426) Watch: Starting SPIT task
|
||||
I (13426) UDP: Starting syslog session to 172.16.16.10
|
||||
I (13426) UDP: Socket bound, port 6454
|
||||
I (13436) Telnet: Socket waiting for connect
|
||||
I (13436) SPIT: Connected to eth
|
||||
I (13456) SPIT: - IPv4 address: 172.16.17.56,
|
||||
I (13456) SPIT: - IPv4 netmask: 255.255.0.0,
|
||||
I (13446) SysLog: Starting Syslog Task
|
||||
I (13466) Watch: NEW SPIT-Type ID: ActionStartShuffle GroupName: CatasWatchMovement Name: ActionStartShuffle confirmed: 0
|
||||
I (13466) UDP: Socket bound, port 514
|
||||
I (13486) Watch: NEW SPIT-Type ID: ActionMoveTo1 GroupName: CatasWatchMovement Name: ActionMoveTo1 confirmed: 0
|
||||
I (13496) Watch: NEW SPIT-Type ID: ActionMoveTo2 GroupName: CatasWatchMovement Name: ActionMoveTo2 confirmed: 0
|
||||
I (13506) Watch: NEW SPIT-Type ID: ActionMoveTo3 GroupName: CatasWatchMovement Name: ActionMoveTo3 confirmed: 0
|
||||
I (13516) Watch: NEW SPIT-Type ID: ActionMoveTo4 GroupName: CatasWatchMovement Name: ActionMoveTo4 confirmed: 0
|
||||
I (13526) Watch: NEW SPIT-Type ID: ActionMoveTo5 GroupName: CatasWatchMovement Name: ActionMoveTo5 confirmed: 0
|
||||
I (13536) Watch: NEW SPIT-Type ID: ActionMoveTo6 GroupName: CatasWatchMovement Name: ActionMoveTo6 confirmed: 0
|
||||
I (13546) SPIT: Starting Socket managing
|
||||
I (17656) Watch: SERVER DETECTED
|
||||
I (17656) Watch: Name: liveShowSPIT
|
||||
I (17656) Watch: ID: 698a3e4f-1ae9-4dd8-9015-29332d29629e
|
||||
I (17656) Watch: Computer: GgP17
|
||||
I (17656) Watch: IP: 172.16.16.10
|
||||
I (17666) Watch: Port: 15120
|
||||
I (17666) Watch: Addition:
|
||||
I (17666) Watch: ClientIP: 172.16.17.56
|
||||
I (17676) SPIT: connect to 172.16.16.10 / 15120
|
||||
I (17676) Watch: MySPITApp: eventConnectionStatus 0->0
|
||||
I (17686) Watch: MySPITApp: eventConnectionStatus 0->4
|
||||
I (18196) Watch: eventProjectReport ID: CatasWatchProject
|
||||
I (18196) Watch: eventStartProjectTransfer
|
||||
W (18306) SPIT: TypeVeto e019646a-4e24-4608-954e-da4ca6761bb6 / ToIgnore 43
|
||||
I (18326) Watch: NEW SPIT-Object ID: 00000m8uedyyt0000000000000002sb0va8bom Name: -> SPITType: ActionStartShuffle
|
||||
I (18336) Watch: NEW SPIT-Object ID: 00000m8uedyyt0000000000000002rd0va8bom Name: -> SPITType: ActionMoveTo1
|
||||
I (18356) Watch: NEW SPIT-Object ID: 00000m8uedyyt0000000000000002vl0va8bom Name: -> SPITType: ActionMoveTo2
|
||||
I (18366) Watch: NEW SPIT-Object ID: 00000m8uedyyt0000000000000002wh0va8bom Name: -> SPITType: ActionMoveTo3
|
||||
I (18386) Watch: NEW SPIT-Object ID: 00000m8uedyyt0000000000000002yl0va8bom Name: -> SPITType: ActionMoveTo4
|
||||
I (18396) Watch: NEW SPIT-Object ID: 00000m8uedyyt0000000000000002tc0va8bom Name: -> SPITType: ActionMoveTo5
|
||||
I (18416) Watch: NEW SPIT-Object ID: 00000m8uedyyt0000000000000002zi0va8bom Name: -> SPITType: ActionMoveTo6
|
||||
I (18446) Watch: Min heap size: 297568 / FreeHeap 299880
|
||||
I (18446) Watch: NEW SPIT-REMOTE-Type ID: playControlStart GroupName: Playcontrol Name: start confirmed: 1
|
||||
I (18466) Watch: NEW SPIT-REMOTE-Type ID: playControlPause GroupName: Playcontrol Name: pause confirmed: 1
|
||||
I (18476) Watch: NEW SPIT-REMOTE-Type ID: nextSceneBridge GroupName: Playcontrol Name: next scene confirmed: 1
|
||||
I (18496) Watch: NEW SPIT-REMOTE-Type ID: nextMainSceneBridge GroupName: Playcontrol Name: next main scene confirmed: 1
|
||||
I (18506) Watch: NEW SPIT-REMOTE-Type ID: previuosSceneBridge GroupName: Playcontrol Name: previous scene confirmed: 1
|
||||
I (18526) Watch: NEW SPIT-REMOTE-Type ID: previousMainSceneBridge GroupName: Playcontrol Name: previous main scene confirmed: 1
|
||||
I (18546) Watch: NEW SPIT-REMOTE-Type ID: mainmixerSound_Volume00 GroupName: Main Mixer Name: Sound confirmed: 1
|
||||
I (18556) Watch: NEW SPIT-REMOTE-Type ID: mainmixerDMX_Dimmer00 GroupName: Main Mixer Name: confirmed: 1
|
||||
I (18566) Watch: NEW SPIT-REMOTE-Type ID: mainmixerDMX_RGB00 GroupName: Main Mixer Name: confirmed: 1
|
||||
I (18586) Watch: NEW SPIT-REMOTE-Type ID: mainmixerDMX_RGB10 GroupName: Main Mixer Name: confirmed: 1
|
||||
I (18606) Watch: NEW SPIT-REMOTE-Type ID: mainmixerDMX_RGB20 GroupName: Main Mixer Name: confirmed: 1
|
||||
I (18616) Watch: NEW SPIT-REMOTE-Type ID: mainmixerDMX_RGB30 GroupName: Main Mixer Name: confirmed: 1
|
||||
I (18636) Watch: NEW SPIT-REMOTE-Type ID: mainmixerDMX_RGB40 GroupName: Main Mixer Name: confirmed: 1
|
||||
I (18646) Watch: NEW SPIT-REMOTE-Type ID: mainmixerDMX_RGB50 GroupName: Main Mixer Name: confirmed: 1
|
||||
I (18666) Watch: NEW SPIT-REMOTE-Type ID: mainmixerMedia_SoundVolume00 GroupName: Main Mixer Name: Media confirmed: 1
|
||||
I (18686) Watch: NEW SPIT-REMOTE-Type ID: mainmixerMedia_Transparency00 GroupName: Main Mixer Name: Media confirmed: 1
|
||||
I (18696) Watch: NEW SPIT-REMOTE-Type ID: selectedJingles GroupName: Playcontrol Name: selected Jingles confirmed: 1
|
||||
I (18716) Watch: NEW SPIT-REMOTE-Type ID: selectedJingleGroups GroupName: Playcontrol Name: selected Jinglegroups confirmed: 1
|
||||
I (18726) Watch: NEW SPIT-REMOTE-Type ID: 00000m8uedyyt0000000000000000lo0va8bom GroupName: MainScene Name: ChangingPositionScene confirmed: 1
|
||||
I (18746) Watch: NEW SPIT-REMOTE-Type ID: 00000m8uedyyt0000000000000000m70va8bom GroupName: MainScene Name: InPosition1Scene confirmed: 1
|
||||
I (18756) Watch: NEW SPIT-REMOTE-Type ID: 00000m8uedyyt0000000000000000mh0va8bom GroupName: MainScene Name: InPosition2Scene confirmed: 1
|
||||
I (18776) Watch: NEW SPIT-REMOTE-Type ID: 00000m8uedyyt0000000000000000mr0va8bom GroupName: MainScene Name: InPosition3Scene confirmed: 1
|
||||
I (18786) Watch: NEW SPIT-REMOTE-Type ID: 00000m8uedyyt0000000000000000nk0va8bom GroupName: MainScene Name: InPosition4Scene confirmed: 1
|
||||
I (18806) Watch: NEW SPIT-REMOTE-Type ID: 00000m8uedyyt0000000000000000nu0va8bom GroupName: MainScene Name: InPosition5Scene confirmed: 1
|
||||
I (18826) Watch: NEW SPIT-REMOTE-Type ID: 00000m8uedyyt0000000000000000o40va8bom GroupName: MainScene Name: InPosition6Scene confirmed: 1
|
||||
I (18836) Watch: NEW SPIT-REMOTE-Type ID: 00000m8uedyyt0000000000000001au0va8bom GroupName: MainScene Name: StartShuffle confirmed: 1
|
||||
I (18856) Watch: NEW SPIT-REMOTE-Type ID: 00000m8uedyyt0000000000000001fj0va8bom GroupName: MainScene Name: Fence confirmed: 1
|
||||
I (18866) Watch: NEW SPIT-REMOTE-Object ID: playControlStart Name: start -> SPITType: start
|
||||
I (18886) Watch: NEW SPIT-REMOTE-Object ID: playControlPause Name: pause -> SPITType: pause
|
||||
I (18906) Watch: NEW SPIT-REMOTE-Object ID: nextSceneBridge Name: next scene -> SPITType: next scene
|
||||
I (18916) Watch: NEW SPIT-REMOTE-Object ID: nextMainSceneBridge Name: next main scene -> SPITType: next main scene
|
||||
I (18936) Watch: NEW SPIT-REMOTE-Object ID: previuosSceneBridge Name: previous scene -> SPITType: previous scene
|
||||
I (18946) Watch: NEW SPIT-REMOTE-Object ID: previousMainSceneBridge Name: previous main scene -> SPITType: previous main scene
|
||||
I (18966) Watch: NEW SPIT-REMOTE-Object ID: mainmixerSound_Volume00 Name: Sound Volume -> SPITType: Sound
|
||||
I (18976) Watch: NEW SPIT-REMOTE-Object ID: mainmixerDMX_Dimmer00 Name: Dimmer -> SPITType:
|
||||
I (18996) Watch: NEW SPIT-REMOTE-Object ID: mainmixerDMX_RGB00 Name: Red -> SPITType:
|
||||
I (19006) Watch: NEW SPIT-REMOTE-Object ID: mainmixerDMX_RGB10 Name: Green -> SPITType:
|
||||
I (19026) Watch: NEW SPIT-REMOTE-Object ID: mainmixerDMX_RGB20 Name: Blue -> SPITType:
|
||||
I (19036) Watch: NEW SPIT-REMOTE-Object ID: mainmixerDMX_RGB30 Name: Cyan -> SPITType:
|
||||
I (19056) Watch: NEW SPIT-REMOTE-Object ID: mainmixerDMX_RGB40 Name: Magenta -> SPITType:
|
||||
I (19076) Watch: NEW SPIT-REMOTE-Object ID: mainmixerDMX_RGB50 Name: Yellow -> SPITType:
|
||||
I (19086) Watch: NEW SPIT-REMOTE-Object ID: mainmixerMedia_SoundVolume00 Name: Sound Volume -> SPITType: Media
|
||||
I (19106) Watch: NEW SPIT-REMOTE-Object ID: mainmixerMedia_Transparency00 Name: Media Transparency -> SPITType: Media
|
||||
I (19116) Watch: NEW SPIT-REMOTE-Object ID: selectedJinglesps Name: Play / Stop -> SPITType: selected Jingles
|
||||
I (19136) Watch: NEW SPIT-REMOTE-Object ID: selectedJinglespf Name: Play / Fade Out -> SPITType: selected Jingles
|
||||
I (19146) Watch: NEW SPIT-REMOTE-Object ID: selectedJingleGroupsps Name: Play / Stop -> SPITType: selected Jinglegroups
|
||||
I (19166) Watch: NEW SPIT-REMOTE-Object ID: selectedJingleGroupspf Name: Play / Fade Out -> SPITType: selected Jinglegroups
|
||||
I (19176) Watch: NEW SPIT-REMOTE-Object ID: 00000m8uedyyt0000000000000000lo0va8bom Name: play -> SPITType: ChangingPositionScene
|
||||
W (19196) SPIT: Finished searching
|
||||
W (19196) SPIT: Start working
|
||||
I (19196) Watch: NEW SPIT-REMOTE-Object ID: 00000m8uedyyt0000000000000000m70va8bom Name: play -> SPITType: InPosition1Scene
|
||||
I (19216) Watch: NEW SPIT-REMOTE-Object ID: 00000m8uedyyt0000000000000000mh0va8bom Name: play -> SPITType: InPosition2Scene
|
||||
I (19226) Watch: NEW SPIT-REMOTE-Object ID: 00000m8uedyyt0000000000000000mr0va8bom Name: play -> SPITType: InPosition3Scene
|
||||
I (19246) Watch: NEW SPIT-REMOTE-Object ID: 00000m8uedyyt0000000000000000nk0va8bom Name: play -> SPITType: InPosition4Scene
|
||||
I (19256) Watch: NEW SPIT-REMOTE-Object ID: 00000m8uedyyt0000000000000000nu0va8bom Name: play -> SPITType: InPosition5Scene
|
||||
I (19276) Watch: NEW SPIT-REMOTE-Object ID: 00000m8uedyyt0000000000000000o40va8bom Name: play -> SPITType: InPosition6Scene
|
||||
I (19286) Watch: NEW SPIT-REMOTE-Object ID: 00000m8uedyyt0000000000000001au0va8bom Name: play -> SPITType: StartShuffle
|
||||
I (19306) Watch: NEW SPIT-REMOTE-Object ID: 00000m8uedyyt0000000000000001fj0va8bom Name: play -> SPITType: Fence
|
||||
I (19316) Watch: eventEndProjectTransfer
|
||||
I (19316) Watch: eventProjectReport ID: CatasWatchProject Name: FramesPerSecond: 44100
|
||||
I (23446) Watch: Min heap size: 278024 / FreeHeap 282460
|
||||
I (28446) Watch: Min heap size: 278024 / FreeHeap 282460
|
||||
I (33446) Watch: Min heap size: 278024 / FreeHeap 282460
|
||||
I (38446) Watch: Min heap size: 278024 / FreeHeap 282460
|
||||
I (43446) Watch: Min heap size: 278024 / FreeHeap 282460
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+94
-137
@@ -694,8 +694,9 @@ void onServerEvent(SPIT_Client::ServerEvent event, const SAD_DetectedServer &p_D
|
||||
}
|
||||
}
|
||||
|
||||
void onConnectionStatus(string p_ServerID, string p_ServerComputerName, string p_ServerName, int p_ServerStepTime, int p_ConnectionStatus, int p_OldConnectionStatus) {
|
||||
ESP_LOGI(TAG, "MySPITApp: eventConnectionStatus %d ", p_ConnectionStatus);
|
||||
void onConnectionStatus(string p_ServerID, string p_ServerComputerName, string p_ServerName, int p_ServerStepTime,
|
||||
SPIT_Client::Connection p_ConnectionStatus, SPIT_Client::Connection p_OldConnectionStatus) {
|
||||
ESP_LOGI(TAG, "MySPITApp: eventConnectionStatus %d->%d ", (int)p_OldConnectionStatus, (int)p_ConnectionStatus);
|
||||
}
|
||||
|
||||
// The transfer of the server's SPITTypes and SPITObjects is finished.
|
||||
@@ -725,153 +726,107 @@ void onProjectUpdate(SPIT_Client::ProjUpdate state, string projectId) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The SPITCLientInterface (implemented by this) will be asked to veto the SPITType while SPIT_Client.parseReportSPITType.<br>
|
||||
* @param p_ReportSPITType
|
||||
* @return false = the SPITType is denied, true = the SPITType is accepted
|
||||
*/
|
||||
bool onCheckSpitTypeVeto(SPIT_Message::ReportSPITType *p_ReportSPITType) {
|
||||
return true; // Bypass veto
|
||||
|
||||
if (p_ReportSPITType == NULL)
|
||||
return true;
|
||||
SPITType *ptrSPITType;
|
||||
ptrSPITType = SPITType::getSPITType(p_ReportSPITType->getID());
|
||||
|
||||
// Don't allow foreign SPITTypes
|
||||
if (ptrSPITType == NULL) {
|
||||
// ESP_LOGW(TAG, "ObjectVeto NoSpitType");
|
||||
return false;
|
||||
}
|
||||
if (ptrSPITType->getCreatedByClient() == false) {
|
||||
// ESP_LOGW(TAG, "getCreatedByClient");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool onCheckSpitObjectVeto(SPIT_Message::ReportSPITObject *p_ReportSPITObject) {
|
||||
return true; // Bypass veto
|
||||
|
||||
if (p_ReportSPITObject == NULL)
|
||||
return true;
|
||||
SPITType *ptrSPITType = SPITType::getSPITType(p_ReportSPITObject->getSPITTypeID());
|
||||
if (ptrSPITType == NULL) {
|
||||
// ESP_LOGW(TAG, "ObjectVeto NoSpitObj");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Don't allow SPITObjects which refers to a SPITType which is not created by this client - other SPITTypes cannot be handled here
|
||||
if (ptrSPITType->getCreatedByClient() == false) {
|
||||
// ESP_LOGW(TAG, "getCreatedByClient");
|
||||
return false;
|
||||
}
|
||||
SPITObject *ptrSPITObject = SPITObject::getSPITObject(p_ReportSPITObject->getID());
|
||||
// Don't allow foreign SPITTypes
|
||||
if (ptrSPITObject == NULL) {
|
||||
// ESP_LOGE(TAG, "Unknown ID");
|
||||
bool onCheckSpitTypeVeto(bool knownType, bool createdByClient) {
|
||||
if (!knownType || !createdByClient) { // Don't allow foreign SPITTypes
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Called when the server has created, loaded, changed or deleted a SPITType.
|
||||
bool onCheckSpitObjectVeto(bool knownType) {
|
||||
return true; // Bypass veto
|
||||
if (!knownType) { // Don't allow objects of unregistered SPITTypes
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Called when the server has created, loaded, changed or deleted a (Remote) SPITType.
|
||||
// Remote SPITType are used in Remote SPITObjects. A Remote SPITObject is used to remote control the SPITServer.
|
||||
// May also occur when the server confirms a SPITType created or changed by the client.
|
||||
void onSpitType(SPIT_Client::ObjectEvent event, const SPITType &p_SPITType) {
|
||||
if (event == SPIT_Client::ObjectEvent::Created) {
|
||||
// Whenever you provide an action for this SPITType take this over in your code.
|
||||
// call _SpitClient.setActionSPITType(p_SPITType.getID(), true);
|
||||
ESP_LOGI(TAG, "NEW SPIT-Type ID: %s GroupName: %s Name: %s confirmed: %d", p_SPITType.getID().data(), p_SPITType.getGroupName().data(), p_SPITType.getName().data(), p_SPITType.getConfirmed());
|
||||
} else if (event == SPIT_Client::ObjectEvent::Changed) {
|
||||
ESP_LOGI(TAG, "SPIT-Type CHANGED ID: %s GroupName: %s Name: %s confirmed: %d", p_SPITType.getID().data(), p_SPITType.getGroupName().data(), p_SPITType.getName().data(), p_SPITType.getConfirmed());
|
||||
} else if (event == SPIT_Client::ObjectEvent::Deleted) {
|
||||
ESP_LOGI(TAG, "SPIT-Type Removed ID: %s GroupName: %s Name: %s\n", p_SPITType.getID().data(), p_SPITType.getGroupName().data(), p_SPITType.getName().data());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the server has created or changed a Remote SPITType.
|
||||
* Remote SPITType are used in Remote SPITObjects. A Remote SPITObject is used to remote control the SPITServer.
|
||||
* @param p_New true = server created a new SPITType / false = server changed a existing SPITType
|
||||
*/
|
||||
void onSpitTypeRemote(SPIT_Client::ObjectEvent event, const SPITType &p_SPITType) {
|
||||
if (event == SPIT_Client::ObjectEvent::Created) {
|
||||
ESP_LOGI(TAG, "NEW SPIT-REMOTE-Type ID: %s GroupName: %s Name: %s confirmed: %d", p_SPITType.getID().data(), p_SPITType.getGroupName().data(), p_SPITType.getName().data(), p_SPITType.getConfirmed());
|
||||
auto typeName = p_SPITType.getName();
|
||||
if (ExpectedObjects.contains(typeName)) {
|
||||
ExpectedObjects[typeName] = p_SPITType.getID();
|
||||
}
|
||||
} else if (event == SPIT_Client::ObjectEvent::Changed) {
|
||||
// we had to inform all Remote SPITObjects using the p_SPITType
|
||||
// perhaps the SPITObject uses information from the SPITType
|
||||
SPITObject *ptrSPITObject;
|
||||
int intSPITObjectCount;
|
||||
intSPITObjectCount = SPITObject::getSPITObjectRemoteCount();
|
||||
for (int intObject = 0; intObject < intSPITObjectCount; intObject++) {
|
||||
ptrSPITObject = SPITObject::getSPITObjectRemote(intObject);
|
||||
if (ptrSPITObject == NULL)
|
||||
continue;
|
||||
if (ptrSPITObject->getSPITTypeID() == p_SPITType.getID()) {
|
||||
// call ecentSPITObjectRemote
|
||||
// onSpitObjectRemote(SPIT_Client::ObjectEvent::Changed, p_SPITType, *ptrSPITObject);
|
||||
void onSpitType(SPIT_Client::ObjectEvent event, bool isRemote, const SPITType &p_SPITType) {
|
||||
if (isRemote) {
|
||||
if (event == SPIT_Client::ObjectEvent::Created) {
|
||||
ESP_LOGI(TAG, "NEW SPIT-REMOTE-Type ID: %s GroupName: %s Name: %s confirmed: %d", p_SPITType.getID().data(), p_SPITType.getGroupName().data(), p_SPITType.getName().data(), p_SPITType.getConfirmed());
|
||||
auto typeName = p_SPITType.getName();
|
||||
if (ExpectedObjects.contains(typeName)) {
|
||||
ExpectedObjects[typeName] = p_SPITType.getID();
|
||||
}
|
||||
} else if (event == SPIT_Client::ObjectEvent::Changed) {
|
||||
// we had to inform all Remote SPITObjects using the p_SPITType
|
||||
// perhaps the SPITObject uses information from the SPITType
|
||||
// SPITObject *ptrSPITObject;
|
||||
// int intSPITObjectCount;
|
||||
// intSPITObjectCount = SPITObject::getSPITObjectRemoteCount();
|
||||
// for (int intObject = 0; intObject < intSPITObjectCount; intObject++) {
|
||||
// ptrSPITObject = SPITObject::getSPITObjectRemote(intObject);
|
||||
// if (ptrSPITObject == nullptr)
|
||||
// continue;
|
||||
// if (ptrSPITObject->getSPITTypeID() == p_SPITType.getID()) {
|
||||
// // call ecentSPITObjectRemote
|
||||
// // onSpitObjectRemote(SPIT_Client::ObjectEvent::Changed, p_SPITType, *ptrSPITObject);
|
||||
// }
|
||||
// }
|
||||
ESP_LOGI(TAG, "SPIT-REMOTE-Type CHANGED ID: %s GroupName: %s Name: %s confirmed: %d", p_SPITType.getID().data(), p_SPITType.getGroupName().data(), p_SPITType.getName().data(), p_SPITType.getConfirmed());
|
||||
} else if (event == SPIT_Client::ObjectEvent::Deleted) {
|
||||
ESP_LOGD(TAG, "SPIT-REMOTE-Type Removed ID: %s GroupName: %s Name: %s\n", p_SPITType.getID().data(), p_SPITType.getGroupName().data(), p_SPITType.getName().data());
|
||||
}
|
||||
} else {
|
||||
if (event == SPIT_Client::ObjectEvent::Created) {
|
||||
// Whenever you provide an action for this SPITType take this over in your code.
|
||||
// call _SpitClient.setActionSPITType(p_SPITType.getID(), true);
|
||||
ESP_LOGI(TAG, "NEW SPIT-Type ID: %s GroupName: %s Name: %s confirmed: %d", p_SPITType.getID().data(), p_SPITType.getGroupName().data(), p_SPITType.getName().data(), p_SPITType.getConfirmed());
|
||||
} else if (event == SPIT_Client::ObjectEvent::Changed) {
|
||||
ESP_LOGI(TAG, "SPIT-Type CHANGED ID: %s GroupName: %s Name: %s confirmed: %d", p_SPITType.getID().data(), p_SPITType.getGroupName().data(), p_SPITType.getName().data(), p_SPITType.getConfirmed());
|
||||
} else if (event == SPIT_Client::ObjectEvent::Deleted) {
|
||||
ESP_LOGI(TAG, "SPIT-Type Removed ID: %s GroupName: %s Name: %s\n", p_SPITType.getID().data(), p_SPITType.getGroupName().data(), p_SPITType.getName().data());
|
||||
}
|
||||
ESP_LOGI(TAG, "SPIT-REMOTE-Type CHANGED ID: %s GroupName: %s Name: %s confirmed: %d", p_SPITType.getID().data(), p_SPITType.getGroupName().data(), p_SPITType.getName().data(), p_SPITType.getConfirmed());
|
||||
} else if (event == SPIT_Client::ObjectEvent::Deleted) {
|
||||
ESP_LOGD(TAG, "SPIT-REMOTE-Type Removed ID: %s GroupName: %s Name: %s\n", p_SPITType.getID().data(), p_SPITType.getGroupName().data(), p_SPITType.getName().data());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the server has created, loaded or changed a SPITObject.
|
||||
* May also occur when the server confirms a SPITObject created by the client, what the client should never do!!.
|
||||
* false = server changed a existing SPITObject
|
||||
* @param p_SPITType a reference to a copy of the associated SPITType instance.
|
||||
* @param p_SPITObject a reference to a copy of the SPITObject instance.
|
||||
*/
|
||||
void onSpitObject(SPIT_Client::ObjectEvent event, const SPITType &p_SPITType, const SPITObject &p_SPITObject) {
|
||||
if (event == SPIT_Client::ObjectEvent::Created) {
|
||||
ESP_LOGI(TAG, "NEW SPIT-Object ID: %s Name: %s -> SPITType: %s", p_SPITObject.getID().data(), p_SPITObject.getName().data(), p_SPITType.getName().data());
|
||||
// check your actions
|
||||
// Whenever you provide an action for this SPITObject take this over in your code.
|
||||
// call _SpitClient.setActionSPITObject(p_SPITObject.getID(), true);
|
||||
// Called when the server has created, loaded or changed a SPITObject.
|
||||
// A Remote SPITObject is used to remote control the SPITServer.
|
||||
// May also occur when the server confirms a SPITObject created by the client, what the client should never do!!.
|
||||
// false = server changed a existing SPITObject
|
||||
// @param p_SPITType a reference to a copy of the associated SPITType instance.
|
||||
// @param p_SPITObject a reference to a copy of the SPITObject instance.
|
||||
void onSpitObject(SPIT_Client::ObjectEvent event, bool isRemote, const SPITType &p_SPITType, const SPITObject &p_SPITObject) {
|
||||
if (isRemote) {
|
||||
if (event == SPIT_Client::ObjectEvent::Created) {
|
||||
ESP_LOGI(TAG, "NEW SPIT-REMOTE-Object ID: %s Name: %s -> SPITType: %s", p_SPITObject.getID().data(), p_SPITObject.getName().data(), p_SPITType.getName().data());
|
||||
// This is a remote SPITObject which can be used to remote control the server.
|
||||
// If you want you can list this for later use
|
||||
} else if (event == SPIT_Client::ObjectEvent::Changed) {
|
||||
ESP_LOGI(TAG, "SPIT-REMOTE-Object CHANGED ID: %s Name: %s -> SPITType: %s", p_SPITObject.getID().data(), p_SPITObject.getName().data(), p_SPITType.getName().data());
|
||||
} else if (event == SPIT_Client::ObjectEvent::Deleted) {
|
||||
ESP_LOGD(TAG, "SPIT-REMOTE-Object Removed ID: %s Name: %s\n", p_SPITObject.getID().data(), p_SPITObject.getName().data());
|
||||
// This is a remote SPITObject
|
||||
// If you have listet this prior you should remove it from the list
|
||||
}
|
||||
} else {
|
||||
if (event == SPIT_Client::ObjectEvent::Created) {
|
||||
ESP_LOGI(TAG, "NEW SPIT-Object ID: %s Name: %s -> SPITType: %s", p_SPITObject.getID().data(), p_SPITObject.getName().data(), p_SPITType.getName().data());
|
||||
// check your actions
|
||||
// Whenever you provide an action for this SPITObject take this over in your code.
|
||||
// call _SpitClient.setActionSPITObject(p_SPITObject.getID(), true);
|
||||
|
||||
// for our little excample as described in loadClientProject:
|
||||
// We have only actions for SPITTypes - means every SPITObject with the associated "Actionx"-SPITTypes will trigger the action when it is played
|
||||
//-> no need to do something here, because setActionSPITType has been set prior and the SPITObject will automatically inherits this
|
||||
// SPITObjects with other SPITTypes asscciated will trigger no actions
|
||||
// for our little excample as described in loadClientProject:
|
||||
// We have only actions for SPITTypes - means every SPITObject with the associated "Actionx"-SPITTypes will trigger the action when it is played
|
||||
//-> no need to do something here, because setActionSPITType has been set prior and the SPITObject will automatically inherits this
|
||||
// SPITObjects with other SPITTypes asscciated will trigger no actions
|
||||
|
||||
} else if (event == SPIT_Client::ObjectEvent::Changed) {
|
||||
ESP_LOGI(TAG, "SPIT-Object CHANGED ID: %s Name: %s -> SPITType: %s", p_SPITObject.getID().data(), p_SPITObject.getName().data(), p_SPITType.getName().data());
|
||||
} else if (event == SPIT_Client::ObjectEvent::Deleted) {
|
||||
ESP_LOGD(TAG, "SPIT-Object Removed ID: %s Name: %s\n", p_SPITObject.getID().data(), p_SPITObject.getName().data());
|
||||
// Check your actions
|
||||
// take the removal of the SPITObject over in your code
|
||||
} else if (event == SPIT_Client::ObjectEvent::Changed) {
|
||||
ESP_LOGI(TAG, "SPIT-Object CHANGED ID: %s Name: %s -> SPITType: %s", p_SPITObject.getID().data(), p_SPITObject.getName().data(), p_SPITType.getName().data());
|
||||
} else if (event == SPIT_Client::ObjectEvent::Deleted) {
|
||||
ESP_LOGD(TAG, "SPIT-Object Removed ID: %s Name: %s\n", p_SPITObject.getID().data(), p_SPITObject.getName().data());
|
||||
// Check your actions
|
||||
// take the removal of the SPITObject over in your code
|
||||
|
||||
// CAUTION: Deleted SPITObjects can be added later again (perhaps per UNDO on the SPITServer)
|
||||
//-> don't remove your assigned action immediately - keep it to reassign it later
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Called when the server has created or changed a Remote SPITObject.
|
||||
* A Remote SPITObject is used to remote control the SPITServer.
|
||||
* @param p_New true = server created a new remote SPITObject
|
||||
* false = server changed a existing remote SPITObject
|
||||
* @param p_SPITType a reference to a copy of the associated SPITType instance.
|
||||
* @param p_SPITObject a reference to a copy of the SPITObject instance.
|
||||
*/
|
||||
void onSpitObjectRemote(SPIT_Client::ObjectEvent event, const SPITType &p_SPITType, const SPITObject &p_SPITObject) {
|
||||
if (event == SPIT_Client::ObjectEvent::Created) {
|
||||
ESP_LOGI(TAG, "NEW SPIT-REMOTE-Object ID: %s Name: %s -> SPITType: %s", p_SPITObject.getID().data(), p_SPITObject.getName().data(), p_SPITType.getName().data());
|
||||
// This is a remote SPITObject which can be used to remote control the server.
|
||||
// If you want you can list this for later use
|
||||
} else if (event == SPIT_Client::ObjectEvent::Changed) {
|
||||
ESP_LOGI(TAG, "SPIT-REMOTE-Object CHANGED ID: %s Name: %s -> SPITType: %s", p_SPITObject.getID().data(), p_SPITObject.getName().data(), p_SPITType.getName().data());
|
||||
} else if (event == SPIT_Client::ObjectEvent::Deleted) {
|
||||
ESP_LOGD(TAG, "SPIT-REMOTE-Object Removed ID: %s Name: %s\n", p_SPITObject.getID().data(), p_SPITObject.getName().data());
|
||||
// This is a remote SPITObject
|
||||
// If you have listet this prior you should remove it from the list
|
||||
// CAUTION: Deleted SPITObjects can be added later again (perhaps per UNDO on the SPITServer)
|
||||
//-> don't remove your assigned action immediately - keep it to reassign it later
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -927,7 +882,7 @@ void onPlaySpitType(string p_PlayerID, string spitTypeId, bool p_PlayerIsRunning
|
||||
* @param p_Value the new value
|
||||
*/
|
||||
void onPlayRemoteObjectStatus(const SPITType &p_SPITType, const SPITObject &p_SPITObject, long long p_FrameInsideObject, int p_Value) {
|
||||
ESP_EARLY_LOGI(TAG, "eventPlayRemoteObjectStatus RemoteSPITType: %s RemoteSPITObject: %s Position: %lld Value: %d", p_SPITType.getName().data(), p_SPITObject.getName().data(), p_FrameInsideObject, p_Value);
|
||||
ESP_EARLY_LOGD(TAG, "eventPlayRemoteObjectStatus RemoteSPITType: %s RemoteSPITObject: %s Position: %lld Value: %d", p_SPITType.getName().data(), p_SPITObject.getName().data(), p_FrameInsideObject, p_Value);
|
||||
}
|
||||
|
||||
void SpitClientApp() {
|
||||
@@ -951,9 +906,7 @@ void SpitClientApp() {
|
||||
.onConnectionStatus = onConnectionStatus,
|
||||
.onProjectUpdate = onProjectUpdate,
|
||||
.onSpitType = onSpitType,
|
||||
.onSpitTypeRemote = onSpitTypeRemote,
|
||||
.onSpitObject = onSpitObject,
|
||||
.onSpitObjectRemote = onSpitObjectRemote,
|
||||
.onPlay = onPlay,
|
||||
.onPlaySpitType = onPlaySpitType,
|
||||
.onPlayRemoteObjectStatus = onPlayRemoteObjectStatus,
|
||||
@@ -1034,5 +987,9 @@ void app_main(void) {
|
||||
fos::Task::delayMs(5000);
|
||||
// ToDo send
|
||||
Syslog::logv(Syslog::Severity::Notice, "Health state");
|
||||
// ESP_LOGI(TAG, "Min heap size: %" PRIu32 " / FreeHeap %" PRIu32 "\n",
|
||||
ESP_LOGI(TAG, "Min heap size: %u / FreeHeap %lu",
|
||||
heap_caps_get_minimum_free_size(MALLOC_CAP_DEFAULT),
|
||||
esp_get_free_heap_size());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user