Repository navigation
pdn_aprs 1.0.0
This is the first stable release. The public API is now frozen under semantic versioning. From 1.0 the major and minor version are shared with aprs-vectors and the other four libraries: a ruling round is a minor version for all five, this library's own fixes are patch versions, and an API break is a major version.
The 1.0 API cleanup: one consistent shape for every build call, one way to report a refusal, and a written compatibility promise. Breaking changes are listed first, with what to do about each.
Breaking changes
What 1.x promises, which is new: source compatibility only. Struct sizes follow the capacities and a 1.x release may add a field to any struct, so rebuild everything that includes pdn_aprs.h on upgrade, link the static library or compile in the single file, and zero-initialise every input struct (a field added later means "absent" when zero).
- The CMake library target is always STATIC (
BUILD_SHARED_LIBSis ignored) and no longer has a SOVERSION. It is built with hidden visibility, and the public functions are markedPDN_APRS_API. pdn_aprs_decode_options.rejectis now a fixedreject[PDN_APRS_MAX_CODES](128) instead ofreject[PDN_APRS_CODE_COUNT], so a new code never changes the struct. Designated initializers (.reject = {[PDN_APRS_CODE_X] = 1}) are unaffected.- Every
pdn_aprs_build_*call, andpdn_aprs_build(), gains a trailingpdn_aprs_encoded *result(may be NULL): it getslen, the Mic-Edestinationand, on failure,reason(plain text, not part of the stable API). Add, NULLto keep today's behaviour. - One input struct for every build call with optional inputs, with
name,timestamp,killed,messaginginside the struct that uses them:pdn_aprs_positionis nowpdn_aprs_position_argsand gainsname,killed,timestampandmessaging.pdn_aprs_build_position(station, &args, buf, cap, result),pdn_aprs_build_object(station, &args, buf, cap, result)andpdn_aprs_build_item(station, &args, buf, cap, result)lose theirtimestamp,messaging,nameandkilledparameters.pdn_aprs_mic_eis nowpdn_aprs_mic_e_args; itsmessageis nowmic_e_message.pdn_aprs_status_optionsis nowpdn_aprs_status_args, andpdn_aprs_build_status_options()is nowpdn_aprs_build_status(station, &args, buf, cap, result). The old text-and-timestamppdn_aprs_build_status()is gone (set.textand.timestamp).- New
pdn_aprs_message_args { addressee, text, message_id, reply_ack }:pdn_aprs_build_message_reply_ack()is nowpdn_aprs_build_message(station, &args, buf, cap, result). The old four-stringpdn_aprs_build_message()is gone (leavereply_ackNULL). - New
pdn_aprs_telemetry_args { sequence, analog[5], empty[5], bits, comment }:pdn_aprs_build_telemetry_channels()is nowpdn_aprs_build_telemetry(station, &args, buf, cap, result).empty[i]set leaves channel i empty (zero means present, so a zeroed struct has all five); the old five-valuepdn_aprs_build_telemetry()is gone.bitsNULL still gives00000000.
- Builder inputs now match the recipe: the telemetry
sequenceis anunsignednumber 0-999 (refused above, written with three digits), where it was text; the bulletin takeschar idandconst char *group(NULL for none) where it took one string like"4WX"; Mic-E takes amessagingflag, andtype_codeis only for a device type ('>',']'or' '), sotype_code = ''or'''is now refused and a Mic-E report is always written with a type code; telemetry metadata calls (_names,_units,_coefficients,_bits`) accept a NULL addressee, meaning the station itself. - Builder error codes now depend on the input, not on the C buffer:
PDN_APRS_ERR_REFUSEDfor anything APRS cannot carry (a name that is too long, a bad station address),PDN_APRS_ERR_ARGUMENTonly for a NULL required pointer or other misuse (altitude in feet and metres both), and the newPDN_APRS_ERR_UNSUPPORTED(-6) for text APRS allows that does not fit the fixed buffers (over 1,024 bytes). A switch over the result codes needs a case for -6. - Weather indexes carry their units, and the enum has a type name,
pdn_aprs_weather_field:PDN_APRS_WX_WIND_DIRECTIONisPDN_APRS_WX_WIND_DIRECTION_DEGREES,_WIND_SPEED_WIND_SPEED_MPH,_WIND_GUST_WIND_GUST_MPH,_TEMPERATURE_TEMPERATURE_F,_RAIN_1H_RAIN_1H_IN,_RAIN_24H_RAIN_24H_IN,_RAIN_MIDNIGHT_RAIN_MIDNIGHT_IN,_HUMIDITY_HUMIDITY_PERCENT,_PRESSURE_PRESSURE_MBAR,_LUMINOSITY_LUMINOSITY_W_M2,_SNOW_24H_SNOW_24H_IN.PDN_APRS_WX_RAIN_RAWis unchanged. - The
#definegroups are now named enums (the fields stayuint8_t):pdn_aprs_fix,pdn_aprs_source,pdn_aprs_origin,pdn_aprs_area_shape,pdn_aprs_storm_type,pdn_aprs_dao_precision,pdn_aprs_tone,pdn_aprs_raw_weather_format.PDN_APRS_NMEA_OTHER,_GLL,_GGAand_RMC(the compression source) are nowPDN_APRS_SOURCE_*. - Renames:
pdn_aprs_status.beam_headingandbeam_powerarebeam_heading_codeandbeam_power_code(and the same inpdn_aprs_status_args);pdn_aprs_reasonispdn_aprs_unrecognized_reasonandPDN_APRS_REASON_*isPDN_APRS_UNRECOGNIZED_*;pdn_aprs_meta_item()ispdn_aprs_telemetry_meta_item();pdn_aprs_decode_written()ispdn_aprs_decode_info_unbounded(). pdn_aprs_options_strict()is removed: writepdn_aprs_decode_options o = {.strict = 1};or seto.strict = 1.pdn_aprs_capabilities.itemis an array of the named structpdn_aprs_capability(it was an anonymous struct); same fields.pdn_aprs_ack.idkeeps its name (the neutral form calls itacked_idorrejected_id, andmessage_idwould mean the ack's own ID elsewhere in the family).pdn_aprs_reportgainsaltitude_in_comment(see Mic-E below), so struct layouts change.
Added
pdn_aprs_format_timestamp(year, month, day, hour, minute, second, format, out)writes a UTC time asDDHHMMz,HHMMSShorMMDDHHMMfor the builders, cutting to the format's step.pdn_aprs_write_tnc2()andpdn_aprs_write_ax25()write a decoded packet back as received (header and information field), for an IGate or digipeater. They returnPDN_APRS_ERR_HEADERfor an unusable header andPDN_APRS_ERR_REFUSEDfor an address AX.25 cannot carry as sent.pdn_aprs_phg_values()gives a PHG's watts, height in feet, gain in dB and directivity in degrees (-1 for omnidirectional).pdn_aprs_has_diagnostic()takes-1for any code, sopdn_aprs_has_diagnostic(&p, -1, PDN_APRS_SEVERITY_ERROR)is has-errors and..._WARNINGhas-warnings.PDN_APRS_COLOR_*constants (the area colours, which were documented but missing), apdn_aprs_colorenum, andpdn_aprs_capability_token()andpdn_aprs_capability_value().- Mic-E: the decoder sets
altitude_in_commenton a report whose altitude was sent as a/A=, and the encoder writes it that way, so data read from a packet writes the bytes it was read from. The builder sets it for an altitude in feet. It is outside the vectors' neutral form. - The diff dump tool's API view gains
has_errors,has_warnings,tnc2,ax25andphg.