2from ctypes
import Structure, cast, c_uint8, c_uint64, c_size_t, c_float, POINTER
6 An error code and error message object wrapper.
8 def __init__(self, errorCode: int, errorMsg: str):
9 super(OceanDirectError, self).
__init__(errorMsg)
18 Python wrapper for C-structure, SpectrumWithMetadata. This is use internally
21 The field order and type must match those of the C-structure we defined otherwise
22 python will throw a runtime error. User must not alter this definition.
24 _fields_ = [(
"buffer", POINTER(c_float)),
25 (
"bufferLength", c_size_t),
26 (
"tickCount", c_uint64)]
30 spectraBuffer = (c_float * spectraLength)(0)
31 self.
buffer = cast(spectraBuffer, POINTER(c_float))
41 Python class containing spectrum and metadata (tickcount).
43 def __init__(self, newSpectrum: list[float], newTickCount: int):
49 Python class containing network configuration (tickcount).
51 def __init__(self, ipv4Address: list[int], subnetMask: list[int],
52 defaultGateway: list[int], dnsServer: list[int]):
63 networkConfig.subnetMask[i] = self.
subnetMask[i]
65 networkConfig.dnsServer[i] = self.
dnsServer[i]
72 Python wrapper for C-structure, LighthouseNetworkConfiguration. This is use internally
75 The field order and type must match those of the C-structure we defined otherwise
76 python will throw a runtime error. User must not alter this definition.
78 _fields_ = [(
"ipv4Address", POINTER(c_uint8)),
79 (
"ipv4AddressSize", c_size_t),
80 (
"subnetMask", POINTER(c_uint8)),
81 (
"subnetMaskSize", c_size_t),
82 (
"defaultGateway", POINTER(c_uint8)),
83 (
"defaultGatewaySize", c_size_t),
84 (
"dnsServer", POINTER(c_uint8)),
85 (
"dnsServerSize", c_size_t) ]
94 ipv4AddressBuffer = (c_uint8 * 4)(0)
95 subnetMaskBuffer = (c_uint8 * 4)(0)
96 defaultGatewayBuffer = (c_uint8 * 4)(0)
97 dnsServerBuffer = (c_uint8 * 4)(0)
102 self.
dnsServer = cast(dnsServerBuffer, POINTER(c_uint8))
Python wrapper for C-structure, LighthouseNetworkConfiguration.
LighthouseNetworkConfiguration getLighthouseNetworkConfiguration(self)
Python class containing network configuration (tickcount).
__init__(self, list[int] ipv4Address, list[int] subnetMask, list[int] defaultGateway, list[int] dnsServer)
getLighthouseNetworkConfiguration_C(self)
An error code and error message object wrapper.
__init__(self, int errorCode, str errorMsg)
tuple[int, str] get_error_details(self)