86 lines
1.3 KiB
C
86 lines
1.3 KiB
C
#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
|
||
|