Code Monkey home page Code Monkey logo

acars_vdlm2_parser's Introduction

About

This library is intended to be used as part of the acars_router project.

What does it provide?

It provides:

  • The ability to parse in vdlm2 and acars messages that are in a JSON format.
  • Simplifies decoding and encoding of both vdlm2 and acars messages.

acars_vdlm2_parser's People

Contributors

jcdeimos avatar fredclausen avatar

Stargazers

 avatar

Watchers

 avatar

acars_vdlm2_parser's Issues

CPDLC Causes deserialization failure

A sample of messages that will cause failure

{"vdl2":{"app":{"name":"dumpvdl2","ver":"2.2.0"},"station":"CS-KABQ-VDLM","t":{"sec":1664035653,"usec":308386},"freq":136975000,"burst_len_octets":67,"hdr_bits_fixed":0,"octets_corrected_by_fec":0,"idx":0,"sig_level":-19.046251,"noise_level":-41.025585,"freq_skew":0.795754,"avlc":{"src":{"addr":"A49206","type":"Aircraft","status":"Airborne"},"dst":{"addr":"10317A","type":"Ground station"},"cr":"Command","frame_type":"I","rseq":6,"sseq":5,"poll":false,"acars":{"err":false,"crc_ok":true,"more":false,"reg":".N394DX","mode":"2","label":"BA","blk_id":"8","ack":"!","flight":"NW0810","msg_num":"J07","msg_num_seq":"A","msg_text":"/USADCXA.DR1.N394DX8259","arinc622":{"msg_type":"fans1a_cpdlc_disconnect_request","crc_ok":true,"gs_addr":"USADCXA","air_addr":".N394DX","cpdlc":{"err":false}}}}}}
{"vdl2":{"app":{"name":"dumpvdl2","ver":"2.2.0"},"station":"CS-KABQ-VDLM","t":{"sec":1664036092,"usec":317638},"freq":136975000,"burst_len_octets":86,"hdr_bits_fixed":0,"octets_corrected_by_fec":0,"idx":0,"sig_level":-16.925297,"noise_level":-40.198395,"freq_skew":2.963141,"avlc":{"src":{"addr":"AD694C","type":"Aircraft","status":"Airborne"},"dst":{"addr":"1012CA","type":"Ground station"},"cr":"Command","frame_type":"I","rseq":0,"sseq":0,"poll":false,"acars":{"err":false,"crc_ok":true,"more":false,"reg":".N963WN","mode":"2","label":"H1","blk_id":"2","ack":"!","flight":"WN2635","msg_num":"F25","msg_num_seq":"A","sublabel":"M1","mfi":"BA","msg_text":"USADCXA.CC1.N963WN610503B249108A59","arinc622":{"msg_type":"fans1a_cpdlc_connect_confirm","crc_ok":true,"gs_addr":"USADCXA","air_addr":".N963WN","cpdlc":{"err":false,"atc_downlink_msg":{"header":{"msg_id":2,"msg_ref":2,"timestamp":{"hour":16,"min":14,"sec":50}},"atc_downlink_msg_element_id":{"choice_label":"[versionnumber]","choice":"dM73VersionNumber","data":{"ver_num":1}}}}}}}}}```

app field in message is altered from original

It looks like AppDetails nukes the name and ver fields.

For acarsdec

Received

2022-10-01T18:47:01 [TRACE] - [Message Handler ACARS] GOT: Ok(AcarsMessage(AcarsMessage { freq: 131.55, channel: Some(3), error: Some(0), level: Some(Float64(-17.2)), timestamp: Some(1664671621.168407), app: Some(AppDetails { name: "acarsdec", ver: "3.7", proxied: None, proxied_by: None, acars_router_version: None }), station_id: Some("CS-KABQ-ACARS"), assstat: Some("skipped"), icao: None, toaddr: None, is_response: None, is_onground: None, mode: Some("2"), label: Some("SQ"), block_id: None, ack: None, tail: None, text: Some("02XAABQKABQ13502N10636WV136975/ARINC"), msgno: None, flight: None }))

Sent

2022-10-01T18:47:01 [DEBUG] - [Message Handler ACARS] SENDING: AcarsMessage(AcarsMessage { freq: 131.55, channel: Some(3), error: Some(0), level: Some(Float64(-17.2)), timestamp: Some(1664671621.168407), app: Some(AppDetails { name: "", ver: "", proxied: Some(true), proxied_by: Some("acars_router"), acars_router_version: Some("1.0.12") }), station_id: Some("CS-KABQ-ACARS"), assstat: Some("skipped"), icao: None, toaddr: None, is_response: None, is_onground: None, mode: Some("2"), label: Some("SQ"), block_id: None, ack: None, tail: None, text: Some("02XAABQKABQ13502N10636WV136975/ARINC"), msgno: None, flight: None })

And dumpvdl2

Received

2022-10-01T18:47:48 [TRACE] - [Message Handler VDLM] GOT: Ok(Vdlm2Message(Vdlm2Message { vdl2: Vdlm2Body { app: Some(AppDetails { name: "dumpvdl2", ver: "2.2.0", proxied: None, proxied_by: None, acars_router_version: None }), avlc: AvlcData { cmd: None, cr: "Command", dst: DstBlock { addr: "1130BA", vehicle_type: "Ground station" }, frame_type: "I", pf: None, src: SrcBlock { addr: "ABAD6C", status: "Airborne", source_type: "Aircraft" }, xid: None, rseq: Some(1), sseq: Some(1), poll: Some(false), acars: Some(AvlcAcars { err: false, crc_ok: true, more: false, reg: ".N8510E", mode: "2", label: "H1", blk_id: "2", ack: "!", flight: Some("WN0135"), msg_num: Some("D48"), msg_num_seq: Some("A"), sublabel: Some("DF"), mfi: None, msg_text: "76401\r\n02E02KDALKLAS\r\nN35370W10885200473601M050235030G00002210J87GX\r\n", arinc622: None }) }, burst_len_octets: 117, freq: 136650000, idx: 0, freq_skew: Some(0.588081), hdr_bits_fixed: Some(0), noise_level: Some(-37.137264), octets_corrected_by_fec: Some(3), sig_level: Some(-20.228634), station: Some("CS-KABQ-VDLM"), t: Some(TBlock { sec: 1664671668, usec: 536765 }) } }))

Sent

2022-10-01T18:47:48 [DEBUG] - [Message Handler VDLM] SENDING: Vdlm2Message(Vdlm2Message { vdl2: Vdlm2Body { app: Some(AppDetails { name: "", ver: "", proxied: Some(true), proxied_by: Some("acars_router"), acars_router_version: Some("1.0.12") }), avlc: AvlcData { cmd: None, cr: "Command", dst: DstBlock { addr: "1130BA", vehicle_type: "Ground station" }, frame_type: "I", pf: None, src: SrcBlock { addr: "ABAD6C", status: "Airborne", source_type: "Aircraft" }, xid: None, rseq: Some(1), sseq: Some(1), poll: Some(false), acars: Some(AvlcAcars { err: false, crc_ok: true, more: false, reg: ".N8510E", mode: "2", label: "H1", blk_id: "2", ack: "!", flight: Some("WN0135"), msg_num: Some("D48"), msg_num_seq: Some("A"), sublabel: Some("DF"), mfi: None, msg_text: "76401\r\n02E02KDALKLAS\r\nN35370W10885200473601M050235030G00002210J87GX\r\n", arinc622: None }) }, burst_len_octets: 117, freq: 136650000, idx: 0, freq_skew: Some(0.588081), hdr_bits_fixed: Some(0), noise_level: Some(-37.137264), octets_corrected_by_fec: Some(3), sig_level: Some(-20.228634), station: Some("CS-KABQ-VDLM"), t: Some(TBlock { sec: 1664671668, usec: 536765 }) } })

dumpvdl2 should always send the AppDetails(name ver) fields in the original payload. acarsdec should mostly always send it provided the user is on a new enough version of the decoder. Old versions may not include it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.