Crate cot_publisher

Crate cot_publisher 

Source
Expand description

This crate provides an interface for publishing Cursor on Target (COT) messages to multicast addresses or TAK servers over TCP/TLS.

There are two features available:

  • blocking - Provides a blocking interface for use in non-async applications
  • emit_errors - Enables error logging using the log crate

The blocking implementation runs a Tokio runtime in a separate thread to handle async operations.

The emit_errors feature allows the library to log errors using the log crate. This is disabled by default to avoid unnecessary dependencies in applications.

§Examples

§Async multicast

use cot_publisher::{CotPublisher, CursorOnTarget};

async fn example() {
    let publisher = CotPublisher::new_multicast("239.2.3.1".parse().unwrap(), 6969);
    let mut cot = publisher.create_cot("unique-uid", "a-f-G-U").unwrap();
    cot.set_position(51.5074, -0.1278);
    cot.set_contact(Some("CALLSIGN"), None);
    cot.publish().await.unwrap();
}

§Blocking multicast

use cot_publisher::blocking::CotPublisher;

let publisher = CotPublisher::new_multicast("239.2.3.1".parse().unwrap(), 6969);
let mut cot = publisher.create_cot("unique-uid", "a-f-G-U").unwrap();
cot.set_position(51.5074, -0.1278);
cot.set_contact(Some("CALLSIGN"), None);
cot.blocking_publish().unwrap();

Modules§

tak_proto
Tak_proto definition build using build.rs stage

Structs§

Contact
Contact information for a COT entity
CotPublisher
Credentials
Stores the credentials needed for TLS connections
CursorOnTarget
Cursor on Target (COT) message structure and related types
Position
Geographic position information for a COT entity
PrecisionLocation
Precision location metadata describing the source of position data
TakServerSetting
Tak server connection settings

Enums§

PublishError
Errors that can occur during publishing
Source
Source for PEM file data