HamName

object HamName(source)

The owner name of a licensed (ham) node, which firmware builds from two HamParameters fields.

AdminModule::handleSetHamMode() joins the call sign and the optional long_name with SEPARATOR — the form hams already use on the air — so KD2ABC plus Attic Heltec becomes KD2ABC//Attic Heltec, and a ham who supplied no long name is named after the bare call sign. The device only ever reports that composed name back as User.long_name, so editing either half means splitting it again: split and compose are inverses over every name firmware can produce.

Properties

Link copied to clipboard
const val MAX_CALL_SIGN_BYTES: Int = 7

Usable bytes in HamParameters.call_sign (max_size:8, one byte of which is the NUL terminator).

Link copied to clipboard
const val MAX_LONG_NAME_BYTES: Int = 14

Usable bytes in HamParameters.long_name (max_size:15, one byte of which is the NUL terminator).

Link copied to clipboard
const val SEPARATOR: String

What firmware puts between the call sign and the long name.

Functions

Link copied to clipboard
fun compose(callSign: String, longName: String): String

Joins the two halves the way firmware does. A blank longName yields the bare callSign — firmware treats unset and whitespace-only alike, so composing a separator for either would not match what the node stores.

Link copied to clipboard
fun forOnboarding(ownerLongName: String): String

Reshapes an existing owner long name for ham onboarding, so enabling licensed mode does not discard a name the operator already chose.

Link copied to clipboard
fun forUnlicensing(ownerLongName: String): String

Reshapes an owner long name on the way back out of licensed mode.

Link copied to clipboard
fun split(ownerLongName: String): Pair<String, String>

Splits an owner long name into its call sign and long name at the first SEPARATOR.