Modify app address, for AT cmd
This commit is contained in:
parent
cd121f49f9
commit
33523335e2
|
@ -200,15 +200,26 @@ static int Ec801eConnect(struct Adapter *adapter, enum NetRoleType net_role, con
|
||||||
int try = 0;
|
int try = 0;
|
||||||
uint8_t ec801e_cmd[64];
|
uint8_t ec801e_cmd[64];
|
||||||
|
|
||||||
ADAPTER_DEBUG("%s enter\n", __func__);
|
printf("%s enter\n", __func__);
|
||||||
|
|
||||||
AtSetReplyEndChar(adapter->agent, 0x4F, 0x4B);
|
AtSetReplyEndChar(adapter->agent, 0x4F, 0x4B);
|
||||||
|
|
||||||
/*step1: serial write "+++", quit transparent mode*/
|
/*step1: serial write "+++", quit transparent mode*/
|
||||||
PrivTaskDelay(1500); //before +++ command, wait at least 1s
|
PrivTaskDelay(1500); //before +++ command, wait at least 1s
|
||||||
ATOrderSend(adapter->agent, REPLY_TIME_OUT, NULL, "+++");
|
ATOrderSend(adapter->agent, REPLY_TIME_OUT, NULL, EC801E_AT_MODE_CMD);
|
||||||
PrivTaskDelay(1500); //after +++ command, wait at least 1s
|
PrivTaskDelay(1500); //after +++ command, wait at least 1s
|
||||||
|
|
||||||
|
for(try = 0; try < TRY_TIMES; try++){
|
||||||
|
ret = AtCmdConfigAndCheck(adapter->agent, EC801E_ATI_CMD, EC801E_OK_REPLY);
|
||||||
|
if (ret == 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ret < 0) {
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
PrivTaskDelay(300);
|
||||||
|
|
||||||
/*step2: serial write "AT+CPIN?", check SIM status*/
|
/*step2: serial write "AT+CPIN?", check SIM status*/
|
||||||
for(try = 0; try < TRY_TIMES; try++){
|
for(try = 0; try < TRY_TIMES; try++){
|
||||||
ret = AtCmdConfigAndCheck(adapter->agent, EC801E_GET_CPIN_CMD, EC801E_READY_REPLY);
|
ret = AtCmdConfigAndCheck(adapter->agent, EC801E_GET_CPIN_CMD, EC801E_READY_REPLY);
|
||||||
|
|
|
@ -407,7 +407,7 @@ int AdapterDeviceConnect(struct Adapter *adapter, enum NetRoleType net_role, con
|
||||||
|
|
||||||
if (NULL == ip_done->connect)
|
if (NULL == ip_done->connect)
|
||||||
return -1;
|
return -1;
|
||||||
|
printf("AdapterDeviceConnect to connect ip=%s port=%s\n", ip, port);
|
||||||
return ip_done->connect(adapter, net_role, ip, port, ip_type);
|
return ip_done->connect(adapter, net_role, ip, port, ip_type);
|
||||||
} else {
|
} else {
|
||||||
printf("AdapterDeviceConnect net_protocol %d not support\n", adapter->net_protocol);
|
printf("AdapterDeviceConnect net_protocol %d not support\n", adapter->net_protocol);
|
||||||
|
|
|
@ -589,6 +589,7 @@ static void *ATAgentReceiveProcess(void *param)
|
||||||
memset(reply->reply_buffer, 0, reply->reply_max_len);
|
memset(reply->reply_buffer, 0, reply->reply_max_len);
|
||||||
memcpy(reply->reply_buffer, agent->maintain_buffer, agent->maintain_len);
|
memcpy(reply->reply_buffer, agent->maintain_buffer, agent->maintain_len);
|
||||||
reply->reply_len = agent->maintain_len;
|
reply->reply_len = agent->maintain_len;
|
||||||
|
printf("%s reply->reply_buffer=%s\n", __func__, reply->reply_buffer);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -74,8 +74,8 @@ out:
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
AdapterDeviceClose(adapter);
|
AdapterDeviceClose(adapter);
|
||||||
}
|
|
||||||
KPrintf("%s fail\n", __func__);
|
KPrintf("%s fail\n", __func__);
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ CONFIG_BSP_USING_LTE=y
|
||||||
CONFIG_LTE_BUS_NAME="lte"
|
CONFIG_LTE_BUS_NAME="lte"
|
||||||
CONFIG_LTE_DRV_NAME="lte_drv"
|
CONFIG_LTE_DRV_NAME="lte_drv"
|
||||||
CONFIG_LTE_DEVICE_NAME_1="lte_dev1"
|
CONFIG_LTE_DEVICE_NAME_1="lte_dev1"
|
||||||
|
# CONFIG_LTE_TEST is not set
|
||||||
|
|
||||||
#
|
#
|
||||||
# Hardware feature
|
# Hardware feature
|
||||||
|
@ -101,6 +102,8 @@ CONFIG_KERNEL_CONSOLEBUF_SIZE=128
|
||||||
# Command shell
|
# Command shell
|
||||||
#
|
#
|
||||||
# CONFIG_TOOL_SHELL is not set
|
# CONFIG_TOOL_SHELL is not set
|
||||||
|
# CONFIG_SHELL_ENTER_CR_AND_LF is not set
|
||||||
|
# CONFIG_SHELL_ENTER_CRLF is not set
|
||||||
|
|
||||||
#
|
#
|
||||||
# Kernel data structure Manage
|
# Kernel data structure Manage
|
||||||
|
@ -166,6 +169,8 @@ CONFIG_FS_VFS_DEVFS=y
|
||||||
CONFIG_TOOL_USING_OTA=y
|
CONFIG_TOOL_USING_OTA=y
|
||||||
CONFIG_MCUBOOT_BOOTLOADER=y
|
CONFIG_MCUBOOT_BOOTLOADER=y
|
||||||
# CONFIG_MCUBOOT_APPLICATION is not set
|
# CONFIG_MCUBOOT_APPLICATION is not set
|
||||||
|
# CONFIG_OTA_BY_PLATFORM is not set
|
||||||
|
# CONFIG_OTA_BY_TCPSERVER is not set
|
||||||
|
|
||||||
#
|
#
|
||||||
# Flash area address and size configuration.
|
# Flash area address and size configuration.
|
||||||
|
|
|
@ -27,7 +27,7 @@ MEMORY
|
||||||
FLASH-160K + RAM-32K
|
FLASH-160K + RAM-32K
|
||||||
*/
|
*/
|
||||||
/*FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 448K*/
|
/*FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 448K*/
|
||||||
FLASH (rx) : ORIGIN = 0x0001c000, LENGTH = 364K
|
FLASH (rx) : ORIGIN = 0x00010000, LENGTH = 412K
|
||||||
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K
|
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ MEMORY
|
||||||
FLASH-144K + RAM-48K
|
FLASH-144K + RAM-48K
|
||||||
FLASH-160K + RAM-32K
|
FLASH-160K + RAM-32K
|
||||||
*/
|
*/
|
||||||
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 112K
|
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 64K
|
||||||
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K
|
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -109,5 +109,8 @@ menuconfig BSP_USING_LTE
|
||||||
config LTE_DEVICE_NAME_1
|
config LTE_DEVICE_NAME_1
|
||||||
string "lte bus device 1 name"
|
string "lte bus device 1 name"
|
||||||
default "lte_dev1"
|
default "lte_dev1"
|
||||||
|
config LTE_TEST
|
||||||
|
bool "Enable lte test"
|
||||||
|
default y
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#define __BOOT_FOR_OTA_H__
|
#define __BOOT_FOR_OTA_H__
|
||||||
|
|
||||||
#define IMAGE_IAP_START_ADD 0x08000000
|
#define IMAGE_IAP_START_ADD 0x08000000
|
||||||
#define IMAGE_IAP_SIZE (112 * 1024)
|
#define IMAGE_IAP_SIZE (64 * 1024)
|
||||||
#define IMAGE_A_START_ADD (IMAGE_IAP_START_ADD + IMAGE_IAP_SIZE)
|
#define IMAGE_A_START_ADD (IMAGE_IAP_START_ADD + IMAGE_IAP_SIZE)
|
||||||
|
|
||||||
void mcuboot_bord_init(void);
|
void mcuboot_bord_init(void);
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
# SRC_FILES := connect_uart.c test_uart.c
|
# SRC_FILES := connect_uart.c test_uart.c
|
||||||
SRC_DIR := test
|
ifeq ($(CONFIG_LTE_TEST),y)
|
||||||
|
SRC_DIR := test
|
||||||
|
endif
|
||||||
SRC_FILES := connect_lte.c
|
SRC_FILES := connect_lte.c
|
||||||
|
|
||||||
include $(KERNEL_ROOT)/compiler.mk
|
include $(KERNEL_ROOT)/compiler.mk
|
||||||
|
|
|
@ -221,7 +221,7 @@ static int SerialGetChar(struct SerialHardwareDevice *serial_dev) {
|
||||||
if (RESET != USART_GetFlagStatus((USART_TypeDef *)serial_cfg->hw_cfg.serial_register_base, USART_FLAG_RXNE)) {
|
if (RESET != USART_GetFlagStatus((USART_TypeDef *)serial_cfg->hw_cfg.serial_register_base, USART_FLAG_RXNE)) {
|
||||||
ch = USART_ReceiveData((USART_TypeDef *)serial_cfg->hw_cfg.serial_register_base) & 0xff;
|
ch = USART_ReceiveData((USART_TypeDef *)serial_cfg->hw_cfg.serial_register_base) & 0xff;
|
||||||
}
|
}
|
||||||
#ifdef BSP_USING_LTE
|
#ifdef LTE_TEST
|
||||||
#define TRANSPARENT_TRANSMISSION_MODE 0 // 数据透传模式
|
#define TRANSPARENT_TRANSMISSION_MODE 0 // 数据透传模式
|
||||||
#define COMMAND_LINE_MODE 1 // 命令行模式
|
#define COMMAND_LINE_MODE 1 // 命令行模式
|
||||||
/* lte模式下,实现DBG串口和MAIN串口的数据转发 */
|
/* lte模式下,实现DBG串口和MAIN串口的数据转发 */
|
||||||
|
|
Loading…
Reference in New Issue