From: hcj <1224667075@qq.com> Date: Mon, 11 Nov 2024 03:21:13 +0000 (+0800) Subject: 增加autoota屏蔽正常模式br代码 X-Git-Tag: fd230_release_V1.3.102~98 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=371496ffb05598a77eb36189a710ce6cd6254d0a;p=mirrors%2FFD230.git 增加autoota屏蔽正常模式br代码 --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp index ac80b05da..9b5af9ea5 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp @@ -799,6 +799,11 @@ void BtGapPairStatusChangedCallback(const bd_addr_t *bdAddr, int status) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BtGapPairStatusChangedCallback addr: ****%02x%02x%02x%02x status: %d\n", bdAddr->addr[3], bdAddr->addr[2], bdAddr->addr[1], bdAddr->addr[0], status); /* addr下标 0 1 2 3 */ + if(uapi_dev_runtime_get_atuoota_status()) + { + return; + } + if ((gap_get_device_class(bdAddr) & 0x200) != 0) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BtGapPairStatusChangedCallback: Mobile Phone Device"); @@ -1084,7 +1089,13 @@ void GapAclStateChangedCallback(const bd_addr_t *bdAddr, gap_acl_state_t state, WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "addr: %02x%02x%02x%02x%02x%02x", bdAddr->addr[5], bdAddr->addr[4], bdAddr->addr[3], /* mac下标 0 1 2 3 4 5 */ bdAddr->addr[2], bdAddr->addr[1], bdAddr->addr[0]); /* mac下标 0 1 2 3 4 5 */ - //效果不好 + + if(uapi_dev_runtime_get_atuoota_status()) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "bt GapAclStateChangedCallback state %d, reason %x succ or err", state, reason); + return; + } + if(!uapi_dev_runtime_get_bt_powerstat()) { gap_disconnect_remote_device(bdAddr); diff --git a/code/sdk/application/wearable/fd230app/nativeui/safemodemanager/src/SafeModeManagerPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/safemodemanager/src/SafeModeManagerPresenter.cpp index 95e7e2ecf..5c0f6a3e9 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/safemodemanager/src/SafeModeManagerPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/safemodemanager/src/SafeModeManagerPresenter.cpp @@ -101,6 +101,7 @@ bool SafeModeManagerPresenter::OnClick(UIView &view, const ClickEvent &event) { if (sppinit == 0) { BtInitSpp(); + uapi_dev_runtime_atuoota_status_status(1); sppinit = 1; } } diff --git a/code/sdk/drivers/peripheral/utils/custom_runtime.c b/code/sdk/drivers/peripheral/utils/custom_runtime.c index 006fff13e..94d95fada 100644 --- a/code/sdk/drivers/peripheral/utils/custom_runtime.c +++ b/code/sdk/drivers/peripheral/utils/custom_runtime.c @@ -103,6 +103,8 @@ typedef struct uint8_t wear_status; uint8_t shutting_down_status;//是否处于关机状态 uint8_t transmitting_status;//是否处于ble传输状态 + + uint8_t atuoota_status;//是否处于自动ota状态 } runtime_status_t; @@ -112,6 +114,16 @@ static runtime_status_t g_runtime={0}; // return &g_runtime; // } +void uapi_dev_runtime_atuoota_status_status(uint8_t data) +{ + g_runtime.atuoota_status=data; +} + + +uint8_t uapi_dev_runtime_get_atuoota_status(void) +{ + return g_runtime.atuoota_status; +} void uapi_dev_runtime_set_transmitting_status(uint8_t data) { diff --git a/code/sdk/drivers/peripheral/utils/custom_runtime.h b/code/sdk/drivers/peripheral/utils/custom_runtime.h index ba7141322..ba4028c84 100644 --- a/code/sdk/drivers/peripheral/utils/custom_runtime.h +++ b/code/sdk/drivers/peripheral/utils/custom_runtime.h @@ -308,6 +308,11 @@ void uapi_dev_runtime_set_transmitting_status(uint8_t data); uint8_t uapi_dev_runtime_get_transmitting_status(void); + +void uapi_dev_runtime_atuoota_status_status(uint8_t data); + +uint8_t uapi_dev_runtime_get_atuoota_status(void); + #ifdef __cplusplus #if __cplusplus }