Implemented simple serial control protocol for APRS stuff.
This commit is contained in:
parent
a667301d57
commit
5495730c92
14
Modem/main.c
14
Modem/main.c
|
@ -15,12 +15,15 @@
|
||||||
|
|
||||||
#include "afsk.h" // Header for AFSK modem
|
#include "afsk.h" // Header for AFSK modem
|
||||||
|
|
||||||
|
|
||||||
|
#include "protocol/SimpleSerial.h" // Simple serial control protocol
|
||||||
#include "protocol/KISS.h" // KISS TNC protocol
|
#include "protocol/KISS.h" // KISS TNC protocol
|
||||||
|
|
||||||
#if SERIAL_DEBUG
|
#if SERIAL_DEBUG
|
||||||
#include "cfg/debug.h" // Debug configuration from BertOS
|
#include "cfg/debug.h" // Debug configuration from BertOS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define SERIAL_PROTOCOL PROTOCOL_SIMPLE_SERIAL
|
||||||
|
|
||||||
//////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////
|
||||||
// A few definitions //
|
// 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
|
#define ADC_CH 0 // Define which channel (pin) we want
|
||||||
// for the ADC (this is A0 on arduino)
|
// for the ADC (this is A0 on arduino)
|
||||||
|
|
||||||
#define SERIAL_PROTOCOL PROTOCOL_SIMPLE_SERIAL
|
|
||||||
#define YOUR_CALLSIGN "nocall"
|
/* Removed for now, use serial to send packets instead
|
||||||
#define TO_CALL "apzmdm"
|
|
||||||
static AX25Call path[] = AX25_PATH(AX25_CALL(TO_CALL, 0), AX25_CALL(YOUR_CALLSIGN, 0), AX25_CALL("wide1", 1), AX25_CALL("wide2", 2));
|
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 SEND_TEST_PACKETS false
|
||||||
#define TEST_INTERVAL 15000L
|
#define TEST_INTERVAL 15000L
|
||||||
#define APRS_MSG "Test APRS packet"
|
#define APRS_MSG "Test APRS packet"
|
||||||
|
*/
|
||||||
|
|
||||||
static uint8_t serialBuffer[CONFIG_AX25_FRAME_BUF_LEN+1]; // Buffer for holding incoming serial data
|
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
|
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)
|
#define SER_BUFFER_FULL (serialLen < MP1_MAX_DATA_SIZE-1)
|
||||||
|
|
||||||
#include "protocol/SimpleSerial.h" // Simple serial control protocol
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////
|
||||||
// And here comes the actual program :) //
|
// And here comes the actual program :) //
|
||||||
|
@ -170,12 +173,15 @@ int main(void)
|
||||||
serialLen = 0;
|
serialLen = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Removing this for now
|
||||||
|
/*
|
||||||
// Use AX.25 to send test data
|
// Use AX.25 to send test data
|
||||||
if (SEND_TEST_PACKETS && timer_clock() - start > ms_to_ticks(TEST_INTERVAL))
|
if (SEND_TEST_PACKETS && timer_clock() - start > ms_to_ticks(TEST_INTERVAL))
|
||||||
{
|
{
|
||||||
start = timer_clock();
|
start = timer_clock();
|
||||||
ax25_sendVia(&ax25, path, countof(path), APRS_MSG, sizeof(APRS_MSG));
|
ax25_sendVia(&ax25, path, countof(path), APRS_MSG, sizeof(APRS_MSG));
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -14,9 +14,9 @@ AX25Call dst;
|
||||||
AX25Call path1;
|
AX25Call path1;
|
||||||
AX25Call path2;
|
AX25Call path2;
|
||||||
|
|
||||||
char CALL[6] = "NOCALL";
|
char CALL[6] = DEFAULT_CALLSIGN;
|
||||||
int CALL_SSID = 0;
|
int CALL_SSID = 0;
|
||||||
char DST[6] = "APZMDM";
|
char DST[6] = DEFAULT_DESTINATION_CALL;
|
||||||
int DST_SSID = 0;
|
int DST_SSID = 0;
|
||||||
char PATH1[6] = "WIDE1";
|
char PATH1[6] = "WIDE1";
|
||||||
int PATH1_SSID = 1;
|
int PATH1_SSID = 1;
|
||||||
|
|
|
@ -4,6 +4,9 @@
|
||||||
|
|
||||||
#define PROTOCOL_SIMPLE_SERIAL 0x01
|
#define PROTOCOL_SIMPLE_SERIAL 0x01
|
||||||
|
|
||||||
|
#define DEFAULT_CALLSIGN "NOCALL"
|
||||||
|
#define DEFAULT_DESTINATION_CALL "APZMDM"
|
||||||
|
|
||||||
void ss_messageCallback(struct AX25Msg *msg, Serial *ser);
|
void ss_messageCallback(struct AX25Msg *msg, Serial *ser);
|
||||||
void ss_serialCallback(void *_buffer, size_t length, Serial *ser, AX25Ctx *ctx);
|
void ss_serialCallback(void *_buffer, size_t length, Serial *ser, AX25Ctx *ctx);
|
||||||
void ss_printSrc(bool val);
|
void ss_printSrc(bool val);
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
#define VERS_BUILD 1918
|
#define VERS_BUILD 1927
|
||||||
#define VERS_HOST "shard"
|
#define VERS_HOST "shard"
|
||||||
|
|
BIN
images/Modem.elf
BIN
images/Modem.elf
Binary file not shown.
|
@ -1570,7 +1570,7 @@ END GROUP
|
||||||
.debug_pubnames
|
.debug_pubnames
|
||||||
*(.debug_pubnames)
|
*(.debug_pubnames)
|
||||||
|
|
||||||
.debug_info 0x0000000000000000 0xf7f4
|
.debug_info 0x0000000000000000 0xf7d9
|
||||||
*(.debug_info)
|
*(.debug_info)
|
||||||
.debug_info 0x0000000000000000 0xd24 obj/Modem/bertos/cpu/avr/drv/ser_mega.o
|
.debug_info 0x0000000000000000 0xd24 obj/Modem/bertos/cpu/avr/drv/ser_mega.o
|
||||||
.debug_info 0x0000000000000d24 0x19f obj/Modem/bertos/cpu/avr/drv/timer_mega.o
|
.debug_info 0x0000000000000d24 0x19f obj/Modem/bertos/cpu/avr/drv/timer_mega.o
|
||||||
|
@ -1583,15 +1583,15 @@ END GROUP
|
||||||
.debug_info 0x0000000000004db4 0x57f obj/Modem/bertos/struct/heap.o
|
.debug_info 0x0000000000004db4 0x57f obj/Modem/bertos/struct/heap.o
|
||||||
.debug_info 0x0000000000005333 0x1073 obj/Modem/bertos/net/ax25.o
|
.debug_info 0x0000000000005333 0x1073 obj/Modem/bertos/net/ax25.o
|
||||||
.debug_info 0x00000000000063a6 0x1b8 obj/Modem/bertos/algo/crc_ccitt.o
|
.debug_info 0x00000000000063a6 0x1b8 obj/Modem/bertos/algo/crc_ccitt.o
|
||||||
.debug_info 0x000000000000655e 0xc4c obj/Modem/Modem/main.o
|
.debug_info 0x000000000000655e 0xc31 obj/Modem/Modem/main.o
|
||||||
.debug_info 0x00000000000071aa 0x6c4 obj/Modem/Modem/hardware.o
|
.debug_info 0x000000000000718f 0x6c4 obj/Modem/Modem/hardware.o
|
||||||
.debug_info 0x000000000000786e 0x13c2 obj/Modem/Modem/afsk.o
|
.debug_info 0x0000000000007853 0x13c2 obj/Modem/Modem/afsk.o
|
||||||
.debug_info 0x0000000000008c30 0x3588 obj/Modem/Modem/protocol/mp1.o
|
.debug_info 0x0000000000008c15 0x3588 obj/Modem/Modem/protocol/mp1.o
|
||||||
.debug_info 0x000000000000c1b8 0xaa6 obj/Modem/Modem/protocol/SimpleSerial.o
|
.debug_info 0x000000000000c19d 0xaa6 obj/Modem/Modem/protocol/SimpleSerial.o
|
||||||
.debug_info 0x000000000000cc5e 0xae8 obj/Modem/Modem/compression/heatshrink_decoder.o
|
.debug_info 0x000000000000cc43 0xae8 obj/Modem/Modem/compression/heatshrink_decoder.o
|
||||||
.debug_info 0x000000000000d746 0x1074 obj/Modem/Modem/compression/heatshrink_encoder.o
|
.debug_info 0x000000000000d72b 0x1074 obj/Modem/Modem/compression/heatshrink_encoder.o
|
||||||
.debug_info 0x000000000000e7ba 0x863 obj/Modem/bertos/mware/formatwr_P.o
|
.debug_info 0x000000000000e79f 0x863 obj/Modem/bertos/mware/formatwr_P.o
|
||||||
.debug_info 0x000000000000f01d 0x7d7 obj/Modem/bertos/drv/kdebug_P.o
|
.debug_info 0x000000000000f002 0x7d7 obj/Modem/bertos/drv/kdebug_P.o
|
||||||
*(.gnu.linkonce.wi.*)
|
*(.gnu.linkonce.wi.*)
|
||||||
|
|
||||||
.debug_abbrev 0x0000000000000000 0x34ba
|
.debug_abbrev 0x0000000000000000 0x34ba
|
||||||
|
@ -1617,7 +1617,7 @@ END GROUP
|
||||||
.debug_abbrev 0x0000000000003021 0x233 obj/Modem/bertos/mware/formatwr_P.o
|
.debug_abbrev 0x0000000000003021 0x233 obj/Modem/bertos/mware/formatwr_P.o
|
||||||
.debug_abbrev 0x0000000000003254 0x266 obj/Modem/bertos/drv/kdebug_P.o
|
.debug_abbrev 0x0000000000003254 0x266 obj/Modem/bertos/drv/kdebug_P.o
|
||||||
|
|
||||||
.debug_line 0x0000000000000000 0x3750
|
.debug_line 0x0000000000000000 0x3751
|
||||||
*(.debug_line)
|
*(.debug_line)
|
||||||
.debug_line 0x0000000000000000 0x0 obj/Modem/bertos/cpu/avr/drv/ser_avr.o
|
.debug_line 0x0000000000000000 0x0 obj/Modem/bertos/cpu/avr/drv/ser_avr.o
|
||||||
.debug_line 0x0000000000000000 0x31b obj/Modem/bertos/cpu/avr/drv/ser_mega.o
|
.debug_line 0x0000000000000000 0x31b obj/Modem/bertos/cpu/avr/drv/ser_mega.o
|
||||||
|
@ -1632,16 +1632,16 @@ END GROUP
|
||||||
.debug_line 0x000000000000126a 0x1bc obj/Modem/bertos/struct/heap.o
|
.debug_line 0x000000000000126a 0x1bc obj/Modem/bertos/struct/heap.o
|
||||||
.debug_line 0x0000000000001426 0x265 obj/Modem/bertos/net/ax25.o
|
.debug_line 0x0000000000001426 0x265 obj/Modem/bertos/net/ax25.o
|
||||||
.debug_line 0x000000000000168b 0xc6 obj/Modem/bertos/algo/crc_ccitt.o
|
.debug_line 0x000000000000168b 0xc6 obj/Modem/bertos/algo/crc_ccitt.o
|
||||||
.debug_line 0x0000000000001751 0x1e3 obj/Modem/Modem/main.o
|
.debug_line 0x0000000000001751 0x1e4 obj/Modem/Modem/main.o
|
||||||
.debug_line 0x0000000000001934 0x15d obj/Modem/Modem/hardware.o
|
.debug_line 0x0000000000001935 0x15d obj/Modem/Modem/hardware.o
|
||||||
.debug_line 0x0000000000001a91 0x49a obj/Modem/Modem/afsk.o
|
.debug_line 0x0000000000001a92 0x49a obj/Modem/Modem/afsk.o
|
||||||
.debug_line 0x0000000000001f2b 0xa6c obj/Modem/Modem/protocol/mp1.o
|
.debug_line 0x0000000000001f2c 0xa6c obj/Modem/Modem/protocol/mp1.o
|
||||||
.debug_line 0x0000000000002997 0x340 obj/Modem/Modem/protocol/SimpleSerial.o
|
.debug_line 0x0000000000002998 0x340 obj/Modem/Modem/protocol/SimpleSerial.o
|
||||||
.debug_line 0x0000000000002cd7 0x0 obj/Modem/Modem/protocol/KISS.o
|
.debug_line 0x0000000000002cd8 0x0 obj/Modem/Modem/protocol/KISS.o
|
||||||
.debug_line 0x0000000000002cd7 0x1fc obj/Modem/Modem/compression/heatshrink_decoder.o
|
.debug_line 0x0000000000002cd8 0x1fc obj/Modem/Modem/compression/heatshrink_decoder.o
|
||||||
.debug_line 0x0000000000002ed3 0x309 obj/Modem/Modem/compression/heatshrink_encoder.o
|
.debug_line 0x0000000000002ed4 0x309 obj/Modem/Modem/compression/heatshrink_encoder.o
|
||||||
.debug_line 0x00000000000031dc 0x2f0 obj/Modem/bertos/mware/formatwr_P.o
|
.debug_line 0x00000000000031dd 0x2f0 obj/Modem/bertos/mware/formatwr_P.o
|
||||||
.debug_line 0x00000000000034cc 0x284 obj/Modem/bertos/drv/kdebug_P.o
|
.debug_line 0x00000000000034cd 0x284 obj/Modem/bertos/drv/kdebug_P.o
|
||||||
|
|
||||||
.debug_frame 0x0000000000000000 0x1b6c
|
.debug_frame 0x0000000000000000 0x1b6c
|
||||||
*(.debug_frame)
|
*(.debug_frame)
|
||||||
|
@ -1692,7 +1692,7 @@ END GROUP
|
||||||
.debug_str 0x0000000000000f5e 0x18 obj/Modem/bertos/algo/crc_ccitt.o
|
.debug_str 0x0000000000000f5e 0x18 obj/Modem/bertos/algo/crc_ccitt.o
|
||||||
0x19b (size before relaxing)
|
0x19b (size before relaxing)
|
||||||
.debug_str 0x0000000000000f76 0x17f obj/Modem/Modem/main.o
|
.debug_str 0x0000000000000f76 0x17f obj/Modem/Modem/main.o
|
||||||
0x5fe (size before relaxing)
|
0x5f9 (size before relaxing)
|
||||||
.debug_str 0x00000000000010f5 0x5b obj/Modem/Modem/hardware.o
|
.debug_str 0x00000000000010f5 0x5b obj/Modem/Modem/hardware.o
|
||||||
0x470 (size before relaxing)
|
0x470 (size before relaxing)
|
||||||
.debug_str 0x0000000000001150 0xca obj/Modem/Modem/afsk.o
|
.debug_str 0x0000000000001150 0xca obj/Modem/Modem/afsk.o
|
||||||
|
|
Loading…
Reference in New Issue