tdl-xoa-driver 1.7.1__py3-none-any.whl → 1.7.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tdl-xoa-driver
3
- Version: 1.7.1
3
+ Version: 1.7.2
4
4
  Summary: TDL XOA Python API is a Python library providing user-friendly communication interfaces to Teledyne LeCroy Xena Ethernet traffic generation test equipment. It provides a rich collection of APIs that can be used to either write test scripts or develop applications.
5
5
  Home-page: https://github.com/xenanetworks/tdl-xoa-driver
6
6
  Author: Leonard Yu, Zoltan Hanisch
@@ -1,8 +1,8 @@
1
- tdl_xoa_driver-1.7.1.dist-info/licenses/LICENSE,sha256=KcCGoRYa8BS0KGUIHDIAeebClL6sX1uRWVrtESwpjOo,11351
2
- xoa_driver/__init__.py,sha256=qcnNgRe9QjMSe2PGgCiDKUZqf7e3cIfmgfFZpaF-IRQ,47
1
+ tdl_xoa_driver-1.7.2.dist-info/licenses/LICENSE,sha256=KcCGoRYa8BS0KGUIHDIAeebClL6sX1uRWVrtESwpjOo,11351
2
+ xoa_driver/__init__.py,sha256=my0_cIbrINVq23cNQpfIfw8trjhpryw9x_IRDbJlEzY,47
3
3
  xoa_driver/enums.py,sha256=bKYWqYkFfUyargNxvJi9_1cvrBy6EUIKkUvsl34frn8,8611
4
4
  xoa_driver/exceptions.py,sha256=baNpophPmeNujMTSfL9TsYHa3Gju2-ozNOg78n8tqN8,1957
5
- xoa_driver/hlfuncs.py,sha256=XxMAXe3NDOLr3PMSbTqJdmX7FKeqh4UhDW1g7s5Wpd4,385
5
+ xoa_driver/hlfuncs.py,sha256=HbGw7HGyPGY_xsxTZujtozcV9cu0QIjEH3LKkJwokww,407
6
6
  xoa_driver/lli.py,sha256=PyT7DT9KxIM8PMw1JMu80J_KIifMPlCg9gd47J7SIjs,434
7
7
  xoa_driver/misc.py,sha256=JBFOiKU1z7DB99HXEDv-tiFM5PvNqNkcT7AxJXZ4lPk,1968
8
8
  xoa_driver/modules.py,sha256=sj7MeLNPqgPFtZU40WdrOQ7tV_WEFXCQfJ3FGnsE-BQ,10287
@@ -18,6 +18,7 @@ xoa_driver/functions/headers.py,sha256=Rf_em8LqCZOz0oxiqvtAFwx71_CtD9_I0p-vEZWtc
18
18
  xoa_driver/functions/layer1_adv.py,sha256=Mbolxw4z4DCXpChZCEtTVjybXV0AHabRo9Cabjzv77A,11422
19
19
  xoa_driver/functions/mgmt.py,sha256=rPnlLxeaRIl8_LhJEvRfSn5npxZeqtrIiG_8Fx22a0k,19997
20
20
  xoa_driver/functions/tools.py,sha256=Wj00KfsuyFsp8HiEoHof28JCNLBYRKZ7FU48pyO2nyk,9916
21
+ xoa_driver/functions/xcvr.py,sha256=I9T67OUUw6UrWbMeKzRtGtD7I39CftdlpqScgj1EO-E,8218
21
22
  xoa_driver/functions/cli/__init__.py,sha256=1qCG8oiucQ51v8tS6mAvu9MpBDQ4dqDhzx-EvdhDTQQ,458
22
23
  xoa_driver/functions/cli/_cli_manager.py,sha256=MKU2wS0Gxd514zvyWsm4qiYg-WLPA6vrHZy2QFcqpsU,22166
23
24
  xoa_driver/functions/cli/_config_block.py,sha256=KaNiAq4ht6Hfoo7iE2h03SAXhE3WX5efyHJcE74dYto,12245
@@ -190,7 +191,7 @@ xoa_driver/internals/hli/ports/port_l23/sec/__init__.py,sha256=47DEQpj8HBSa-_TIm
190
191
  xoa_driver/internals/hli/ports/port_l23/sec/macsec.py,sha256=HZNO5t-7WnQ2sUqLCFMXy4h80TOYJmx-9GF3MDrQoOg,3184
191
192
  xoa_driver/internals/hli/ports/port_l23/tcvr/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
192
193
  xoa_driver/internals/hli/ports/port_l23/tcvr/cmis.py,sha256=gqCRk6JFbU4waol2zEaaORWvQE3IIrT-ASHm-DFUl-U,5713
193
- xoa_driver/internals/hli/ports/port_l23/tcvr/transceiver.py,sha256=MzX2p109NyFKz4lhEyT6MAOQZ7uDCeJpM6Sx2rPcm84,4459
194
+ xoa_driver/internals/hli/ports/port_l23/tcvr/transceiver.py,sha256=U9R2_MzsPrMAqv0587L9S_HpyIXtbUTWhtRm2ZdmLIo,4313
194
195
  xoa_driver/internals/hli/ports/port_l23/trafficgen/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
195
196
  xoa_driver/internals/hli/ports/port_l23/trafficgen/capture.py,sha256=mH_yPZW_3lTX9n1NTCMQlIixd5BWcb5VRfCrtpzY8I8,1955
196
197
  xoa_driver/internals/hli/ports/port_l23/trafficgen/runt.py,sha256=VuxgV2piV57hUlDKcO2sucYwhwpsVO3nwiE1qvexo6g,849
@@ -236,7 +237,7 @@ xoa_driver/internals/utils/managers/abc.py,sha256=M3XgI2FVQLUXixS5SKnZTm0MweHY6D
236
237
  xoa_driver/internals/utils/managers/exceptions.py,sha256=fqLSin-OQCIKuhpzvK6RZThF3FJ8FsHers4EmqM9gSs,628
237
238
  xoa_driver/internals/utils/managers/modules_manager.py,sha256=sCEhqUu7Waot16rucJ5nI9FyHuFEeU_sBx1JjZdhDJg,3236
238
239
  xoa_driver/internals/utils/managers/ports_manager.py,sha256=cmXGWMVbHB27E7e0t-K9mUDessdU_t_v-6WUtpqbIho,3554
239
- tdl_xoa_driver-1.7.1.dist-info/METADATA,sha256=2NvijpVYnk2Sowh5uevaUP599vbDgNPZDWPcnC6pPm0,4171
240
- tdl_xoa_driver-1.7.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
241
- tdl_xoa_driver-1.7.1.dist-info/top_level.txt,sha256=sBbN3hwpa4s2VxsUBoWJ5jIqqDr50vgcEb-V8kL7pvE,11
242
- tdl_xoa_driver-1.7.1.dist-info/RECORD,,
240
+ tdl_xoa_driver-1.7.2.dist-info/METADATA,sha256=3pLZYkLPhQp54_Lr4NHmMNsgvBF-SS9i4IOiHIsYyKc,4171
241
+ tdl_xoa_driver-1.7.2.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
242
+ tdl_xoa_driver-1.7.2.dist-info/top_level.txt,sha256=sBbN3hwpa4s2VxsUBoWJ5jIqqDr50vgcEb-V8kL7pvE,11
243
+ tdl_xoa_driver-1.7.2.dist-info/RECORD,,
xoa_driver/__init__.py CHANGED
@@ -1,2 +1,2 @@
1
- __version__ = "1.7.1"
1
+ __version__ = "1.7.2"
2
2
  __short_version__ = "1.7"
