mirror of
https://github.com/markqvist/OpenModem.git
synced 2025-05-02 06:26:24 -04:00
Implemented simple serial control protocol for APRS stuff.
This commit is contained in:
parent
a667301d57
commit
5495730c92
6 changed files with 38 additions and 29 deletions
14
Modem/main.c
14
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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue