diff --git a/.cproject b/.cproject
new file mode 100644
index 0000000..632be6e
--- /dev/null
+++ b/.cproject
@@ -0,0 +1,247 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.gitignore b/.gitignore
index 24be497..a533210 100644
--- a/.gitignore
+++ b/.gitignore
@@ -74,10 +74,6 @@ local.properties
# PyDev specific (Python IDE for Eclipse)
*.pydevproject
-# CDT-specific (C/C++ Development Tooling)
-.cproject
-.mxproject
-
# CDT- autotools
.autotools
diff --git a/.mxproject b/.mxproject
new file mode 100644
index 0000000..5041c83
--- /dev/null
+++ b/.mxproject
@@ -0,0 +1,14 @@
+[PreviousGenFiles]
+HeaderPath=C:/sw4stm32-projekty/vp-digi/Inc
+HeaderFiles=usb_device.h;usbd_conf.h;usbd_desc.h;usbd_cdc_if.h;stm32f1xx_it.h;stm32f1xx_hal_conf.h;main.h;
+SourcePath=C:/sw4stm32-projekty/vp-digi/Src
+SourceFiles=usb_device.c;usbd_conf.c;usbd_desc.c;usbd_cdc_if.c;stm32f1xx_it.c;stm32f1xx_hal_msp.c;main.c;
+
+[PreviousLibFiles]
+LibFiles=Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pcd.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pcd_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_usb.h;Drivers/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio_ex.h;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_cortex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_exti.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h;Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_core.h;Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_ctlreq.h;Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_def.h;Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_ioreq.h;Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc/usbd_cdc.h;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pcd.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pcd_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usb.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c;Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c;Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c;Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ioreq.c;Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.c;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pcd.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pcd_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_usb.h;Drivers/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio_ex.h;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_cortex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_exti.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h;Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_core.h;Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_ctlreq.h;Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_def.h;Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_ioreq.h;Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc/usbd_cdc.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h;Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/system_stm32f1xx.c;Drivers/CMSIS/Include/cmsis_armcc.h;Drivers/CMSIS/Include/cmsis_armclang.h;Drivers/CMSIS/Include/cmsis_compiler.h;Drivers/CMSIS/Include/cmsis_gcc.h;Drivers/CMSIS/Include/cmsis_iccarm.h;Drivers/CMSIS/Include/cmsis_version.h;Drivers/CMSIS/Include/core_armv8mbl.h;Drivers/CMSIS/Include/core_armv8mml.h;Drivers/CMSIS/Include/core_cm0.h;Drivers/CMSIS/Include/core_cm0plus.h;Drivers/CMSIS/Include/core_cm1.h;Drivers/CMSIS/Include/core_cm23.h;Drivers/CMSIS/Include/core_cm3.h;Drivers/CMSIS/Include/core_cm33.h;Drivers/CMSIS/Include/core_cm4.h;Drivers/CMSIS/Include/core_cm7.h;Drivers/CMSIS/Include/core_sc000.h;Drivers/CMSIS/Include/core_sc300.h;Drivers/CMSIS/Include/mpu_armv7.h;Drivers/CMSIS/Include/mpu_armv8.h;Drivers/CMSIS/Include/tz_context.h;
+
+[PreviousUsedSW4STM32Files]
+SourceFiles=..\Src\main.c;..\Src\usb_device.c;..\Src\usbd_conf.c;..\Src\usbd_desc.c;..\Src\usbd_cdc_if.c;..\Src\stm32f1xx_it.c;..\Src\stm32f1xx_hal_msp.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pcd.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pcd_ex.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usb.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c;..\Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c;..\Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c;..\Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ioreq.c;..\Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.c;..\\Src/system_stm32f1xx.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pcd.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pcd_ex.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usb.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c;..\Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c;..\Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c;..\Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ioreq.c;..\Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.c;..\\Src/system_stm32f1xx.c;..\Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/system_stm32f1xx.c;;..\Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c;..\Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c;..\Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ioreq.c;..\Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.c;
+HeaderPath=..\Drivers\STM32F1xx_HAL_Driver\Inc;..\Drivers\STM32F1xx_HAL_Driver\Inc\Legacy;..\Middlewares\ST\STM32_USB_Device_Library\Core\Inc;..\Middlewares\ST\STM32_USB_Device_Library\Class\CDC\Inc;..\Drivers\CMSIS\Device\ST\STM32F1xx\Include;..\Drivers\CMSIS\Include;..\Inc;
+CDefines=USE_HAL_DRIVER;STM32F103xB;USE_HAL_DRIVER;USE_HAL_DRIVER;
+
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f492c25..4987187 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,12 @@
+# 1.2.4 (2022-08-30)
+## New features
+* Added ```monkiss [on/off]``` command that enables sending own and digipeated frames to KISS ports
+## Bug fixes
+* included .cproject so that the project can be imported and compiled in SW4STM32 without generating in CubeMX
+## Other
+* none
+## Known bugs
+* none
# 1.2.3 (2022-08-23)
## New features
* none
@@ -6,7 +15,7 @@
## Other
* none
## Known bugs
-* none as far
+* none
# 1.2.2 (2022-06-11)
## New features
* none
@@ -33,7 +42,7 @@
## Other
* none
## Known bugs
-* none so far
+* none
# 1.2.0 (2021-09-10)
This is the very first open-source VP-Digi release.
## New features
@@ -46,4 +55,4 @@ This is the very first open-source VP-Digi release.
## Other
* Code was partially rewritten (especially digipeater, modem and AX.25 layer)
## Known bugs
-* none so far
+* none
diff --git a/Inc/common.h b/Inc/common.h
index 5cec1be..87dcc41 100644
--- a/Inc/common.h
+++ b/Inc/common.h
@@ -31,6 +31,7 @@ const uint8_t *versionString; //version string
uint8_t autoReset;
uint32_t autoResetTimer;
+uint8_t kissMonitor;
/**
* @brief Generate random number from min to max
@@ -65,4 +66,11 @@ void common_toTNC2(uint8_t *from, uint16_t fromlen, uint8_t *to);
*/
uint32_t crc32(uint32_t crc0, uint8_t *s, uint64_t n);
+/**
+ * @brief Send frame to available UARTs and USB in KISS format
+ * @param[in] *buf Frame buffer
+ * @param[in] len Frame buffer length
+ */
+void SendKiss(uint8_t *buf, uint16_t len);
+
#endif /* COMMON_H_ */
diff --git a/Inc/config.h b/Inc/config.h
index f71d7d6..9c34d31 100644
--- a/Inc/config.h
+++ b/Inc/config.h
@@ -85,7 +85,8 @@ along with VP-Digi. If not, see .
#define CONFIG_DIGISSID6 1212
#define CONFIG_DIGISSID7 1214
#define CONFIG_PWM_FLAT 1216
-#define CONFIG_XXX 1218 //next address (not used)
+#define CONFIG_KISSMONITOR 1218
+#define CONFIG_XXX 1220 //next address (not used)
/**
* @brief Store configuration from RAM to Flash
diff --git a/Src/beacon.c b/Src/beacon.c
index 3ea52af..bdb5ff9 100644
--- a/Src/beacon.c
+++ b/Src/beacon.c
@@ -81,6 +81,11 @@ void Beacon_send(uint8_t no)
ax25.frameXmit[ax25.xmitIdx++] = buf[i]; //copy frame to main TX buffer
}
+ if(kissMonitor) //monitoring mode, send own frames to KISS ports
+ {
+ SendKiss(ax25.frameXmit, ax25.xmitIdx);
+ }
+
ax25.frameXmit[ax25.xmitIdx++] = 0xFF; //frame separator
Digi_storeDeDupeFromXmitBuf(frameStart); //store frame hash in duplicate protection buffer (to prevent from digipeating own packets)
diff --git a/Src/common.c b/Src/common.c
index a3b6164..d1e444e 100644
--- a/Src/common.c
+++ b/Src/common.c
@@ -19,16 +19,19 @@ along with VP-Digi. If not, see .
#include "ax25.h"
#include
#include
+#include "drivers/uart.h"
+#include "usbd_cdc_if.h"
uint8_t call[6] = {'N' << 1, '0' << 1, 'C' << 1, 'A' << 1, 'L' << 1, 'L' << 1};
uint8_t callSsid = 0;
const uint8_t dest[7] = {130, 160, 156, 172, 96, 98, 96}; //APNV01-0
-const uint8_t *versionString = (const uint8_t*)"VP-Digi v. 1.2.3\r\nThe open-source standalone APRS digipeater controller and KISS TNC\r\n";
+const uint8_t *versionString = (const uint8_t*)"VP-Digi v. 1.2.4\r\nThe open-source standalone APRS digipeater controller and KISS TNC\r\n";
uint8_t autoReset = 0;
uint32_t autoResetTimer = 0;
+uint8_t kissMonitor = 0;
int64_t strToInt(uint8_t *str, uint8_t len)
@@ -181,3 +184,39 @@ uint32_t crc32(uint32_t crc0, uint8_t *s, uint64_t n)
return ~crc;
}
+
+void SendKiss(uint8_t *buf, uint16_t len)
+{
+ Uart *u = &uart1;
+
+ for(uint8_t i = 0; i < 2; i++)
+ {
+ if(u->mode == MODE_KISS) //check if KISS mode
+ {
+ uart_sendByte(u, 0xc0); //send data in kiss format
+ uart_sendByte(u, 0x00);
+ for(uint16_t j = 0; j < len; j++)
+ {
+ uart_sendByte(u, buf[j]);
+ }
+ uart_sendByte(u, 0xc0);
+ uart_transmitStart(u);
+ }
+ u = &uart2;
+ }
+
+ if(USBmode == MODE_KISS) //check if USB in KISS mode
+ {
+ uint8_t t[2] = {0xc0, 0};
+
+ CDC_Transmit_FS(&t[0], 1);
+ CDC_Transmit_FS(&t[1], 1);
+
+ for(uint16_t i = 0; i < len; i++)
+ {
+ CDC_Transmit_FS(&buf[i], 1);
+
+ }
+ CDC_Transmit_FS(&t[0], 1);
+ }
+}
diff --git a/Src/config.c b/Src/config.c
index 70a2c80..36310e3 100644
--- a/Src/config.c
+++ b/Src/config.c
@@ -189,6 +189,7 @@ void Config_write(void)
flash_writeString(CONFIG_DIGIFILLIST, digi.callFilter[0], 140);
flash_write(CONFIG_AUTORST, autoReset);
flash_write(CONFIG_PWM_FLAT, afskCfg.usePWM | (afskCfg.flatAudioIn << 1));
+ flash_write(CONFIG_KISSMONITOR, kissMonitor);
flash_write(CONFIG_FLAG, FLAG_CONFIG_WRITTEN);
@@ -273,6 +274,7 @@ uint8_t Config_read(void)
t = (uint8_t)flash_read(CONFIG_PWM_FLAT);
afskCfg.usePWM = t & 1;
afskCfg.flatAudioIn = (t & 2) > 0;
+ kissMonitor = (flash_read(CONFIG_KISSMONITOR) == 1);
return 1;
}
diff --git a/Src/digipeater.c b/Src/digipeater.c
index 2695993..55552e2 100644
--- a/Src/digipeater.c
+++ b/Src/digipeater.c
@@ -84,6 +84,11 @@ void Digi_viscousRefresh(void)
ax25.frameXmit[ax25.xmitIdx] = 0xFF;
ax25.xmitIdx++;
+ if(kissMonitor) //monitoring mode, send own frames to KISS ports
+ {
+ SendKiss(ax25.frameXmit, ax25.xmitIdx - 1);
+ }
+
uint8_t buf[200];
common_toTNC2((uint8_t*)&ax25.frameXmit[begin], ax25.xmitIdx - begin - 1, buf);
@@ -308,6 +313,11 @@ static void makeFrame(uint8_t *frame, uint16_t elStart, uint16_t len, uint32_t h
}
ax25.frameXmit[ax25.xmitIdx++] = 0xFF;
+ if(kissMonitor) //monitoring mode, send own frames to KISS ports
+ {
+ SendKiss(ax25.frameXmit, ax25.xmitIdx - 1);
+ }
+
common_toTNC2((uint8_t *)&ax25.frameXmit[begin], ax25.xmitIdx - begin - 1, buf);
term_sendMonitor((uint8_t*)"(AX.25) Digipeating frame: ", 0);
term_sendMonitor(buf, 0);
diff --git a/Src/main.c b/Src/main.c
index fca770d..d608d79 100644
--- a/Src/main.c
+++ b/Src/main.c
@@ -93,7 +93,7 @@ void handleFrame(void)
uint8_t modemReceived = ax25.frameReceived; //store states
ax25.frameReceived = 0; //clear flag
- uint8_t bufto[FRAMELEN + 30], buf[FRAMELEN]; //bufory dla konwersji ramki z formatu APRS do TNC2
+ uint8_t bufto[FRAMELEN + 30], buf[FRAMELEN]; //buffer for raw frames to TNC2 frames conversion
uint16_t bufidx = 0;
uint16_t i = ax25.frameBufRd;
@@ -119,38 +119,7 @@ void handleFrame(void)
}
- Uart *u = &uart1;
-
- for(uint8_t i = 0; i < 2; i++)
- {
- if(u->mode == MODE_KISS) //check if KISS mode
- {
- uart_sendByte(u, 0xc0); //send data in kiss format
- uart_sendByte(u, 0x00);
- for(uint16_t j = 0; j < (bufidx); j++)
- {
- uart_sendByte(u, buf[j]);
- }
- uart_sendByte(u, 0xc0);
- uart_transmitStart(u);
- }
- u = &uart2;
- }
-
- if(USBmode == MODE_KISS) //check if USB in KISS mode
- {
- uint8_t t[2] = {0xc0, 0};
-
- CDC_Transmit_FS(&t[0], 1);
- CDC_Transmit_FS(&t[1], 1);
-
- for(uint16_t i = 0; i < (bufidx); i++)
- {
- CDC_Transmit_FS(&buf[i], 1);
-
- }
- CDC_Transmit_FS(&t[0], 1);
- }
+ SendKiss(buf, bufidx); //send KISS frames if ports available
if(((USBmode == MODE_MONITOR) || (uart1.mode == MODE_MONITOR) || (uart2.mode == MODE_MONITOR)))
diff --git a/Src/terminal.c b/Src/terminal.c
index 36222da..8ad9305 100644
--- a/Src/terminal.c
+++ b/Src/terminal.c
@@ -487,6 +487,7 @@ void term_parse(uint8_t *cmd, uint16_t len, Terminal_stream src, Uart_data_type
term_sendBuf(src);
term_sendString((uint8_t*)"digi list <0-19> [set /remove] - sets/clears specified callsign slot in filter list\r\n", 0);
term_sendString((uint8_t*)"autoreset <0-255> - sets auto-reset interval (h) - 0 to disable\r\n", 0);
+ term_sendString((uint8_t*)"monkiss [on/off] - send own and digipeated frames to KISS ports\r\n", 0);
term_sendBuf(src);
return;
}
@@ -680,10 +681,14 @@ void term_parse(uint8_t *cmd, uint16_t len, Terminal_stream src, Uart_data_type
term_sendByte(callent + 48);
term_sendString((uint8_t*)" entries\r\nAuto-reset every (h): ", 0);
if(autoReset == 0)
- term_sendString((uint8_t*)"disabled\r\n", 0);
+ term_sendString((uint8_t*)"disabled", 0);
else
term_sendNumber(autoReset);
- term_sendString((uint8_t*)"\r\n", 0);
+ term_sendString((uint8_t*)"\r\nKISS monitor: ", 0);
+ if(kissMonitor == 1)
+ term_sendString((uint8_t*)"On\r\n", 0);
+ else
+ term_sendString((uint8_t*)"Off\r\n", 0);
term_sendBuf(src);
return;
}
@@ -1593,7 +1598,6 @@ void term_parse(uint8_t *cmd, uint16_t len, Terminal_stream src, Uart_data_type
term_sendBuf(src);
return;
}
-
else err = 1;
if(err == 1)
@@ -1606,6 +1610,7 @@ void term_parse(uint8_t *cmd, uint16_t len, Terminal_stream src, Uart_data_type
return;
}
+
if(checkcmd(cmd, 10, (uint8_t*)"autoreset "))
{
uint8_t tmp[4] = {0};
@@ -1693,6 +1698,28 @@ void term_parse(uint8_t *cmd, uint16_t len, Terminal_stream src, Uart_data_type
return;
}
+ if(checkcmd(cmd, 8, (uint8_t*)"monkiss "))
+ {
+ uint8_t err = 0;
+ if(checkcmd(&cmd[8], 2, (uint8_t*)"on"))
+ kissMonitor = 1;
+ else if(checkcmd(&cmd[8], 3, (uint8_t*)"off"))
+ kissMonitor = 0;
+ else
+ err = 1;
+
+ if(err)
+ {
+ term_sendString((uint8_t*)"Incorrect command!\r\n", 0);
+ }
+ else
+ {
+ term_sendString((uint8_t*)"OK\r\n", 0);
+ }
+ term_sendBuf(src);
+ return;
+ }
+
term_sendString((uint8_t*)"Unknown command. For command list type \"help\"\r\n", 0);
term_sendBuf(src);