From 5495730c92a1b71cae96d72d572083d485a22fca Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Wed, 18 Jun 2014 11:40:21 +0200 Subject: [PATCH] Implemented simple serial control protocol for APRS stuff. --- Modem/main.c | 14 +++++++---- Modem/protocol/SimpleSerial.c | 4 ++-- Modem/protocol/SimpleSerial.h | 3 +++ buildrev.h | 2 +- images/Modem.elf | Bin 208516 -> 208492 bytes images/Modem.map | 44 +++++++++++++++++----------------- 6 files changed, 38 insertions(+), 29 deletions(-) diff --git a/Modem/main.c b/Modem/main.c index f1ad89a..926f8f3 100644 --- a/Modem/main.c +++ b/Modem/main.c @@ -15,12 +15,15 @@ #include "afsk.h" // Header for AFSK modem + +#include "protocol/SimpleSerial.h" // Simple serial control protocol #include "protocol/KISS.h" // KISS TNC protocol #if SERIAL_DEBUG #include "cfg/debug.h" // Debug configuration from BertOS #endif +#define SERIAL_PROTOCOL PROTOCOL_SIMPLE_SERIAL ////////////////////////////////////////////////////// // A few definitions // @@ -33,13 +36,13 @@ static Serial ser; // Declare a serial interface struct #define ADC_CH 0 // Define which channel (pin) we want // for the ADC (this is A0 on arduino) -#define SERIAL_PROTOCOL PROTOCOL_SIMPLE_SERIAL -#define YOUR_CALLSIGN "nocall" -#define TO_CALL "apzmdm" + +/* Removed for now, use serial to send packets instead static AX25Call path[] = AX25_PATH(AX25_CALL(TO_CALL, 0), AX25_CALL(YOUR_CALLSIGN, 0), AX25_CALL("wide1", 1), AX25_CALL("wide2", 2)); #define SEND_TEST_PACKETS false #define TEST_INTERVAL 15000L #define APRS_MSG "Test APRS packet" +*/ static uint8_t serialBuffer[CONFIG_AX25_FRAME_BUF_LEN+1]; // Buffer for holding incoming serial data static int sbyte; // For holding byte read from serial port @@ -49,7 +52,7 @@ static bool sertx = false; // Flag signifying whether it's #define SER_BUFFER_FULL (serialLen < MP1_MAX_DATA_SIZE-1) -#include "protocol/SimpleSerial.h" // Simple serial control protocol + ////////////////////////////////////////////////////// // And here comes the actual program :) // @@ -170,12 +173,15 @@ int main(void) serialLen = 0; } + // Removing this for now + /* // Use AX.25 to send test data if (SEND_TEST_PACKETS && timer_clock() - start > ms_to_ticks(TEST_INTERVAL)) { start = timer_clock(); ax25_sendVia(&ax25, path, countof(path), APRS_MSG, sizeof(APRS_MSG)); } + */ } return 0; diff --git a/Modem/protocol/SimpleSerial.c b/Modem/protocol/SimpleSerial.c index f57924a..281090a 100644 --- a/Modem/protocol/SimpleSerial.c +++ b/Modem/protocol/SimpleSerial.c @@ -14,9 +14,9 @@ AX25Call dst; AX25Call path1; AX25Call path2; -char CALL[6] = "NOCALL"; +char CALL[6] = DEFAULT_CALLSIGN; int CALL_SSID = 0; -char DST[6] = "APZMDM"; +char DST[6] = DEFAULT_DESTINATION_CALL; int DST_SSID = 0; char PATH1[6] = "WIDE1"; int PATH1_SSID = 1; diff --git a/Modem/protocol/SimpleSerial.h b/Modem/protocol/SimpleSerial.h index d7eaff6..b9f4eb8 100644 --- a/Modem/protocol/SimpleSerial.h +++ b/Modem/protocol/SimpleSerial.h @@ -4,6 +4,9 @@ #define PROTOCOL_SIMPLE_SERIAL 0x01 +#define DEFAULT_CALLSIGN "NOCALL" +#define DEFAULT_DESTINATION_CALL "APZMDM" + void ss_messageCallback(struct AX25Msg *msg, Serial *ser); void ss_serialCallback(void *_buffer, size_t length, Serial *ser, AX25Ctx *ctx); void ss_printSrc(bool val); diff --git a/buildrev.h b/buildrev.h index 860bbdf..9537481 100644 --- a/buildrev.h +++ b/buildrev.h @@ -1,2 +1,2 @@ -#define VERS_BUILD 1918 +#define VERS_BUILD 1927 #define VERS_HOST "shard" diff --git a/images/Modem.elf b/images/Modem.elf index a48a24a411f673a07997f55c06171cd5f6ed1b72..3c8f2d7900bc40db95a86f94ae11abe376cc1137 100755 GIT binary patch delta 1028 zcmY+CU1$_%6o$|H&CF(ZlCHBR4XdVRqb8fUaW|`7kP^Xat6~(DAhChgws9eeg=$*t zO~EaMk~@n-JR#UWK^oVK{s^7g3Qg@#5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