forked from eclipse-iceoryx/iceoryx2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtransmission_data.py
More file actions
34 lines (27 loc) · 1.08 KB
/
transmission_data.py
File metadata and controls
34 lines (27 loc) · 1.08 KB
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
29
30
31
32
33
34
# Copyright (c) 2025 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache Software License 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0, or the MIT license
# which is available at https://opensource.org/licenses/MIT.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
"""Publish-Subscribe example payload type."""
import ctypes
class TransmissionData(ctypes.Structure):
"""The strongly typed payload type."""
_fields_ = [
("x", ctypes.c_int32),
("y", ctypes.c_int32),
("funky", ctypes.c_double),
]
def __str__(self) -> str:
"""Returns human-readable string of the contents."""
return f"TransmissionData {{ x: {self.x}, y: {self.y}, funky: {self.funky} }}"
@staticmethod
def type_name() -> str:
"""Returns the system-wide unique type name required for communication."""
return "TransmissionData"