On this page

SUPL-Protocol

This package contains the basic definitions as asn.1 files and the generated and split up rust code from these by using rasn.

Usage

The easiest way to use the protocol by setting up a stream and using the SuplConnection, like it is done in this test

use supl_protocol::util::SuplConnection;
use supl_protocol::supl_end::SUPLEND;
use supl_protocol::ulp::UlpMessage;
use supl_protocol::ulp_components::{SessionID, Version};

#[tokio::test]
async fn supl_connection_message_passed_through() {
    let (client, server) = tokio::io::duplex(BUFFER_SIZE);
    let mut client = SuplConnection::new(client);
    let mut server = SuplConnection::new(server);
    let message = ULPPDU::new(
        7,
        Version::new(1, 2, 3),
        SessionID::new(None, None),
        UlpMessage::msSUPLEND(SUPLEND::new(None, None, None, None)),
    );
    client.write(message.clone()).await.unwrap();
    assert_eq!(server.read().await.unwrap(), message);
}

Development

The majority of the code in this crate has been generated using rasn and it's compiler. The source of the asn files used here is the collection in pycrate.

License

This project is licensed under the EUPL-1.2