COT Publisher
A Rust library for publishing Cursor on Target (COT) messages to multicast networks and TAK Servers.
This library provides both async and blocking interfaces for integrating COT functionality into Rust applications
Features
The crate supports publishing COT messages through two transport mechanisms:
- Multicast Publishing
- TLS/mTLS Publishing (TAK Server etc.)
- Async and Blocking API's
Installation
Add this to your Cargo.toml:
[]
= "2.0.0-rc2"
For blocking operations, enable the blocking feature:
[]
= { = "2.0.0-rc2", = ["blocking"] }
Basic Usage
Async Multicast Publishing
use CotPublisher;
async
Blocking Multicast Publishing
use CotPublisher;
TAK Server Connection with TLS
use ;
use Url;
async
COT Message Types
The COT type field follows the standard COT taxonomy. Common types include:
a-f-G-E-V-C: Ground friendly unit, equipment, vehicle, combata-f-G-E-V-M: Ground friendly unit, equipment, vehicle, medicala-f-G-I: Ground friendly unit, installationsa-h-G: Ground hostile unita-n-G: Ground neutral unita-u-G: Ground unknown unit
Extended Position Information
// Set position with altitude and accuracy information
cot.set_position_extended;
// Add precision location source information
cot.set_precision_location;
Custom XML Details
COT messages support custom XML detail sections for application-specific data:
cot.set_xml_detail;
Certificate Management for TAK Server
When connecting to TAK Server, you need client certificates. TAK Server typically generates certificates protected with the password "atakatak".
It is possible to provide the password as part of the connection Credential or remove password protection using:
Certificates can be loaded from files or embedded as strings in your application:
// From files
let credentials = from_unencrypted_pem?;
// From strings (useful for embedded certificates)
let cert_pem = include_str!;
let key_pem = include_str!;
let credentials = from_unencrypted_pem?;
If the CA Certificate is not provided in the ClientCredentials then the system native certificates will be used.
TAK Server Configuration
To accept COT messages, configure TAK Server with a streaming data feed (in many cases a mTLS connection is enabled by default):
- Navigate to Configuration → Inputs and Data Feeds → Add Streaming Data Feed
- Select "Secure Streaming TCP (TLS) CoT or Protobuf" as the protocol
- Configure the desired port
- Create client certificates using the TAK Server makeCert script
Error Handling
Enable error logging by adding the emit_errors feature:
[]
= { = "2.0.0-rc1", = ["emit_errors"] }
When enabled logs are emitted via the log crate.
Examples
The repository includes several complete examples:
simple_multicast.rs: Basic multicast publishing with position updatesblocking_multicast.rs: Blocking interface demonstrationtakserver_connection.rs: TAK Server connection with TLS certificates
Run examples with:
The takserver example requires certificate / key information to be added before it can be used.
License
This project is licensed under the MIT License.