#include <stdio.h>
void listDevices (void)
{
int i;
char name[100];
int channel_count = 0;
printf("First argument must be a channel!\n\n");
printf("Channel\t Name\n");
printf("--------------------------------------------------------\n");
for (i = 0; (status ==
canOK) && (i < channel_count); i++) {
name[0] = '\0';
printf("%d\t %s\n", i, name);
}
}
{
int rtt_actual;
int rssi_actual;
*rssi_mean = 0;
*rtt_mean = 0;
rtt, rtt_len, &rtt_actual);
int i;
printf("RSSI (%d):", rssi_actual);
for(i = 0; i < rssi_actual; i++) {
*rssi_mean += rssi[i];
printf(" %d", rssi[i]);
}
printf("\nRTT (%d):", rtt_actual);
for(i = 0; i < rtt_actual; i++) {
*rtt_mean += rtt[i];
printf(" %d", rtt[i]);
}
printf("\n");
if (rssi_actual) {
*rssi_mean = *rssi_mean / rssi_actual;
}
if (rtt_actual) {
*rtt_mean = *rtt_mean / rtt_actual;
}
}
}
int main (int argc, char *argv[])
{
int canlib_channel = 0;
int j;
int rssi_mean, rtt_mean;
switch (argc) {
case 1:
listDevices();
return 0;
case 2:
canlib_channel = argv[1][0] - '0';
break;
default:
listDevices();
return -1;
}
printf("canlib channel = %d\n", canlib_channel);
printf("Could not start config (%d)\n", status);
return status;
}
printf("config_handle = %d\n\n", config_handle);
printf("kvrNetworkConnectionTest( on )\n\n");
printf("Could not start connection test (%d)\n", status);
return status;
}
Sleep(2000);
for (j = 0; j < 10; j++) {
Sleep(2000);
getRssiRtt(config_handle, &rssi_mean, &rtt_mean);
printf("rssi_mean = %d\n", rssi_mean);
printf("rtt_mean = %d\n\n", rtt_mean);
}
printf("Done!\n");
return 0;
}