diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2023-11-06 18:37:11 +0300 |
|---|---|---|
| committer | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2023-11-06 18:37:11 +0300 |
| commit | 2f8c92f261586f68a976efce0cfcdd0401f402e0 (patch) | |
| tree | 33189cc48987789dff4e7fba0a74d2b2326f0a04 /pkg/classes/customData.go | |
| parent | convert cm ticks correctly (diff) | |
| download | sdp.go-2f8c92f261586f68a976efce0cfcdd0401f402e0.tar.gz sdp.go-2f8c92f261586f68a976efce0cfcdd0401f402e0.tar.bz2 sdp.go-2f8c92f261586f68a976efce0cfcdd0401f402e0.zip | |
dont try to understand it, feel itlp-parser
Diffstat (limited to 'pkg/classes/customData.go')
| -rw-r--r-- | pkg/classes/customData.go | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/pkg/classes/customData.go b/pkg/classes/customData.go deleted file mode 100644 index 59cb121..0000000 --- a/pkg/classes/customData.go +++ /dev/null | |||
| @@ -1,26 +0,0 @@ | |||
| 1 | package classes | ||
| 2 | |||
| 3 | import ( | ||
| 4 | "github.com/pektezol/bitreader" | ||
| 5 | ) | ||
| 6 | |||
| 7 | type CustomData struct { | ||
| 8 | Type int32 | ||
| 9 | Size int32 | ||
| 10 | Data string | ||
| 11 | } | ||
| 12 | |||
| 13 | func (customData *CustomData) ParseCustomData(reader *bitreader.Reader, tickNumber int32, packetType uint8) { | ||
| 14 | customData.Type = reader.TryReadSInt32() | ||
| 15 | customData.Size = reader.TryReadSInt32() | ||
| 16 | if customData.Type != 0 || customData.Size == 8 { | ||
| 17 | // Not SAR data | ||
| 18 | customData.Data = string(reader.TryReadBytesToSlice(uint64(customData.Size))) | ||
| 19 | return | ||
| 20 | } | ||
| 21 | // SAR data | ||
| 22 | sarData := SarData{} | ||
| 23 | data := reader.TryReadBytesToSlice(uint64(customData.Size)) | ||
| 24 | sarReader := bitreader.NewReaderFromBytes(data, true) | ||
| 25 | sarData.ParseSarData(sarReader) | ||
| 26 | } | ||