2017-08-20 12:41:17 +00:00
|
|
|
/*
|
|
|
|
* beacon.c
|
|
|
|
*
|
|
|
|
* Created on: 01.07.2017
|
|
|
|
* Author: mateusz
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#include "aprs/beacon.h"
|
|
|
|
#include "main.h"
|
2019-04-16 21:33:41 +00:00
|
|
|
#include "rte_main.h"
|
2017-08-20 12:41:17 +00:00
|
|
|
|
|
|
|
#include "station_config.h"
|
|
|
|
|
2020-01-04 13:15:33 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
|
2020-04-10 20:54:30 +00:00
|
|
|
void beacon_send_own(void) {
|
2021-01-07 07:11:44 +00:00
|
|
|
main_wait_for_tx_complete();
|
2020-04-10 20:54:30 +00:00
|
|
|
main_own_aprs_msg_len = sprintf(main_own_aprs_msg, "=%07.2f%c%c%08.2f%c%c %s", (float)_LAT, _LATNS, _SYMBOL_F, (float)_LON, _LONWE, _SYMBOL_S, _COMMENT);
|
2019-01-27 11:34:43 +00:00
|
|
|
main_own_aprs_msg[main_own_aprs_msg_len] = 0;
|
|
|
|
ax25_sendVia(&main_ax25, main_own_path, main_own_path_ln, main_own_aprs_msg, main_own_aprs_msg_len);
|
2017-08-20 12:41:17 +00:00
|
|
|
after_tx_lock = 1;
|
2019-01-26 22:18:25 +00:00
|
|
|
afsk_txStart(&main_afsk);
|
2017-08-20 12:41:17 +00:00
|
|
|
}
|
2019-04-16 21:33:41 +00:00
|
|
|
|
2020-04-10 20:54:30 +00:00
|
|
|
void beacon_send_on_startup(void) {
|
2019-04-16 21:33:41 +00:00
|
|
|
main_own_aprs_msg_len = sprintf(main_own_aprs_msg, "> START boot_cnt %#.2x hf_cnt %#.2x hf_pc %#.8x hf_lr %#.8x", rte_main_boot_cycles, rte_main_hard_faults, rte_main_hardfault_pc, rte_main_hardfault_lr);
|
|
|
|
main_own_aprs_msg[main_own_aprs_msg_len] = 0;
|
|
|
|
ax25_sendVia(&main_ax25, main_own_path, main_own_path_ln, main_own_aprs_msg, main_own_aprs_msg_len);
|
|
|
|
after_tx_lock = 1;
|
|
|
|
afsk_txStart(&main_afsk);
|
|
|
|
}
|
2020-04-10 20:54:30 +00:00
|
|
|
|
|
|
|
void beacon_send_from_user_content(uint16_t content_ln, char* content_ptr) {
|
2021-01-07 07:11:44 +00:00
|
|
|
main_wait_for_tx_complete();
|
2020-04-10 20:54:30 +00:00
|
|
|
ax25_sendVia(&main_ax25, main_own_path, main_own_path_ln, content_ptr, content_ln);
|
|
|
|
after_tx_lock = 1;
|
|
|
|
afsk_txStart(&main_afsk);
|
|
|
|
}
|