Constructor
# new Sdk(nameopt)
Create an Sdk.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
name |
string
|
<optional> |
null | Name to identify the client when communicating with the robot. |
Methods
# clear_robots()
Remove all cached Robot instances.
Subsequent calls to create_robot() will return newly created Robots.
Existing robot instances will continue to work, but their time sync and token refresh
threads will be stopped.
# create_robot(address, nameopt) → {Robot}
Get a Robot initialized with this Sdk, creating it if it does not yet exist.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
address |
string
|
Network-resolvable address of the robot, e.g. '192.168.80.3' | ||
name |
string
|
<optional> |
null | A unique identifier for the robot, e.g. 'My First Robot'. Default null to use the address as the name. |
robot A Robot initialized with the current Sdk settings.
# load_app_token(resource_path)
App tokens are no longer in use. Authorization is now handled via licenses.
Parameters:
| Name | Type | Description |
|---|---|---|
resource_path |
string
|
The path where the token is saved. |
- Deprecated:
- since v2.0.1
# load_robot_cert(resource_path_globopt) → {void}
Load the SSL certificate for the robot.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
resource_path_glob |
string
|
<optional> |
null | Optional path to certificate resource(s). If null, will load the certificate in the 'resources' package. Otherwise, should be a glob expression to match certificates. Defaults to null. |
void
# register_service_client(creation_func, service_typeopt, service_nameopt) → {void}
Tell the Sdk how to create a specific type of service client.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
creation_func |
Object
|
Callable that returns a client. Typically just the class. | ||
service_type |
string
|
<optional> |
null | Type of the service. If null (default), will try to get the name from creation_func. |
service_name |
string
|
<optional> |
null | Name of the service. If null (default), will try to get the name from creation_func. |
void
# set_max_message_length(max_message_length) → {void}
Updates the send and receive max message length values in all the clients/channels created from this point on.
Parameters:
| Name | Type | Description |
|---|---|---|
max_message_length |
number
|
Max message length value to use for sending and receiving messages. |
void