Files
player/Project_App_Calendar/App_Src/win/mywin_user_chat.h
2025-07-05 19:47:28 +08:00

86 lines
1.3 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef MYWIN_USER_CHAT_H__
#define MYWIN_USER_CHAT_H__
#include "at_host.h"
#include "ble_demo.h"
//定义最大mac地址数
#define CHAT_MAX_MAC_NUM 32
//定义mac地址长度
#define CHAT_MAX_MAC_LEN 20
//定义接收缓冲大小
#define CHAT_MAX_RECV_LEN 100
typedef struct
{
WIN_TouchWinStruct win;
int font_size; //字体大小
char mode; //设置的蓝牙模式
int page; //页面0主页1主机mac地址选择2从机设置蓝牙名称3通信
char *mac[CHAT_MAX_MAC_NUM];
char *mac_name[CHAT_MAX_MAC_NUM];
int mac_num;
ble_struct ble; //蓝牙设备
WIN_ScrollbarStruct *mac_select; //主机模式用来选择mac的滚动条
WIN_InputboxStruct *name; //从机模式用来设置蓝牙名称的输入框
WIN_RecordStruct *record; //聊天记录
WIN_InputboxStruct *chars_send; //发送数据输入框
WIN_ButtonStruct *connect; //主机模式的连接按键
WIN_ButtonStruct *next; //下一步按键,
WIN_ButtonStruct *send; //聊天框的发送按键
WIN_ScrollbarStruct *handle_select; //用来选择发送的连接句柄
}WIN_ChatStruct;
WIN_ChatStruct *WIN_CreatChat (WIN_WindowStruct *base,
void (*msgLoop)(struct _WIN_WindowStruct *win,WIN_MsgStruct *msg),
int x,int y,int x_size,int y_size);
void WIN_DeleteChat(WIN_ChatStruct *chat);
void CHAT_DefaultMsgLoop(WIN_ChatStruct *chat,WIN_MsgStruct *msg);
int CHAT_StartChat(WIN_WindowStruct *win);
#endif