Created
December 9, 2012 03:13
-
-
Save oneman/4243176 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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