void CiaoClass::begin() { String start; String stop; // Wait for U-boot to finish startup do { dropAll(); delay(1000); }while (stream.available() > 0); stream.println("ciao;r;status"); //check the bridge python status String status = stream.readStringUntil(END_TX_CHAR); if(status == "1;running"){ do{ //kill a istance of the bridge.py stream.println("ciao;w;quit"); stop = stream.readStringUntil(END_TX_CHAR); delay(3000); }while(stop != "1;done"); } do{ stream.print(F("run-ciao\n")); //start bridge python stream.readStringUntil(END_TX_CHAR); delay(3000); stream.println("ciao;r;status"); //check if bridge python is running start = stream.readStringUntil(END_TX_CHAR); }while (start != "1;running"); }
bool Element::dropAll( const string& finfo ) { const Finfo* f = findFinfo( finfo ); if ( f ) { return dropAll( f->msg() ); } return 0; }
void freshTables() /* Make database have defined but empty tables. */ { dropAll(); createAll(); }
int main(int argc, char *argv[]) /* Process command line. */ { boolean drop, move, copy; struct sigaction sigSpec; setlinebuf(stdout); setlinebuf(stderr); ZeroVar(&sigSpec); sigSpec.sa_handler = sigStopSignaled; sigSpec.sa_flags = SA_RESTART; if (sigaction(SIGUSR1, &sigSpec, NULL) < 0) errnoAbort("can't set SIGUSR1 handler"); optionInit(&argc, argv, optionSpecs); drop = optionExists("drop"); move = optionExists("move"); copy = optionExists("copy"); gReload = optionExists("reload"); if (move || copy) { if (argc != 3) usage(); } else if (argc != 2) usage(); if ((drop+move+copy) > 1) errAbort("can only specify one of -drop, -move, or -copy"); gbVerbInit(optionInt("verbose", 0)); if (gbVerbose >= 6) sqlMonitorEnable(JKSQL_TRACE); if (drop) dropAll(argv[1]); else if (move) moveAll(argv[1], argv[2]); else if (copy) copyAll(argv[1], argv[2]); else { char *reloadList = optionVal("reloadList", NULL); gDatabase = argv[1]; gOptions = dbLoadOptionsParse(gDatabase); gForceIgnoreDelete = optionExists("forceIgnoreDelete"); if (optionExists("rebuildDerived")) gOptions.flags |= DBLOAD_BYPASS_GBLOADED|DBLOAD_REBUILD_DERIVED; gMaxShrinkage = optionFloat("maxShrinkage", 0.1); gGbdbGenBank = optionVal("gbdbGenBank", NULL); if (gGbdbGenBank == NULL) gGbdbGenBank = gbConfGet(gOptions.conf, "gbdb.genbank"); if (gGbdbGenBank == NULL) gGbdbGenBank = "/gbdb/genbank"; gWorkDir = optionVal("workdir", "work/load"); if (gOptions.flags & DBLOAD_DRY_RUN) printf("*** using dry run mode ***\n"); gbLoadRna(reloadList); } return 0; }