forked from xuos/xiuos
support lcd test on xidatong-arm32 support wifi test on xidatong-arm32 support ethernet test on xidatong-arm32 on nuttx from Wang_linyu
it is OK
This commit is contained in:
@@ -169,7 +169,7 @@ int AdapterDeviceOpen(struct Adapter *adapter)
|
||||
|
||||
result = priv_done->open(adapter);
|
||||
if (0 == result) {
|
||||
printf("Device %s open success.\n", adapter->name);
|
||||
printf("Device %s %p open success.\n", adapter->name, adapter->adapter_param);
|
||||
adapter->adapter_status = INSTALL;
|
||||
} else {
|
||||
if (adapter->fd) {
|
||||
@@ -187,7 +187,7 @@ int AdapterDeviceOpen(struct Adapter *adapter)
|
||||
|
||||
result = ip_done->open(adapter);
|
||||
if (0 == result) {
|
||||
printf("Device %s open success.\n", adapter->name);
|
||||
printf("Device %s param %p open success.\n", adapter->name, adapter->adapter_param);
|
||||
adapter->adapter_status = INSTALL;
|
||||
} else {
|
||||
if (adapter->fd) {
|
||||
|
||||
@@ -139,9 +139,9 @@ int ATOrderSend(ATAgentType agent, uint32_t timeout_s, ATReplyType reply, const
|
||||
|
||||
abstime.tv_sec = timeout_s;
|
||||
|
||||
PrivMutexObtain(&agent->lock);
|
||||
PrivMutexObtain(&agent->lock);
|
||||
agent->receive_mode = AT_MODE;
|
||||
|
||||
|
||||
memset(agent->maintain_buffer, 0x00, agent->maintain_max);
|
||||
agent->maintain_len = 0;
|
||||
|
||||
@@ -154,8 +154,8 @@ int ATOrderSend(ATAgentType agent, uint32_t timeout_s, ATReplyType reply, const
|
||||
const char *cmd = NULL;
|
||||
|
||||
agent->reply = reply;
|
||||
PrivMutexAbandon(&agent->lock);
|
||||
|
||||
PrivMutexAbandon(&agent->lock);
|
||||
|
||||
if(agent->reply != NULL) {
|
||||
PrivMutexObtain(&agent->lock);
|
||||
reply->reply_len = 0;
|
||||
@@ -211,8 +211,7 @@ int AtCmdConfigAndCheck(ATAgentType agent, char *cmd, char *check)
|
||||
ret = -1;
|
||||
goto __exit;
|
||||
}
|
||||
printf("[reply result :\n");
|
||||
printf("%s]\n", result);
|
||||
printf("[reply result: %s]\n", result);
|
||||
if(!strstr(result, check)) {
|
||||
printf("%s %d check[%s] reply[%s] failed.\n",__func__,__LINE__,check,result);
|
||||
ret = -1;
|
||||
@@ -230,7 +229,7 @@ char *GetReplyText(ATReplyType reply)
|
||||
}
|
||||
|
||||
int AtSetReplyLrEnd(ATAgentType agent, char enable)
|
||||
{
|
||||
{
|
||||
if (!agent) {
|
||||
return -1;
|
||||
}
|
||||
@@ -241,7 +240,7 @@ int AtSetReplyLrEnd(ATAgentType agent, char enable)
|
||||
}
|
||||
|
||||
int AtSetReplyEndChar(ATAgentType agent, char last_ch, char end_ch)
|
||||
{
|
||||
{
|
||||
if (!agent) {
|
||||
return -1;
|
||||
}
|
||||
@@ -253,7 +252,7 @@ int AtSetReplyEndChar(ATAgentType agent, char last_ch, char end_ch)
|
||||
}
|
||||
|
||||
int AtSetReplyCharNum(ATAgentType agent, unsigned int num)
|
||||
{
|
||||
{
|
||||
if (!agent) {
|
||||
return -1;
|
||||
}
|
||||
@@ -292,18 +291,18 @@ int EntmRecv(ATAgentType agent, char *rev_buffer, int buffer_len, int timeout_s)
|
||||
abstime.tv_sec = timeout_s;
|
||||
if(buffer_len > ENTM_RECV_MAX){
|
||||
printf("read length more then max length[%d] Bytes",ENTM_RECV_MAX);
|
||||
return -1;
|
||||
return -1;
|
||||
}
|
||||
PrivMutexObtain(&agent->lock);
|
||||
PrivMutexObtain(&agent->lock);
|
||||
agent->receive_mode = ENTM_MODE;
|
||||
agent->read_len = buffer_len;
|
||||
PrivMutexAbandon(&agent->lock);
|
||||
PrivMutexAbandon(&agent->lock);
|
||||
//PrivTaskDelay(1000);
|
||||
if (PrivSemaphoreObtainWait(&agent->entm_rx_notice, &abstime)) {
|
||||
printf("wait sem[%d] timeout\n",agent->entm_rx_notice);
|
||||
return -1;
|
||||
}
|
||||
PrivMutexObtain(&agent->lock);
|
||||
PrivMutexObtain(&agent->lock);
|
||||
|
||||
printf("EntmRecv once len %d.\n", agent->entm_recv_len);
|
||||
|
||||
@@ -312,7 +311,7 @@ int EntmRecv(ATAgentType agent, char *rev_buffer, int buffer_len, int timeout_s)
|
||||
memset(agent->entm_recv_buf, 0, ENTM_RECV_MAX);
|
||||
agent->entm_recv_len = 0;
|
||||
agent->read_len = 0;
|
||||
PrivMutexAbandon(&agent->lock);
|
||||
PrivMutexAbandon(&agent->lock);
|
||||
|
||||
return buffer_len;
|
||||
}
|
||||
@@ -323,7 +322,7 @@ static int GetCompleteATReply(ATAgentType agent)
|
||||
char ch = 0, last_ch = 0;
|
||||
bool is_full = false;
|
||||
|
||||
PrivMutexObtain(&agent->lock);
|
||||
PrivMutexObtain(&agent->lock);
|
||||
|
||||
memset(agent->maintain_buffer, 0x00, agent->maintain_max);
|
||||
agent->maintain_len = 0;
|
||||
@@ -331,7 +330,7 @@ static int GetCompleteATReply(ATAgentType agent)
|
||||
memset(agent->entm_recv_buf, 0x00, 256);
|
||||
agent->entm_recv_len = 0;
|
||||
|
||||
PrivMutexAbandon(&agent->lock);
|
||||
PrivMutexAbandon(&agent->lock);
|
||||
|
||||
while (1) {
|
||||
PrivRead(agent->fd, &ch, 1);
|
||||
@@ -359,7 +358,7 @@ static int GetCompleteATReply(ATAgentType agent)
|
||||
} else {
|
||||
printf("entm_recv_buf is_full ...\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (agent->receive_mode == AT_MODE) {
|
||||
if (read_len < agent->maintain_max) {
|
||||
if(ch != 0) { ///< if the char is null then do not save it to the buff
|
||||
@@ -367,13 +366,14 @@ static int GetCompleteATReply(ATAgentType agent)
|
||||
read_len++;
|
||||
agent->maintain_len = read_len;
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
printf("maintain_len is_full ...\n");
|
||||
printf("maintain_len is_full %d ...\n", read_len);
|
||||
is_full = true;
|
||||
}
|
||||
|
||||
if (((ch == '\n') && (last_ch == '\r') && (agent->reply_lr_end)) ||
|
||||
if (((ch == '\n') && (agent->reply_lr_end)) ||
|
||||
((ch == '\n') && (last_ch == '\r') && (agent->reply_lr_end)) ||
|
||||
((ch == agent->reply_end_char) && (agent->reply_end_char) &&
|
||||
(last_ch == agent->reply_end_last_char) && (agent->reply_end_last_char)) ||
|
||||
((read_len == agent->reply_char_num) && (agent->reply_char_num))) {
|
||||
@@ -384,7 +384,7 @@ static int GetCompleteATReply(ATAgentType agent)
|
||||
PrivMutexAbandon(&agent->lock);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
printf("GetCompleteATReply done\n");
|
||||
agent->receive_mode = DEFAULT_MODE;
|
||||
PrivMutexAbandon(&agent->lock);
|
||||
@@ -418,7 +418,7 @@ int DeleteATAgent(ATAgentType agent)
|
||||
if(agent->at_handler > 0){
|
||||
PrivTaskDelete(agent->at_handler, 0);
|
||||
}
|
||||
|
||||
|
||||
if (agent->fd > 0) {
|
||||
printf("close agent fd = %d\n",agent->fd);
|
||||
PrivClose(agent->fd);
|
||||
@@ -464,7 +464,7 @@ static void *ATAgentReceiveProcess(void *param)
|
||||
|
||||
while (1) {
|
||||
if (GetCompleteATReply(agent) > 0) {
|
||||
PrivMutexObtain(&agent->lock);
|
||||
PrivMutexObtain(&agent->lock);
|
||||
if (agent->reply != NULL) {
|
||||
ATReplyType reply = agent->reply;
|
||||
|
||||
@@ -521,7 +521,7 @@ static int ATAgentInit(ATAgentType agent)
|
||||
#ifdef ADD_NUTTX_FETURES
|
||||
pthread_attr_t attr = PTHREAD_ATTR_INITIALIZER;
|
||||
attr.priority = 18;
|
||||
attr.stacksize = 4096;
|
||||
attr.stacksize = 8192;
|
||||
|
||||
#else
|
||||
pthread_attr_t attr;
|
||||
@@ -550,7 +550,7 @@ int InitATAgent(const char *agent_name, int agent_fd, uint32 maintain_max)
|
||||
if (GetATAgent(agent_name) != NULL) {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
while (i < AT_AGENT_MAX && at_agent_table[i].fd > 0) {
|
||||
i++;
|
||||
}
|
||||
|
||||
@@ -99,8 +99,8 @@ int AdapterWifiInit(void)
|
||||
/******************wifi TEST*********************/
|
||||
int AdapterWifiTest(void)
|
||||
{
|
||||
char cmd[64];
|
||||
int baud_rate = BAUD_RATE_57600;
|
||||
// char cmd[64];
|
||||
// int baud_rate = BAUD_RATE_57600;
|
||||
|
||||
struct Adapter* adapter = AdapterDeviceFindByName(ADAPTER_WIFI_NAME);
|
||||
|
||||
@@ -168,13 +168,13 @@ int AdapterWifiTest(void)
|
||||
|
||||
const char *wifi_msg = "Wifi Test";
|
||||
int len = strlen(wifi_msg);
|
||||
for(int i = 0;i < 10; ++i) {
|
||||
for(int i = 0; i < 10; ++i) {
|
||||
AdapterDeviceSend(adapter, wifi_msg, len);
|
||||
PrivTaskDelay(4000);
|
||||
}
|
||||
|
||||
char wifi_recv_msg[128];
|
||||
for(int j=0;j<10;++j){
|
||||
for(int j = 0; j < 10; ++j){
|
||||
AdapterDeviceRecv(adapter, wifi_recv_msg, 128);
|
||||
PrivTaskDelay(1000);
|
||||
}
|
||||
@@ -198,7 +198,7 @@ PRIV_SHELL_CMD_FUNCTION(WifiClose, a WiFi close sample, PRIV_SHELL_CMD_MAIN_ATTR
|
||||
int WifiSetup(int argc, char *argv[])
|
||||
{
|
||||
struct Adapter* adapter = AdapterDeviceFindByName(ADAPTER_WIFI_NAME);
|
||||
struct WifiParam param;
|
||||
static struct WifiParam param;
|
||||
memset(¶m,0,sizeof(struct WifiParam));
|
||||
strncpy((char *)param.wifi_ssid, argv[1], strlen(argv[1]));
|
||||
strncpy((char *)param.wifi_pwd, argv[2], strlen(argv[2]));
|
||||
@@ -292,7 +292,7 @@ enum
|
||||
APT_WIFI_PARAM_NUM
|
||||
};
|
||||
|
||||
#define APT_WIFI_PARAM_LEN 20
|
||||
#define APT_WIFI_PARAM_LEN 128
|
||||
|
||||
char wifi_param[APT_WIFI_PARAM_NUM][APT_WIFI_PARAM_LEN] = {0};
|
||||
|
||||
@@ -301,6 +301,7 @@ ret = __func; \
|
||||
if(ret != 0){ \
|
||||
printf("%s %d failed\n", __func__, __LINE__); \
|
||||
AdapterDeviceClose(adapter); \
|
||||
free(adapter->adapter_param); \
|
||||
return ret; \
|
||||
};
|
||||
|
||||
@@ -309,7 +310,16 @@ void AdapterWifiGetParam(int argc, char *argv[])
|
||||
int i, j;
|
||||
char *param_str[] = {"ip", "port", "ssid", "pwd", "gw", "server", "mask", "ping"};
|
||||
char *default_str[] =
|
||||
{"192.168.137.34", "12345", "test", "tttttttt", "192.168.137.71", "192.168.137.1", "255.255.255.0", "220.181.38.251"};
|
||||
{
|
||||
"192.168.137.34",
|
||||
"12345",
|
||||
"test",
|
||||
"tttttttt",
|
||||
"192.168.137.71",
|
||||
"192.168.137.1",
|
||||
"255.255.255.0",
|
||||
"220.181.38.251"
|
||||
};
|
||||
|
||||
for(i = 0; i < APT_WIFI_PARAM_NUM; i ++)
|
||||
{
|
||||
@@ -338,21 +348,24 @@ void AdapterWifiGetParam(int argc, char *argv[])
|
||||
}
|
||||
|
||||
|
||||
int AdapterWifiTest(int argc, char *argv[])
|
||||
int AdapterWifiTestWithParam(int argc, char *argv[])
|
||||
{
|
||||
int i, ret;
|
||||
|
||||
struct Adapter* adapter = AdapterDeviceFindByName(ADAPTER_WIFI_NAME);
|
||||
struct Adapter* adapter = AdapterDeviceFindByName(ADAPTER_WIFI_NAME);
|
||||
AdapterWifiGetParam(argc, argv);
|
||||
|
||||
enum NetRoleType net_role = CLIENT;
|
||||
enum IpType ip_type = IPV4;
|
||||
struct WifiParam param;
|
||||
memset(¶m, 0, sizeof(struct WifiParam));
|
||||
strncpy((char *)param.wifi_ssid, wifi_param[APT_WIFI_PARAM_SSID], strlen(wifi_param[APT_WIFI_PARAM_SSID]));
|
||||
strncpy((char *)param.wifi_pwd, wifi_param[APT_WIFI_PARAM_PWD], strlen(wifi_param[APT_WIFI_PARAM_PWD]));
|
||||
|
||||
adapter->adapter_param = ¶m;
|
||||
adapter->adapter_param = malloc(sizeof(struct WifiParam));
|
||||
memset(adapter->adapter_param, 0, sizeof(struct WifiParam));
|
||||
struct WifiParam *apt_param = (struct WifiParam *)adapter->adapter_param;
|
||||
strcpy(apt_param->wifi_ssid, wifi_param[APT_WIFI_PARAM_SSID]);
|
||||
strcpy(apt_param->wifi_pwd, wifi_param[APT_WIFI_PARAM_PWD]);
|
||||
|
||||
printf("2022-10-14 Mr. Wang commit Wifi\n");
|
||||
printf("apt %p ssid %p %s\n", apt_param, apt_param->wifi_ssid);
|
||||
|
||||
CHECK_RET(AdapterDeviceOpen(adapter));
|
||||
CHECK_RET(AdapterDeviceSetUp(adapter));
|
||||
@@ -373,8 +386,9 @@ int AdapterWifiTest(int argc, char *argv[])
|
||||
PrivTaskDelay(4000);
|
||||
}
|
||||
|
||||
char wifi_recv_msg[128];
|
||||
for(i = 0; i < 10; i ++)
|
||||
char wifi_recv_msg[APT_WIFI_PARAM_LEN];
|
||||
memset(wifi_recv_msg, 0, APT_WIFI_PARAM_LEN);
|
||||
for(i = 0; i < APT_WIFI_PARAM_NUM; i ++)
|
||||
{
|
||||
AdapterDeviceRecv(adapter, wifi_recv_msg, 128);
|
||||
PrivTaskDelay(1000);
|
||||
@@ -385,6 +399,7 @@ int AdapterWifiTest(int argc, char *argv[])
|
||||
// CHECK_RET(AdapterDevicePing(adapter, wifi_param[APT_WIFI_PARAM_PING]));
|
||||
// AdapterDeviceDisconnect(adapter, NULL);
|
||||
ret = AdapterDeviceClose(adapter);
|
||||
free(adapter->adapter_param);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
|
||||
struct WifiParam
|
||||
{
|
||||
uint8_t wifi_ssid[128];
|
||||
uint8_t wifi_pwd[128];
|
||||
char wifi_ssid[128];
|
||||
char wifi_pwd[128];
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -196,39 +196,59 @@ static int Esp07sWifiSetUp(struct Adapter *adapter)
|
||||
return -1;
|
||||
}
|
||||
PrivTaskDelay(2000);
|
||||
|
||||
printf("%s check %d adapter %p wifi %p param %p\n", __func__, __LINE__, adapter, param,
|
||||
adapter->adapter_param);
|
||||
|
||||
/* config as softAP+station mode */
|
||||
ret = AtCmdConfigAndCheck(agent, "AT+CWMODE=3\r\n", "OK");
|
||||
if(ret < 0) {
|
||||
printf("%s %d cmd[AT+CWMODE=3] config failed!\n",__func__,__LINE__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// printf("%s check %d pwd %s\n", __func__, __LINE__, param->wifi_pwd);
|
||||
|
||||
PrivTaskDelay(2000);
|
||||
/* connect the router */
|
||||
memset(cmd,0,sizeof(cmd));
|
||||
strncpy(cmd,"AT+CWJAP=",strlen("AT+CWJAP="));
|
||||
strcpy(cmd,"AT+CWJAP=");//strlen("AT+CWJAP="));
|
||||
strncat(cmd,"\"",1);
|
||||
strncat(cmd,param->wifi_ssid,strlen(param->wifi_ssid));
|
||||
|
||||
// printf("%s check %d len %d\n", __func__, __LINE__, strlen(param->wifi_pwd));
|
||||
|
||||
strncat(cmd,param->wifi_ssid,128);
|
||||
|
||||
strncat(cmd,"\"",1);
|
||||
strncat(cmd,",",1);
|
||||
strncat(cmd,"\"",1);
|
||||
|
||||
// printf("%s check %d len %d\n", __func__, __LINE__, strlen(param->wifi_pwd));
|
||||
|
||||
strncat(cmd,param->wifi_pwd,strlen(param->wifi_pwd));
|
||||
|
||||
strncat(cmd,"\"",1);
|
||||
strcat(cmd,"\r\n");
|
||||
|
||||
printf("%s check %d\n", __func__, __LINE__);
|
||||
|
||||
ret = AtCmdConfigAndCheck(agent, cmd, "OK");
|
||||
if(ret < 0) {
|
||||
printf("%s %d cmd[%s] connect[%s] failed!\n",__func__,__LINE__,cmd,param->wifi_ssid);
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("%s check %d\n", __func__, __LINE__);
|
||||
|
||||
/* check the wifi ip address */
|
||||
ATReplyType reply = CreateATReply(256);
|
||||
if (NULL == reply) {
|
||||
printf("%s %d at_create_resp failed!\n",__func__,__LINE__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("%s check %d\n", __func__, __LINE__);
|
||||
|
||||
ret = ATOrderSend(agent, REPLY_TIME_OUT, reply, "AT+CIFSR\r\n");
|
||||
if(ret < 0){
|
||||
printf("%s %d ATOrderSend AT+CIFSR failed.\n",__func__,__LINE__);
|
||||
@@ -238,7 +258,7 @@ static int Esp07sWifiSetUp(struct Adapter *adapter)
|
||||
|
||||
result = GetReplyText(reply);
|
||||
if (!result) {
|
||||
printf("%s %n get reply failed.\n",__func__,__LINE__);
|
||||
printf("%s %d get reply failed.\n",__func__,__LINE__);
|
||||
ret = -1;
|
||||
goto __exit;
|
||||
}
|
||||
@@ -355,7 +375,7 @@ static int Esp07sWifiNetstat(struct Adapter *adapter)
|
||||
|
||||
result = GetReplyText(reply);
|
||||
if (!result) {
|
||||
printf("%s %n get reply failed.\n",__func__,__LINE__);
|
||||
printf("%s %d get reply failed.\n",__func__,__LINE__);
|
||||
ret = -1;
|
||||
goto __exit;
|
||||
}
|
||||
|
||||
@@ -47,14 +47,24 @@ if ADD_XIZI_FETURES
|
||||
endif
|
||||
|
||||
if ADD_NUTTX_FETURES
|
||||
if ARCH_BOARD_XIDATONG_ARM32
|
||||
config ADAPTER_E18_MODEPIN
|
||||
int "E18 MODE pin number"
|
||||
default "61"
|
||||
|
||||
config ADAPTER_E18_PIN_DRIVER
|
||||
string "E18 device pin driver path"
|
||||
default "/dev/gpio0"
|
||||
endif
|
||||
if ARCH_BOARD_XIDATONG_ARM32
|
||||
config ADAPTER_E18_MODE_PATH
|
||||
string "E18 MODE pin device"
|
||||
default "/dev/gpio2"
|
||||
|
||||
endif
|
||||
config ADAPTER_E18_DRIVER_EXTUART
|
||||
bool "Using extra uart to support zigbee"
|
||||
default y
|
||||
|
||||
|
||||
config ADAPTER_E18_DRIVER
|
||||
string "E18 device uart driver path"
|
||||
default "/dev/ttyS1"
|
||||
|
||||
@@ -40,10 +40,35 @@ char *cmd_set_ch = "AT+CH=11"; /*set channel as 11*/
|
||||
#define E18_AS_HEX_MODE 0
|
||||
#define E18_AS_AT_MODE 1
|
||||
|
||||
|
||||
static int E18HardwareModeGet()
|
||||
{
|
||||
#ifdef ADD_NUTTX_FETURES
|
||||
#ifdef CONFIG_ARCH_BOARD_XIDATONG_ARM32
|
||||
int ret = 0;
|
||||
int pin_fd;
|
||||
|
||||
pin_fd = PrivOpen(ADAPTER_E18_PIN_DRIVER, O_RDWR);
|
||||
|
||||
struct PinStat pin_stat;
|
||||
pin_stat.pin = ADAPTER_E18_MODEPIN;
|
||||
|
||||
ret = PrivRead(pin_fd, &pin_stat, 1);
|
||||
|
||||
PrivTaskDelay(200);
|
||||
|
||||
PrivClose(pin_fd);
|
||||
|
||||
if(pin_stat.val == GPIO_HIGH) {
|
||||
printf(" E18 as AT mode\n");
|
||||
return E18_AS_AT_MODE;
|
||||
} else {
|
||||
printf(" E18 as HEX mode\n");
|
||||
return E18_AS_HEX_MODE;
|
||||
}
|
||||
#else
|
||||
return E18_AS_HEX_MODE;
|
||||
#endif
|
||||
#else
|
||||
int ret = 0;
|
||||
int pin_fd;
|
||||
@@ -66,7 +91,41 @@ static int E18HardwareModeGet()
|
||||
printf(" E18 as HEX mode\n");
|
||||
return E18_AS_HEX_MODE;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
static int E18HardwareModeSet(void)
|
||||
{
|
||||
#ifdef ADD_NUTTX_FETURES
|
||||
#ifdef CONFIG_ARCH_BOARD_XIDATONG_ARM32
|
||||
int ret = 0;
|
||||
int pin_fd;
|
||||
|
||||
pin_fd = PrivOpen(ADAPTER_E18_PIN_DRIVER, O_RDWR);
|
||||
|
||||
struct PinStat pin_stat;
|
||||
pin_stat.pin = ADAPTER_E18_MODEPIN;
|
||||
pin_stat.val = GPIO_HIGH;
|
||||
|
||||
// ret = PrivWrite(pin_fd, &pin_stat, 1);
|
||||
|
||||
ioctl(pin_fd, GPIOC_WRITE, (unsigned long)0);
|
||||
|
||||
PrivTaskDelay(200);
|
||||
|
||||
ret = PrivRead(pin_fd, &pin_stat, 1);
|
||||
|
||||
PrivClose(pin_fd);
|
||||
|
||||
if(pin_stat.val == GPIO_HIGH) {
|
||||
printf(" E18 set AT mode\n");
|
||||
return E18_AS_AT_MODE;
|
||||
} else {
|
||||
printf(" E18 set HEX mode\n");
|
||||
return E18_AS_HEX_MODE;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
static int E18UartOpen(struct Adapter *adapter)
|
||||
@@ -186,6 +245,8 @@ static int E18NetRoleConfig(struct Adapter *adapter)
|
||||
int ret = 0;
|
||||
int mode = -1;
|
||||
|
||||
printf("start %s\n", __func__);
|
||||
// E18HardwareModeSet();
|
||||
|
||||
if (NULL == adapter) {
|
||||
printf("%s %d adapter is null!\n",__func__,__LINE__);
|
||||
|
||||
Reference in New Issue
Block a user