diff options
| author | Arturs Artamonovs <arturs.artamonovs@protonmail.com> | 2026-09-27 10:24:48 +0100 |
|---|---|---|
| committer | Arturs Artamonovs <arturs.artamonovs@protonmail.com> | 2026-09-27 10:24:48 +0100 |
| commit | fa8b756462fec42b23acbf253313c9292e43afed (patch) | |
| tree | 81b153638b18226feb254f44d0e8a7efababe69a /ADSBDecoderFramework/ADSBTypeCodeIndentification.swift | |
| parent | 40038b02ce651958ae703c8ecfe5f5578e1f7f09 (diff) | |
| download | ADSBDecoder-main.tar.gz ADSBDecoder-main.zip | |
remove from files multiple clases and put them in separate filesmain
Diffstat (limited to 'ADSBDecoderFramework/ADSBTypeCodeIndentification.swift')
| -rw-r--r-- | ADSBDecoderFramework/ADSBTypeCodeIndentification.swift | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/ADSBDecoderFramework/ADSBTypeCodeIndentification.swift b/ADSBDecoderFramework/ADSBTypeCodeIndentification.swift new file mode 100644 index 0000000..ad66378 --- /dev/null +++ b/ADSBDecoderFramework/ADSBTypeCodeIndentification.swift @@ -0,0 +1,34 @@ +// +// ADSBTypeCodeIndentification.swift +// ADSBDecoder +// +// Created by Jacky Jack on 27/09/2026. +// + +public class ADSBTypeCodeIndentification: CustomStringConvertible { + var TypeCode:Int = 4 + var Category:Int = 0 + public var ICAOName:String + + public init(_ bindata:ArraySlice<UInt8>) { + let cat = bindata[4]&0x7 + Category = Int(cat) + let char_0 = bindata[5]>>2 + let char_1 = (bindata[5]&0x3)<<4 + bindata[6]>>4 + let char_2 = (bindata[6]&0xf)<<2 + (bindata[7]>>6)&0x3 + let char_3 = (bindata[7])&0x3f + let char_4 = bindata[8]>>2 + let char_5 = (bindata[8]&0x3)<<4 + bindata[9]>>4 + let char_6 = (bindata[9]&0xf)<<2 + (bindata[10]>>6) + let char_7 = bindata[10]&0x3f + + //print(char_0, char_1, char_2,char_3,char_4,char_5,char_6,char_7) + ICAOName = ICAO2String(char_0, char_1, char_2, char_3, char_4, char_5, char_6, char_7) + //print("ICAO name \(ICAOName)") + } + + public var description: String { + let description = "TypeCode \(TypeCode) Cat \(Category) Flight name \(ICAOName)" + return description + } +} |
