From 622210818657232441a7180d0e5265cc00561e78 Mon Sep 17 00:00:00 2001 From: chunyexixiaoyu <834670833@qq.com> Date: Fri, 6 May 2022 17:53:25 +0800 Subject: [PATCH] APP_Framework/Framework/: solve the problem the rebase cause. --- APP_Framework/Framework/connection/adapter.c | 6 ++-- .../Framework/connection/adapter_agent.c | 10 +++--- APP_Framework/Framework/connection/at_agent.h | 35 ++++--------------- 3 files changed, 15 insertions(+), 36 deletions(-) diff --git a/APP_Framework/Framework/connection/adapter.c b/APP_Framework/Framework/connection/adapter.c index 96d93c828..a4b0f4cc9 100644 --- a/APP_Framework/Framework/connection/adapter.c +++ b/APP_Framework/Framework/connection/adapter.c @@ -21,9 +21,11 @@ #include static DoublelistType adapter_list; - +#ifdef ADD_XIZI_FETURES +static int adapter_list_lock; +#else static pthread_mutex_t adapter_list_lock; - +#endif /** * @description: Init adapter framework * @return 0 diff --git a/APP_Framework/Framework/connection/adapter_agent.c b/APP_Framework/Framework/connection/adapter_agent.c index 5c0222847..d3f9603c2 100755 --- a/APP_Framework/Framework/connection/adapter_agent.c +++ b/APP_Framework/Framework/connection/adapter_agent.c @@ -31,7 +31,7 @@ #endif #ifdef ADD_RTTHREAD_FETURES #include - +#endif #define AT_CMD_MAX_LEN 128 #define AT_AGENT_MAX 2 static char send_buf[AT_CMD_MAX_LEN]; @@ -451,10 +451,10 @@ int DeleteATAgent(ATAgentType agent) PrivSemaphoreDelete(&agent->entm_rx_notice); } - // if (agent->rsp_sem) { - // printf("delete agent rsp_sem = %d\n",agent->rsp_sem); - // PrivSemaphoreDelete(&agent->rsp_sem); - // } + if (agent->rsp_sem) { + printf("delete agent rsp_sem = %d\n",agent->rsp_sem); + PrivSemaphoreDelete(&agent->rsp_sem); + } if (agent->maintain_buffer) { PrivFree(agent->maintain_buffer); diff --git a/APP_Framework/Framework/connection/at_agent.h b/APP_Framework/Framework/connection/at_agent.h index 7f82f511a..4ac0b4099 100755 --- a/APP_Framework/Framework/connection/at_agent.h +++ b/APP_Framework/Framework/connection/at_agent.h @@ -52,8 +52,8 @@ struct ATAgent uint32 maintain_len; uint32 maintain_max; -#ifdef ADD_NUTTX_FETURES - pthread_mutex_t lock; +#ifdef ADD_XIZI_FETURES + int lock; #else pthread_mutex_t lock; #endif @@ -63,34 +63,11 @@ struct ATAgent char reply_end_last_char; char reply_end_char; uint32 reply_char_num; +#ifdef ADD_XIZI_FETURES + int rsp_sem; +#else sem_t rsp_sem; - - pthread_t at_handler; - - #define ENTM_RECV_MAX 256 - char entm_recv_buf[ENTM_RECV_MAX]; - uint32 entm_recv_len; - enum ReceiveMode receive_mode; - int entm_rx_notice; -}; -typedef struct ATAgent *ATAgentType; - -int EntmSend(ATAgentType agent, const char *data, int len); -int EntmRecv(ATAgentType agent, char *rev_buffer, int buffer_len, int timeout_s); -char *GetReplyText(ATReplyType reply); -int AtSetReplyEndChar(ATAgentType agent, char last_ch, char end_ch); -int AtSetReplyCharNum(ATAgentType agent, unsigned int num); -int AtSetReplyLrEnd(ATAgentType agent, char enable); -ATReplyType CreateATReply(uint32 reply_max_len); -unsigned int IpTint(char *ipstr); -void SwapStr(char *str, int begin, int end); -char* IpTstr(unsigned int ipint); -ATAgentType GetATAgent(const char *agent_name); -int InitATAgent(const char *agent_name, int fd, uint32 maintain_max); -int DeleteATAgent(ATAgentType agent); -int ParseATReply(char* str, const char *format, ...); -void DeleteATReply(ATReplyType reply); - +#endif pthread_t at_handler; #define ENTM_RECV_MAX 256