Tekvel Magic
Loading...
Searching...
No Matches
NIF Class Reference

Network adapter. More...

Public Member Functions

def __init__ (self, index=None, desc=None, **kwargs)
 
def get_interface_list (self)
 Returns a list of network interfaces available in the machine. More...
 
def select_interface (self, custom_title=None, custom_message=None)
 Displays the list of avilable interfaces and stores inforation about the selected interface in class instance. More...
 
def get_index (self)
 Returns index (starting with 0) of the selected network interface or Raises exception if none was selected. More...
 
def get_desc (self)
 Returns description of the selected network interface or Raises exception if none was selected. More...
 
def get_id (self)
 Returns platform-indepndent identifier of the selected network interface or Raises exception if interface has not been selected or platform not supported. More...
 

Detailed Description

Network adapter.

This class allows to perform manipulations with network adapter, such as displaying the list of available network adapters and selecting network adapter in a cross-platform way to be further used in other classes and functions where it is required. The class can be initialized multiple times thus allowing to select multiple interface IDs to be used by different functions (e.g. if it is required to publish Sampled Values on one interface while subscribing to GOOSE messages via another interface).

Example usage:

nif1 = NIF() # displays select NIF dialog and returns an instance of NIF class initialized by the ID of the selected interface.
nif1_idx = nif1.get_index() # returns index of the selected interface
nif1_desc = nif1.get_desc() # returns the description of the selected interface.
nif1_id = nif1.get_id() # returns platform-independent identifier of the NIF

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  index = None,
  desc = None,
**  kwargs 
)

Member Function Documentation

◆ get_desc()

def get_desc (   self)

Returns description of the selected network interface or Raises exception if none was selected.

Exceptions
ExceptionNetwork interface has not been selected!

◆ get_id()

def get_id (   self)

Returns platform-indepndent identifier of the selected network interface or Raises exception if interface has not been selected or platform not supported.

This function shall always be used to obtain NIF identifier for further use in NIF-related functions and classes.

Exceptions
ExceptionNetwork interface has not been selected!

◆ get_index()

def get_index (   self)

Returns index (starting with 0) of the selected network interface or Raises exception if none was selected.

Exceptions
ExceptionNetwork interface has not been selected!
Warning
This index shall not be used as interface ID for further identification of the network interface in communication functions or classes as it does not provide platform-independent identification. Use get_id() function instead to obtain platform-independent ID of the interface.

◆ get_interface_list()

def get_interface_list (   self)

Returns a list of network interfaces available in the machine.

◆ select_interface()

def select_interface (   self,
  custom_title = None,
  custom_message = None 
)

Displays the list of avilable interfaces and stores inforation about the selected interface in class instance.