int main(int argc, char **argv) { bt_config_t config; paramInit(&config, argc, argv); DPRINTF(DEBUG_INIT, "peer.c main beginning\n"); #ifdef TESTING config.identity = 1; // your group number here strcpy(config.chunk_file, "chunkfile"); strcpy(config.has_chunk_file, "haschunks"); #endif bt_parse_command_line(&config); #ifdef DEBUG if (debug & DEBUG_INIT) { bt_dump_config(&config); } #endif peer_run(&config); return 0; }
void commInit(void) { if (isInit) return; #ifdef USE_ESKYLINK eskylinkInit(); #else /* radiolinkInit(); */ #endif crtpInit(); #ifdef USE_UART_CRTP crtpSetLink(uartGetLink()); #elif defined(USE_ESKYLINK) crtpSetLink(eskylinkGetLink()); #else crtpSetLink(radiolinkGetLink()); #endif crtpserviceInit(); logInit(); consoleInit(); paramInit(); //setup CRTP communication channel //TODO: check for USB first and prefer USB over radio //if (usbTest()) // crtpSetLink(usbGetLink); //else if(radioTest()) // crtpSetLink(radioGetLink()); isInit = true; }