libvcomm  1.0
 All Data Structures Files Functions Variables Typedefs Macros Groups Pages
libvcomm_simple.c
/*
* libvcomm_simple.c
*
* Created on: 17.09.2012
* Author: Tarmo Kople <tarmo@flycom.ee>
*/
#include <stdio.h>
#include <stdlib.h>
#include <vcomm.h>
int main(void) {
hid_device *vhandle; // connection handle
int resp; // libvcomm response
/*
* Open IRvoodoo
*/
if ((resp = Vopen(&vhandle, NULL))) {
fprintf(stderr, "Err %d\n", resp);
return EXIT_FAILURE;
}
/*
* Get last decoded IRcode
*/
ircode_t ircode; // create empty IRcode structure
resp = Vget_ircode(&vhandle, &ircode); // fill IRcode structure (get from IRvoodoo)
if (resp) {
fprintf(stderr, "Err %d\n", resp);
return EXIT_FAILURE;
}
/*
* Close IRvoodoo (to avoid memory leaks)
*/
Vclose(&vhandle);
return EXIT_SUCCESS;
}