Skip to content

Commit

Permalink
Merge pull request #32 from wcampbell0x2a/add-48-30-codes
Browse files Browse the repository at this point in the history
Add 48/030 fields
  • Loading branch information
wcampbell0x2a authored Feb 9, 2024
2 parents 58fd64e + 092b561 commit 841a6a1
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 37 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.4.0] - 2024-02-09
- Add support for the following 48/030 packets:
- `WrongDFReplyFormatDetected`
- `TransponderAnomalyMs`
- `TransponderAnomalySI`
- `PotentialICConflict`
- `ICConflictDetectionPossible`
- `AMGAllocated(u16)`
- `Manufacture(u16)`

## [0.3.1] - 2023-10-14
- Update deku to 0.16
- Update syn to 2.0
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "asterix"
version = "0.3.1"
version = "0.4.0"
authors = ["wcampbell"]
edition = "2021"
categories = ["encoding", "parsing"]
Expand All @@ -18,5 +18,5 @@ members = [

[dependencies]
deku = "0.16"
asterix-derive = { version = "^0.3", path = "asterix-derive" }
asterix-derive = { version = "^0.4", path = "asterix-derive" }
assert_hex = "0.4"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Currently supported:
Add the following to your `Cargo.toml` file:
```toml
[dependencies]
asterix = "v0.3.1"
asterix = "v0.4.0"
```

## Changelog
Expand Down
2 changes: 1 addition & 1 deletion asterix-derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "asterix-derive"
version = "0.3.1"
version = "0.4.0"
authors = ["wcampbell <[email protected]>"]
edition = "2021"
description = "proc-macro convenience with the deku library, for updating ASTERIX FSPECs"
Expand Down
2 changes: 1 addition & 1 deletion src/fspec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub fn trim_fspec(fspec: &mut Vec<u8>) {
}

/// Add FX bits
pub fn add_fx(fspec: &mut Vec<u8>) {
pub fn add_fx(fspec: &mut [u8]) {
let fspec_len = fspec.len();
for f in fspec.iter_mut().take(fspec_len - 1) {
*f |= FSPEC_IDENT
Expand Down
110 changes: 78 additions & 32 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,38 +203,84 @@ pub enum MTYPE {
#[derive(Debug, PartialEq, Clone, Copy, DekuRead, DekuWrite)]
#[deku(type = "u16", bits = "7")]
pub enum CODE {
NotDefined = 0,
MultipathReply = 1,
ReplySidelobeInterrogationReception = 2,
SplitPlot = 3,
SecondTimeAroundReply = 4,
Angel = 5,
SlowMovingTarget = 6,
FixedPSRPlot = 7,
SlowPSRPlot = 8,
LowQualityPSRPlot = 9,
PhantomSSRPlot = 10,
NonMatchingMode3ACode = 11,
ModeCCodeModeSAbnormal = 12,
TargetInClutter = 13,
MaximumDopplerREsponseInZeroFilter = 14,
TransponderAnomalyDetected = 15,
DuplicatedOrIllegalModeSAircraftAddress = 16,
ModeSErrorCorrectionApplied = 17,
UndecodableModeCSCode = 18,
Birds = 19,
FlockOfBirds = 20,
Mode1PresentOriginalReply = 21,
Mode2PresentOriginalReply = 22,
PlotCausedByWindTurbine = 23,
Helicopter = 24,
MaxiumumNumberInterrogationsSurveillance = 25,
MaxiumumNumberInterrogationsBDS = 26,
BDSOverlayIncoherence = 27,
PotentialBDSSwapDetected = 28,
TrackUpdateZenithalGap = 29,
ModeSTrackReAquired = 30,
DuplicatedMode5PairNoPinDetected = 31,
#[deku(id = "0")]
NotDefined,
#[deku(id = "1")]
MultipathReply,
#[deku(id = "2")]
ReplySidelobeInterrogationReception,
#[deku(id = "3")]
SplitPlot,
#[deku(id = "4")]
SecondTimeAroundReply,
#[deku(id = "5")]
Angel,
#[deku(id = "6")]
SlowMovingTarget,
#[deku(id = "7")]
FixedPSRPlot,
#[deku(id = "8")]
SlowPSRPlot,
#[deku(id = "9")]
LowQualityPSRPlot,
#[deku(id = "10")]
PhantomSSRPlot,
#[deku(id = "11")]
NonMatchingMode3ACode,
#[deku(id = "12")]
ModeCCodeModeSAbnormal,
#[deku(id = "13")]
TargetInClutter,
#[deku(id = "14")]
MaximumDopplerREsponseInZeroFilter,
#[deku(id = "15")]
TransponderAnomalyDetected,
#[deku(id = "16")]
DuplicatedOrIllegalModeSAircraftAddress,
#[deku(id = "17")]
ModeSErrorCorrectionApplied,
#[deku(id = "18")]
UndecodableModeCSCode,
#[deku(id = "19")]
Birds,
#[deku(id = "20")]
FlockOfBirds,
#[deku(id = "21")]
Mode1PresentOriginalReply,
#[deku(id = "22")]
Mode2PresentOriginalReply,
#[deku(id = "23")]
PlotCausedByWindTurbine,
#[deku(id = "24")]
Helicopter,
#[deku(id = "25")]
MaxiumumNumberInterrogationsSurveillance,
#[deku(id = "26")]
MaxiumumNumberInterrogationsBDS,
#[deku(id = "27")]
BDSOverlayIncoherence,
#[deku(id = "28")]
PotentialBDSSwapDetected,
#[deku(id = "29")]
TrackUpdateZenithalGap,
#[deku(id = "30")]
ModeSTrackReAquired,
#[deku(id = "31")]
DuplicatedMode5PairNoPinDetected,
#[deku(id = "32")]
WrongDFReplyFormatDetected,
#[deku(id = "33")]
TransponderAnomalyMs,
#[deku(id = "34")]
TransponderAnomalySI,
#[deku(id = "35")]
PotentialICConflict,
#[deku(id = "36")]
ICConflictDetectionPossible,
#[deku(id_pat = "37..=63")]
AMGAllocated(u16),
#[deku(id_pat = "64..=127")]
Manufacturer(u16),
}

#[derive(Debug, PartialEq, Clone, Copy, DekuRead, DekuWrite)]
Expand Down

0 comments on commit 841a6a1

Please sign in to comment.