Skip to content

Commit cd345d4

Browse files
committed
Merge branch 'release/sameold-0.2.3'
2 parents 24fc5a3 + f48f1b6 commit cd345d4

6 files changed

Lines changed: 34 additions & 7 deletions

File tree

Cargo.lock

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

crates/samedec/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "samedec"
33
description = "A SAME/EAS digital receiver and alerting program"
4-
version = "0.2.2"
4+
version = "0.2.3"
55
authors = ["Colin S <3526918+cbs228@users.noreply.github.com>"]
66
license = "MIT OR Apache-2.0"
77
edition = "2018"
@@ -10,7 +10,7 @@ repository = "https://github.com/cbs228/sameold.git"
1010
readme = "README.md"
1111

1212
[dependencies]
13-
sameold = {path = "../sameold", version = "0.2.1"}
13+
sameold = {path = "../sameold", version = "0.2.3"}
1414
byteorder = "^1.4"
1515
clap = "^2.33"
1616
log = "^0.4"

crates/samedec/src/app.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ impl From<State<Alerting>> for State<Waiting> {
269269

270270
// Create a demonstration message
271271
fn make_demo_message(at: &DateTime<Utc>) -> Message {
272-
let msg_string = format!("ZCZC-EAS-DMO-999000+0015-{}-N0CALL-", at.format("%j%H%M"));
272+
let msg_string = format!("ZCZC-EAS-DMO-999000+0015-{}-N0 CALL -", at.format("%j%H%M"));
273273
Message::StartOfMessage(MessageHeader::new(msg_string).expect("unable to create DMO message"))
274274
}
275275

crates/sameold/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "sameold"
33
description = "A SAME/EAS digital receiver library"
4-
version = "0.2.2"
4+
version = "0.2.3"
55
authors = ["Colin S <3526918+cbs228@users.noreply.github.com>"]
66
license = "MIT OR Apache-2.0"
77
edition = "2018"

crates/sameold/src/framing.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,9 +517,18 @@ fn bit_vote_parity(b0: u8, b1: u8, b2: u8) -> (u8, u32) {
517517
//
518518
// Allowed characters include the following ASCII:
519519
// - Uppercase letters
520+
// - Lowercase letters
520521
// - Numbers
521522
// - Minus sign (`-`)
522523
// - Plus sign (`+`)
524+
// - Question mark (`?`)
525+
// - Open parentheses (`(`)
526+
// - Close parentheses (`)`)
527+
// - Open brackets (`[`)
528+
// - Close brackets (`]`)
529+
// - Period (`.`)
530+
// - Underscore (`_`)
531+
// - Comma (`,`)
523532
// - Slash (`/`)
524533
// - Space (` `)(might be encountered in callsign field)
525534
//
@@ -530,15 +539,33 @@ fn bit_vote_parity(b0: u8, b1: u8, b2: u8) -> (u8, u32) {
530539
fn is_allowed_byte(c: u8) -> bool {
531540
const MINUS: u8 = '-' as u8;
532541
const PLUS: u8 = '+' as u8;
542+
const QUESTION_MARK: u8 = '?' as u8;
543+
const OPEN_PARENTHESES: u8 = '(' as u8;
544+
const CLOSE_PARENTHESES: u8 = ')' as u8;
545+
const OPEN_BRACKETS: u8 = '[' as u8;
546+
const CLOSE_BRACKETS: u8 = ']' as u8;
547+
const PERIOD: u8 = '.' as u8;
548+
const UNDERSCORE: u8 = '_' as u8;
549+
const COMMA: u8 = ',' as u8;
533550
const SLASH: u8 = '/' as u8;
534551
const SPACE: u8 = ' ' as u8;
535552
const NUMBERS: [u8; 2] = ['0' as u8, '9' as u8];
536553
const UPPER_ALPHA: [u8; 2] = ['A' as u8, 'Z' as u8];
554+
const LOWER_ALPHA: [u8; 2] = ['a' as u8, 'z' as u8];
537555

538556
c == MINUS
539557
|| (c >= NUMBERS[0] && c <= NUMBERS[1])
540558
|| (c >= UPPER_ALPHA[0] && c <= UPPER_ALPHA[1])
559+
|| (c >= LOWER_ALPHA[0] && c <= LOWER_ALPHA[1])
541560
|| c == SLASH
561+
|| c == QUESTION_MARK
562+
|| c == OPEN_PARENTHESES
563+
|| c == CLOSE_PARENTHESES
564+
|| c == OPEN_BRACKETS
565+
|| c == CLOSE_BRACKETS
566+
|| c == PERIOD
567+
|| c == UNDERSCORE
568+
|| c == COMMA
542569
|| c == PLUS
543570
|| c == SPACE
544571
}

crates/sameold/src/message/message.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ const PREFIX_MESSAGE_END: &str = "NNNN";
569569
fn check_header(hdr: &str) -> Result<(usize, usize), MessageDecodeErr> {
570570
lazy_static! {
571571
static ref RE: Regex =
572-
Regex::new(r"^ZCZC-[A-Z]{3}-[A-Z]{3}(-[0-9]{6})+(\+[0-9]{4}-[0-9]{7}-.{3,8}-)")
572+
Regex::new(r"^ZCZC-[[:alpha:]]{3}-[[:alpha:]]{3}(-[0-9]{6})+(\+[0-9]{4}-[0-9]{7}-.{3,8}-)")
573573
.expect("bad SAME regexp");
574574
}
575575

0 commit comments

Comments
 (0)