@@ -0,0 +1,196 @@
1
+ """
2
+ Transceiver R/W functions
3
+ """
4
+
5
+ from __future__ import annotations
6
+ import asyncio
7
+ from typing import (
8
+ TYPE_CHECKING,
9
+ Any,
10
+ Union,
11
+ List,
12
+ Tuple,
13
+ )
14
+ if TYPE_CHECKING:
15
+ from xoa_driver.ports import Z800FreyaPort, Z1600EdunPort, Z100LokiPort, Z10OdinPort, Z400ThorPort
16
+
17
+ from ..misc import Hex
18
+
19
+
20
+
21
+ async def get_xcvr_rw_seq_bank(port: "Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort", bank: int, page: int, register: int, length: int) -> str:
22
+ """Read a number of bytes from transceiver register interface via I2C.
23
+
24
+ :param port: The port object
25
+ :type port: Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort
26
+ :param bank: The bank address, e.g. 10 or 0xA
27
+ :type bank: int
28
+ :param page: The page address, e.g. 10 or 0xA
29
+ :type page: int
30
+ :param register: The register address, e.g. 10 or 0xA
31
+ :type register: int
32
+ :param length: The number of bytes to read
33
+ :type length: int
34
+ :return: The read bytes as a string, e.g. 'DEADBEEF'
35
+ :rtype: str
36
+ """
37
+
38
+ resp = await port.transceiver.access_rw_seq_bank(bank_address=bank, page_address=page, register_address=register, byte_count=length).get()
39
+ return resp.value
40
+
41
+ async def set_xcvr_rw_seq_bank(port: "Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort", bank: int, page: int, register: int, value: str) -> None:
42
+ """Write a number of bytes to transceiver register interface via I2C.
43
+
44
+ :param port: The port object
45
+ :type port: Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort
46
+ :param bank: The bank address, e.g. 10 or 0xA
47
+ :type bank: int
48
+ :param page: The page address, e.g. 10 or 0xA
49
+ :type page: int
50
+ :param register: The register address, e.g. 10 or 0xA
51
+ :type register: int
52
+ :param value: The bytes to write as a string, e.g. 'DEADBEEF'
53
+ :type value: str
54
+ """
55
+ await port.transceiver.access_rw_seq_bank(bank_address=bank, page_address=page, register_address=register, byte_count=len(value)//2).set(value=Hex(value))
56
+
57
+
58
+ async def get_xcvr_rw_seq(port: "Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort", page: int, register: int, length: int) -> str:
59
+ """Read a number of bytes from transceiver register interface via I2C.
60
+
61
+ :param port: The port object
62
+ :type port: Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort
63
+ :param page: The page address, e.g. 10 or 0xA
64
+ :type page: int
65
+ :param register: The register address, e.g. 10 or 0xA
66
+ :type register: int
67
+ :param length: The number of bytes to read
68
+ :type length: int
69
+ :return: The read bytes as a string, e.g. 'DEADBEEF'
70
+ :rtype: str
71
+ """
72
+
73
+ resp = await port.transceiver.access_rw_seq(page_address=page, register_address=register, byte_count=length).get()
74
+ return resp.value
75
+
76
+ async def set_xcvr_rw_seq(port: "Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort", page: int, register: int, value: str) -> None:
77
+ """Write a number of bytes to transceiver register interface via I2C.
78
+
79
+ :param port: The port object
80
+ :type port: Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort
81
+ :param page: The page address, e.g. 10 or 0xA
82
+ :type page: int
83
+ :param register: The register address, e.g. 10 or 0xA
84
+ :type register: int
85
+ :param value: The bytes to write as a string, e.g. 'DEADBEEF'
86
+ :type value: str
87
+ """
88
+ await port.transceiver.access_rw_seq(page_address=page, register_address=register, byte_count=len(value)//2).set(value=Hex(value))
89
+
90
+
91
+ async def get_xcvr_rw(port: "Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort", page: int, register: int) -> str:
92
+ """Read 4 bytes from transceiver register interface.
93
+
94
+ :param port: The port object
95
+ :type port: Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort
96
+ :param page: The page address, e.g. 10 or 0xA
97
+ :type page: int
98
+ :param register: The register address, e.g. 10 or 0xA
99
+ :type register: int
100
+ :return: The read bytes as a string, e.g. 'DEADBEEF'
101
+ :rtype: str
102
+ """
103
+
104
+ resp = await port.transceiver.access_rw(page_address=page, register_address=register).get()
105
+ return resp.value
106
+
107
+ async def set_xcvr_rw(port: "Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort", page: int, register: int, value: str) -> None:
108
+ """Write 4 bytes to transceiver register interface.
109
+
110
+ :param port: The port object
111
+ :type port: Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort
112
+ :param page: The page address, e.g. 10 or 0xA
113
+ :type page: int
114
+ :param register: The register address, e.g. 10 or 0xA
115
+ :type register: int
116
+ :param value: The bytes to write as a string, e.g. 'DEADBEEF'
117
+ :type value: str
118
+ """
119
+ await port.transceiver.access_rw(page_address=page, register_address=register).set(value=Hex(value))
120
+
121
+ async def get_xcvr_mii(port: "Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort", register: int) -> str:
122
+ """Read 2 bytes from transceiver register interface.
123
+
124
+ :param port: The port object
125
+ :type port: Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort
126
+ :param register: The register address, e.g. 10 or 0xA
127
+ :type register: int
128
+ :return: The read 2 bytes as a string, e.g. 'DEAF'
129
+ :rtype: str
130
+ """
131
+
132
+ resp = await port.transceiver.access_mii(register_address=register).get()
133
+ return resp.value
134
+
135
+ async def set_xcvr_mii(port: "Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort",register: int, value: str) -> None:
136
+ """Write 2 bytes to transceiver register interface.
137
+
138
+ :param port: The port object
139
+ :type port: Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort
140
+ :param page: The page address, e.g. 10 or 0xA
141
+ :type page: int
142
+ :param register: The register address, e.g. 10 or 0xA
143
+ :type register: int
144
+ :param value: The 2 bytes to write as a string, e.g. 'DEAF'
145
+ :type value: str
146
+ """
147
+ await port.transceiver.access_mii(register_address=register).set(value=Hex(value))
148
+
149
+ async def get_i2c_freq_khz(port: "Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort") -> int:
150
+ """Read access speed on a transceiver I2C access in the unit of KHz. Default to 100.
151
+
152
+ When the transceiver is plugged out and in again, the speed will be reset to the default value 100. The speed has a minimum and a maximum, which can be obtained from P_CAPABILITIES.
153
+
154
+ The I2C speed configuration will not be included in the port configuration file (.xpc).
155
+ When you load a port configuration to a port, the transceiver I2C access speed will be reset to default 100.
156
+
157
+ :param port: The port object
158
+ :type port: Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort
159
+ :return: The current I2C access speed in KHz
160
+ :rtype: int
161
+ """
162
+
163
+ resp = await port.transceiver.i2c_config.get()
164
+ return resp.frequency
165
+
166
+ async def set_i2c_freq_khz(port: "Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort", frequency: int) -> None:
167
+ """Set access speed on a transceiver I2C access in the unit of KHz.
168
+
169
+ When the transceiver is plugged out and in again, the speed will be reset to the default value 100. The speed has a minimum and a maximum, which can be obtained from P_CAPABILITIES.
170
+
171
+ The I2C speed configuration will not be included in the port configuration file (.xpc).
172
+ When you load a port configuration to a port, the transceiver I2C access speed will be reset to default 100.
173
+
174
+ :param port: The port object
175
+ :type port: Z1600EdunPort | Z800FreyaPort | Z400ThorPort | Z100LokiPort | Z10OdinPort
176
+ :param frequency: The desired I2C access speed in KHz
177
+ :type frequency: int
178
+ """
179
+
180
+ await port.transceiver.i2c_config.set(frequency=frequency)
181
+
182
+
183
+
184
+
185
+ __all__ = (
186
+ "get_xcvr_rw_seq_bank",
187
+ "set_xcvr_rw_seq_bank",
188
+ "get_xcvr_rw_seq",
189
+ "set_xcvr_rw_seq",
190
+ "get_xcvr_rw",
191
+ "set_xcvr_rw",
192
+ "get_xcvr_mii",
193
+ "set_xcvr_mii",
194
+ "get_i2c_freq_khz",
195
+ "set_i2c_freq_khz",
196
+ )
xoa_driver/hlfuncs.py CHANGED
@@ -11,6 +11,7 @@ from xoa_driver.functions import (
11
11
  cmis,
12
12
  layer1_adv,
13
13
  async_wrapper,
14
+ xcvr,
14
15
  )
15
16
 
16
17
  __all__ = (
@@ -23,4 +24,5 @@ __all__ = (
23
24
  "cmis",
24
25
  "layer1_adv",
25
26
  "async_wrapper",
27
+ "xcvr",
26
28
  )
@@ -45,7 +45,7 @@ class Transceiver:
45
45
  """
46
46
 
47
47
  def access_rw(self, page_address: int, register_address: int) -> "PX_RW":
48
- """Access to register interface by the transceiver.
48
+ """R/W access (4 bytes) to register interface by the transceiver.
49
49
 
50
50
  :param page_address: page address
51
51
  :type page_address: int
@@ -64,7 +64,7 @@ class Transceiver:
64
64
  )
65
65
 
66
66
  def access_mii(self, register_address: int) -> "PX_MII":
67
- """Access to the register interface supported by the media-independent interface (MII) transceiver.
67
+ """R/W access (2 bytes) to the register interface supported by MII transceiver.
68
68
 
69
69
  :param register_address: register address
70
70
  :type register_address: int
@@ -79,7 +79,7 @@ class Transceiver:
79
79
  )
80
80
 
81
81
  def access_rw_seq(self, page_address: int, register_address: int, byte_count: int) -> "PX_RW_SEQ":
82
- """Sequential read/write a number of bytes to the register interface supported by the media-independent interface (MII) transceiver.
82
+ """Sequential R/W a number of bytes to the register interface.
83
83
 
84
84
  :param page_address: page address (0-255)
85
85
  :type page_address: int
@@ -100,7 +100,7 @@ class Transceiver:
100
100
  )
101
101
 
102
102
  def access_rw_seq_bank(self, bank_address: int, page_address: int, register_address: int, byte_count: int) -> "PX_RW_SEQ_BANK":
103
- """Sequential read/write a number of bytes to the register interface supported by the media-independent interface (MII) transceiver.
103
+ """Sequential R/W a number of bytes to the register interface.
104
104
 
105
105
  :param bank_address: bank address (0-255)
106
106
  :type bank_address: int