aboutsummaryrefslogtreecommitdiff
path: root/tests/test_interfaces.py
blob: 3fc4a945a2f0c29020d27abc753c7dd805e06198 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/python
from __future__ import absolute_import, print_function, division
from pymba import *
import time


def test_interfaces():
    # start Vimba
    with Vimba() as vimba:
        # get list of available interfaces
        interfaceIds = vimba.getInterfaceIds()
        for interfaceId in interfaceIds:
            print('Interface ID:', interfaceId)

        # get interface object and open it
        interface0 = vimba.getInterface(interfaceIds[0])
        interface0.open()

        # list interface features
        interfaceFeatureNames = interface0.get_feature_names()
        for name in interfaceFeatureNames:
            print('Interface feature:', name)

        # close interface
        interface0.close()

if __name__ == '__main__':
    test_interfaces()