2014-03-13 17:23:55 +01:00
|
|
|
/*
|
|
|
|
* server.h: SAT>IP plugin for the Video Disk Recorder
|
|
|
|
*
|
|
|
|
* See the README file for copyright information and how to reach the author.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __SATIP_SERVER_H
|
|
|
|
#define __SATIP_SERVER_H
|
|
|
|
|
2015-01-15 22:33:51 +01:00
|
|
|
class cSatipServer;
|
|
|
|
|
|
|
|
// --- cSatipFrontend ---------------------------------------------------------
|
|
|
|
|
|
|
|
class cSatipFrontend : public cListObject {
|
|
|
|
private:
|
|
|
|
int indexM;
|
|
|
|
int transponderM;
|
|
|
|
cString descriptionM;
|
|
|
|
bool usedM;
|
|
|
|
|
|
|
|
public:
|
|
|
|
cSatipFrontend(const int indexP, const char *descriptionP);
|
|
|
|
virtual ~cSatipFrontend();
|
|
|
|
void Use(bool onOffP) { usedM = onOffP; }
|
|
|
|
cString Description(void) { return descriptionM; }
|
|
|
|
bool IsUsed(void) { return usedM; }
|
|
|
|
int Index(void) { return indexM; }
|
|
|
|
int Transponder(void) { return transponderM; }
|
|
|
|
void SetTransponder(int transponderP) { transponderM = transponderP; }
|
|
|
|
};
|
|
|
|
|
|
|
|
// --- cSatipFrontends --------------------------------------------------------
|
|
|
|
|
|
|
|
class cSatipFrontends : public cList<cSatipFrontend> {
|
|
|
|
public:
|
|
|
|
bool Matches(int transponderP);
|
|
|
|
bool Assign(int transponderP);
|
|
|
|
bool Use(int transponderP, bool onOffP);
|
|
|
|
};
|
|
|
|
|
2014-03-13 17:23:55 +01:00
|
|
|
// --- cSatipServer -----------------------------------------------------------
|
|
|
|
|
|
|
|
class cSatipServer : public cListObject {
|
|
|
|
private:
|
2015-01-15 22:33:51 +01:00
|
|
|
enum eSatipFrontend {
|
|
|
|
eSatipFrontendDVBS2 = 0,
|
|
|
|
eSatipFrontendDVBT,
|
|
|
|
eSatipFrontendDVBT2,
|
|
|
|
eSatipFrontendDVBC,
|
|
|
|
eSatipFrontendDVBC2,
|
|
|
|
eSatipFrontendCount
|
2014-03-13 17:23:55 +01:00
|
|
|
};
|
|
|
|
cString addressM;
|
|
|
|
cString modelM;
|
2014-11-10 23:05:03 +01:00
|
|
|
cString descriptionM;
|
2015-01-15 22:33:51 +01:00
|
|
|
cSatipFrontends frontendsM[eSatipFrontendCount];
|
2014-05-08 21:09:35 +02:00
|
|
|
int quirkM;
|
2014-03-13 17:23:55 +01:00
|
|
|
time_t createdM;
|
|
|
|
cTimeMs lastSeenM;
|
|
|
|
|
|
|
|
public:
|
2014-05-08 21:09:35 +02:00
|
|
|
enum eSatipQuirk {
|
|
|
|
eSatipQuirkNone = 0x00,
|
|
|
|
eSatipQuirkSessionId = 0x01,
|
2014-10-31 17:18:33 +01:00
|
|
|
eSatipQuirkPlayPids = 0x02,
|
2014-11-03 20:54:19 +01:00
|
|
|
eSatipQuirkForceLock = 0x04,
|
2015-01-09 14:42:03 +01:00
|
|
|
eSatipQuirkUseXCI = 0x08,
|
2014-05-08 21:09:35 +02:00
|
|
|
eSatipQuirkMask = 0x0F
|
|
|
|
};
|
2014-11-10 23:05:03 +01:00
|
|
|
cSatipServer(const char *addressP, const char *modelP, const char *descriptionP);
|
2014-03-13 17:23:55 +01:00
|
|
|
virtual ~cSatipServer();
|
|
|
|
virtual int Compare(const cListObject &listObjectP) const;
|
2015-01-15 22:33:51 +01:00
|
|
|
bool Assign(int sourceP, int systemP, int transponderP);
|
|
|
|
bool Matches(int sourceP);
|
|
|
|
bool Matches(int sourceP, int systemP, int transponderP);
|
|
|
|
void Use(int transponderP, bool onOffP);
|
|
|
|
int GetModulesDVBS2(void);
|
|
|
|
int GetModulesDVBT(void);
|
|
|
|
int GetModulesDVBT2(void);
|
|
|
|
int GetModulesDVBC(void);
|
|
|
|
int GetModulesDVBC2(void);
|
2014-03-13 17:23:55 +01:00
|
|
|
const char *Address() { return *addressM; }
|
2014-11-10 23:05:03 +01:00
|
|
|
const char *Model(void) { return *modelM; }
|
|
|
|
const char *Description() { return *descriptionM; }
|
2014-05-08 21:09:35 +02:00
|
|
|
bool Quirk(int quirkP) { return ((quirkP & eSatipQuirkMask) & quirkM); }
|
2014-03-13 17:23:55 +01:00
|
|
|
void Update(void) { lastSeenM.Set(); }
|
|
|
|
uint64_t LastSeen(void) { return lastSeenM.Elapsed(); }
|
|
|
|
time_t Created(void) { return createdM; }
|
|
|
|
};
|
|
|
|
|
|
|
|
// --- cSatipServers ----------------------------------------------------------
|
|
|
|
|
|
|
|
class cSatipServers : public cList<cSatipServer> {
|
|
|
|
public:
|
|
|
|
cSatipServer *Find(cSatipServer *serverP);
|
2015-01-15 22:33:51 +01:00
|
|
|
cSatipServer *Find(int sourceP);
|
|
|
|
cSatipServer *Assign(int sourceP, int transponderP, int systemP);
|
2014-03-13 17:23:55 +01:00
|
|
|
cSatipServer *Update(cSatipServer *serverP);
|
2015-01-15 22:33:51 +01:00
|
|
|
void Use(cSatipServer *serverP, int transponderP, bool onOffP);
|
|
|
|
bool IsQuirk(cSatipServer *serverP, int quirkP);
|
2014-03-13 17:23:55 +01:00
|
|
|
void Cleanup(uint64_t intervalMsP = 0);
|
2015-01-15 22:33:51 +01:00
|
|
|
cString GetAddress(cSatipServer *serverP);
|
2014-03-13 17:23:55 +01:00
|
|
|
cString GetString(cSatipServer *serverP);
|
|
|
|
cString List(void);
|
|
|
|
int NumProvidedSystems(void);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __SATIP_SERVER_H
|