Skip to content

Instantly share code, notes, and snippets.

@oneman
Created December 9, 2012 03:13
Show Gist options
  • Save oneman/4243176 to your computer and use it in GitHub Desktop.
Save oneman/4243176 to your computer and use it in GitHub Desktop.
#include "kr_client.h"
int main (int argc, char *argv[]) {
kr_client_t *client;
char *sysname;
sysname = NULL;
client = NULL;
if (argc < 2) {
return 1;
}
if (!krad_valid_host_and_port (argv[1])) {
if (!krad_valid_sysname(argv[1])) {
fprintf (stderr, "Invalid station sysname!\n");
return 1;
} else {
sysname = argv[1];
}
}
client = kr_connect (sysname);
if (client == NULL) {
fprintf (stderr, "Could not connect to %s krad radio daemon\n", sysname);
return 1;
}
while (1) {
// fun happens here
// invent me
kr_client_poll (client, timeout_in_ms);
}
kr_disconnect (&client);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment