diff --git a/applications/app_newlib/fs_syscalls.c b/applications/app_newlib/fs_syscalls.c index 38f25ebd..99fe27dc 100644 --- a/applications/app_newlib/fs_syscalls.c +++ b/applications/app_newlib/fs_syscalls.c @@ -28,7 +28,7 @@ Modification: Use file system functions #include #include -#include "../user_api/switch_api/user_api.h" +#include int _close_r(struct _reent *ptr, int fd) { diff --git a/applications/app_newlib/mem_syscalls.c b/applications/app_newlib/mem_syscalls.c index b64f3576..967aa66b 100644 --- a/applications/app_newlib/mem_syscalls.c +++ b/applications/app_newlib/mem_syscalls.c @@ -26,7 +26,7 @@ Author: AIIT XUOS Lab Modification: Use malloc, realloc, calloc and free functions *************************************************/ -#include "../user_api/switch_api/user_api.h" +#include void *_malloc_r (struct _reent *ptr, size_t size) { diff --git a/applications/connection_demo/nbiot_demo/nbiot_demo.c b/applications/connection_demo/nbiot_demo/nbiot_demo.c index 40219762..a3c7d97f 100644 --- a/applications/connection_demo/nbiot_demo/nbiot_demo.c +++ b/applications/connection_demo/nbiot_demo/nbiot_demo.c @@ -28,8 +28,6 @@ extern void RegisterAdapterNBIoT(void); void NbiotEnable(void) { - RegisterAdapterNBIoT(); - struct AdapterAT* at_adapter = ATAdapterFind(NBIOT_ADAPTER_ID); UserTaskDelay(5000); diff --git a/applications/framework_init.c b/applications/framework_init.c index 20ef0327..80b53092 100644 --- a/applications/framework_init.c +++ b/applications/framework_init.c @@ -17,6 +17,7 @@ extern int SensorFrameworkInit(void); extern int RegisterAdapterEthernet(void); extern int RegisterAdapterWifi(void); extern int RegisterAdapterZigbee(void); +extern int RegisterAdapterNBIoT(void); extern int LoraSx12xxSpiDeviceInit(); extern int D124VoiceInit(void); @@ -100,6 +101,10 @@ static struct InitDesc connection_desc[] = #ifdef CONNECTION_COMMUNICATION_ZIGBEE { "zigbee adpter", RegisterAdapterZigbee}, #endif + +#ifdef CONNECTION_COMMUNICATION_NB_IOT + { "NB-IoT adpter", RegisterAdapterNBIoT}, +#endif { "NULL", NULL }, }; diff --git a/applications/sensor_app/co2_zg09.c b/applications/sensor_app/co2_zg09.c index 997700de..113fecff 100644 --- a/applications/sensor_app/co2_zg09.c +++ b/applications/sensor_app/co2_zg09.c @@ -18,7 +18,7 @@ * @date 2021.04.23 */ -#include "../user_api/switch_api/user_api.h" +#include #include /** diff --git a/applications/sensor_app/humidity_hs300x.c b/applications/sensor_app/humidity_hs300x.c index 53779737..be3ab441 100644 --- a/applications/sensor_app/humidity_hs300x.c +++ b/applications/sensor_app/humidity_hs300x.c @@ -18,7 +18,7 @@ * @date 2021.04.23 */ -#include "../user_api/switch_api/user_api.h" +#include #include /** diff --git a/applications/sensor_app/pm1_0_ps5308.c b/applications/sensor_app/pm1_0_ps5308.c index b2c09c51..6ff29ecd 100644 --- a/applications/sensor_app/pm1_0_ps5308.c +++ b/applications/sensor_app/pm1_0_ps5308.c @@ -18,7 +18,7 @@ * @date 2021.04.23 */ -#include "../user_api/switch_api/user_api.h" +#include #include /** diff --git a/applications/sensor_app/temperature_hs300x.c b/applications/sensor_app/temperature_hs300x.c index 4df9f7d3..0730fdfb 100644 --- a/applications/sensor_app/temperature_hs300x.c +++ b/applications/sensor_app/temperature_hs300x.c @@ -18,7 +18,7 @@ * @date 2021.04.23 */ -#include "../user_api/switch_api/user_api.h" +#include #include /** diff --git a/applications/sensor_app/voice_d124.c b/applications/sensor_app/voice_d124.c index 2bc1f7b6..57bceabd 100644 --- a/applications/sensor_app/voice_d124.c +++ b/applications/sensor_app/voice_d124.c @@ -18,7 +18,7 @@ * @date 2021.04.23 */ -#include "../user_api/switch_api/user_api.h" +#include #include /** diff --git a/framework/connection/Adapter/include/xs_adapter_at_nbiot.h b/framework/connection/Adapter/include/xs_adapter_at_nbiot.h index ed1f0763..115dc050 100644 --- a/framework/connection/Adapter/include/xs_adapter_at_nbiot.h +++ b/framework/connection/Adapter/include/xs_adapter_at_nbiot.h @@ -25,7 +25,10 @@ #include "xs_adapter_at.h" #include "xs_adapter_at_agent.h" #include "xs_adapter_def.h" -#include "../../../applications/user_api/switch_api/user_api.h" + +#include +#include +#include #define MAX_SOCKET_NUM 8 diff --git a/framework/connection/Adapter/nbiot/bc28/xs_adapter_at_nbiot.c b/framework/connection/Adapter/nbiot/bc28/xs_adapter_at_nbiot.c index 44e37d09..6fde6322 100644 --- a/framework/connection/Adapter/nbiot/bc28/xs_adapter_at_nbiot.c +++ b/framework/connection/Adapter/nbiot/bc28/xs_adapter_at_nbiot.c @@ -156,8 +156,11 @@ int NBIoTSocketCreate(struct AdapterAT *adapterAT, uint8_t socket_fd, uint8_t ty printf("cmd : %s\n", at_cmd); ATOrderSend(adapterAT->agent, REPLY_TIME_OUT, reply, at_cmd); - MdelayKTask(3000); - printf("bak : %s\n", adapterAT->agent->maintain_buffer); + UserTaskDelay(3000); + printf("bak : "); + for(int i = 0; i < strlen(reply->reply_buffer); i++) + printf(" 0x%02x", reply->reply_buffer[i]); + printf("\n"); struct Socket (*socketlist)[MAX_SOCKET_NUM] = &adapterAT->socket; memset(socketlist[socket_fd], 0, sizeof(struct Socket)); @@ -219,7 +222,7 @@ int NBIoTSocketConnect(struct AdapterAT *adapterAT , uint8_t socket_fd , struct printf("cmd : %s\n", at_cmd); ATOrderSend(adapterAT->agent, REPLY_TIME_OUT, reply, at_cmd); - MdelayKTask(300); + UserTaskDelay(300); socketlist[socket_fd]->dst_ip = dst_ip; socketlist[socket_fd]->dst_port = dst_port; @@ -267,7 +270,7 @@ int NBIoTSocketClose(struct AdapterAT *adapterAT, uint8_t socket_fd ) printf("cmd : %s\n", at_cmd); ATOrderSend(adapterAT->agent, REPLY_TIME_OUT, reply, at_cmd); - MdelayKTask(300); + UserTaskDelay(300); memset(socketlist[socket_fd], 0, sizeof(struct Socket)); @@ -325,7 +328,7 @@ int NbiotSend(struct Adapter *padapter, const char* data, int len, bool block, i printf("cmd : %s\n", at_cmd); ATOrderSend(adapterAT->agent, REPLY_TIME_OUT, reply, at_cmd); - MdelayKTask(300); + UserTaskDelay(300); __exit: if (reply) { diff --git a/tool/shell/letter-shell/cmd.c b/tool/shell/letter-shell/cmd.c index de93fc44..20c0d686 100644 --- a/tool/shell/letter-shell/cmd.c +++ b/tool/shell/letter-shell/cmd.c @@ -33,7 +33,7 @@ long Version(void) 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, - Version,Version, show xios Version information); + Version,Version, show XiUOS Version information); static __inline void PrintSpace(int len) {