2023-08-08 09:42:35 +08:00

53 lines
1009 B
Dart

import 'package:uuid/uuid.dart';
///发送数据类
enum DataChannel{
ble
}
extension Extension on DataChannel {
bool get isBLE => this == DataChannel.ble;
}
class EventSendModel {
List<int> data = [];
String? topic = '';
DataChannel? sendChannel;
String? deviceId;
Uuid? serviceId;
Uuid? characteristicId;
EventSendModel({required this.data,this.topic,this.sendChannel, this.deviceId, this.serviceId, this.characteristicId});
}
///接收数据类
class EventReceiveModel {
dynamic data;
String? tag = '';
DataChannel? sendChannel;
EventReceiveModel({
required this.data,
this.sendChannel,
this.tag});
}
///解析数据域
class EventParseModel {
int? type;
int? commandIndex;
dynamic data;
EventParseModel({required this.type, required this.data, this.commandIndex});
}
///debug info model
class StateModel {
final String title;
final String subTitle;
final bool result;
StateModel({this.title= '',this.subTitle = '',this.result = false});
}