Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wip] fix: dsc & dse parsing with kaitai #218

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 128 additions & 0 deletions dsc_dse.ksy
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
meta:
id: dsc_dse
seq:
- id: start_sentence
type: str
size: 1
encoding: UTF-8
- id: talker_id
type: str
size: 2
encoding: UTF-8
- id: sentence_id
type: str
terminator: 44 # ,
encoding: UTF-8
- id: format_specifier
doc: |
Format Specifier (without first digit)
102 = selective call to a group of ships in particular geographic area
112 = distress alert call
114 = selective call to a group of ships having common interest
116 = all ships call
120 = selective call to particular individual station
123 = selective call to a particular individual using automatic service
type: str
terminator: 44 # ,
encoding: UTF-8
- id: sender_mssi
type: str
terminator: 44 # ,
encoding: UTF-8
- id: category_specifier
doc: |
Category Element (without first digit)
100 = Routine
108 = Safety
110 = Urgency
112 = Distress
type: str
terminator: 44 # ,
encoding: UTF-8
- id: category_field_1
type: str
terminator: 44 # ,
encoding: UTF-8
- id: category_field_2
type: str
terminator: 44 # ,
encoding: UTF-8
- id: sender_position
type: str
terminator: 44 # ,
encoding: UTF-8
- id: time_utc
type: str
terminator: 44 # ,
encoding: UTF-8
- id: vessel_mmsi
doc: |
Vessel MMSI in a relayed distress
type: str
terminator: 44 # ,
encoding: UTF-8
- id: unknown_1
type: str
terminator: 44 # ,
encoding: UTF-8
- id: unknown_2
type: str
terminator: 44 # ,
encoding: UTF-8
- id: expansion_follows
type: str
terminator: 42 # ,
encoding: UTF-8
- id: checksum
type: str
size: 2
encoding: UTF-8
- id: continuation
type:
switch-on: expansion_follows
cases:
'"E"': expansion
types:
expansion:
seq:
- id: start_sentence
type: str
size: 1
encoding: UTF-8
- id: talker_id
type: str
size: 2
encoding: UTF-8
- id: sentence_id
type: str
terminator: 44 # ,
encoding: UTF-8
- id: message_id
type: str
terminator: 44
encoding: UTF-8
- id: message_count
type: str
terminator: 44
encoding: UTF-8
- id: unknown
type: str
terminator: 44
encoding: UTF-8
- id: sender_mmsi
type: str
terminator: 44
encoding: UTF-8
- id: expansion_data_specifier
type: str
terminator: 44
encoding: UTF-8
- id: payload
type: str
terminator: 42
encoding: UTF-8
- id: checksum
type: str
size: 2
encoding: UTF-8

2 changes: 2 additions & 0 deletions test/dsc_alert.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$CDDSC,12,5031105200,,05,00,2380814428,1800,,,R,E*6C
$CDDSE,1,1,A,5031105200,04,19252411*18
2 changes: 2 additions & 0 deletions test/dsc_position_report.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$CDDSC,20,5031105200,08,21,26,2380814428,1800,,,B,E*77
$CDDSE,1,1,A,5031105200,04,19252411*18
2 changes: 2 additions & 0 deletions test/dsc_relayed_alert.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$CDDSC,16,2350763930,12,12,00,2380814428,1800,5031105200,05,S,E*65
$CDDSE,1,1,A,5031105200,04,19252411*18