diff --git a/applications/connection_demo/zigbee_demo/zigbee_receive_demo.c b/applications/connection_demo/zigbee_demo/zigbee_receive_demo.c index 3de9bcc20..74032013f 100644 --- a/applications/connection_demo/zigbee_demo/zigbee_receive_demo.c +++ b/applications/connection_demo/zigbee_demo/zigbee_receive_demo.c @@ -22,7 +22,8 @@ #include #include #include -#include "../applications/user_api/switch_api/user_api.h" +#include +#include static int re_sem; static int buff_sem; @@ -77,9 +78,10 @@ void ZigbeeReceiveDemo(int argc, char *argv[]) } +#ifndef SEPARATE_COMPILE SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_MAIN), ZigbeeReceiveDemo, ZigbeeReceiveDemo, zigbee receive function ); - +#endif diff --git a/applications/connection_demo/zigbee_demo/zigbee_send_demo.c b/applications/connection_demo/zigbee_demo/zigbee_send_demo.c index d2749f026..2dc6d3e5f 100644 --- a/applications/connection_demo/zigbee_demo/zigbee_send_demo.c +++ b/applications/connection_demo/zigbee_demo/zigbee_send_demo.c @@ -22,7 +22,7 @@ #include #include #include - +#include adapter_t padapter; /* a demo function to send message through command line using zigbee*/ /* first open zigbee to start demo*/ @@ -32,20 +32,21 @@ void ZigbeeOpenDemo() // adapter_t padapter = ZigbeeAdapterFind("zigbee"); padapter = ZigbeeAdapterFind("zigbee"); if (NONE == padapter){ - KPrintf("adapter find failed!\n"); + printf("adapter find failed!\n"); return; } /*Open adapter*/ if (0 != padapter->done.NetAiitOpen(padapter)){ - KPrintf("adapter open failed!\n"); + printf("adapter open failed!\n"); return; } } +#ifndef SEPARATE_COMPILE SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_MAIN), ZigbeeOpenDemo, ZigbeeOpenDemo, zigbee send function ); - +#endif void ZigbeeSendDemo(int argc, char *argv[]) { @@ -54,8 +55,9 @@ void ZigbeeSendDemo(int argc, char *argv[]) padapter->done.NetAiitSend(padapter, argv[1], strlen(argv[1]) ,true,10000,0, NULL,&v,NULL); } +#ifndef SEPARATE_COMPILE SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_MAIN), ZigbeeSendDemo, ZigbeeSendDemo, zigbee send function ); - +#endif diff --git a/framework/connection/Adapter/zigbee/xs_adaper_zigbee_register.c b/framework/connection/Adapter/zigbee/xs_adaper_zigbee_register.c index ccdcaa2db..336e34c5b 100644 --- a/framework/connection/Adapter/zigbee/xs_adaper_zigbee_register.c +++ b/framework/connection/Adapter/zigbee/xs_adaper_zigbee_register.c @@ -20,7 +20,7 @@ */ #include #include - +#include /* initialize to the register list*/ int RegisterAdapterZigbee(void) { diff --git a/framework/connection/Adapter/zigbee/xs_adapter_zigbee.c b/framework/connection/Adapter/zigbee/xs_adapter_zigbee.c index 0ed2abde6..97b7c9104 100644 --- a/framework/connection/Adapter/zigbee/xs_adapter_zigbee.c +++ b/framework/connection/Adapter/zigbee/xs_adapter_zigbee.c @@ -20,10 +20,14 @@ */ #include "xs_adapter_zigbee.h" -#include "../applications/user_api/switch_api/user_api.h" -#include "../applications/user_api/include/bus_serial.h" -#include "../applications/user_api/include/dev_serial.h" +// #include "../applications/user_api/switch_api/user_api.h" +// #include "../applications/user_api/include/bus_serial.h" +// #include "../applications/user_api/include/dev_serial.h" +#include +#include +#include +#include #ifdef CONNECTION_COMMUNICATION_ZIGBEE_AIIT #define SAMPLE_UART_NAME "/dev/extuart_dev0" int use_aiit = 1; @@ -63,9 +67,9 @@ int ZigbeeOpen(struct Adapter *padapter) cfg.port_configure = 0; } - ioctl(serial_fd, OPE_INT, &cfg); + ioctl(serial_fd, 0, &cfg); UserTaskDelay(1000); - KPrintf("Zigbee ready\n"); + printf("Zigbee ready\n"); return 0; } @@ -157,11 +161,12 @@ void ZigbeeSettingDemo(int argc, char *argv[]) UserTaskDelay(500); write(serial_fd,set5,strlen(set5)); UserTaskDelay(500); - KPrintf("zigbee setting success!\n"); + printf("zigbee setting success!\n"); } +#ifndef SEPARATE_COMPILE SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_MAIN), ZigbeeSettingDemo, ZigbeeSettingDemo, zigbee send function ); - +#endif void ZigbeeClose(struct Adapter *padapter) {