app-starlock/lib/talk/starChart/proto/remote_unlock.proto

60 lines
1.9 KiB
Protocol Buffer
Raw Permalink 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.

syntax = "proto3";
package main;
option go_package = "./spb";
// 依靠网关拼接数据包的远程开锁指令
message RemoteUnlockReq {
// 16 byte publicKey and 16 byte privateKey
// 只是这里才需要传递公钥私钥;
// 蓝牙透传的话,包加密解密是在自己这边做的,密钥不用传给网关;
bytes PublicKey = 1;
bytes PrivateKey = 2;
bytes SignKey = 3;
// 枚举:开锁方式 离线开门0, 在线开门2 离线关门32 在线关门34
enum OpenModeE {
OfflineOpen = 0;
OnlineOpen = 2;
OfflineClose = 32;
OnlineClose = 34;
}
// CmdID 2字节uint16
uint32 CmdID = 4;
// bluetoothDeviceName 40长度字符串 实际上是lockName
string bluetoothDeviceName = 5;
// UserID 20长度字符串
string UserID = 6;
// OpenMode 开门方式
OpenModeE OpenMode = 7;
// 开锁当前时间
uint64 OpenTime = 8;
// Token uint32 首次请求 Token 填 0如果锁需要鉴权操作者身份则会分配动态口令并在应答消息中返回二次请求时带上。
uint32 Token = 9;
// // AuthCodeLen 鉴权码长度 uint8
// uint32 AuthCodeLen = 9;
// // authCode 鉴权码 变长, 把KeyID、authUserID、时间戳、公钥通过md5加密之后就是authCode
// string AuthCode = 10;
// OnlineToken 联网token 16字节字符串
string OnlineToken = 11;
}
message RemoteUnlockResp {
// CmdID 2字节uint16
uint32 CmdID = 1;
// Token uint32 首次请求 Token 填 0如果锁需要鉴权操作者身份则会分配动态口令并在应答消息中返回二次请求时带上。
uint32 Token = 2;
// Status uint8 处理状态
uint32 Status = 3;
// Power uint8 剩余电量,百分比
uint32 Power = 4;
// OpenMode uint8 开锁方式
uint32 OpenMode = 5;
// Power1 uint8 电池1剩余电量百分比
uint32 Power1 = 6;
// 蓝牙输入字节
bytes BluetoothInput = 7;
// 蓝牙输出字节
bytes BluetoothOutput = 8;
}