Skip to content

Commit dd25d8c

Browse files
Version printable and included in ntrip request headers
1 parent 48f268a commit dd25d8c

File tree

5 files changed

+16
-4
lines changed

5 files changed

+16
-4
lines changed

Cargo.lock

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "rtcm-json"
33
version = "0.4.0"
44
authors = ["Martin Håkansson <[email protected]>"]
55
categories = ["encoding","command-line-interface", "command-line-utilities","parser-implementations"]
6-
description = "Serializing/deserializing RTCM v. 3 as json"
6+
description = "JSON serialization/deserialization of RTCM v. 3"
77
keywords = ["rtcm","serde","json"]
88
license = "MIT OR Apache-2.0"
99
readme = "README.md"
@@ -18,4 +18,5 @@ serde_json = "1.0.91"
1818
circular = "0.3.0"
1919
clap = { version = "4.1.1", features = ["derive"] }
2020
base64 = "0.21.0"
21-
chrono = "0.4.23"
21+
chrono = "0.4.23"
22+
version = "3.0.0"

src/arguments.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ const COORDINATE_GROUP_ID: &'static str = "coordinate-group";
7272

7373
pub fn parse_arguments() -> Result<Arguments, ()> {
7474
let matches = Command::new("rtcm-json")
75+
.version(version!())
76+
.about("JSON serialization/deserialization of RTCM v. 3")
7577
.arg(
7678
Arg::new(REVERSE_ID)
7779
.short('b')

src/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
use circular::Buffer;
2-
32
use rtcm_rs::{self, prelude::*};
43
use serde_json;
54
use tcp_server::TcpServer;
65
use std::io::{BufRead, BufReader, Read, Write};
6+
#[macro_use]
7+
extern crate version;
78

89
mod arguments;
910
mod coordinate;

src/ntrip_client.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ impl Read for NtripClient {
4646
//initialize connection
4747
stream.write_all(
4848
format!(
49-
"GET /{} HTTP/1.0\r\nUser-Agent: NTRIP rtcm-json/0.1\r\nAccept: */*\r\n{}\r\n",
49+
"GET /{} HTTP/1.0\r\nUser-Agent: NTRIP rtcm-json/{}\r\nAccept: */*\r\n{}\r\n",
5050
&self.mountpoint,
51+
version!(),
5152
if let Some(cr) = self.credentials.as_ref() {
5253
format!("Authorization: Basic {}\r\n", encode_credentials(cr))
5354
} else {

0 commit comments

Comments
 (0)