CotTypeMapper

Maps CoT type strings (e.g. "a-f-G-U-C") to integer enum values matching the CotType enum in atak.proto, and back.

Forward-compatibility contract

When a CoT type string is not in the known mapping — either because it's new (a v2.1 peer added a type the v2 receiver doesn't know) or because it's legitimately niche — typeToEnum returns COTTYPE_OTHER (0) and the caller populates cot_type_str (field 23) with the full original string. On the wire, the combination cot_type_id = 0 + cot_type_str = "…" is the canonical way to carry unknown types without losing information: the reconstructed CoT XML uses cot_type_str directly, so <event type="…"> comes back byte-identical regardless of whether the receiver's enum knows the value.

Receivers that want to detect the downgrade should check cot_type_id == COTTYPE_OTHER && cot_type_str.isNotEmpty().

Properties

Link copied to clipboard
const val COTHOW_H_E: Int = 1
Link copied to clipboard
const val COTHOW_H_G_I_G_O: Int = 3
Link copied to clipboard
const val COTHOW_M_F: Int = 5
Link copied to clipboard
const val COTHOW_M_G: Int = 2
Link copied to clipboard
const val COTHOW_M_P: Int = 6
Link copied to clipboard
const val COTHOW_M_R: Int = 4
Link copied to clipboard
const val COTHOW_M_S: Int = 7
Link copied to clipboard
const val COTHOW_UNSPECIFIED: Int = 0

Sentinel for an unknown / unset how. The builder defaults this to m-g on emit.

