From 208c999ac91dd0e418dea5b58cc77eb156a18b2b Mon Sep 17 00:00:00 2001 From: SnickerSun Date: Wed, 20 Mar 2024 19:04:07 +0800 Subject: [PATCH] =?utf8?q?=E4=BC=98=E5=8C=96cat1=E4=BB=A3=E7=A0=81?= =?utf8?q?=EF=BC=8Ccat1=E7=94=B5=E6=BA=90=E5=85=B3=E9=97=AD=E6=97=B6?= =?utf8?q?=EF=BC=8C=E8=B7=B3=E8=BF=87=E6=8C=87=E4=BB=A4=E4=B8=8B=E8=BE=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.cpp | 7 +++++++ code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.h | 1 + .../drivers/peripheral/slip/cat1Service/cat1_server.cpp | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.cpp b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.cpp index 838d0d87f..83eb444d3 100644 --- a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.cpp +++ b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.cpp @@ -60,6 +60,13 @@ uint32_t uapi_cat1_reset(uint32_t pwron) return 0; } + +bool uapi_cat1_get_power_stat(void) +{ + + return ( GPIO_LEVEL_HIGH == uapi_gpio_get_output_val(S_AGPIO_L23)); + +} void uapi_cat1_start_volte_voice(void) { char *argv[]={"start"}; diff --git a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.h b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.h index 36efbfec2..bb06366b6 100644 --- a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.h +++ b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ctl.h @@ -18,6 +18,7 @@ void uapi_cat1_stop_volte_voice(void); void uapi_cat1_remove_audio_vote(void); void uapi_cat1_add_audio_vote(void); void uapi_cat1_wakeup_cat1(uint8_t wakeup); +bool uapi_cat1_get_power_stat(void); #ifdef __cplusplus #if __cplusplus diff --git a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp index 3e27dc358..6a94c08a3 100644 --- a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp +++ b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp @@ -152,6 +152,12 @@ static void udp_send_response(char *tx_buffer, char *head, char *content) #include "uart_porting.h" void udp_send_msg_toCat1(char cmd,char *content) { + + if (!uapi_cat1_get_power_stat()) + { + printf("Error cat1 poweroff skipp send data\n"); + return ; + } uapi_cat1_wakeup_cat1(1); // uart_port_register_irq(UART_BUS_0); -- 2.17.1