2017-08-20 12:41:17 +00:00
|
|
|
/*
|
|
|
|
* KissCommunication.h
|
|
|
|
*
|
|
|
|
* Created on: 29.04.2017
|
|
|
|
* Author: mateusz
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef KISSCOMMUNICATION_H_
|
|
|
|
#define KISSCOMMUNICATION_H_
|
|
|
|
|
|
|
|
#include "aprs/config.h"
|
|
|
|
#include "aprs/ax25.h"
|
|
|
|
#include "aprs/afsk.h"
|
|
|
|
|
|
|
|
#include "stdint.h"
|
|
|
|
|
2022-08-18 20:15:25 +00:00
|
|
|
#include "drivers/serial.h"
|
2019-05-05 07:48:51 +00:00
|
|
|
|
2019-01-12 13:44:16 +00:00
|
|
|
#define KISS_TOO_LONG_FRM -1
|
2017-08-20 12:41:17 +00:00
|
|
|
|
|
|
|
#define FEND (uint8_t)0xC0
|
|
|
|
#define FESC (uint8_t)0xDB
|
|
|
|
#define TFEND (uint8_t)0xDC
|
|
|
|
#define TFESC (uint8_t)0xDD
|
|
|
|
|
2022-09-20 18:58:11 +00:00
|
|
|
#define NONSTANDARD (uint8_t)0x0F
|
|
|
|
|
2022-08-16 20:09:31 +00:00
|
|
|
#define KISS_DATA (uint8_t) 0x00
|
2022-09-08 20:43:30 +00:00
|
|
|
|
2022-08-16 20:09:31 +00:00
|
|
|
#define KISS_GET_RUNNING_CONFIG (uint8_t) 0x20
|
|
|
|
#define KISS_RUNNING_CONFIG (uint8_t) 0x70
|
2022-09-08 20:43:30 +00:00
|
|
|
|
2022-09-04 15:23:56 +00:00
|
|
|
#define KISS_GET_VERSION_AND_ID (uint8_t) 0x21
|
|
|
|
#define KISS_VERSION_AND_ID (uint8_t) 0x71
|
2022-08-16 20:09:31 +00:00
|
|
|
|
2022-09-08 20:43:30 +00:00
|
|
|
#define KISS_ERASE_STARTUP_CFG (uint8_t) 0x22
|
|
|
|
#define KISS_ERASE_STARTUP_CFG_RESP (uint8_t) 0x72
|
|
|
|
|
|
|
|
#define KISS_PROGRAM_STARTUP_CFG (uint8_t) 0x23
|
|
|
|
#define KISS_PROGRAM_STARTUP_CFG_RESP (uint8_t) 0x73
|
|
|
|
|
2022-08-16 20:09:31 +00:00
|
|
|
#define KISS_RETURN_IDLE 1
|
|
|
|
|
2022-08-18 20:15:25 +00:00
|
|
|
extern uint8_t kiss_current_async_message;
|
|
|
|
|
2017-08-20 12:41:17 +00:00
|
|
|
/* C++ detection */
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2022-08-16 20:09:31 +00:00
|
|
|
uint8_t kiss_async_pooler(uint8_t* output, uint16_t output_len );
|
|
|
|
|
|
|
|
int32_t kiss_send_ax25_to_host(uint8_t* input_frame, uint16_t input_frame_len, uint8_t* output, uint16_t output_len);
|
2022-08-18 20:15:25 +00:00
|
|
|
int32_t kiss_parse_received(uint8_t* input_frame_from_host, uint16_t input_len, AX25Ctx* ax25, Afsk* a, uint8_t * response_buffer, uint16_t resp_buf_ln );
|
2017-08-20 12:41:17 +00:00
|
|
|
|
2019-05-05 07:48:51 +00:00
|
|
|
void kiss_reset_buffer(uint8_t* output, uint16_t output_len, uint16_t* current_len);
|
|
|
|
uint8_t kiss_put_char(uint8_t c, uint8_t* output, uint16_t output_len, uint16_t* current_len, uint16_t* crc);
|
2019-05-05 12:25:48 +00:00
|
|
|
uint8_t kiss_put_char_nocheck(uint8_t c, uint8_t* output, uint16_t output_len, uint16_t* current_len, uint16_t* crc);
|
2019-05-05 07:48:51 +00:00
|
|
|
void kiss_put_call(const AX25Call *addr, uint8_t is_last, uint8_t* output, uint16_t output_len, uint16_t* current_len, uint16_t* crc);
|
|
|
|
void kiss_finalize_buffer(uint8_t* output, uint16_t output_len, uint16_t* current_len);
|
|
|
|
|
2017-08-20 12:41:17 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* KISSCOMMUNICATION_H_ */
|