Skip to content

Commit 29a24fd

Browse files
author
Dr. Brandon Wiley
committed
Rewrote WSPRMessageSequence codec
1 parent c6f1f63 commit 29a24fd

26 files changed

+1892
-2085
lines changed

Codex/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ android {
3434
}
3535

3636
dependencies {
37-
37+
implementation(kotlin("reflect"))
3838
implementation(libs.androidx.core.ktx)
3939
implementation(libs.androidx.appcompat)
4040
implementation(libs.material)

Codex/src/main/java/org/operatorfoundation/codex/Decoder.kt

Lines changed: 0 additions & 82 deletions
This file was deleted.

Codex/src/main/java/org/operatorfoundation/codex/Encoder.kt

Lines changed: 0 additions & 111 deletions
This file was deleted.

Codex/src/main/java/org/operatorfoundation/codex/symbols/Symbol.kt renamed to Codex/src/main/java/org/operatorfoundation/codex/Symbol.kt

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
1-
package org.operatorfoundation.codex.symbols
1+
package org.operatorfoundation.codex
22

33
import java.math.BigInteger
44

5+
interface SymbolFactory<T: Symbol>
6+
{
7+
fun encode(numericValue: BigInteger): T
8+
9+
/**
10+
* Returns the number of possible values this symbol can represent.
11+
* For example, Binary returns 2, Byte returns 256.
12+
*/
13+
fun size(): Int
14+
}
15+
516
/**
617
* Base interface for all symbol types that can encode/decode values.
718
* Symbols represent different character sets or value ranges (e.g., letters, numbers, bytes).
@@ -10,27 +21,12 @@ import java.math.BigInteger
1021
*/
1122
interface Symbol
1223
{
13-
/**
14-
* Returns the number of possible values this symbol can represent.
15-
* For example, Binary returns 2, Byte returns 256.
16-
*/
17-
fun size(): Int
18-
1924
/**
2025
* Decodes a ByteArray to its numeric representation.
2126
* For example, CallLetterNumber decodes "A".toByteArray() to 0, "B".toByteArray() to 1, etc.
2227
*
2328
* @param encodedValue ByteArray containing the encoded data
2429
* @return The decoded numeric value as BigInteger
2530
*/
26-
fun decode(encodedValue: ByteArray): BigInteger
27-
28-
/**
29-
* Encodes a numeric value to its byte array representation.
30-
* For example, CallLetterNumber encodes 0 to "A".toByteArray(), 1 to "B".toByteArray(), etc.
31-
*
32-
* @param numericValue The numeric value to encode as BigInteger
33-
* @return ByteArray containing the encoded data
34-
*/
35-
fun encode(numericValue: BigInteger): ByteArray
31+
fun decode(): BigInteger
3632
}

0 commit comments

Comments
 (0)