@@ -1628,10 +1628,15 @@ static void aprs_mic_e (decode_aprs_t *A, packet_t pp, unsigned char *info, int
1628
1628
* It's a lot more complicated with different types of addressees
1629
1629
* and replies with acknowledgement or rejection.
1630
1630
*
1631
- * There is even a special case for telemetry metadata.
1631
+ * Is it an elegant generalization to lump all of these special cases
1632
+ * together or was it a big mistake that will cause confusion and incorrect
1633
+ * implementations? The decision to put telemetry metadata here is baffling.
1632
1634
*
1633
1635
*
1634
- * Cases: :xxxxxxxxx:PARM. Telemetry metadata, parameter name
1636
+ * Cases: :BLNxxxxxx: ... Bulletin.
1637
+ * :NWSxxxxxx: ... National Weather Service Bulletin.
1638
+ *
1639
+ * :xxxxxxxxx:PARM. Telemetry metadata, parameter name
1635
1640
* :xxxxxxxxx:UNIT. Telemetry metadata, unit/label
1636
1641
* :xxxxxxxxx:EQNS. Telemetry metadata, Equation Coefficients
1637
1642
* :xxxxxxxxx:BITS. Telemetry metadata, Bit Sense/Project Name
@@ -1736,6 +1741,46 @@ static void aprs_message (decode_aprs_t *A, unsigned char *info, int ilen, int q
1736
1741
1737
1742
strlcpy (A -> g_addressee , addressee , sizeof (A -> g_addressee ));
1738
1743
1744
+ /*
1745
+ * Addressee starting with BLN or NWS is a bulletin.
1746
+ */
1747
+ if (strlen (addressee ) >= 3 && strncmp (addressee ,"BLN" ,3 ) == 0 ) {
1748
+
1749
+ // Interpret 3 cases of identifiers.
1750
+ // BLN9 "general bulletin" has a single digit.
1751
+ // BLNX "announcement" has a single uppercase letter.
1752
+ // BLN9xxxxx "group bulletin" has single digit group id and group name up to 5 characters.
1753
+
1754
+ if (strlen (addressee ) == 4 && isdigit (addressee [3 ])) {
1755
+ snprintf (A -> g_data_type_desc , sizeof (A -> g_data_type_desc ), "General Bulletin with identifier \"%s\"" , addressee + 3 );
1756
+ }
1757
+ else if (strlen (addressee ) == 4 && isupper (addressee [3 ])) {
1758
+ snprintf (A -> g_data_type_desc , sizeof (A -> g_data_type_desc ), "Announcement with identifier \"%s\"" , addressee + 3 );
1759
+ }
1760
+ if (strlen (addressee ) >=5 && isdigit (addressee [3 ])) {
1761
+ snprintf (A -> g_data_type_desc , sizeof (A -> g_data_type_desc ), "Group Bulletin with identifier \"%c\", group name \"%s\"" , addressee [3 ], addressee + 4 );
1762
+ }
1763
+ else {
1764
+ // Not one of the official formats.
1765
+ snprintf (A -> g_data_type_desc , sizeof (A -> g_data_type_desc ), "Bulletin with identifier \"%s\"" , addressee + 3 );
1766
+ }
1767
+ A -> g_message_subtype = message_subtype_bulletin ;
1768
+ strlcpy (A -> g_comment , p -> message , sizeof (A -> g_comment ));
1769
+ }
1770
+
1771
+ else if (strlen (addressee ) >= 3 && strncmp (addressee ,"NWS" ,3 ) == 0 ) {
1772
+ // NWS-xxxxx
1773
+
1774
+ if (strlen (addressee ) >=4 && addressee [3 ] == '-' ) {
1775
+ snprintf (A -> g_data_type_desc , sizeof (A -> g_data_type_desc ), "NWS bulletin with identifier \"%s\"" , addressee + 4 );
1776
+ }
1777
+ else {
1778
+ snprintf (A -> g_data_type_desc , sizeof (A -> g_data_type_desc ), "NWS bulletin with identifier \"%s\", missing - after NWS" , addressee + 3 );
1779
+ }
1780
+ A -> g_message_subtype = message_subtype_nws ;
1781
+ strlcpy (A -> g_comment , p -> message , sizeof (A -> g_comment ));
1782
+ }
1783
+
1739
1784
1740
1785
/*
1741
1786
* Special message formats contain telemetry metadata.
@@ -1748,7 +1793,7 @@ static void aprs_message (decode_aprs_t *A, unsigned char *info, int ilen, int q
1748
1793
* Why not use other characters after the "T" for metadata?
1749
1794
*/
1750
1795
1751
- if (strncmp (p -> message ,"PARM." ,5 ) == 0 ) {
1796
+ else if (strncmp (p -> message ,"PARM." ,5 ) == 0 ) {
1752
1797
snprintf (A -> g_data_type_desc , sizeof (A -> g_data_type_desc ), "Telemetry Parameter Name Message for \"%s\"" , addressee );
1753
1798
A -> g_message_subtype = message_subtype_telem_parm ;
1754
1799
telemetry_name_message (addressee , p -> message + 5 );
@@ -1847,7 +1892,7 @@ static void aprs_message (decode_aprs_t *A, unsigned char *info, int ilen, int q
1847
1892
// X>Y:}A>B::WA1XYX-15:Howdy y'all{toolong
1848
1893
1849
1894
else {
1850
- // Look for message number.
1895
+ // Normal messaage case. Look for message number.
1851
1896
char * pno = strchr (p -> message , '{' );
1852
1897
if (pno != NULL ) {
1853
1898
strlcpy (A -> g_message_number , pno + 1 , sizeof (A -> g_message_number ));
0 commit comments