mirror of
https://projects.vdr-developer.org/git/vdr-plugin-streamdev.git
synced 2023-10-10 17:16:51 +00:00
Added DeviceName() and DeviceType() to client device. The server IP and the
number of the device used on the server are returned respectively.
This commit is contained in:
@@ -318,17 +318,34 @@ void cStreamdevDevice::UpdatePriority(bool SwitchingChannels) {
|
||||
}
|
||||
}
|
||||
|
||||
cString cStreamdevDevice::DeviceName(void) const {
|
||||
return StreamdevClientSetup.RemoteIp;
|
||||
}
|
||||
|
||||
cString cStreamdevDevice::DeviceType(void) const {
|
||||
static int dev = -1;
|
||||
static cString devType("STRDev");
|
||||
int d = -1;
|
||||
if (ClientSocket.DataSocket(siLive) != NULL)
|
||||
ClientSocket.GetSignal(NULL, NULL, &d);
|
||||
if (d != dev) {
|
||||
dev = d;
|
||||
devType = d < 0 ? "STRDev" : *cString::sprintf("STRD%2d", d);
|
||||
}
|
||||
return devType;
|
||||
}
|
||||
|
||||
int cStreamdevDevice::SignalStrength(void) const {
|
||||
int strength = -1;
|
||||
if (ClientSocket.DataSocket(siLive) != NULL)
|
||||
ClientSocket.GetSignal(&strength, NULL);
|
||||
ClientSocket.GetSignal(&strength, NULL, NULL);
|
||||
return strength;
|
||||
}
|
||||
|
||||
int cStreamdevDevice::SignalQuality(void) const {
|
||||
int quality = -1;
|
||||
if (ClientSocket.DataSocket(siLive) != NULL)
|
||||
ClientSocket.GetSignal(NULL, &quality);
|
||||
ClientSocket.GetSignal(NULL, &quality, NULL);
|
||||
return quality;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user