Channel

class bosdyn.client.channel.RefreshingAccessTokenAuthMetadataPlugin(token_cb, add_app_token)[source]

Bases: grpc.AuthMetadataPlugin

Plugin to refresh access token.

Parameters
  • token_cb – Callable that returns a tuple of (app_token, user_token)

  • add_app_token (bool) – Whether to include an app token in the metadata. This is necessary for compatibility with old robot software.

bosdyn.client.channel.create_secure_channel_creds(cert, token_cb, add_app_token)[source]

Returns credentials for establishing a secure channel. Uses previously set values on the linked Sdk and self.

bosdyn.client.channel.create_secure_channel(address, port, creds, authority)[source]

Create a secure channel to given host:port.

Parameters
  • address – Connection host address.

  • port – Connection port.

  • creds – A ChannelCredentials instance.

  • authority – Authority option for the channel.

Returns

A secure channel.

bosdyn.client.channel.create_insecure_channel(address, port, authority=None)[source]

Create an insecure channel to given host and port.

This method is only used for testing purposes. Applications must use secure channels to communicate with services running on Spot.

Parameters
  • address – Connection host address.

  • port – Connection port.

  • authority – Authority option for the channel.

Returns

An insecure channel.

bosdyn.client.channel.translate_exception(rpc_error)[source]

Translated a GRPC error into an SDK RpcError.

Parameters

rpc_error – RPC error to translate.

Returns

Specific sub-type of RpcError.