Network

class ingenialink.network.NetDevEvt(value)[source]

Device Event.

class ingenialink.network.NetProt(value)[source]

Network Protocol.

class ingenialink.network.NetState(value)[source]

Network State.

class ingenialink.network.Network[source]

Declaration of a general Network object.

abstract connect_to_slave(*args: Any, **kwargs: Any) Servo[source]

Connects to a drive through a given the drive ID.

Parameters:
  • *args – Protocol dependent positional arguments.

  • **kwargs – Protocol dependent keyword arguments.

abstract disconnect_from_slave(servo: Servo) None[source]

Disconnects the drive from the network.

Parameters:

servo – Instance of the servo connected.

abstract get_servo_state(servo_id: int | str) NetState[source]

Get the state of a servo that’s a part of network.

The state indicates if the servo is connected or disconnected.

Parameters:

servo_id – The servo’s ID.

Returns:

The servo’s state.

abstract load_firmware(*args: Any, **kwargs: Any) None[source]

Loads a given firmware file to a target drive.

Parameters:
  • *args – Protocol dependent positional arguments.

  • **kwargs – Protocol dependent keyword arguments.

abstract scan_slaves() list[int][source]

Scans for drives in the network.

abstract scan_slaves_info() OrderedDict[int, SlaveInfo][source]

Scans for drives in the network.

Returns:

Detected drives with their information.

abstract start_status_listener(*args: Any, **kwargs: Any) None[source]

Start monitoring network events (CONNECTION/DISCONNECTION).

abstract stop_status_listener(*args: Any, **kwargs: Any) None[source]

Stops the NetStatusListener from listening to the drive.

abstract subscribe_to_status(target: int | str, callback: Callable[[NetDevEvt], Any]) None[source]

Subscribe to network state changes.

Parameters:
  • target – ID of the drive to subscribe.

  • callback – Callback function.

abstract unsubscribe_from_status(target: int | str, callback: Callable[[NetDevEvt], Any]) None[source]

Unsubscribe from network state changes.

Parameters:
  • target – ID of the drive to subscribe.

  • callback – Callback function.

property protocol: NetProt

Obtain network protocol.

Type:

NET_PROT

servos: list[Any]

List of the connected servos in the network.

class ingenialink.network.SlaveInfo(product_code: int | None = None, revision_number: int | None = None)[source]

Class to store slave information.