wifi适配
This commit is contained in:
parent
655afe81f3
commit
e22f0a13a0
@ -6,7 +6,7 @@ Hashes:
|
||||
Hash: eb5533fe0f4e966603333de97fabccd1
|
||||
TypeTreeHash:
|
||||
serializedVersion: 2
|
||||
Hash: 1d177af04cfcafba01b7fe11f13e71ed
|
||||
Hash: 4ef10e69fc7e9d4f59619e5fdfae318d
|
||||
IncrementalBuildHash:
|
||||
serializedVersion: 2
|
||||
Hash: eb5533fe0f4e966603333de97fabccd1
|
||||
@ -24,10 +24,10 @@ ClassTypes:
|
||||
Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3}
|
||||
- Class: 114
|
||||
Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
|
||||
- Class: 114
|
||||
Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
- Class: 114
|
||||
Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3}
|
||||
- Class: 114
|
||||
Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
- Class: 114
|
||||
Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
|
||||
- Class: 114
|
||||
|
||||
@ -113,7 +113,7 @@ namespace Kill.Bluetooth.Protocol
|
||||
public byte[] ToBytes()
|
||||
{
|
||||
int dataLength = Data != null ? Data.Length : 0;
|
||||
byte[] bytes = new byte[6 + dataLength + 2]; // 帧头(2) + 命令(1) + 读写(1) + 长度(1) + 数据 + CRC(2)
|
||||
byte[] bytes = new byte[5 + dataLength + 2]; // 帧头(2) + 命令(1) + 读写(1) + 长度(1) + 数据 + CRC(2)
|
||||
|
||||
bytes[0] = Header1;
|
||||
bytes[1] = Header2;
|
||||
|
||||
@ -369,15 +369,21 @@ namespace Kill.UI.Pages
|
||||
|
||||
if (DataManager.Instance.hasWifi && !DataManager.Instance.hasBluetooth)
|
||||
{
|
||||
LoadingUI.Show();
|
||||
bool success = await HomePageCtrl.Instance.SendBleCommandByWifiAsync(
|
||||
BLEConstants.CMD_FILL_LIGHT_CONTROL, lightControl.ToBytes());
|
||||
LoadingUI.Hide();
|
||||
if (success)
|
||||
{
|
||||
SyncLightConfigFromCurrent();
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError("[LightSettingPage] 灯光设置失败");
|
||||
Debug.LogError("[LightSettingPage] WiFi灯光设置失败");
|
||||
selectedLightEnabled = currentLightEnabled;
|
||||
selectedLightType = currentLightType;
|
||||
selectedIntensity = currentIntensity;
|
||||
UpdateUI();
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@ -362,10 +362,28 @@ namespace Kill.UI.Pages
|
||||
/// <summary>
|
||||
/// 试射测试按钮点击
|
||||
/// </summary>
|
||||
public void OnClickFireTest()
|
||||
public async void OnClickFireTest()
|
||||
{
|
||||
Debug.Log("[SafetySettingPage] 点击试射测试按钮");
|
||||
|
||||
if (DataManager.Instance.hasWifi && !DataManager.Instance.hasBluetooth)
|
||||
{
|
||||
LoadingUI.Show();
|
||||
var test = new EnvironmentChangeTest { TriggerTest = true };
|
||||
bool success = await HomePageCtrl.Instance.SendBleCommandByWifiAsync(
|
||||
BLEConstants.CMD_ENVIRONMENT_CHANGE_TEST, test.ToBytes());
|
||||
LoadingUI.Hide();
|
||||
if (success)
|
||||
{
|
||||
Debug.Log("[SafetySettingPage] WiFi试射测试已触发");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError("[SafetySettingPage] WiFi试射测试触发失败");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
LoadingUI.Show();
|
||||
BLECommunicationManager.Instance?.TriggerLaserTest((success) =>
|
||||
{
|
||||
@ -379,7 +397,6 @@ namespace Kill.UI.Pages
|
||||
Debug.LogError("[SafetySettingPage] 试射测试触发失败");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -395,15 +412,17 @@ namespace Kill.UI.Pages
|
||||
|
||||
if (DataManager.Instance.hasWifi && !DataManager.Instance.hasBluetooth)
|
||||
{
|
||||
LoadingUI.Show();
|
||||
bool success = await HomePageCtrl.Instance.SendBleCommandByWifiAsync(
|
||||
BLEConstants.CMD_VISUAL_DETECTION_SETTING, setting.ToBytes());
|
||||
LoadingUI.Hide();
|
||||
if (success)
|
||||
{
|
||||
SyncVisualConfig();
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError("[SafetySettingPage] 视觉检测设置失败");
|
||||
Debug.LogError("[SafetySettingPage] WiFi视觉检测设置失败");
|
||||
selectedVisualEnabled = currentVisualEnabled;
|
||||
selectedVisualSensitivity = currentVisualSensitivity;
|
||||
UpdateVisualDetectionSensitivityText();
|
||||
@ -454,15 +473,17 @@ namespace Kill.UI.Pages
|
||||
|
||||
if (DataManager.Instance.hasWifi && !DataManager.Instance.hasBluetooth)
|
||||
{
|
||||
LoadingUI.Show();
|
||||
bool success = await HomePageCtrl.Instance.SendBleCommandByWifiAsync(
|
||||
BLEConstants.CMD_MILLIMETER_WAVE_SETTING, setting.ToBytes());
|
||||
LoadingUI.Hide();
|
||||
if (success)
|
||||
{
|
||||
SyncRadarConfig();
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError("[SafetySettingPage] 毫米波雷达设置失败");
|
||||
Debug.LogError("[SafetySettingPage] WiFi毫米波雷达设置失败");
|
||||
selectedWaveSensitivity = currentWaveSensitivity;
|
||||
UpdateMillimeterWaveSensitivityText();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user