Beispiel #1
0
	void Init()
	{
		camera.Init();
		environment.Init();
		atews[0].Init();
		atews[1].Init();
	}
Beispiel #2
0
int Start(int argc, char** argv) {
  InitDebugSettings();

  // Initalize JerryScript engine.
  if (!InitJerry()) {
    DLOG("InitJerry failed");
    return 1;
  }

  // Create environtment.
  Environment* env = Environment::GetEnv();

  // Init environment with argument and uv loop.
  env->Init(argc, argv, uv_default_loop());

  // Start IoT.js
  if (!StartIoTjs(env)) {
    DLOG("StartIoTJs failed");
    return 1;
  }

  // close uv loop.
  //uv_stop(env->loop());
  uv_walk(env->loop(), UvWalkToCloseCallback, NULL);
  uv_run(env->loop(), UV_RUN_DEFAULT);

  int res = uv_loop_close(env->loop());
  IOTJS_ASSERT(res == 0);

  // Release JerryScript engine.
  ReleaseJerry();

  ReleaseDebugSettings();

  return 0;
}