fix zigbee compile problem when separate compiling
This commit is contained in:
parent
d88e575a99
commit
caace9f454
|
@ -22,7 +22,8 @@
|
|||
#include <string.h>
|
||||
#include <xs_klist.h>
|
||||
#include <xs_adapter_manager.h>
|
||||
#include "../applications/user_api/switch_api/user_api.h"
|
||||
#include <user_api.h>
|
||||
#include <string.h>
|
||||
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
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include <string.h>
|
||||
#include <xs_klist.h>
|
||||
#include <xs_adapter_manager.h>
|
||||
|
||||
#include <string.h>
|
||||
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
|
||||
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
*/
|
||||
#include <xs_adapter_zigbee.h>
|
||||
#include <xs_adapter_manager.h>
|
||||
|
||||
#include <string.h>
|
||||
/* initialize to the register list*/
|
||||
int RegisterAdapterZigbee(void)
|
||||
{
|
||||
|
|
|
@ -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 <user_api.h>
|
||||
#include <bus_serial.h>
|
||||
#include <dev_serial.h>
|
||||
#include <string.h>
|
||||
#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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue