src/connectivity/openthread/ot-stack/src/app.cc
// Get the spinel setup client from a file path. Set `client_ptr_` on success.
Get the spinel setup client from a file path. Set `client_ptr_` on success.
Get the spinel setup client from a file path . Set ` client_ptr_ ` on success .
zx_status_t OtStackApp::SetDeviceSetupClientInDevmgr(const std::string& path) {
  fbl::unique_fd fd(open(path.c_str(), O_RDWR));
  if (!fd.is_valid()) {
    FX_LOGS(ERROR) << "failed to connect to device\n";
    return ZX_ERR_INTERNAL;
  }
  zx::channel chan;
  zx_status_t status = fdio_get_service_handle(fd.release(), chan.reset_and_get_address());
  if (status != ZX_OK) {
    FX_PLOGS(ERROR, status) << "Fdio get handle failed";
    return status;
  }
  device_setup_client_ptr_ =
      std::make_unique<fidl_spinel::DeviceSetup::SyncClient>(std::move(chan));
  return ZX_OK;
}
zx_status_t OtStackApp :: SetDeviceSetupClientInDevmgr ( const std :: string & path ) { fbl :: unique_fd fd ( open ( path . c_str ( ) , O_RDWR ) ) ; if ( ! fd . is_valid ( ) ) { FX_LOGS ( ERROR ) << " \n " ; return ZX_ERR_INTERNAL ; } zx :: channel chan ; zx_status_t status = fdio_get_service_handle ( fd . release ( ) , chan . reset_and_get_address ( ) ) ; if ( status != ZX_OK ) { FX_PLOGS ( ERROR , status ) << " " ; return status ; } device_setup_client_ptr_ = std :: make_unique < fidl_spinel :: DeviceSetup :: SyncClient > ( std :: move ( chan ) ) ; return ZX_OK ; }
Get the spinel setup client from a file path.
Get the spinel setup client from a file path .