Telemetry Data Push Reference
xovis.datapush.tcp_server
Xovis SDK - Data Plane TCP Server
This module implements a high-speed TCP ingestion engine for Xovis telemetry.
It handles raw concatenated JSON datapush using a sliding buffer and
json.JSONDecoder().raw_decode() for zero-copy extraction, adhering to the
Data Plane's throughput requirements.
Classes
XovisTCPServer
High-speed TCP Ingestion Engine for Xovis Telemetry.
Manages persistent TCP connections from Xovis sensors. Implements a specialized sliding buffer to extract concatenated JSON frames without delimiters, dispatching them to attached sinks with minimal latency.
Source code in src/xovis/datapush/tcp_server.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | |
Methods:
__init__()
Initializes the XovisTCPServer.
Source code in src/xovis/datapush/tcp_server.py
29 30 31 32 33 | |
_handle_client(reader, writer)
async
Handles an individual sensor connection lifecycle.
Uses a sliding string buffer combined with raw_decode to safely
extract concatenated JSON objects from the raw byte stream.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
reader
|
StreamReader
|
The client stream reader. |
required |
writer
|
StreamWriter
|
The client stream writer. |
required |
Source code in src/xovis/datapush/tcp_server.py
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | |
attach_sink(sink)
Attaches a telemetry consumer to the server.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sink
|
XovisSink
|
An object implementing the XovisSink protocol. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
XovisTCPServer |
XovisTCPServer
|
The server instance for method chaining. |
Source code in src/xovis/datapush/tcp_server.py
35 36 37 38 39 40 41 42 43 44 45 46 | |
start(host='0.0.0.0', port=9000)
async
Starts the TCP server and begins listening for sensor connections.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
host
|
str
|
The network interface to bind to. Defaults to "0.0.0.0". |
'0.0.0.0'
|
port
|
int
|
The TCP port to listen on. Defaults to 9000. |
9000
|
Raises:
| Type | Description |
|---|---|
OSError
|
If the port is already in use or binding fails. |
Source code in src/xovis/datapush/tcp_server.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | |
stop()
async
Gracefully tears down the TCP server.
Source code in src/xovis/datapush/tcp_server.py
48 49 50 51 52 53 54 55 | |
xovis.datapush.http_server
Xovis SDK - Data Plane HTTP Server
This module implements a high-performance ASGI Webhook Server for Xovis telemetry
ingestion. It resides strictly within the Data Plane, utilizing aiohttp and orjson
for zero-copy, lock-free processing of incoming HTTP pushes without Pydantic overhead.
Classes
XovisHTTPServer
High-performance ASGI Webhook Server for Xovis Telemetry.
Operates strictly within the Data Plane to ingest 12.5Hz telemetry via HTTP webhooks. Designed for maximum throughput, it bypasses UTF-8 decoding and Pydantic validation, dispatching parsed frames to attached sinks via asynchronous fire-and-forget tasks.
Source code in src/xovis/datapush/http_server.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 | |
Methods:
_handle_post(request)
async
Hot path ingestion for incoming HTTP requests.
Directly reads bytes from the socket buffer and performs instantaneous C-level deserialization via orjson. Broadcasts frames to sinks asynchronously to unblock the HTTP response immediately.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
Request
|
The incoming aiohttp request. |
required |
Returns:
| Type | Description |
|---|---|
Response
|
web.Response: A 200 OK response on success, or appropriate error codes. |
Source code in src/xovis/datapush/http_server.py
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 | |
attach_sink(sink)
Attaches a telemetry consumer to the server.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sink
|
XovisSink
|
An object implementing the XovisSink protocol to receive ingested telemetry frames. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
XovisHTTPServer |
XovisHTTPServer
|
The server instance for method chaining. |
Source code in src/xovis/datapush/http_server.py
45 46 47 48 49 50 51 52 53 54 55 56 57 | |
start(host='0.0.0.0', port=9001)
async
Initializes the aiohttp runner and binds the TCP socket.
Enters a non-blocking sleep loop to keep the server alive until cancelled.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
host
|
str
|
The network interface to bind to. Defaults to "0.0.0.0". |
'0.0.0.0'
|
port
|
int
|
The TCP port to listen on. Defaults to 9001. |
9001
|
Raises:
| Type | Description |
|---|---|
OSError
|
If the port is already in use or binding fails. |
Source code in src/xovis/datapush/http_server.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | |
stop()
async
Gracefully tears down the HTTP server and cleans up active connections.
Source code in src/xovis/datapush/http_server.py
84 85 86 87 88 89 90 91 | |
xovis.datapush.udp_server
Xovis SDK - Data Plane UDP Server
This module implements a high-performance UDP ingestion engine for Xovis
telemetry. It utilizes asyncio.DatagramProtocol for low-latency ingestion
of discrete JSON packets, residing strictly within the Data Plane.
Classes
XovisUDPProtocol
Bases: DatagramProtocol
Protocol implementation for high-speed UDP ingestion.
Handles incoming datagrams from Xovis sensors. Each datagram is expected to be a complete JSON frame. This class operates in the hot path and dispatches telemetry to sinks with minimal overhead.
Source code in src/xovis/datapush/udp_server.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | |
Methods:
__init__(sinks)
Initializes the UDP protocol.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sinks
|
List[XovisSink]
|
A list of attached telemetry sinks. |
required |
Source code in src/xovis/datapush/udp_server.py
28 29 30 31 32 33 34 35 36 | |
connection_made(transport)
Called when the UDP socket is ready.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
transport
|
DatagramTransport
|
The transport for the socket. |
required |
Source code in src/xovis/datapush/udp_server.py
38 39 40 41 42 43 44 45 46 47 | |
datagram_received(data, addr)
Hot path ingestion for UDP datagrams.
Parses the incoming byte packet as a JSON object and routes it to the attached sinks.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
bytes
|
The raw packet data. |
required |
addr
|
tuple
|
The source address of the packet. |
required |
Source code in src/xovis/datapush/udp_server.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | |
XovisUDPServer
High-performance UDP Ingestion Engine for Xovis Telemetry.
Operates within the Data Plane to provide low-latency telemetry ingestion. Coordinates the lifecycle of the UDP socket and the underlying protocol.
Source code in src/xovis/datapush/udp_server.py
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | |
Methods:
__init__()
Initializes the XovisUDPServer.
Source code in src/xovis/datapush/udp_server.py
93 94 95 96 97 98 99 | |
attach_sink(sink)
Attaches a telemetry consumer to the server.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sink
|
XovisSink
|
An object implementing the XovisSink protocol. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
XovisUDPServer |
XovisUDPServer
|
The server instance for method chaining. |
Source code in src/xovis/datapush/udp_server.py
101 102 103 104 105 106 107 108 109 110 111 112 | |
start(host='0.0.0.0', port=9002)
async
Starts the UDP server and begins listening for datagrams.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
host
|
str
|
The network interface to bind to. Defaults to "0.0.0.0". |
'0.0.0.0'
|
port
|
int
|
The UDP port to listen on. Defaults to 9002. |
9002
|
Raises:
| Type | Description |
|---|---|
OSError
|
If binding fails. |
Source code in src/xovis/datapush/udp_server.py
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | |
stop()
async
Gracefully tears down the UDP server.
Source code in src/xovis/datapush/udp_server.py
114 115 116 117 118 119 120 121 | |
xovis.datapush.tcp_client
Xovis SDK - Data Plane TCP Client
This module implements a high-speed active TCP ingestion client. It connects to Xovis sensors configured in SERVER mode (ports 49156/49159) and extracts concatenated JSON frames using a zero-copy sliding buffer, adhering strictly to the Data Plane's non-blocking architecture.
Classes
XovisTCPClient
Active TCP Ingestion Client for Xovis Telemetry.
Initiates and persists a connection to a Xovis sensor running in SERVER mode. Utilizes a sliding string buffer to slice out continuous JSON payloads without network delimiters, routing them to attached sinks.
Source code in src/xovis/datapush/tcp_client.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | |
Methods:
__init__(host, port=49156, reconnect_interval=5.0)
Initializes the XovisTCPClient.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
host
|
str
|
The IP address or hostname of the Xovis sensor. |
required |
port
|
int
|
The TCP port the sensor is listening on. Defaults to 49156 (Singlesensor) or 49159 (Multisensor). |
49156
|
reconnect_interval
|
float
|
Seconds to wait before attempting to reconnect after a drop. Defaults to 5.0. |
5.0
|
Source code in src/xovis/datapush/tcp_client.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | |
_connect_and_read()
async
Maintains the active socket and parses the byte stream.
Uses the raw_decode sliding buffer to slice complete JSON objects
out of the fragmented MTU network chunks.
Source code in src/xovis/datapush/tcp_client.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | |
attach_sink(sink)
Attaches a telemetry consumer to the client.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sink
|
XovisSink
|
An object implementing the XovisSink protocol. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
XovisTCPClient |
XovisTCPClient
|
The client instance for method chaining. |
Source code in src/xovis/datapush/tcp_client.py
46 47 48 49 50 51 52 53 54 55 56 57 | |
start()
async
Starts the client connection loop.
Continuously attempts to connect to the sensor and read the stream. If the connection drops or the sensor reboots, it will automatically back off and reconnect.
Source code in src/xovis/datapush/tcp_client.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | |
stop()
async
Terminates the active connection loop.
Source code in src/xovis/datapush/tcp_client.py
81 82 83 84 | |
xovis.datapush.mqtt_client
Xovis SDK - Data Plane MQTT Client
This module implements a high-performance MQTT ingestion client for Xovis telemetry.
It utilizes aiomqtt to subscribe to broker topics, process JSON payloads, and
dispatch them to attached sinks while natively handling network backpressure.
Classes
XovisMQTTClient
Active MQTT Ingestion Client for Xovis Telemetry.
Connects to an MQTT broker, subscribes to the configured telemetry topic, and routes incoming JSON payloads to the attached sinks. Supports TLS and username/password authentication.
Source code in src/xovis/datapush/mqtt_client.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | |
Methods:
__init__(host, topic, port=1883, username=None, password=None, use_ssl=False)
Initializes the XovisMQTTClient.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
host
|
str
|
The IP address or hostname of the MQTT broker. |
required |
topic
|
str
|
The MQTT topic to subscribe to. |
required |
port
|
int
|
The broker port. Defaults to 1883 (or 8883 if SSL is True). |
1883
|
username
|
Optional[str]
|
Authentication username. |
None
|
password
|
Optional[str]
|
Authentication password. |
None
|
use_ssl
|
bool
|
Whether to use TLS encryption. Defaults to False. |
False
|
Source code in src/xovis/datapush/mqtt_client.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | |
attach_sink(sink)
Attaches a telemetry consumer to the client.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sink
|
XovisSink
|
An object implementing the XovisSink protocol. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
XovisMQTTClient |
XovisMQTTClient
|
The client instance for method chaining. |
Source code in src/xovis/datapush/mqtt_client.py
60 61 62 63 64 65 66 67 68 69 70 71 | |
start()
async
Starts the MQTT client loop.
Connects to the broker, subscribes to the topic, and listens for messages.
aiomqtt automatically handles reconnections under the hood.
Source code in src/xovis/datapush/mqtt_client.py
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | |
stop()
async
Terminates the active connection loop.
Source code in src/xovis/datapush/mqtt_client.py
122 123 124 | |
xovis.datapush.sinks
Xovis SDK - Data Plane Sink Interfaces
This module defines the architectural contract for all telemetry consumers
within the Data Plane. It provides the XovisSink protocol, ensuring a
unified interface for high-frequency frame and event processing.
Classes
XovisSink
Bases: Protocol
Base interface for developer integrations attaching to the stream.
Defines the standard protocol for processing incoming telemetry data.
Implementations of this protocol are attached to XovisTCPServer,
XovisUDPServer, or XovisHTTPServer to receive real-time updates.
Source code in src/xovis/datapush/sinks.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | |
Methods:
on_events(events)
async
Triggered when discrete events are detected by the sensor.
Captures high-level logic events such as zone entries, exits, or line crossings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
events
|
list
|
A list of discrete event dictionaries. |
required |
Source code in src/xovis/datapush/sinks.py
41 42 43 44 45 46 47 48 49 50 51 | |
on_frame(frame)
async
Triggered for every tracked frame received from the sensor.
In standard configurations, this occurs approximately 12.5 times per second and contains all tracked objects and coordinates.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frame
|
dict
|
The parsed telemetry frame payload. |
required |
Source code in src/xovis/datapush/sinks.py
29 30 31 32 33 34 35 36 37 38 39 | |