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.
82 lines
2.4 KiB
82 lines
2.4 KiB
#pragma once
|
|
|
|
#include "ui.h"
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
#define MAX_LEN 256
|
|
/***********************************************************************************************************************
|
|
* 类型定义 *
|
|
***********************************************************************************************************************/
|
|
typedef enum {
|
|
/**
|
|
* @brief 事件
|
|
*/
|
|
kpt_button_event = 0x65, //
|
|
kpt_sys_event_page_id = 0x66,
|
|
kpt_sys_event_touch_data = 0x67,
|
|
kpt_sys_event_sleep_touch = 0x68,
|
|
kpt_sys_event_string_var = 0x70,
|
|
kpt_sys_event_number_var = 0x71,
|
|
kpt_sys_event_sleep_mode = 0x86,
|
|
kpt_sys_event_auto_wakeup = 0x87,
|
|
kpt_sys_event_sys_start = 0x88,
|
|
kpt_sys_event_sd_upgrade = 0x89,
|
|
kpt_sys_event_passthrough_finish = 0xFD,
|
|
kpt_sys_event_passthrough_ready = 0xFE,
|
|
|
|
/**
|
|
* @brief 用户消息回执
|
|
*/
|
|
kpt_ack = 0xAA,
|
|
kpt_inputfield_content_change_event0 = 0xAB, // 同页面输入框内容变更事件
|
|
kpt_inputfield_content_change_event1 = 0xAC, // 跨页面键盘输入事件
|
|
kpt_double_state_button_event = 0xAD,
|
|
kpt_login_request = 0xAE,
|
|
kpt_unlogin_request = 0xAF,
|
|
kpt_on_keyboard_page_load = 0xB0, // 键盘页面加载
|
|
kpt_on_promopt_page_load = 0xB1, // 弹窗页面加载
|
|
} tjc_event_type_t;
|
|
|
|
typedef struct tjc_screen_packet {
|
|
tjc_event_type_t eventId;
|
|
|
|
uint8_t pid;
|
|
uint8_t bid;
|
|
union {
|
|
// inputfield_content_event
|
|
struct {
|
|
uint8_t text[MAX_LEN];
|
|
} inputfield_content;
|
|
|
|
// kpt_usr_login_request
|
|
// struct {
|
|
// char usrName[TJC_MAX_USR_NAME_SIZE + 1]; //+1是为了存放字符串结束符
|
|
// char passwd[TJC_USR_PASSWD_SIZE + 1];
|
|
// } login_request;
|
|
|
|
// kpt_double_state_button_event
|
|
struct {
|
|
uint8_t val;
|
|
} double_state_button;
|
|
|
|
struct {
|
|
uint8_t val; // 0 抬起,1按下
|
|
} button_event;
|
|
|
|
struct {
|
|
uint8_t fromPage;
|
|
uint8_t fromPopPage;
|
|
} on_page_load;
|
|
|
|
struct {
|
|
bool isFromPopWin;
|
|
} sys_event_page_id;
|
|
|
|
} d;
|
|
} tjc_screen_event_t;
|
|
|
|
typedef void (*tjc_processe_event_t)(tjc_screen_event_t*);
|
|
typedef void (*onpagefunc_t)();
|
|
|
|
void event_process(uint8_t* packet);
|
|
void regCallBack(onpagefunc_t cb);
|