mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-31 17:31:20 +02:00
add pzapit -gi returns the current channel ID (hexadecimal)& name (tuxcvs)
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@155 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
@@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
int usage (const char * basename)
|
int usage (const char * basename)
|
||||||
{
|
{
|
||||||
|
std::cout << "get current channel id: " << basename << " -gi" << std::endl;
|
||||||
std::cout << "bouquet list: " << basename << " [-ra]" << std::endl;
|
std::cout << "bouquet list: " << basename << " [-ra]" << std::endl;
|
||||||
std::cout << "channel list: " << basename << " [-ra] <bouquet-number>" << std::endl;
|
std::cout << "channel list: " << basename << " [-ra] <bouquet-number>" << std::endl;
|
||||||
std::cout << "zap by number: " << basename << " [-ra] <bouquet-number> <channel-number>" << std::endl;
|
std::cout << "zap by number: " << basename << " [-ra] <bouquet-number> <channel-number>" << std::endl;
|
||||||
@@ -100,6 +101,7 @@ int main (int argc, char** argv)
|
|||||||
bool leaveStandby = false;
|
bool leaveStandby = false;
|
||||||
bool sendMotorCommand = false;
|
bool sendMotorCommand = false;
|
||||||
bool quiet = false;
|
bool quiet = false;
|
||||||
|
bool getchannel = false;
|
||||||
uint8_t motorCmdType = 0;
|
uint8_t motorCmdType = 0;
|
||||||
uint8_t motorCmd = 0;
|
uint8_t motorCmd = 0;
|
||||||
uint8_t motorNumParameters = 0;
|
uint8_t motorNumParameters = 0;
|
||||||
@@ -241,13 +243,13 @@ int main (int argc, char** argv)
|
|||||||
{
|
{
|
||||||
sscanf(argv[++i], "%lld", &satmask);
|
sscanf(argv[++i], "%lld", &satmask);
|
||||||
sscanf(argv[++i], "%d", &diseqc[0]);
|
sscanf(argv[++i], "%d", &diseqc[0]);
|
||||||
/*
|
/*
|
||||||
diseqc[0] = strlen(argv[i+1]);
|
diseqc[0] = strlen(argv[i+1]);
|
||||||
for (i++, j = 0; j <= diseqc[0]; j++)
|
for (i++, j = 0; j <= diseqc[0]; j++)
|
||||||
{
|
{
|
||||||
diseqc[j+1] = argv[i][j] - 48;
|
diseqc[j+1] = argv[i][j] - 48;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -304,6 +306,11 @@ int main (int argc, char** argv)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (!strncmp(argv[i], "-gi", 3))
|
||||||
|
{
|
||||||
|
getchannel = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
else if (i < argc - 1)
|
else if (i < argc - 1)
|
||||||
{
|
{
|
||||||
if ((sscanf(argv[i], "%d", &bouquet) > 0) && (sscanf(argv[++i], "%u", &channel) > 0))
|
if ((sscanf(argv[i], "%d", &bouquet) > 0) && (sscanf(argv[++i], "%u", &channel) > 0))
|
||||||
@@ -503,6 +510,12 @@ int main (int argc, char** argv)
|
|||||||
//zapit.startPlayBack();
|
//zapit.startPlayBack();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
if (getchannel)
|
||||||
|
{
|
||||||
|
t_channel_id channel = zapit.getCurrentServiceID();
|
||||||
|
printf("%llx (%s)\n", channel, (zapit.getChannelName(channel)).c_str());
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* choose source mode */
|
/* choose source mode */
|
||||||
@@ -579,13 +592,12 @@ int main (int argc, char** argv)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
channel_found:
|
channel_found:
|
||||||
zapit.zapTo(channels[channel-1].nr);
|
zapit.zapTo(channels[channel-1].nr);
|
||||||
std::cout << "zapped to " << channels[channel-1].name << std::endl;
|
std::cout << "zapped to " << channels[channel-1].name << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!quiet)
|
||||||
if(!quiet)
|
|
||||||
{
|
{
|
||||||
CZapitClient::responseGetPIDs pids;
|
CZapitClient::responseGetPIDs pids;
|
||||||
zapit.getPIDS(pids);
|
zapit.getPIDS(pids);
|
||||||
|
Reference in New Issue
Block a user