Identify the interface type of an interface

8 views
Skip to first unread message

V Vijayan

unread,
May 31, 2023, 7:02:03 AM5/31/23
to ostinato
Hi Srivats,

I use the below command to get the list of interfaces available in the drone hardware.

        o_ports = self.drone.getPortConfig(self.drone.getPortIdList())
        for o_port in o_ports.port:
            print('%d.%s (%s)' % (o_port.port_id.id, o_port.name, o_port.description))

I would like to 
1) identify the interface type say it is ethernet or loopback
2) state of the hardware like link up or link down

This interfaces list needs to be displayed to user choose the sending and receiving interface. So, cant display all the interface of drone like loopback,

Thanks

V Vijayan

unread,
Jun 3, 2023, 5:48:30 PM6/3/23
to ostinato

On summary note, I planned to display the ethernet interfaces from multiple machines (drones) and user can choose on which interface the data has to be sent and on which interface the data has to be received.

Srivats P

unread,
Jun 13, 2023, 7:48:30 AM6/13/23
to V Vijayan, ostinato
Vijay,

On Sun, Jun 4, 2023 at 3:18 AM V Vijayan <velu...@gmail.com> wrote:

On summary note, I planned to display the ethernet interfaces from multiple machines (drones) and user can choose on which interface the data has to be sent and on which interface the data has to be received.


On Wednesday, May 31, 2023 at 4:32:03 PM UTC+5:30 V Vijayan wrote:
Hi Srivats,

I use the below command to get the list of interfaces available in the drone hardware.

        o_ports = self.drone.getPortConfig(self.drone.getPortIdList())
        for o_port in o_ports.port:
            print('%d.%s (%s)' % (o_port.port_id.ido_port.name, o_port.description))

I would like to 
1) identify the interface type say it is ethernet or loopback

You can use a check as shown in the example tutorial -
        if ('lo' in port.name or 'loopback' in port.description.lower()):
            tx_port_number = port.port_id.id
            rx_port_number = port.port_id.id
 
2) state of the hardware like link up or link down

Use getStats() to fetch the port stats. The stats also include the link state - stats.port_stats[0].state.link_state
 

This interfaces list needs to be displayed to user choose the sending and receiving interface. So, cant display all the interface of drone like loopback,

If you connect to the drone from the GUI, does the GUI show all the interfaces?

Please include some logs and screenshots so that I can understand your issue better and help you.

Srivats (Creator, Ostinato)


--
Get Ostinato News and Updates on Twitter - Follow @ostinato (http://twitter.com/ostinato)
---
You received this message because you are subscribed to the Google Groups "ostinato" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ostinato+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ostinato/bb020424-2ec1-44a7-b960-1f0cda1d6025n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages