Channel

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

Bases: AuthMetadataPlugin

Plugin to refresh access token.

Parameters:

token_cb – a callback to provide a valid user token.

bosdyn.client.channel.create_secure_channel_creds(cert, token_cb)[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, options=[])[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.

  • options – A list of additional parameters for the GRPC channel.

Returns:

A secure channel.

bosdyn.client.channel.create_insecure_channel(address, port, authority=None, options=[])[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.

  • options – A list of additional parameters for the GRPC 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.

bosdyn.client.channel.generate_channel_options(max_send_message_length=None, max_receive_message_length=None, keep_alive_ping_time_ms=None)[source]

Generate the array of options to specify in the creation of a client channel or server.

The list contains the values for max allowed message length for both sending and receiving. If no values are provided, the default values of 100 MB are used. It also contains a value for time between keep_alive pings, which default to 5s.

Parameters:
  • max_send_message_length (int) – Max message length allowed for message to send.

  • max_receive_message_length (int) – Max message length allowed for message to receive.

  • keep_alive_ping_time_ms (int) – Period in milliseconds after which a keepalive ping is sent

  • transport. (on the) –

Returns:

Array with values for channel options.