|
|
@ -17,6 +17,7 @@ import com.iflytop.sgs.common.enums.cmd.CmdColor; |
|
|
|
import com.iflytop.sgs.common.service.CanBusService; |
|
|
|
import com.iflytop.sgs.hardware.exception.HardwareException; |
|
|
|
import com.iflytop.sgs.hardware.service.AppEventBusService; |
|
|
|
import com.iflytop.sgs.hardware.type.appevent.A8kCanBusOnConnectEvent; |
|
|
|
import com.iflytop.sgs.hardware.type.appevent.AppEvent; |
|
|
|
import jakarta.annotation.PostConstruct; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
@ -48,6 +49,7 @@ public class DeviceInitService { |
|
|
|
} |
|
|
|
|
|
|
|
private void onAppEvent(AppEvent event) { |
|
|
|
if(event instanceof A8kCanBusOnConnectEvent){ |
|
|
|
new Thread(() -> { |
|
|
|
try { |
|
|
|
CompletableFuture.runAsync(() -> { |
|
|
@ -75,6 +77,7 @@ public class DeviceInitService { |
|
|
|
} |
|
|
|
}).start(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public void initSensorState() throws Exception { |
|
|
|
deviceSensorService.collectSensorState(); |
|
|
|