Link copied to clipboard
const val COTTYPE_A_F_A: Int = 50
Link copied to clipboard
const val COTTYPE_A_F_A_C: Int = 48
Link copied to clipboard
const val COTTYPE_A_F_A_C_F: Int = 47
Link copied to clipboard
const val COTTYPE_A_F_A_C_H: Int = 23
Link copied to clipboard
const val COTTYPE_A_F_A_C_L: Int = 49
Link copied to clipboard
const val COTTYPE_A_F_A_M: Int = 7
Link copied to clipboard
const val COTTYPE_A_F_A_M_F: Int = 18
Link copied to clipboard
const val COTTYPE_A_F_A_M_F_C_H: Int = 19
Link copied to clipboard
const val COTTYPE_A_F_A_M_F_F: Int = 8
Link copied to clipboard
const val COTTYPE_A_F_A_M_F_L: Int = 21
Link copied to clipboard
const val COTTYPE_A_F_A_M_F_P: Int = 22
Link copied to clipboard
const val COTTYPE_A_F_A_M_F_U_L: Int = 20
Link copied to clipboard
const val COTTYPE_A_F_A_M_H: Int = 6
Link copied to clipboard
const val COTTYPE_A_F_A_M_H_A: Int = 9
Link copied to clipboard
const val COTTYPE_A_F_A_M_H_C: Int = 51
Link copied to clipboard
const val COTTYPE_A_F_A_M_H_Q: Int = 46
Link copied to clipboard
const val COTTYPE_A_F_A_M_H_U_M: Int = 10
Link copied to clipboard
const val COTTYPE_A_F_F_B: Int = 71
Link copied to clipboard
const val COTTYPE_A_F_G: Int = 32
Link copied to clipboard
const val COTTYPE_A_F_G_E: Int = 66
Link copied to clipboard
const val COTTYPE_A_F_G_E_S: Int = 65
Link copied to clipboard
const val COTTYPE_A_F_G_E_S_E: Int = 15
Link copied to clipboard
const val COTTYPE_A_F_G_E_V: Int = 112
Link copied to clipboard
const val COTTYPE_A_F_G_E_V_A: Int = 82
Link copied to clipboard
const val COTTYPE_A_F_G_E_V_A_T: Int = 106
Link copied to clipboard
const val COTTYPE_A_F_G_E_V_C: Int = 16
Link copied to clipboard
const val COTTYPE_A_F_G_E_V_C_PS: Int = 68
Link copied to clipboard
const val COTTYPE_A_F_G_E_V_C_U: Int = 67
Link copied to clipboard
const val COTTYPE_A_F_G_E_X_M: Int = 95
Link copied to clipboard
const val COTTYPE_A_F_G_I: Int = 91
Link copied to clipboard
const val COTTYPE_A_F_G_U: Int = 33
Link copied to clipboard
const val COTTYPE_A_F_G_U_C: Int = 1
Link copied to clipboard
Link copied to clipboard
const val COTTYPE_A_F_G_U_C_F: Int = 87
Link copied to clipboard
Link copied to clipboard
const val COTTYPE_A_F_G_U_C_I: Int = 2
Link copied to clipboard
const val COTTYPE_A_F_G_U_C_I_D: Int = 102
Link copied to clipboard
const val COTTYPE_A_F_G_U_C_I_L: Int = 59
Link copied to clipboard
const val COTTYPE_A_F_G_U_C_I_Z: Int = 57
Link copied to clipboard
const val COTTYPE_A_F_G_U_C_R_O: Int = 60
Link copied to clipboard
const val COTTYPE_A_F_G_U_C_R_V: Int = 61
Link copied to clipboard
const val COTTYPE_A_F_G_U_C_R_X: Int = 56
Link copied to clipboard
const val COTTYPE_A_F_G_U_C_V_S: Int = 55
Link copied to clipboard
const val COTTYPE_A_F_G_U_H: Int = 62
Link copied to clipboard
const val COTTYPE_A_F_G_U_S_M_C: Int = 64
Link copied to clipboard
Link copied to clipboard
const val COTTYPE_A_F_S: Int = 17
Link copied to clipboard
const val COTTYPE_A_F_S_N_N_R: Int = 70
Link copied to clipboard
const val COTTYPE_A_H_A: Int = 44
Link copied to clipboard
const val COTTYPE_A_H_A_M_F_F: Int = 11
Link copied to clipboard
const val COTTYPE_A_H_A_M_H_A: Int = 12
Link copied to clipboard
const val COTTYPE_A_H_G: Int = 34
Link copied to clipboard
const val COTTYPE_A_H_G_E_V: Int = 111
Link copied to clipboard
const val COTTYPE_A_H_G_E_V_A_T: Int = 105
Link copied to clipboard
const val COTTYPE_A_H_G_E_X_M: Int = 94
Link copied to clipboard
const val COTTYPE_A_H_G_I: Int = 90
Link copied to clipboard
const val COTTYPE_A_H_G_U_C_F: Int = 86
Link copied to clipboard
const val COTTYPE_A_H_G_U_C_I: Int = 109
Link copied to clipboard
const val COTTYPE_A_H_G_U_C_I_D: Int = 101
Link copied to clipboard
const val COTTYPE_A_H_S: Int = 98
Link copied to clipboard
const val COTTYPE_A_N_A: Int = 83
Link copied to clipboard
const val COTTYPE_A_N_A_C: Int = 5
Link copied to clipboard
const val COTTYPE_A_N_A_C_F: Int = 3
Link copied to clipboard
const val COTTYPE_A_N_A_C_H: Int = 4
Link copied to clipboard
const val COTTYPE_A_N_A_M_F_F: Int = 52
Link copied to clipboard
const val COTTYPE_A_N_A_M_F_Q: Int = 24
Link copied to clipboard
const val COTTYPE_A_N_G: Int = 36
Link copied to clipboard
const val COTTYPE_A_N_G_E_V: Int = 110
Link copied to clipboard
const val COTTYPE_A_N_G_E_V_A_T: Int = 104
Link copied to clipboard
const val COTTYPE_A_N_G_E_X_M: Int = 93
Link copied to clipboard
const val COTTYPE_A_N_G_I: Int = 89
Link copied to clipboard
const val COTTYPE_A_N_G_U_C_F: Int = 85
Link copied to clipboard
const val COTTYPE_A_N_G_U_C_I: Int = 108
Link copied to clipboard
const val COTTYPE_A_N_G_U_C_I_D: Int = 100
Link copied to clipboard
const val COTTYPE_A_N_S: Int = 97
Link copied to clipboard
const val COTTYPE_A_U_A: Int = 45
Link copied to clipboard
const val COTTYPE_A_U_A_C: Int = 13
Link copied to clipboard
const val COTTYPE_A_U_A_C_F: Int = 53
Link copied to clipboard
const val COTTYPE_A_U_G: Int = 35
Link copied to clipboard
const val COTTYPE_A_U_G_E_V: Int = 69
Link copied to clipboard
const val COTTYPE_A_U_G_E_V_A_T: Int = 103
Link copied to clipboard
const val COTTYPE_A_U_G_E_X_M: Int = 92
Link copied to clipboard
const val COTTYPE_A_U_G_I: Int = 88
Link copied to clipboard
const val COTTYPE_A_U_G_U_C_F: Int = 84
Link copied to clipboard
const val COTTYPE_A_U_G_U_C_I: Int = 107
Link copied to clipboard
const val COTTYPE_A_U_G_U_C_I_D: Int = 99
Link copied to clipboard
const val COTTYPE_A_U_S: Int = 96
Link copied to clipboard
const val COTTYPE_B_A_G: Int = 31
Link copied to clipboard
const val COTTYPE_B_A_O_C: Int = 123
Link copied to clipboard
const val COTTYPE_B_A_O_CAN: Int = 29
Link copied to clipboard
const val COTTYPE_B_A_O_OPN: Int = 28
Link copied to clipboard
const val COTTYPE_B_A_O_PAN: Int = 27
Link copied to clipboard
const val COTTYPE_B_A_O_TBL: Int = 30
Link copied to clipboard
const val COTTYPE_B_F_T_A: Int = 75
Link copied to clipboard
const val COTTYPE_B_F_T_R: Int = 74
Link copied to clipboard
const val COTTYPE_B_I_V: Int = 73
Link copied to clipboard
const val COTTYPE_B_I_X_I: Int = 120
Link copied to clipboard
const val COTTYPE_B_M_P_C: Int = 79
Link copied to clipboard
const val COTTYPE_B_M_P_C_CP: Int = 115
Link copied to clipboard
const val COTTYPE_B_M_P_C_IP: Int = 114
Link copied to clipboard
const val COTTYPE_B_M_P_S_M: Int = 78
Link copied to clipboard
const val COTTYPE_B_M_P_S_P_I: Int = 39
Link copied to clipboard
const val COTTYPE_B_M_P_S_P_LOC: Int = 72
Link copied to clipboard
const val COTTYPE_B_M_P_S_P_OP: Int = 116
Link copied to clipboard
const val COTTYPE_B_M_P_W: Int = 38
Link copied to clipboard
const val COTTYPE_B_M_P_W_GOTO: Int = 113
Link copied to clipboard
const val COTTYPE_B_M_R: Int = 37
Link copied to clipboard
const val COTTYPE_B_R_F_H_C: Int = 26
Link copied to clipboard
const val COTTYPE_B_T_F: Int = 25
Link copied to clipboard
const val COTTYPE_B_T_F_D: Int = 121
Link copied to clipboard
const val COTTYPE_B_T_F_R: Int = 122
Link copied to clipboard
const val COTTYPE_M_T_T: Int = 125
Link copied to clipboard
const val COTTYPE_OTHER: Int = 0

