syntax = "proto3"; package main; option go_package = "./spb"; // 用于蓝牙透传的数据结构 message BleReq { // 用唯一的设备名来进行匹配而不是mac地址 string bluetoothDeviceName = 2; // 下面是蓝牙结构内容,未加密状态 bytes StructData = 3; // 扫描+发送+接受的总超时时间,单位为秒 uint32 Timeout = 1; // 空闲断开时间(秒),0为立即断开 uint32 IdleTimeout = 6; } message BleResp { // 定义一个枚举状态【成功,失败,找不到设备,无法建立连接,无法发送数据,超时】 enum StatusE { SUCCESS = 0; // 成功 FAIL = 1; // 其他失败(需要错误消息) NOT_FOUND = 2; // 找不到设备 CONNECT_FAIL = 3; // 建立连接失败 SEND_FAIL = 4; // 发送数据失败 TIMEOUT = 5; // 超时 } // 状态 StatusE Status = 1; // 下面是蓝牙结构内容 bytes StructData = 2; }