src/connectivity/openthread/ot-stack/src/app.cc
// Setup FIDL server side which handle requests from upper layer components.
Setup FIDL server side which handle requests from upper layer components.
Setup FIDL server side which handle requests from upper layer components .
zx_status_t OtStackApp::SetupFidlService() {
  zx_handle_t directory_request = zx_take_startup_handle(PA_DIRECTORY_REQUEST);
  if (directory_request == ZX_HANDLE_INVALID) {
    FX_LOGS(ERROR) << "Got invalid directory_request channel";
    return ZX_ERR_INTERNAL;
  }
  svc_dir_t* dir = nullptr;
  zx_status_t status = svc_dir_create(loop_.dispatcher(), directory_request, &dir);
  if (status != ZX_OK) {
    FX_PLOGS(ERROR, status) << "Error creating service directory";
    return status;
  }
  fidl_request_handler_ptr_ = std::make_unique<LowpanSpinelDeviceFidlImpl>(*this);
  status = svc_dir_add_service(dir, "svc", "fuchsia.lowpan.spinel.Device", this, connect);
  if (status != ZX_OK) {
    FX_PLOGS(ERROR, status) << "Error adding service in ot-stack";
    return status;
  }
  return ZX_OK;
}
zx_status_t OtStackApp :: SetupFidlService ( ) { zx_handle_t directory_request = zx_take_startup_handle ( PA_DIRECTORY_REQUEST ) ; if ( directory_request == ZX_HANDLE_INVALID ) { FX_LOGS ( ERROR ) << " " ; return ZX_ERR_INTERNAL ; } svc_dir_t * dir = nullptr ; zx_status_t status = svc_dir_create ( loop_ . dispatcher ( ) , directory_request , & dir ) ; if ( status != ZX_OK ) { FX_PLOGS ( ERROR , status ) << " " ; return status ; } fidl_request_handler_ptr_ = std :: make_unique < LowpanSpinelDeviceFidlImpl > ( * this ) ; status = svc_dir_add_service ( dir , " " , " " , this , connect ) ; if ( status != ZX_OK ) { FX_PLOGS ( ERROR , status ) << " " ; return status ; } return ZX_OK ; }
Setup FIDL server side which handle requests from upper layer components.
Setup FIDL server side which handle requests from upper layer components .