Network¶
-
class
ingenialink.serial.network.
SerialNetwork
(timeout_rd=0.5, timeout_wr=0.5)[source]¶ Network for all Serial communications.
- Parameters
timeout_rd (int) – Timeout for read commands.
timeout_wr (int) – Timeout for write commands.
-
close_socket
()¶ Closes the established network socket.
-
connect_to_slave
(target=None, dictionary='')[source]¶ Connects to a slave through the given network settings.
- Parameters
target (str) – IP of the target slave.
dictionary (str) – Path to the target dictionary file.
- Returns
Instance of the servo connected.
- Return type
SerialServo
-
destroy_network
()¶ Destroy network instance.
-
disconnect_from_slave
(servo)[source]¶ Disconnects the slave from the network.
- Parameters
servo (SerialServo) – Instance of the servo connected.
-
scan_slaves
()[source]¶ Obtain a list of network devices.
- Returns
List of network devices.
- Return type
list
- Raises
TypeError – If the protocol type is invalid.
-
set_reconnection_retries
(retries)¶ Set the number of reconnection retries in our application.
- Parameters
retries (int) – Number of reconnection retries.
-
set_recv_timeout
(timeout)¶ Set receive communications timeout.
- Parameters
timeout (int) – Timeout in ms.
- Returns
Result code.
- Return type
int
-
set_status_check_stop
(stop)¶ Start/Stop the internal monitor of the drive status.
- Parameters
stop (int) – 0 to START, 1 to STOP.
- Returns
Result code.
- Return type
int
-
stop_network_monitor
()¶ Stop monitoring network events.
-
subscribe_to_status
(callback)¶ Calls given function everytime a connection/disconnection event is raised.
- Parameters
callback (Callback) – Function that will be called every time an event
raised. (is) –
-
servos
¶ List of the connected servos in the network.
- Type
list
-
property
state
¶ Obtain network state.
- Returns
Current network state.
- Return type
str
-
property
status
¶ Obtain network status.
- Returns
Current network status.
- Return type
str
-
property
timeout_rd
¶ Read timeout
- Type
int
-
property
timeout_wr
¶ Write timeout
- Type
int