From b24e19b43e33906b4cea548ef91afec4448d15c6 Mon Sep 17 00:00:00 2001 From: Tim Ahpee Date: Sun, 3 Sep 2017 16:56:10 +1000 Subject: [PATCH 1/6] Work in progress adding MIC-E format --- LibAPRS/LibAPRS.cpp | 169 ++++++++++++++++++++++++++++++++++++++------ LibAPRS/LibAPRS.h | 10 +-- 2 files changed, 153 insertions(+), 26 deletions(-) diff --git a/LibAPRS/LibAPRS.cpp b/LibAPRS/LibAPRS.cpp index f271933..31c8e00 100644 --- a/LibAPRS/LibAPRS.cpp +++ b/LibAPRS/LibAPRS.cpp @@ -18,14 +18,17 @@ AX25Call dst; AX25Call path1; AX25Call path2; -char CALL[7] = "NOCALL"; -int CALL_SSID = 0; -char DST[7] = "APZMDM"; -int DST_SSID = 0; -char PATH1[7] = "WIDE1"; -int PATH1_SSID = 1; -char PATH2[7] = "WIDE2"; -int PATH2_SSID = 2; +#define MAX_CALL_LENGTH 6 +char CALL[MAX_CALL_LENGTH] = "NOCALL"; +int8_t CALL_SSID = 0; +char DST[MAX_CALL_LENGTH] = "APZMDM"; +int8_t DST_SSID = 0; +char PATH1[MAX_CALL_LENGTH] = "WIDE1"; +int8_t PATH1_SSID = 1; +char PATH2[MAX_CALL_LENGTH] = "WIDE2"; +int8_t PATH2_SSID = 2; +uint8_t MICE_MSG; +uint8_t MICE_SSID; AX25Call path[4]; @@ -39,11 +42,13 @@ uint8_t power = 10; uint8_t height = 10; uint8_t gain = 10; uint8_t directivity = 10; +uint16_t speed; +uint16_t course; ///////////////////////// // Message packet assembly fields -char message_recip[7]; -int message_recip_ssid = -1; +char message_recip[6]; +int8_t message_recip_ssid = -1; int message_seq = 0; char lastMessage[67]; @@ -63,8 +68,8 @@ void APRS_poll(void) { ax25_poll(&AX25); } -void APRS_setCallsign(char *call, int ssid) { - memset(CALL, 0, 7); +void APRS_setCallsign(char *call, int8_t ssid) { + memset(CALL, 0, MAX_CALL_LENGTH); int i = 0; while (i < 6 && call[i] != 0) { CALL[i] = call[i]; @@ -73,8 +78,8 @@ void APRS_setCallsign(char *call, int ssid) { CALL_SSID = ssid; } -void APRS_setDestination(char *call, int ssid) { - memset(DST, 0, 7); +void APRS_setDestination(char *call, int8_t ssid) { + memset(DST, 0, MAX_CALL_LENGTH); int i = 0; while (i < 6 && call[i] != 0) { DST[i] = call[i]; @@ -83,8 +88,8 @@ void APRS_setDestination(char *call, int ssid) { DST_SSID = ssid; } -void APRS_setPath1(char *call, int ssid) { - memset(PATH1, 0, 7); +void APRS_setPath1(char *call, int8_t ssid) { + memset(PATH1, 0, MAX_CALL_LENGTH); int i = 0; while (i < 6 && call[i] != 0) { PATH1[i] = call[i]; @@ -93,8 +98,8 @@ void APRS_setPath1(char *call, int ssid) { PATH1_SSID = ssid; } -void APRS_setPath2(char *call, int ssid) { - memset(PATH2, 0, 7); +void APRS_setPath2(char *call, int8_t ssid) { + memset(PATH2, 0, MAX_CALL_LENGTH); int i = 0; while (i < 6 && call[i] != 0) { PATH2[i] = call[i]; @@ -103,8 +108,8 @@ void APRS_setPath2(char *call, int ssid) { PATH2_SSID = ssid; } -void APRS_setMessageDestination(char *call, int ssid) { - memset(message_recip, 0, 7); +void APRS_setMessageDestination(char *call, int8_t ssid) { + memset(message_recip, 0, 6); int i = 0; while (i < 6 && call[i] != 0) { message_recip[i] = call[i]; @@ -175,6 +180,24 @@ void APRS_setDirectivity(int s) { } } +// Set the speed in knots. Valid speeds are 0-799 knots +void APRS_setSpeed(int s) { + if (s >= 0 && s < 800) { + speed = s; + } else { + speed = 0; + } +} + +// Set the course, valid courses are 0-360 where 0 is unknown and 360 is due north +void APRS_setCourse(int c) { + if (c >= 0 && c <= 360) { + course = c; + } else { + course = 0; + } +} + void APRS_printSettings() { Serial.println(F("LibAPRS Settings:")); Serial.print(F("Callsign: ")); Serial.print(CALL); Serial.print(F("-")); Serial.println(CALL_SSID); @@ -218,6 +241,110 @@ void APRS_sendPkt(void *_buffer, size_t length) { ax25_sendVia(&AX25, path, countof(path), buffer, length); } +// 3 bits of MIC-E message. Bit A is the most significant bit. +// If custom is set then we use the custom message bits when encoding +// Standard messages Custom Messages +// 0x07: M0: Off Duty C0: Custom-0 +// 0x06: M1: En route C1: Custom-1 +// 0x05: M2: In service C2: Custom-2 +// 0x04: M3: Returning C3: Custom-3 +// 0x03: M4: Committed C4: Custom-4 +// 0x02: M5: Special C5: Custom-5 +// 0x01: M6: Priority C6: Custom-6 +// 0x00: Emergency Emergency +void APRS_set_mice_msg(uint8_t msg, bool custom) { + MICE_MSG = msg & 0x07; + // If custom message bits, store the custom flag in bit 7 of the MICE_MSG + if (custom) { + MICE_MSG |= 0x80; + } +} + +void APRS_set_mice_ssid(uint8_t ssid) { + MICE_SSID = ssid & 0x0F; +} + +uint8_t APRS_sendLoc_mice(void *_buffer, size_t length) { + uint8_t payloadLength = 9; + uint8_t *packet = (uint8_t*)malloc(payloadLength); + // Sanity check the latitude and longtitude + if (latitude[7] != 'N' && latitude[7] != 'S') { + return 1; + } + if (longtitude[8] != 'E' && longtitude[8] != 'W') { + return 1; + } + // Build the Destination callsign with the latitude information + DST[0] = (latitude[0] & 0x04) | 0x30; + if (MICE_MSG & 0x04) { + if (MICE_MSG & 0x80) { // Standard message bit + DST[0] += 0x20; + } else { + DST[0] += 0x17; // Custom message bit + } + } + DST[1] = (latitude[1] & 0x04) | 0x30; + if (MICE_MSG & 0x02) { + if (MICE_MSG & 0x80) { // Standard message bit + DST[1] += 0x20; + } else { + DST[1] += 0x17; // Custom message bit + } + } + DST[2] = (latitude[2] & 0x04) | 0x30; + if (MICE_MSG & 0x01) { + if (MICE_MSG & 0x80) { // Standard message bit + DST[2] += 0x20; + } else { + DST[2] += 0x17; // Custom message bit + } + } + DST[3] = (latitude[3] & 0x04) | 0x30; + if (latitude[7] == 'N') { // North/South Latitude Indicator + DST[3] += 0x20; + } + DST[4] = (latitude[5] & 0x04) | 0x30; // Use latitude[5] becuase latitude[4] is a . + // if (longtitude[0] == '1') { // If the longitude is > 100, set this bit + // DST[4] += 0x20; + // } + DST[5] = (latitude[6] & 0x04) | 0x30; + if (longtitude[8] == 'W') { // If the longitude is > 100, set this bit + DST[4] += 0x20; + } + if (MICE_SSID == 0) { + path_len = 4; + } + + packet[0] = 0x60; // The ` character indicating valid GPS data + // Degrees. If longitude > 100 the +100 longitude bit is set in the Destination field, but only in + // certain circumstances, see http://www.aprs.org/doc/APRS101.PDF page 47 + uint8_t lon_deg = ((longitude[1] & 0x04) * 10 + (longitude[2] & 0x04)); + if (lon < 9) { + packet[1] = 118 + lon_deg; + DST[4] += 0x20; + } else if (lon < 100) { + packet[1] = 38 + lon_deg - 10; + } else if (lon < 110) { + packet[1] = 108 + lon_deg - 100; + DST[4] += 0x20; + } else { + packet[1] = 38 + lon_deg - 110; + DST[4] += 0x20; + } + + uint8_t lon_min = ((longitude[3] & 0x04) * 10) + (longitude[4] & 0x04)); + if (lon_min < 10) { + packet[2] = 88 + lon_min; + } else { + packet[2] = 38 + lon_min - 10; + } + packet[3] = ((longitude[6] & 0x04) * 10) + (longitude[7] & 0x04)) + 28; + + // bytes 4, 5 and 6 encode the speed and course + packet[4] = (speed / 10) + 28; + +} + // Dynamic RAM usage of this function is 30 bytes void APRS_sendLoc(void *_buffer, size_t length) { size_t payloadLength = 20+length; @@ -303,7 +430,7 @@ void APRS_sendMsg(void *_buffer, size_t length) { packet[12+length] = h+48; packet[13+length] = d+48; packet[14+length] = n+48; - + APRS_sendPkt(packet, payloadLength); free(packet); } diff --git a/LibAPRS/LibAPRS.h b/LibAPRS/LibAPRS.h index 78e725a..2f806a2 100644 --- a/LibAPRS/LibAPRS.h +++ b/LibAPRS/LibAPRS.h @@ -11,11 +11,11 @@ void APRS_init(int reference, bool open_squelch); void APRS_poll(void); -void APRS_setCallsign(char *call, int ssid); -void APRS_setDestination(char *call, int ssid); -void APRS_setMessageDestination(char *call, int ssid); -void APRS_setPath1(char *call, int ssid); -void APRS_setPath2(char *call, int ssid); +void APRS_setCallsign(char *call, int8_t ssid); +void APRS_setDestination(char *call, int8_t ssid); +void APRS_setMessageDestination(char *call, int8_t ssid); +void APRS_setPath1(char *call, int8_t ssid); +void APRS_setPath2(char *call, int8_t ssid); void APRS_setPreamble(unsigned long pre); void APRS_setTail(unsigned long tail); From 851be6893ed43a6b44a72c789e8dfc29b78d7077 Mon Sep 17 00:00:00 2001 From: Tim Ahpee Date: Sun, 3 Sep 2017 19:01:58 +1000 Subject: [PATCH 2/6] Working(?) MIC-E encoder --- LibAPRS/LibAPRS.cpp | 50 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 42 insertions(+), 8 deletions(-) diff --git a/LibAPRS/LibAPRS.cpp b/LibAPRS/LibAPRS.cpp index 31c8e00..c2d8503 100644 --- a/LibAPRS/LibAPRS.cpp +++ b/LibAPRS/LibAPRS.cpp @@ -311,24 +311,21 @@ uint8_t APRS_sendLoc_mice(void *_buffer, size_t length) { if (longtitude[8] == 'W') { // If the longitude is > 100, set this bit DST[4] += 0x20; } - if (MICE_SSID == 0) { - path_len = 4; - } packet[0] = 0x60; // The ` character indicating valid GPS data // Degrees. If longitude > 100 the +100 longitude bit is set in the Destination field, but only in // certain circumstances, see http://www.aprs.org/doc/APRS101.PDF page 47 uint8_t lon_deg = ((longitude[1] & 0x04) * 10 + (longitude[2] & 0x04)); - if (lon < 9) { + if (lon < 10) { packet[1] = 118 + lon_deg; DST[4] += 0x20; } else if (lon < 100) { packet[1] = 38 + lon_deg - 10; } else if (lon < 110) { - packet[1] = 108 + lon_deg - 100; + packet[1] = 108 + (lon_deg - 100); DST[4] += 0x20; } else { - packet[1] = 38 + lon_deg - 110; + packet[1] = 38 + (lon_deg - 110); DST[4] += 0x20; } @@ -341,8 +338,45 @@ uint8_t APRS_sendLoc_mice(void *_buffer, size_t length) { packet[3] = ((longitude[6] & 0x04) * 10) + (longitude[7] & 0x04)) + 28; // bytes 4, 5 and 6 encode the speed and course - packet[4] = (speed / 10) + 28; - + // Page 50 of the APRS spec + packet[4] = (speed / 10) + 28; // 100's an 10's of knots + packet[5] = (speed % 10) * 10 + 32; // 1's of knots + if (course > 99 && course < 200) { // 100's of degrees + packet[5] += 1; + } else if (course < 300) { + packet[5] += 2; + } else { + packet[5] += 3; + } + packet[6] = (course % 100) = 28; + packet[7] = (uint8_t)symbol; + packet[8] = (uint8_t)symbolTable; + + if (MICE_SSID != 0) { + path_len = 0; + } else { + path_len = 4; + } + + uint8_t *buffer = (uint8_t *)_buffer; + + memcpy(dst.call, DST, 6); + dst.ssid = DST_SSID; + + memcpy(src.call, CALL, 6); + src.ssid = CALL_SSID; + + memcpy(path1.call, PATH1, 6); + path1.ssid = PATH1_SSID; + + memcpy(path2.call, PATH2, 6); + path2.ssid = PATH2_SSID; + + path[0] = dst; + path[1] = src; + path[2] = path1; + path[3] = path2; + ax25_sendVia(&AX25, path, path_len, buffer, length); } // Dynamic RAM usage of this function is 30 bytes From 5a21cf4e8ab0a96364489b467862a01ab1f7e7de Mon Sep 17 00:00:00 2001 From: Tim Ahpee Date: Sun, 3 Sep 2017 21:59:51 +1000 Subject: [PATCH 3/6] Working Mic-E Encoder --- LibAPRS/LibAPRS.cpp | 77 ++++++++++++++++++++++++--------------------- LibAPRS/LibAPRS.h | 6 ++++ 2 files changed, 47 insertions(+), 36 deletions(-) diff --git a/LibAPRS/LibAPRS.cpp b/LibAPRS/LibAPRS.cpp index c2d8503..c473cdc 100644 --- a/LibAPRS/LibAPRS.cpp +++ b/LibAPRS/LibAPRS.cpp @@ -18,7 +18,7 @@ AX25Call dst; AX25Call path1; AX25Call path2; -#define MAX_CALL_LENGTH 6 +#define MAX_CALL_LENGTH 7 char CALL[MAX_CALL_LENGTH] = "NOCALL"; int8_t CALL_SSID = 0; char DST[MAX_CALL_LENGTH] = "APZMDM"; @@ -265,7 +265,8 @@ void APRS_set_mice_ssid(uint8_t ssid) { } uint8_t APRS_sendLoc_mice(void *_buffer, size_t length) { - uint8_t payloadLength = 9; + uint8_t path_len; + uint8_t payloadLength = 9 + length; uint8_t *packet = (uint8_t*)malloc(payloadLength); // Sanity check the latitude and longtitude if (latitude[7] != 'N' && latitude[7] != 'S') { @@ -275,53 +276,53 @@ uint8_t APRS_sendLoc_mice(void *_buffer, size_t length) { return 1; } // Build the Destination callsign with the latitude information - DST[0] = (latitude[0] & 0x04) | 0x30; + DST[0] = (latitude[0] & 0x0F) | 0x30; if (MICE_MSG & 0x04) { - if (MICE_MSG & 0x80) { // Standard message bit - DST[0] += 0x20; + if (MICE_MSG & 0x80) { + DST[0] += 0x17; // Custom message bit } else { - DST[0] += 0x17; // Custom message bit + DST[0] += 0x20; // Standard message bit } } - DST[1] = (latitude[1] & 0x04) | 0x30; + DST[1] = (latitude[1] & 0x0F) | 0x30; if (MICE_MSG & 0x02) { - if (MICE_MSG & 0x80) { // Standard message bit - DST[1] += 0x20; + if (MICE_MSG & 0x80) { + DST[1] += 0x17; // Custom message bit } else { - DST[1] += 0x17; // Custom message bit + DST[1] += 0x20; // Standard message bit } } - DST[2] = (latitude[2] & 0x04) | 0x30; + DST[2] = (latitude[2] & 0x0F) | 0x30; if (MICE_MSG & 0x01) { - if (MICE_MSG & 0x80) { // Standard message bit - DST[2] += 0x20; + if (MICE_MSG & 0x80) { + DST[2] += 0x17; // Custom message bit } else { - DST[2] += 0x17; // Custom message bit + DST[2] += 0x20; // Standard message bit } } - DST[3] = (latitude[3] & 0x04) | 0x30; + DST[3] = (latitude[3] & 0x0F) | 0x30; if (latitude[7] == 'N') { // North/South Latitude Indicator DST[3] += 0x20; } - DST[4] = (latitude[5] & 0x04) | 0x30; // Use latitude[5] becuase latitude[4] is a . - // if (longtitude[0] == '1') { // If the longitude is > 100, set this bit + DST[4] = (latitude[5] & 0x0F) | 0x30; // Use latitude[5] becuase latitude[4] is a . + // if (longtitude[0] == '1') { // If the longtitude is > 100, set this bit // DST[4] += 0x20; // } - DST[5] = (latitude[6] & 0x04) | 0x30; - if (longtitude[8] == 'W') { // If the longitude is > 100, set this bit + DST[5] = (latitude[6] & 0x0F) | 0x30; + if (longtitude[8] == 'W') { // If the longtitude is > 100, set this bit DST[4] += 0x20; } packet[0] = 0x60; // The ` character indicating valid GPS data - // Degrees. If longitude > 100 the +100 longitude bit is set in the Destination field, but only in + // Degrees. If longtitude > 100 the +100 longtitude bit is set in the Destination field, but only in // certain circumstances, see http://www.aprs.org/doc/APRS101.PDF page 47 - uint8_t lon_deg = ((longitude[1] & 0x04) * 10 + (longitude[2] & 0x04)); - if (lon < 10) { + uint8_t lon_deg = ((longtitude[0] & 0x0F) * 100 + (longtitude[1] & 0x0F) * 10 + (longtitude[2] & 0x0F)); + if (lon_deg < 10) { packet[1] = 118 + lon_deg; DST[4] += 0x20; - } else if (lon < 100) { + } else if (lon_deg < 100) { packet[1] = 38 + lon_deg - 10; - } else if (lon < 110) { + } else if (lon_deg < 110) { packet[1] = 108 + (lon_deg - 100); DST[4] += 0x20; } else { @@ -329,26 +330,26 @@ uint8_t APRS_sendLoc_mice(void *_buffer, size_t length) { DST[4] += 0x20; } - uint8_t lon_min = ((longitude[3] & 0x04) * 10) + (longitude[4] & 0x04)); + uint8_t lon_min = ((longtitude[3] & 0x0F) * 10) + (longtitude[4] & 0x0F); if (lon_min < 10) { packet[2] = 88 + lon_min; } else { packet[2] = 38 + lon_min - 10; } - packet[3] = ((longitude[6] & 0x04) * 10) + (longitude[7] & 0x04)) + 28; + packet[3] = ((longtitude[6] & 0x0F) * 10) + (longtitude[7] & 0x0F) + 28; // bytes 4, 5 and 6 encode the speed and course // Page 50 of the APRS spec packet[4] = (speed / 10) + 28; // 100's an 10's of knots packet[5] = (speed % 10) * 10 + 32; // 1's of knots - if (course > 99 && course < 200) { // 100's of degrees - packet[5] += 1; - } else if (course < 300) { - packet[5] += 2; - } else { - packet[5] += 3; + if (course > 299) { + packet[5] += 3; + } else if (course > 199) { + packet[5] += 2; + } else if (course > 99) { + packet[5] += 1; } - packet[6] = (course % 100) = 28; + packet[6] = (course % 100) + 28; packet[7] = (uint8_t)symbol; packet[8] = (uint8_t)symbolTable; @@ -358,8 +359,6 @@ uint8_t APRS_sendLoc_mice(void *_buffer, size_t length) { path_len = 4; } - uint8_t *buffer = (uint8_t *)_buffer; - memcpy(dst.call, DST, 6); dst.ssid = DST_SSID; @@ -376,7 +375,13 @@ uint8_t APRS_sendLoc_mice(void *_buffer, size_t length) { path[1] = src; path[2] = path1; path[3] = path2; - ax25_sendVia(&AX25, path, path_len, buffer, length); + if (length > 0) { + uint8_t *buffer = (uint8_t *)_buffer; + memcpy(&packet[9], buffer, length); + } + ax25_sendVia(&AX25, path, path_len, packet, payloadLength); + free(packet); + return 0; } // Dynamic RAM usage of this function is 30 bytes diff --git a/LibAPRS/LibAPRS.h b/LibAPRS/LibAPRS.h index 2f806a2..40a8eb4 100644 --- a/LibAPRS/LibAPRS.h +++ b/LibAPRS/LibAPRS.h @@ -28,11 +28,17 @@ void APRS_setPower(int s); void APRS_setHeight(int s); void APRS_setGain(int s); void APRS_setDirectivity(int s); +void APRS_setSpeed(int s); +void APRS_setCourse(int c); void APRS_sendPkt(void *_buffer, size_t length); void APRS_sendLoc(void *_buffer, size_t length); void APRS_sendMsg(void *_buffer, size_t length); void APRS_msgRetry(); +uint8_t APRS_sendLoc_mice(void *_buffer, size_t length); +void APRS_set_mice_ssid(uint8_t ssid); +void APRS_set_mice_msg(uint8_t msg, bool custom); + void APRS_printSettings(); From 06d61c6a14c19a2f602deba18f8a3ee16a55a064 Mon Sep 17 00:00:00 2001 From: Tim Ahpee Date: Sun, 3 Sep 2017 22:06:15 +1000 Subject: [PATCH 4/6] Reverted some of the memory reduction changes --- LibAPRS/LibAPRS.cpp | 12 ++++++------ LibAPRS/LibAPRS.h | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/LibAPRS/LibAPRS.cpp b/LibAPRS/LibAPRS.cpp index c473cdc..71b5749 100644 --- a/LibAPRS/LibAPRS.cpp +++ b/LibAPRS/LibAPRS.cpp @@ -20,13 +20,13 @@ AX25Call path2; #define MAX_CALL_LENGTH 7 char CALL[MAX_CALL_LENGTH] = "NOCALL"; -int8_t CALL_SSID = 0; +int CALL_SSID = 0; char DST[MAX_CALL_LENGTH] = "APZMDM"; -int8_t DST_SSID = 0; +int DST_SSID = 0; char PATH1[MAX_CALL_LENGTH] = "WIDE1"; -int8_t PATH1_SSID = 1; +int PATH1_SSID = 1; char PATH2[MAX_CALL_LENGTH] = "WIDE2"; -int8_t PATH2_SSID = 2; +int PATH2_SSID = 2; uint8_t MICE_MSG; uint8_t MICE_SSID; @@ -47,8 +47,8 @@ uint16_t course; ///////////////////////// // Message packet assembly fields -char message_recip[6]; -int8_t message_recip_ssid = -1; +char message_recip[7]; +int message_recip_ssid = -1; int message_seq = 0; char lastMessage[67]; diff --git a/LibAPRS/LibAPRS.h b/LibAPRS/LibAPRS.h index 40a8eb4..4881d84 100644 --- a/LibAPRS/LibAPRS.h +++ b/LibAPRS/LibAPRS.h @@ -11,11 +11,11 @@ void APRS_init(int reference, bool open_squelch); void APRS_poll(void); -void APRS_setCallsign(char *call, int8_t ssid); -void APRS_setDestination(char *call, int8_t ssid); -void APRS_setMessageDestination(char *call, int8_t ssid); -void APRS_setPath1(char *call, int8_t ssid); -void APRS_setPath2(char *call, int8_t ssid); +void APRS_setCallsign(char *call, int ssid); +void APRS_setDestination(char *call, int ssid); +void APRS_setMessageDestination(char *call, int ssid); +void APRS_setPath1(char *call, int ssid); +void APRS_setPath2(char *call, int ssid); void APRS_setPreamble(unsigned long pre); void APRS_setTail(unsigned long tail); From bd5ad6e8b67a96771773b6888c7ed828d6dd6a9c Mon Sep 17 00:00:00 2001 From: Tim Ahpee Date: Sun, 3 Sep 2017 22:08:06 +1000 Subject: [PATCH 5/6] Reverted more memory reduction changes --- LibAPRS/LibAPRS.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/LibAPRS/LibAPRS.cpp b/LibAPRS/LibAPRS.cpp index 71b5749..0f3b0fc 100644 --- a/LibAPRS/LibAPRS.cpp +++ b/LibAPRS/LibAPRS.cpp @@ -68,7 +68,7 @@ void APRS_poll(void) { ax25_poll(&AX25); } -void APRS_setCallsign(char *call, int8_t ssid) { +void APRS_setCallsign(char *call, int ssid) { memset(CALL, 0, MAX_CALL_LENGTH); int i = 0; while (i < 6 && call[i] != 0) { @@ -78,7 +78,7 @@ void APRS_setCallsign(char *call, int8_t ssid) { CALL_SSID = ssid; } -void APRS_setDestination(char *call, int8_t ssid) { +void APRS_setDestination(char *call, int ssid) { memset(DST, 0, MAX_CALL_LENGTH); int i = 0; while (i < 6 && call[i] != 0) { @@ -88,7 +88,7 @@ void APRS_setDestination(char *call, int8_t ssid) { DST_SSID = ssid; } -void APRS_setPath1(char *call, int8_t ssid) { +void APRS_setPath1(char *call, int ssid) { memset(PATH1, 0, MAX_CALL_LENGTH); int i = 0; while (i < 6 && call[i] != 0) { @@ -98,7 +98,7 @@ void APRS_setPath1(char *call, int8_t ssid) { PATH1_SSID = ssid; } -void APRS_setPath2(char *call, int8_t ssid) { +void APRS_setPath2(char *call, int ssid) { memset(PATH2, 0, MAX_CALL_LENGTH); int i = 0; while (i < 6 && call[i] != 0) { @@ -108,7 +108,7 @@ void APRS_setPath2(char *call, int8_t ssid) { PATH2_SSID = ssid; } -void APRS_setMessageDestination(char *call, int8_t ssid) { +void APRS_setMessageDestination(char *call, int ssid) { memset(message_recip, 0, 6); int i = 0; while (i < 6 && call[i] != 0) { From d9797bb285fe4d95a6ba8959447186cedc12626b Mon Sep 17 00:00:00 2001 From: Tim Ahpee Date: Sun, 10 Sep 2017 21:53:37 +1000 Subject: [PATCH 6/6] Added #defines for the MIC-E Standard Messages --- LibAPRS/LibAPRS.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/LibAPRS/LibAPRS.h b/LibAPRS/LibAPRS.h index 4881d84..d003940 100644 --- a/LibAPRS/LibAPRS.h +++ b/LibAPRS/LibAPRS.h @@ -8,6 +8,15 @@ #include "AFSK.h" #include "AX25.h" +#define MICE_STD_MSG_OFF_DUTY 0x07 +#define MICE_STD_MSG_EN_ROUTE 0x06 +#define MICE_STD_MSG_IN_SERVICE 0x05 +#define MICE_STD_MSG_RETURNING 0x04 +#define MICE_STD_MSG_COMMITTED 0x03 +#define MICE_STD_MSG_SPECIAL 0x02 +#define MICE_STD_MSG_PRIORITY 0x01 +#define MICE_STD_MSG_EMERGENCY 0x00 + void APRS_init(int reference, bool open_squelch); void APRS_poll(void);