A LoRa APRS node with KISS interface based on a Raspberry Pi Pico
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

53 lines
1.2 KiB

#ifndef KISS_H
#define KISS_H
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <stdarg.h>
#define FEND 0xC0
#define FESC 0xDB
#define TFEND 0xDC
#define TFESC 0xDD
#define CMD_UNKNOWN 0xFE
#define CMD_DATA 0x00
#define CMD_HARDWARE 0x06
#define CMD_EXIT_KISS 0xFF
#define HW_RSSI 0x21
#define CMD_ERROR 0x90
#define ERROR_INITRADIO 0x01
#define ERROR_TXFAILED 0x02
#define ERROR_QUEUE_FULL 0x04
struct aprs_frame {
uint8_t source_address[10];
uint8_t digi_path[255];
uint8_t data_field[255];
uint8_t message[255];
uint8_t digis[10][10];
uint8_t acknowledge_number[255];
bool acknowledge_request = false;
uint16_t server_command = 0;
uint16_t number_of_digipeaters = 0;
uint8_t valid_apsr_data = false;
};
struct ax25_frame {
uint8_t complete[512];
uint16_t lenght = 0;
uint8_t kiss_frame[512];
};
class KissClass
{
public:
uint16_t EncodeFrame(struct aprs_frame *frame, struct ax25_frame *ax25frame);
private:
uint8_t * EncodeCall(uint8_t string[]);
};
#endif