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::SetDeviceSetupClientInIsolatedDevmgr(const std::string& path) {
  zx_status_t res = ZX_OK;
  res = ConnectServiceByName("fuchsia.openthread.devmgr.IsolatedDevmgr", &isolated_devfs_);
  if (res != ZX_OK) {
    FX_LOGS(ERROR) << "fdio_service_connect_by_name failed";
    return res;
  }
  zx::channel fake_device_server_side, fake_device_client_side;
  res = zx::channel::create(0, &fake_device_server_side, &fake_device_client_side);
  if (res != ZX_OK) {
    FX_LOGS(ERROR) << "zx::channel::create failed";
    return res;
  }
  res = fdio_service_connect_at(isolated_devfs_.get(), path.c_str(),
                                fake_device_server_side.release());
  if (res != ZX_OK) {
    FX_LOGS(ERROR) << "fdio_service_connect_at failed";
    return res;
  }
  device_setup_client_ptr_ =
      std::make_unique<fidl_spinel::DeviceSetup::SyncClient>(std::move(fake_device_client_side));
  return ZX_OK;
}
zx_status_t OtStackApp :: SetDeviceSetupClientInIsolatedDevmgr ( const std :: string & path ) { zx_status_t res = ZX_OK ; res = ConnectServiceByName ( " " , & isolated_devfs_ ) ; if ( res != ZX_OK ) { FX_LOGS ( ERROR ) << " " ; return res ; } zx :: channel fake_device_server_side , fake_device_client_side ; res = zx :: channel :: create ( 0 , & fake_device_server_side , & fake_device_client_side ) ; if ( res != ZX_OK ) { FX_LOGS ( ERROR ) << " " ; return res ; } res = fdio_service_connect_at ( isolated_devfs_ . get ( ) , path . c_str ( ) , fake_device_server_side . release ( ) ) ; if ( res != ZX_OK ) { FX_LOGS ( ERROR ) << " " ; return res ; } device_setup_client_ptr_ = std :: make_unique < fidl_spinel :: DeviceSetup :: SyncClient > ( std :: move ( fake_device_client_side ) ) ; return ZX_OK ; }
Get the spinel setup client from a file path.
Get the spinel setup client from a file path .