Sentinel for an unknown / unmapped CoT type. The raw string then travels in cot_type_str.

Link copied to clipboard
const val COTTYPE_T_S: Int = 124
Link copied to clipboard
const val COTTYPE_T_X_D_D: Int = 14
Link copied to clipboard
const val COTTYPE_U_D_C_C: Int = 42
Link copied to clipboard
const val COTTYPE_U_D_C_E: Int = 119
Link copied to clipboard
const val COTTYPE_U_D_F: Int = 40
Link copied to clipboard
const val COTTYPE_U_D_F_M: Int = 76
Link copied to clipboard
const val COTTYPE_U_D_P: Int = 77
Link copied to clipboard
const val COTTYPE_U_D_R: Int = 41
Link copied to clipboard
const val COTTYPE_U_D_V: Int = 117
Link copied to clipboard
const val COTTYPE_U_D_V_M: Int = 118
Link copied to clipboard
const val COTTYPE_U_R_B_BULLSEYE: Int = 81
Link copied to clipboard
const val COTTYPE_U_R_B_C_C: Int = 80
Link copied to clipboard
const val COTTYPE_U_RB_A: Int = 43
Link copied to clipboard
const val COTTYPE_Y_DASH: Int = 126

Functions

Link copied to clipboard
fun howToEnum(howString: String): Int

Map a CoT how string (e.g. "m-g") to its CotHow enum int.

Link copied to clipboard
fun howToString(howId: Int): String?

Map a CotHow enum int back to its canonical how string.

Link copied to clipboard
fun isAircraft(cotTypeId: Int): Boolean

Whether a known CoT type is in the Air battle dimension (the 3rd CoT atom is A, as in a-n-A-C-F).

Link copied to clipboard
fun isAircraftString(cotTypeString: String): Boolean

Whether a CoT type string is in the Air battle dimension (3rd --atom equals "A", e.g. "a-f-A-M-H").

Link copied to clipboard
fun typeToEnum(cotTypeString: String): Int

Map a CoT type string (e.g. "a-f-G-U-C") to its CotType enum int.

Link copied to clipboard
fun typeToString(cotTypeId: Int): String?

Map a CotType enum int back to its canonical CoT type string.