Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 117 → Rev 125

/Riddim/riddim.c
1,3 → 1,6
#include <confuse.h>
#include <string.h>
 
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
74,6 → 77,9
#define INPUT_EVDEV 2
 
 
// from config
char *input_evdev_name;
 
// time struct for measuring
struct timeval time_struct1;
struct timeval time_struct2;
180,7 → 186,7
int evdev_fd;
int connect_evdev()
{
if ((evdev_fd = open("/dev/input/event10", O_RDONLY)) < 0) {
if ((evdev_fd = open(input_evdev_name, O_RDONLY)) < 0) {
printf(" cant open evdev ");
return 0;
}
375,11 → 381,29
 
int input=INPUT_NONE;
 
 
int main(int argc, char**argv)
{
 
printf("Starting Riddim \n");
printf("\tRemote Interactive Digital Drone Interface Mashup\n");
 
cfg_opt_t opts[] = {
CFG_SIMPLE_STR("input_evdev", &input_evdev_name),
CFG_END()
};
cfg_t *cfg;
 
// input_evdev_name=strdup("/dev/event0");
printf("Parsing config file");
cfg = cfg_init(opts, 0);
cfg_parse(cfg, "/etc/riddim.conf");
printf("input %s:",input_evdev_name);
 
// 1st argument -> Bluetooth adrees to bypass scanning ( takes to long for short testing roundtrips )
if (argv[1])
{
407,7 → 431,7
else
printf(".. ERROR ");//
 
/* printf("\nInitializing evdev input ..\n");
printf("\nInitializing evdev input (%s) ..\n",input_evdev_name);
if (connect_evdev())
{
printf(".. done");//
415,7 → 439,7
}
else
printf(".. ERROR ");//
*/
printf("\nInitializing X-52 output ..");
 
x52_output = x52_init();