APP_Framework/Framework/: solve the problem the rebase cause.

This commit is contained in:
chunyexixiaoyu 2022-05-06 17:53:25 +08:00
parent 33e3b798b7
commit 6222108186
3 changed files with 15 additions and 36 deletions

View File

@ -21,9 +21,11 @@
#include <adapter.h>
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

View File

@ -31,7 +31,7 @@
#endif
#ifdef ADD_RTTHREAD_FETURES
#include <rtthread.h>
#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);

View File

@ -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