Merge branch 'develop_sky_liyi' into 'develop_sky'

Develop sky liyi

See merge request StarlockTeam/app-starlock!216
This commit is contained in:
李仪 2025-07-23 03:38:22 +00:00
commit 41c4623876
4 changed files with 55 additions and 30 deletions

View File

@ -348,21 +348,43 @@ class BlueManage {
} else { } else {
// 128834 // 128834
if (cleanUuid.length >= 32) { if (cleanUuid.length >= 32) {
final String thirdAndFourth = cleanUuid.substring(2, 4); // 23 if (deviceType == DeviceType.blue) {
for (final prefix in prefixes) { final String thirdAndFourth = cleanUuid.substring(6, 8); // 23
if (thirdAndFourth == prefix) { for (final prefix in prefixes) {
if (isSingle) { if (thirdAndFourth == prefix) {
return true; // isSingle为truetrue if (isSingle) {
} else { return true; // isSingle为truetrue
// UUID的第31321 } else {
if (cleanUuid.length >= 32) { // UUID的第31321
String pairStatus = if (cleanUuid.length >= 32) {
cleanUuid.substring(30, 32); // 31321 String pairStatus =
// 00=01= cleanUuid.substring(30, 32); // 31321
if (pairStatus == '00') { // 00=01=
return true; // true if (pairStatus == '00') {
return true; // true
}
// 01trueuuid
}
}
}
}
} else if (deviceType == DeviceType.gateway) {
final String thirdAndFourth = cleanUuid.substring(6, 8); // 23
for (final prefix in prefixes) {
if (thirdAndFourth == prefix) {
if (isSingle) {
return true; // isSingle为truetrue
} else {
// UUID的第31321
if (cleanUuid.length >= 32) {
String pairStatus =
cleanUuid.substring(30, 32); // 31321
// 00=01=
if (pairStatus == '00') {
return true; // true
}
// 01trueuuid
} }
// 01trueuuid
} }
} }
} }

View File

@ -9,10 +9,10 @@ List<String> getDeviceType(DeviceType deviceType) {
List<String> t = ['758824']; List<String> t = ['758824'];
switch (deviceType) { switch (deviceType) {
case DeviceType.blue: case DeviceType.blue:
t = ['758824', '75', '768824', '76']; t = ['758824', '75', '768824', '76','24'];
break; break;
case DeviceType.gateway: case DeviceType.gateway:
t = ['758825']; t = ['758825','25'];
break; break;
} }
return t; return t;

View File

@ -337,17 +337,15 @@ class NearbyLockLogic extends BaseGetXController {
// 'featureSettingValue': state.featureSettingValue, // 'featureSettingValue': state.featureSettingValue,
// 'featureSettingParams': state.featureSettingParams, // 'featureSettingParams': state.featureSettingParams,
// }); // });
Get.toNamed(Routers.saveLockPage, Get.toNamed(Routers.saveLockPage, arguments: <String, Object?>{
arguments: <String, Object?>{ 'addressInfo': {},
'addressInfo': {}, 'pwdTimestamp': state.timestampValue * 1000,
'pwdTimestamp': state.timestampValue * 1000, 'lockInfo': state.lockInfo,
'lockInfo': state.lockInfo, 'featureValue': state.featureValue,
'featureValue': state.featureValue, 'featureSettingValue': state.featureSettingValue,
'featureSettingValue': state.featureSettingValue, 'featureSettingParams': state.featureSettingParams,
'featureSettingParams': state.featureSettingParams, 'isFromMap': 0,
'isFromMap': 0, });
});
break; break;
case 0x06: case 0x06:

View File

@ -25,6 +25,7 @@ class SelectGatewayListLogic extends BaseGetXController {
// //
late StreamSubscription<Reply> _replySubscription; late StreamSubscription<Reply> _replySubscription;
void _initReplySubscription() { void _initReplySubscription() {
_replySubscription = _replySubscription =
EventBusManager().eventBus!.on<Reply>().listen((Reply reply) async { EventBusManager().eventBus!.on<Reply>().listen((Reply reply) async {
@ -35,7 +36,6 @@ class SelectGatewayListLogic extends BaseGetXController {
}); });
} }
// WIFI配网结果
Future<void> _replyGatewayGetStatusReply(Reply reply) async { Future<void> _replyGatewayGetStatusReply(Reply reply) async {
final int status = reply.data[2]; final int status = reply.data[2];
@ -99,7 +99,7 @@ class SelectGatewayListLogic extends BaseGetXController {
void startScanBlueList() { void startScanBlueList() {
state.devices.clear(); state.devices.clear();
BlueManage().startScan(2000, DeviceType.gateway, (List<ScanResult> list) { BlueManage().startScan(2000, DeviceType.gateway, (List<ScanResult> list) {
AppLog.log('ScanResultList:$list'); // AppLog.log('ScanResultList:$list');
for (int i = 0; i < list.length; i++) { for (int i = 0; i < list.length; i++) {
final ScanResult device = list[i]; final ScanResult device = list[i];
// if ((device.advertisementData.serviceUuids.isNotEmpty // if ((device.advertisementData.serviceUuids.isNotEmpty
@ -211,7 +211,12 @@ class SelectGatewayListLogic extends BaseGetXController {
@override @override
void dispose() { void dispose() {
super.dispose();
_replySubscription.cancel(); _replySubscription.cancel();
super.dispose();
}
@override
void onClose() {
_replySubscription.cancel();
super.onClose();
} }
} }