forked from xuos/xiuos
update rt-thread bsp and add webnet from tian_chunyu
it is OK
This commit is contained in:
commit
ad84a842b0
|
@ -16,3 +16,6 @@
|
||||||
[submodule "Ubiquitous/Nuttx_Fusion_XiUOS/apps"]
|
[submodule "Ubiquitous/Nuttx_Fusion_XiUOS/apps"]
|
||||||
path = Ubiquitous/Nuttx_Fusion_XiUOS/apps
|
path = Ubiquitous/Nuttx_Fusion_XiUOS/apps
|
||||||
url = https://code.gitlink.org.cn/wgzAIIT/incubator-nuttx-apps.git
|
url = https://code.gitlink.org.cn/wgzAIIT/incubator-nuttx-apps.git
|
||||||
|
[submodule "APP_Framework/Applications/webnet/WebNet_XiUOS"]
|
||||||
|
path = APP_Framework/Applications/webnet/WebNet_XiUOS
|
||||||
|
url = https://gitlink.org.cn/xuos/WebNet_XiUOS.git
|
||||||
|
|
|
@ -19,4 +19,5 @@ menu "Applications"
|
||||||
source "$APP_DIR/Applications/knowing_app/Kconfig"
|
source "$APP_DIR/Applications/knowing_app/Kconfig"
|
||||||
source "$APP_DIR/Applications/sensor_app/Kconfig"
|
source "$APP_DIR/Applications/sensor_app/Kconfig"
|
||||||
source "$APP_DIR/Applications/embedded_database_app/Kconfig"
|
source "$APP_DIR/Applications/embedded_database_app/Kconfig"
|
||||||
|
source "$APP_DIR/Applications/webnet/Kconfig"
|
||||||
endmenu
|
endmenu
|
||||||
|
|
|
@ -0,0 +1,92 @@
|
||||||
|
menuconfig APP_USING_WEBNET
|
||||||
|
bool "WebNet: A lightweight, customizable, embeddable Web Server for RT-Thread"
|
||||||
|
default n
|
||||||
|
if APP_USING_WEBNET
|
||||||
|
|
||||||
|
config PKG_WEBNET_PATH
|
||||||
|
string
|
||||||
|
default "/packages/iot/webnet"
|
||||||
|
|
||||||
|
config WEBNET_PORT
|
||||||
|
int "Server listen port"
|
||||||
|
default 80
|
||||||
|
range 0 65535
|
||||||
|
|
||||||
|
config WEBNET_CONN_MAX
|
||||||
|
int "Maximum number of server connections"
|
||||||
|
default 16
|
||||||
|
range 1 100
|
||||||
|
|
||||||
|
config WEBNET_ROOT
|
||||||
|
string "Server root directory"
|
||||||
|
default "/webnet"
|
||||||
|
|
||||||
|
menu "Select supported modules"
|
||||||
|
|
||||||
|
config WEBNET_USING_LOG
|
||||||
|
bool "LOG: Enable output log support"
|
||||||
|
default n
|
||||||
|
|
||||||
|
config WEBNET_USING_AUTH
|
||||||
|
bool "AUTH: Enable basic HTTP authentication support"
|
||||||
|
default n
|
||||||
|
|
||||||
|
config WEBNET_USING_CGI
|
||||||
|
bool "CGI: Enable Common Gateway Interface support"
|
||||||
|
default n
|
||||||
|
|
||||||
|
config WEBNET_USING_ASP
|
||||||
|
bool "ASP: Enable Active Server Pages support"
|
||||||
|
default n
|
||||||
|
|
||||||
|
config WEBNET_USING_SSI
|
||||||
|
bool "SSI: Enable Server Side Includes support"
|
||||||
|
default n
|
||||||
|
|
||||||
|
config WEBNET_USING_INDEX
|
||||||
|
bool "INDEX: Enable list all the file in the directory support"
|
||||||
|
default n
|
||||||
|
|
||||||
|
config WEBNET_USING_ALIAS
|
||||||
|
bool "ALIAS: Enable alias support"
|
||||||
|
default n
|
||||||
|
|
||||||
|
config WEBNET_USING_DAV
|
||||||
|
bool "DAV: Enable Web-based Distributed Authoring and Versioning support"
|
||||||
|
default n
|
||||||
|
|
||||||
|
config WEBNET_USING_UPLOAD
|
||||||
|
bool "UPLOAD: Enable upload file support"
|
||||||
|
default n
|
||||||
|
|
||||||
|
config WEBNET_USING_GZIP
|
||||||
|
bool "GZIP: Enable compressed file support by GZIP"
|
||||||
|
default n
|
||||||
|
|
||||||
|
config WEBNET_CACHE_LEVEL
|
||||||
|
int "CACHE: Configure cache level(0:disable 1:use Last-Modified 2:use Cache-Control)"
|
||||||
|
default 0
|
||||||
|
range 0 2
|
||||||
|
|
||||||
|
if WEBNET_CACHE_LEVEL = 2
|
||||||
|
|
||||||
|
config WEBNET_CACHE_MAX_AGE
|
||||||
|
int "Cache-Control time in seconds"
|
||||||
|
default 1800
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
endmenu
|
||||||
|
|
||||||
|
config WEBNET_USING_SAMPLES
|
||||||
|
bool "Enable webnet samples"
|
||||||
|
default n
|
||||||
|
select WEBNET_USING_ASP
|
||||||
|
select WEBNET_USING_AUTH
|
||||||
|
select WEBNET_USING_CGI
|
||||||
|
select WEBNET_USING_INDEX
|
||||||
|
select WEBNET_USING_ALIAS
|
||||||
|
select WEBNET_USING_SSI
|
||||||
|
select WEBNET_USING_UPLOAD
|
||||||
|
endif
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
import os
|
||||||
|
Import('RTT_ROOT')
|
||||||
|
from building import *
|
||||||
|
|
||||||
|
cwd = GetCurrentDir()
|
||||||
|
objs = []
|
||||||
|
list = os.listdir(cwd)
|
||||||
|
|
||||||
|
for d in list:
|
||||||
|
path = os.path.join(cwd, d)
|
||||||
|
if os.path.isfile(os.path.join(path, 'SConscript')):
|
||||||
|
objs = objs + SConscript(os.path.join(path, 'SConscript'))
|
||||||
|
|
||||||
|
Return('objs')
|
|
@ -436,11 +436,13 @@ int DeleteATAgent(ATAgentType agent)
|
||||||
PrivMutexDelete(&agent->lock);
|
PrivMutexDelete(&agent->lock);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef ADD_XIZI_FETURES
|
||||||
if (agent->entm_rx_notice) {
|
if (agent->entm_rx_notice) {
|
||||||
printf("delete agent entm_rx_notice = %d\n",agent->entm_rx_notice);
|
printf("delete agent entm_rx_notice = %d\n",agent->entm_rx_notice);
|
||||||
PrivSemaphoreDelete(&agent->entm_rx_notice);
|
PrivSemaphoreDelete(&agent->entm_rx_notice);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#endif
|
||||||
#ifdef ADD_XIZI_FETURES
|
#ifdef ADD_XIZI_FETURES
|
||||||
if (agent->rsp_sem) {
|
if (agent->rsp_sem) {
|
||||||
printf("delete agent rsp_sem = %d\n",agent->rsp_sem);
|
printf("delete agent rsp_sem = %d\n",agent->rsp_sem);
|
||||||
|
|
|
@ -74,7 +74,11 @@ struct ATAgent
|
||||||
char entm_recv_buf[ENTM_RECV_MAX];
|
char entm_recv_buf[ENTM_RECV_MAX];
|
||||||
uint32 entm_recv_len;
|
uint32 entm_recv_len;
|
||||||
enum ReceiveMode receive_mode;
|
enum ReceiveMode receive_mode;
|
||||||
|
#ifdef ADD_XIZI_FETURES
|
||||||
int entm_rx_notice;
|
int entm_rx_notice;
|
||||||
|
#else
|
||||||
|
sem_t entm_rx_notice;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
typedef struct ATAgent *ATAgentType;
|
typedef struct ATAgent *ATAgentType;
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@ import os
|
||||||
Import('RTT_ROOT')
|
Import('RTT_ROOT')
|
||||||
from building import *
|
from building import *
|
||||||
SOURCES = []
|
SOURCES = []
|
||||||
|
if GetDepend(['CONNECTION_ADAPTER_BLUETOOTH']):
|
||||||
SOURCES = ['adapter_bluetooth.c'] + SOURCES
|
SOURCES = ['adapter_bluetooth.c'] + SOURCES
|
||||||
objs = []
|
objs = []
|
||||||
cwd = GetCurrentDir()
|
cwd = GetCurrentDir()
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
import os
|
||||||
|
Import('RTT_ROOT')
|
||||||
|
from building import *
|
||||||
|
SOURCES = []
|
||||||
|
if GetDepend(['CONNECTION_ADAPTER_ETHERNET']):
|
||||||
|
SOURCES = ['adapter_ethernet.c'] + SOURCES
|
||||||
|
objs = []
|
||||||
|
cwd = GetCurrentDir()
|
||||||
|
path = [cwd]
|
||||||
|
group = DefineGroup('ethernet', SOURCES, depend = [], CPPPATH = [cwd])
|
||||||
|
objs = objs + group
|
||||||
|
list = os.listdir(cwd)
|
||||||
|
|
||||||
|
for d in list:
|
||||||
|
path = os.path.join(cwd, d)
|
||||||
|
if os.path.isfile(os.path.join(path, 'SConscript')):
|
||||||
|
objs = objs + SConscript(os.path.join(path, 'SConscript'))
|
||||||
|
|
||||||
|
Return('objs')
|
|
@ -97,14 +97,14 @@ int AdapterEthernetTest(void)
|
||||||
|
|
||||||
AdapterDeviceSetUp(adapter);
|
AdapterDeviceSetUp(adapter);
|
||||||
|
|
||||||
const char *ip = "10.10.100.50";
|
const char *ip = "192.168.131.26";
|
||||||
const char *port = "12345";
|
const char *port = "9999";
|
||||||
enum NetRoleType net_role = CLIENT;//SERVER
|
enum NetRoleType net_role = CLIENT;//SERVER
|
||||||
enum IpType ip_type = IPV4;
|
enum IpType ip_type = IPV4;
|
||||||
AdapterDeviceConnect(adapter, net_role, ip, port, ip_type);
|
AdapterDeviceConnect(adapter, net_role, ip, port, ip_type);
|
||||||
|
|
||||||
printf("ready to test data transfer\n");
|
printf("ready to test data transfer\n");
|
||||||
|
PrivTaskDelay(2000);
|
||||||
len = strlen(ethernet_msg);
|
len = strlen(ethernet_msg);
|
||||||
for (i = 0;i < 10; i ++) {
|
for (i = 0;i < 10; i ++) {
|
||||||
printf("AdapterEthernetTest send %s\n", ethernet_msg);
|
printf("AdapterEthernetTest send %s\n", ethernet_msg);
|
||||||
|
@ -117,8 +117,13 @@ int AdapterEthernetTest(void)
|
||||||
printf("AdapterEthernetTest recv %s\n", ethernet_recv_msg);
|
printf("AdapterEthernetTest recv %s\n", ethernet_recv_msg);
|
||||||
memset(ethernet_recv_msg, 0, 128);
|
memset(ethernet_recv_msg, 0, 128);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#ifdef ADD_RTTHREAD_FETURES
|
||||||
|
MSH_CMD_EXPORT(AdapterEthernetTest,a ethernet adpter sample);
|
||||||
|
#elif definded ADD_XIZI_FETURES
|
||||||
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC)|SHELL_CMD_PARAM_NUM(0)|SHELL_CMD_DISABLE_RETURN, AdapterEthernetTest, AdapterEthernetTest, show adapter ethernet information);
|
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC)|SHELL_CMD_PARAM_NUM(0)|SHELL_CMD_DISABLE_RETURN, AdapterEthernetTest, AdapterEthernetTest, show adapter ethernet information);
|
||||||
|
#endif
|
||||||
|
|
|
@ -29,5 +29,7 @@ if ADD_NUTTX_FETURES
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if ADD_RTTHREAD_FETURES
|
if ADD_RTTHREAD_FETURES
|
||||||
|
config ADAPTER_HFA21_DRIVER
|
||||||
|
string "HFA21 device uart driver path"
|
||||||
|
default "/dev/uart3"
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
from building import *
|
||||||
|
import os
|
||||||
|
|
||||||
|
cwd = GetCurrentDir()
|
||||||
|
src = []
|
||||||
|
if GetDepend(['ADAPTER_HFA21_ETHERNET']):
|
||||||
|
src += ['hfa21_ethernet.c']
|
||||||
|
group = DefineGroup('connection ethernet hfa21', src, depend = [], CPPPATH = [cwd])
|
||||||
|
|
||||||
|
Return('group')
|
|
@ -72,7 +72,7 @@ static int Hfa21EthernetOpen(struct Adapter *adapter)
|
||||||
/*step2: init AT agent*/
|
/*step2: init AT agent*/
|
||||||
if (!adapter->agent) {
|
if (!adapter->agent) {
|
||||||
char *agent_name = "ethernet_uart_client";
|
char *agent_name = "ethernet_uart_client";
|
||||||
if (EOK != InitATAgent(agent_name, adapter->fd, 512)) {
|
if (0 != InitATAgent(agent_name, adapter->fd, 512)) {
|
||||||
printf("at agent init failed !\n");
|
printf("at agent init failed !\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -174,13 +174,14 @@ static int Hfa21EthernetSetUp(struct Adapter *adapter)
|
||||||
goto __exit;
|
goto __exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PrivTaskDelay(2000);
|
||||||
/*Step4 : FVEW disable WANN function, ethernet work at LANN mode*/
|
/*Step4 : FVEW disable WANN function, ethernet work at LANN mode*/
|
||||||
ret = AtCmdConfigAndCheck(adapter->agent, HFA21_ETHERNET_AT_DISABLE_WANN_CMD, HFA21_ETHERNET_OK_REPLY);
|
ret = AtCmdConfigAndCheck(adapter->agent, HFA21_ETHERNET_AT_DISABLE_WANN_CMD, HFA21_ETHERNET_OK_REPLY);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
goto __exit;
|
goto __exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Step5 : RELD enable F-AT cmd*/
|
/*Step5 : RELD enable F-AT cmd*/
|
||||||
|
PrivTaskDelay(2000);
|
||||||
ret = AtCmdConfigAndCheck(adapter->agent, HFA21_ETHERNET_AT_RELD_CMD, HFA21_ETHERNET_OK_REPLY);
|
ret = AtCmdConfigAndCheck(adapter->agent, HFA21_ETHERNET_AT_RELD_CMD, HFA21_ETHERNET_OK_REPLY);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
goto __exit;
|
goto __exit;
|
||||||
|
@ -195,13 +196,13 @@ static int Hfa21EthernetSetUp(struct Adapter *adapter)
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
goto __exit;
|
goto __exit;
|
||||||
}
|
}
|
||||||
|
PrivTaskDelay(2000);
|
||||||
/*Step7 : AT+WANN check if get ip、netmask、gateway*/
|
/*Step7 : AT+WANN check if get ip、netmask、gateway*/
|
||||||
ret = AtCmdConfigAndCheck(adapter->agent, HFA21_ETHERNET_AT_WANN_CMD, HFA21_ETHERNET_OK_REPLY);
|
ret = AtCmdConfigAndCheck(adapter->agent, HFA21_ETHERNET_AT_WANN_CMD, HFA21_ETHERNET_OK_REPLY);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
goto __exit;
|
goto __exit;
|
||||||
}
|
}
|
||||||
|
PrivTaskDelay(2000);
|
||||||
/*Step8 : AT+Z reboot hfa21 device*/
|
/*Step8 : AT+Z reboot hfa21 device*/
|
||||||
ret = AtCmdConfigAndCheck(adapter->agent, HFA21_ETHERNET_AT_REBOOT_CMD, HFA21_ETHERNET_OK_REPLY);
|
ret = AtCmdConfigAndCheck(adapter->agent, HFA21_ETHERNET_AT_REBOOT_CMD, HFA21_ETHERNET_OK_REPLY);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
@ -209,7 +210,6 @@ static int Hfa21EthernetSetUp(struct Adapter *adapter)
|
||||||
}
|
}
|
||||||
|
|
||||||
PrivTaskDelay(10000);
|
PrivTaskDelay(10000);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
__exit:
|
__exit:
|
||||||
|
@ -365,6 +365,7 @@ static int Hfa21EthernetConnect(struct Adapter *adapter, enum NetRoleType net_ro
|
||||||
}
|
}
|
||||||
|
|
||||||
adapter->net_role = net_role;
|
adapter->net_role = net_role;
|
||||||
|
PrivTaskDelay(2000);
|
||||||
|
|
||||||
/*Step3 : AT+Z reboot hfa21 device*/
|
/*Step3 : AT+Z reboot hfa21 device*/
|
||||||
ret = AtCmdConfigAndCheck(adapter->agent, HFA21_ETHERNET_AT_REBOOT_CMD, HFA21_ETHERNET_OK_REPLY);
|
ret = AtCmdConfigAndCheck(adapter->agent, HFA21_ETHERNET_AT_REBOOT_CMD, HFA21_ETHERNET_OK_REPLY);
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
import os
|
||||||
|
Import('RTT_ROOT')
|
||||||
|
from building import *
|
||||||
|
SOURCES = []
|
||||||
|
if GetDepend(['CONNECTION_ADAPTER_NB']):
|
||||||
|
SOURCES = ['adapter_nbiot.c'] + SOURCES
|
||||||
|
objs = []
|
||||||
|
cwd = GetCurrentDir()
|
||||||
|
path = [cwd]
|
||||||
|
group = DefineGroup('nb', SOURCES, depend = [], CPPPATH = [cwd])
|
||||||
|
objs = objs + group
|
||||||
|
list = os.listdir(cwd)
|
||||||
|
|
||||||
|
for d in list:
|
||||||
|
path = os.path.join(cwd, d)
|
||||||
|
if os.path.isfile(os.path.join(path, 'SConscript')):
|
||||||
|
objs = objs + SConscript(os.path.join(path, 'SConscript'))
|
||||||
|
|
||||||
|
Return('objs')
|
|
@ -25,6 +25,8 @@
|
||||||
extern AdapterProductInfoType BC28Attach(struct Adapter *adapter);
|
extern AdapterProductInfoType BC28Attach(struct Adapter *adapter);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define ADAPTER_NBIOT_NAME "nbiot"
|
||||||
|
|
||||||
static int AdapterNbiotRegister(struct Adapter *adapter)
|
static int AdapterNbiotRegister(struct Adapter *adapter)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
@ -95,7 +97,13 @@ int opennb(void)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
// SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC)|SHELL_CMD_PARAM_NUM(0)|SHELL_CMD_DISABLE_RETURN, opennb, opennb, show adapter nb information);
|
#ifdef ADD_RTTHREAD_FETURES
|
||||||
|
MSH_CMD_EXPORT(opennb,open nb sample);
|
||||||
|
#endif
|
||||||
|
#ifdef ADD_XIZI_FETURES
|
||||||
|
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC)|SHELL_CMD_PARAM_NUM(0)|SHELL_CMD_DISABLE_RETURN, opennb, opennb, show adapter nb information);
|
||||||
|
#endif
|
||||||
|
|
||||||
int closenb(void)
|
int closenb(void)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
@ -113,7 +121,12 @@ int closenb(void)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
// SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC)|SHELL_CMD_PARAM_NUM(0)|SHELL_CMD_DISABLE_RETURN, closenb, closenb, show adapter nb information);
|
#ifdef ADD_RTTHREAD_FETURES
|
||||||
|
MSH_CMD_EXPORT(closenb,close nb sample);
|
||||||
|
#endif
|
||||||
|
#ifdef ADD_XIZI_FETURES
|
||||||
|
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC)|SHELL_CMD_PARAM_NUM(0)|SHELL_CMD_DISABLE_RETURN, closenb, closenb, show adapter nb information);
|
||||||
|
#endif
|
||||||
|
|
||||||
int connectnb(int argc, char *argv[])
|
int connectnb(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
@ -133,7 +146,12 @@ int closenb(void)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
// SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_MAIN)|SHELL_CMD_PARAM_NUM(2)|SHELL_CMD_DISABLE_RETURN, connectnb, connectnb, show adapter nb information);
|
#ifdef ADD_RTTHREAD_FETURES
|
||||||
|
MSH_CMD_EXPORT(connectnb,connect nb test);
|
||||||
|
#endif
|
||||||
|
#ifdef ADD_XIZI_FETURES
|
||||||
|
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_MAIN)|SHELL_CMD_PARAM_NUM(2)|SHELL_CMD_DISABLE_RETURN, connectnb, connectnb, show adapter nb information);
|
||||||
|
#endif
|
||||||
|
|
||||||
int sendnb(int argc, char *argv[])
|
int sendnb(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
@ -154,7 +172,12 @@ int closenb(void)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
// SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_MAIN)|SHELL_CMD_PARAM_NUM(2)|SHELL_CMD_DISABLE_RETURN, sendnb, sendnb, show adapter nb information);
|
#ifdef ADD_RTTHREAD_FETURES
|
||||||
|
MSH_CMD_EXPORT(sendnb,send nb test);
|
||||||
|
#endif
|
||||||
|
#ifdef ADD_XIZI_FETURES
|
||||||
|
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_MAIN)|SHELL_CMD_PARAM_NUM(2)|SHELL_CMD_DISABLE_RETURN, sendnb, sendnb, show adapter nb information);
|
||||||
|
#endif
|
||||||
|
|
||||||
int recvnb(void)
|
int recvnb(void)
|
||||||
{
|
{
|
||||||
|
@ -167,5 +190,9 @@ int closenb(void)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
// SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC)|SHELL_CMD_PARAM_NUM(0)|SHELL_CMD_DISABLE_RETURN, recvnb, recvnb, show adapter nb information);
|
#ifdef ADD_RTTHREAD_FETURES
|
||||||
|
MSH_CMD_EXPORT(recvnb,receive nb test);
|
||||||
|
#endif
|
||||||
|
#ifdef ADD_XIZI_FETURES
|
||||||
|
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC)|SHELL_CMD_PARAM_NUM(0)|SHELL_CMD_DISABLE_RETURN, recvnb, recvnb, show adapter nb information);
|
||||||
|
#endif
|
||||||
|
|
|
@ -36,5 +36,13 @@ if ADD_NUTTX_FETURES
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if ADD_RTTHREAD_FETURES
|
if ADD_RTTHREAD_FETURES
|
||||||
|
config ADAPTER_BC28_DRIVER
|
||||||
|
string "BC28 device uart driver path"
|
||||||
|
default "/dev/uart2"
|
||||||
|
config ADAPTER_BC28_PIN_DRIVER
|
||||||
|
string "BC28 device pin driver path"
|
||||||
|
default "/dev/pin"
|
||||||
|
config ADAPTER_BC28_RESETPIN
|
||||||
|
string "BC28 RESET pin number"
|
||||||
|
default "100"
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
from building import *
|
||||||
|
import os
|
||||||
|
|
||||||
|
cwd = GetCurrentDir()
|
||||||
|
src = []
|
||||||
|
if GetDepend(['ADAPTER_BC28']):
|
||||||
|
src += ['bc28.c']
|
||||||
|
group = DefineGroup('connection nb bc28', src, depend = [], CPPPATH = [cwd])
|
||||||
|
|
||||||
|
Return('group')
|
|
@ -490,7 +490,7 @@ static int BC28Open(struct Adapter *adapter)
|
||||||
/*step2: init AT agent*/
|
/*step2: init AT agent*/
|
||||||
if (!adapter->agent) {
|
if (!adapter->agent) {
|
||||||
char *agent_name = "niot_device";
|
char *agent_name = "niot_device";
|
||||||
if (EOK != InitATAgent(agent_name, adapter->fd, 512)) {
|
if (0 != InitATAgent(agent_name, adapter->fd, 512)) {
|
||||||
PrivClose(adapter->fd);
|
PrivClose(adapter->fd);
|
||||||
PrivMutexDelete(&nbiot_lock);
|
PrivMutexDelete(&nbiot_lock);
|
||||||
printf("at agent init failed !\n");
|
printf("at agent init failed !\n");
|
||||||
|
|
|
@ -2,6 +2,7 @@ import os
|
||||||
Import('RTT_ROOT')
|
Import('RTT_ROOT')
|
||||||
from building import *
|
from building import *
|
||||||
SOURCES = []
|
SOURCES = []
|
||||||
|
if GetDepend(['CONNECTION_ADAPTER_WIFI']):
|
||||||
SOURCES = ['adapter_wifi.c'] + SOURCES
|
SOURCES = ['adapter_wifi.c'] + SOURCES
|
||||||
objs = []
|
objs = []
|
||||||
cwd = GetCurrentDir()
|
cwd = GetCurrentDir()
|
||||||
|
|
|
@ -195,3 +195,12 @@ void PrivFree(void *pointer)
|
||||||
free(pointer);
|
free(pointer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*********************kernel**********************/
|
||||||
|
void PrivTaskenterCritical()
|
||||||
|
{
|
||||||
|
rt_enter_critical();
|
||||||
|
}
|
||||||
|
void PrivTaskexitCritical()
|
||||||
|
{
|
||||||
|
rt_exit_critical();
|
||||||
|
}
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
#include <dfs_posix.h>
|
#include <dfs_posix.h>
|
||||||
#include <dfs.h>
|
#include <dfs.h>
|
||||||
#include<sys/ioctl.h>
|
#include<sys/ioctl.h>
|
||||||
|
#include <sys/select.h>
|
||||||
#ifdef RT_USING_POSIX_TERMIOS
|
#ifdef RT_USING_POSIX_TERMIOS
|
||||||
#include <posix_termios.h>
|
#include <posix_termios.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -60,7 +61,7 @@
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
typedef signed char bool;
|
||||||
typedef signed char int8;
|
typedef signed char int8;
|
||||||
typedef signed short int16;
|
typedef signed short int16;
|
||||||
typedef signed int int32;
|
typedef signed int int32;
|
||||||
|
@ -96,6 +97,9 @@ typedef unsigned long long uint64;
|
||||||
#define SERIAL_RB_BUFSZ 128
|
#define SERIAL_RB_BUFSZ 128
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define TRUE (1)
|
||||||
|
#define FALSE (0)
|
||||||
|
|
||||||
struct PinDevIrq
|
struct PinDevIrq
|
||||||
{
|
{
|
||||||
int irq_mode;//< RISING/FALLING/HIGH/LOW
|
int irq_mode;//< RISING/FALLING/HIGH/LOW
|
||||||
|
@ -197,6 +201,13 @@ void *PrivCalloc(size_t count, size_t size);
|
||||||
void PrivFree(void *pointer);
|
void PrivFree(void *pointer);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*********************kernel**********************/
|
||||||
|
void PrivTaskenterCritical();
|
||||||
|
void PrivTaskexitCritical();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -25,14 +25,12 @@ CONFIG_RT_USING_HOOK=y
|
||||||
CONFIG_RT_USING_IDLE_HOOK=y
|
CONFIG_RT_USING_IDLE_HOOK=y
|
||||||
CONFIG_RT_IDLE_HOOK_LIST_SIZE=4
|
CONFIG_RT_IDLE_HOOK_LIST_SIZE=4
|
||||||
CONFIG_IDLE_THREAD_STACK_SIZE=256
|
CONFIG_IDLE_THREAD_STACK_SIZE=256
|
||||||
CONFIG_RT_USING_TIMER_SOFT=y
|
# CONFIG_RT_USING_TIMER_SOFT is not set
|
||||||
CONFIG_RT_TIMER_THREAD_PRIO=4
|
|
||||||
CONFIG_RT_TIMER_THREAD_STACK_SIZE=512
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# kservice optimization
|
# kservice optimization
|
||||||
#
|
#
|
||||||
# CONFIG_RT_KSERVICE_USING_STDLIB is not set
|
CONFIG_RT_KSERVICE_USING_STDLIB=y
|
||||||
# CONFIG_RT_KSERVICE_USING_TINY_SIZE is not set
|
# CONFIG_RT_KSERVICE_USING_TINY_SIZE is not set
|
||||||
# CONFIG_RT_USING_ASM_MEMCPY is not set
|
# CONFIG_RT_USING_ASM_MEMCPY is not set
|
||||||
CONFIG_RT_DEBUG=y
|
CONFIG_RT_DEBUG=y
|
||||||
|
@ -186,9 +184,7 @@ CONFIG_RT_USING_PIN=y
|
||||||
# CONFIG_RT_USING_MTD_NOR is not set
|
# CONFIG_RT_USING_MTD_NOR is not set
|
||||||
# CONFIG_RT_USING_MTD_NAND is not set
|
# CONFIG_RT_USING_MTD_NAND is not set
|
||||||
# CONFIG_RT_USING_PM is not set
|
# CONFIG_RT_USING_PM is not set
|
||||||
CONFIG_RT_USING_RTC=y
|
# CONFIG_RT_USING_RTC is not set
|
||||||
# CONFIG_RT_USING_ALARM is not set
|
|
||||||
# CONFIG_RT_USING_SOFT_RTC is not set
|
|
||||||
# CONFIG_RT_USING_SDIO is not set
|
# CONFIG_RT_USING_SDIO is not set
|
||||||
CONFIG_RT_USING_SPI=y
|
CONFIG_RT_USING_SPI=y
|
||||||
# CONFIG_RT_USING_QSPI is not set
|
# CONFIG_RT_USING_QSPI is not set
|
||||||
|
@ -284,9 +280,9 @@ CONFIG_SOC_STM32F407ZG=y
|
||||||
CONFIG_BSP_USING_GPIO=y
|
CONFIG_BSP_USING_GPIO=y
|
||||||
CONFIG_BSP_USING_UART=y
|
CONFIG_BSP_USING_UART=y
|
||||||
CONFIG_BSP_USING_UART1=y
|
CONFIG_BSP_USING_UART1=y
|
||||||
# CONFIG_BSP_USING_UART2 is not set
|
CONFIG_BSP_USING_UART2=y
|
||||||
CONFIG_BSP_USING_UART3=y
|
CONFIG_BSP_USING_UART3=y
|
||||||
CONFIG_BSP_USING_UART4=y
|
# CONFIG_BSP_USING_UART4 is not set
|
||||||
# CONFIG_BSP_USING_I2C1 is not set
|
# CONFIG_BSP_USING_I2C1 is not set
|
||||||
# CONFIG_BSP_USING_SPI is not set
|
# CONFIG_BSP_USING_SPI is not set
|
||||||
# CONFIG_BSP_USING_CH438 is not set
|
# CONFIG_BSP_USING_CH438 is not set
|
||||||
|
@ -330,12 +326,11 @@ CONFIG_CONNECTION_FRAMEWORK_DEBUG=y
|
||||||
# CONFIG_CONNECTION_ADAPTER_4G is not set
|
# CONFIG_CONNECTION_ADAPTER_4G is not set
|
||||||
# CONFIG_CONNECTION_ADAPTER_NB is not set
|
# CONFIG_CONNECTION_ADAPTER_NB is not set
|
||||||
# CONFIG_CONNECTION_ADAPTER_WIFI is not set
|
# CONFIG_CONNECTION_ADAPTER_WIFI is not set
|
||||||
# CONFIG_CONNECTION_ADAPTER_ETHERNET is not set
|
CONFIG_ADAPTER_HFA21_DRIVER="/dev/uart3"
|
||||||
CONFIG_CONNECTION_ADAPTER_BLUETOOTH=y
|
CONFIG_CONNECTION_ADAPTER_ETHERNET=y
|
||||||
CONFIG_ADAPTER_HC08=y
|
CONFIG_ADAPTER_HFA21_ETHERNET=y
|
||||||
CONFIG_ADAPTER_BLUETOOTH_HC08="hc08"
|
CONFIG_ADAPTER_ETHERNET_HFA21="hfa21_ethernet"
|
||||||
CONFIG_ADAPTER_HC08_WORK_ROLE="M"
|
# CONFIG_CONNECTION_ADAPTER_BLUETOOTH is not set
|
||||||
CONFIG_ADAPTER_HC08_DRIVER="/dev/uart4"
|
|
||||||
# CONFIG_CONNECTION_ADAPTER_ZIGBEE is not set
|
# CONFIG_CONNECTION_ADAPTER_ZIGBEE is not set
|
||||||
# CONFIG_CONNECTION_ADAPTER_5G is not set
|
# CONFIG_CONNECTION_ADAPTER_5G is not set
|
||||||
# CONFIG_SUPPORT_KNOWING_FRAMEWORK is not set
|
# CONFIG_SUPPORT_KNOWING_FRAMEWORK is not set
|
||||||
|
@ -384,6 +379,7 @@ CONFIG_MAIN_KTASK_STACK_SIZE=1024
|
||||||
#
|
#
|
||||||
# CONFIG_APPLICATION_SENSOR is not set
|
# CONFIG_APPLICATION_SENSOR is not set
|
||||||
# CONFIG_USING_EMBEDDED_DATABASE_APP is not set
|
# CONFIG_USING_EMBEDDED_DATABASE_APP is not set
|
||||||
|
# CONFIG_APP_USING_WEBNET is not set
|
||||||
|
|
||||||
#
|
#
|
||||||
# lib
|
# lib
|
||||||
|
|
|
@ -21,12 +21,10 @@
|
||||||
#define RT_USING_IDLE_HOOK
|
#define RT_USING_IDLE_HOOK
|
||||||
#define RT_IDLE_HOOK_LIST_SIZE 4
|
#define RT_IDLE_HOOK_LIST_SIZE 4
|
||||||
#define IDLE_THREAD_STACK_SIZE 256
|
#define IDLE_THREAD_STACK_SIZE 256
|
||||||
#define RT_USING_TIMER_SOFT
|
|
||||||
#define RT_TIMER_THREAD_PRIO 4
|
|
||||||
#define RT_TIMER_THREAD_STACK_SIZE 512
|
|
||||||
|
|
||||||
/* kservice optimization */
|
/* kservice optimization */
|
||||||
|
|
||||||
|
#define RT_KSERVICE_USING_STDLIB
|
||||||
#define RT_DEBUG
|
#define RT_DEBUG
|
||||||
#define RT_DEBUG_COLOR
|
#define RT_DEBUG_COLOR
|
||||||
|
|
||||||
|
@ -123,7 +121,6 @@
|
||||||
#define RT_USING_I2C
|
#define RT_USING_I2C
|
||||||
#define RT_USING_I2C_BITOPS
|
#define RT_USING_I2C_BITOPS
|
||||||
#define RT_USING_PIN
|
#define RT_USING_PIN
|
||||||
#define RT_USING_RTC
|
|
||||||
#define RT_USING_SPI
|
#define RT_USING_SPI
|
||||||
#define RT_USING_SPI_MSD
|
#define RT_USING_SPI_MSD
|
||||||
#define RT_USING_SFUD
|
#define RT_USING_SFUD
|
||||||
|
@ -174,8 +171,8 @@
|
||||||
#define BSP_USING_GPIO
|
#define BSP_USING_GPIO
|
||||||
#define BSP_USING_UART
|
#define BSP_USING_UART
|
||||||
#define BSP_USING_UART1
|
#define BSP_USING_UART1
|
||||||
|
#define BSP_USING_UART2
|
||||||
#define BSP_USING_UART3
|
#define BSP_USING_UART3
|
||||||
#define BSP_USING_UART4
|
|
||||||
#define BSP_USING_USB
|
#define BSP_USING_USB
|
||||||
#define BSP_USING_STM32_USBH
|
#define BSP_USING_STM32_USBH
|
||||||
#define USB_BUS_NAME "usb"
|
#define USB_BUS_NAME "usb"
|
||||||
|
@ -196,11 +193,10 @@
|
||||||
#define ADD_RTTHREAD_FETURES
|
#define ADD_RTTHREAD_FETURES
|
||||||
#define SUPPORT_CONNECTION_FRAMEWORK
|
#define SUPPORT_CONNECTION_FRAMEWORK
|
||||||
#define CONNECTION_FRAMEWORK_DEBUG
|
#define CONNECTION_FRAMEWORK_DEBUG
|
||||||
#define CONNECTION_ADAPTER_BLUETOOTH
|
#define ADAPTER_HFA21_DRIVER "/dev/uart3"
|
||||||
#define ADAPTER_HC08
|
#define CONNECTION_ADAPTER_ETHERNET
|
||||||
#define ADAPTER_BLUETOOTH_HC08 "hc08"
|
#define ADAPTER_HFA21_ETHERNET
|
||||||
#define ADAPTER_HC08_WORK_ROLE "M"
|
#define ADAPTER_ETHERNET_HFA21 "hfa21_ethernet"
|
||||||
#define ADAPTER_HC08_DRIVER "/dev/uart4"
|
|
||||||
|
|
||||||
/* Security */
|
/* Security */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue