#include <stdint.h>
#include <stdio.h>
void show_channel_info(int channel_no);
void list_channels(void)
{
char driverName[256];
int chanCount = 0;
int i;
check("canGetNumberOfChannels", stat);
printf("Found %d channel(s).\n", chanCount);
for (i = 0; i < chanCount; i++) {
show_channel_info(i);
}
}
{
char buf[50];
buf[0] = '\0';
printf("%s: failed, stat=%d (%s)\n", id, (int)stat, buf);
}
}
void show_channel_info(int channel_no)
{
char name[256];
char driverName[256];
char custChanName[40];
unsigned int ean[2], fw[2], serial[2];
unsigned int chan_no_on_card;
memset(name, 0, sizeof(name));
memset(custChanName, 0, sizeof(custChanName));
memset(ean, 0, sizeof(ean));
memset(fw, 0, sizeof(fw));
memset(serial, 0, sizeof(serial));
check("canGetChannelData: DEVDESCR_ASCII", stat);
check("canGetChannelData: CARD_UPC_NO", stat);
check("canGetChannelData: CARD_SERIAL_NO", stat);
check("canGetChannelData: CARD_FIRMWARE_REV", stat);
&chan_no_on_card, sizeof(chan_no_on_card));
check("canGetChannelData: canCHANNELDATA_CHAN_NO_ON_CARD", stat);
custChanName, sizeof(custChanName));
printf("ch %2.1d: %-22s\t%x-%05x-%05x-%x, s/n %u, v%u.%u.%u :%d \"%s\"\n",
channel_no, name,
(ean[1] >> 12), ((ean[1] & 0xfff) << 8) | ((ean[0] >> 24) & 0xff),
(ean[0] >> 4) & 0xfffff, (ean[0] & 0x0f),
serial[0],
fw[1] >> 16, fw[1] & 0xffff, fw[0] & 0xffff,
chan_no_on_card, custChanName);
}