#ifndef __ABC800_DEFS_H__
#define __ABC800_DEFS_H__

#include <Arduino.h>

#define TRUE 1
#define FALSE 0
// Software config
#define KEY800_FWVERSION    1
#define KEY800_HWVERSION 	101

// Serial port settings
#define KEY800_SERIAL_BAUD_RATE 115200
#define KEY800_SERIALKETBOARD_BAUD_RATE 625

//Logging
#define KEY800_LOGGING_ENABLE_SERIAL
#ifndef KEY800_LOGGING_SERIAL_PORT
#define KEY800_LOGGING_SERIAL_PORT 		Serial
#endif
#define KEY800_LOGGING_VERBOSE_LEVEL 	5

//WIFI
#ifndef ABC800_WIFI_RETRY_TIMEOUT
#define ABC800_WIFI_RETRY_TIMEOUT 		00
#endif

#ifndef ABC800_WIFI_TIMEOUT_MS 
#define ABC800_WIFI_TIMEOUT_MS			10000 
#endif 

#ifndef ABC800_WIFI_RECOVER_TIME_MS 
#define ABC800_WIFI_RECOVER_TIME_MS 		30000 
#endif 

#define ABC800_REPLACE_CHAR 				0x00
#define ABC800_REPLACE_FUNCTION 			0x01

#define ABC800_KEY_OUT_BUFFER_SIZE		2048
#define ABC800_KEY_IN_BUFFER_SIZE		256
#define ABC800_KEY_REPEAT_TIME			100
#define ABC800_KEY_CHECK_TIME			50
#define ABC800_KEY_REPEAT_TIME_DELAY		500

#define ABC800_KEY_WIFI_SSID				"ABC800-KEY800"
#define ABC800_KEY_WIFI_PSK				"key800!!!"
#define ABC800_KEY_WIFI_HOSTNAME			"ABC800-KEY800"
#define ABC800_KEY_SPIFFS_CONFIG_PART  	"data"

#define ABC800_KEY_IN_ABC800				0x00
#define ABC800_KEY_RESET					0x01
#define ABC800_KEY_KD						0x02
#define ABC800_KEY_DELAY_LEGACY				50
#define ABC800_KEY_DELAY					4		

#define ABC800_KEY_SPIFFS_PATH			"/"
#define ABC800_KEY_SPIFFS_PARTITION		"data"

struct key800config
{
	char * ssid;
	char * psk;
};
struct key800queue
{
	uint8_t 	ascii;
	uint8_t 	modifier;
	uint8_t 	special;
};
struct customreplace
{
	uint8_t		abc800key;
	uint8_t		function;
	uint8_t		replace; 
};
#endif