forked from xuos/xiuos
support E18 zigbee for nuttx on xidatong-riscv64
This commit is contained in:
parent
31f03a56d6
commit
c4ab73350b
|
@ -47,29 +47,25 @@ if ADD_XIZI_FETURES
|
|||
endif
|
||||
|
||||
if ADD_NUTTX_FETURES
|
||||
config ADAPTER_E18_MODEPIN
|
||||
int "E18 MODE pin number"
|
||||
default "61"
|
||||
config ADAPTER_E18_MODE_PATH
|
||||
string "E18 MODE pin device"
|
||||
default "/dev/gpio2"
|
||||
|
||||
config ADAPTER_E18_PIN_DRIVER
|
||||
string "E18 device pin driver path"
|
||||
default "/dev/pin_dev"
|
||||
config ADAPTER_E18_DRIVER_EXTUART
|
||||
bool "Using extra uart to support zigbee"
|
||||
default y
|
||||
|
||||
config ADAPTER_E18_DRIVER
|
||||
string "E18 device uart driver path"
|
||||
default "/dev/ttyS1"
|
||||
depends on !ADAPTER_E18_DRIVER_EXTUART
|
||||
---help---
|
||||
If USART1 is selected, then fill in /dev/ttyS1 here.
|
||||
|
||||
config ADAPTER_E18_DRIVER
|
||||
string "E18 device uart driver path"
|
||||
default "/dev/ttyS1"
|
||||
depends on !ADAPTER_E18_DRIVER_EXTUART
|
||||
---help---
|
||||
If USART1 is selected, then fill in /dev/ttyS1 here.
|
||||
|
||||
if ADAPTER_E18_DRIVER_EXTUART
|
||||
config ADAPTER_E18_DRIVER
|
||||
string "E18 device extra uart driver path"
|
||||
default "/dev/extuart_dev1"
|
||||
|
||||
config ADAPTER_E18_DRIVER_EXT_PORT
|
||||
int "if E18 device using extuart, choose port"
|
||||
default "1"
|
||||
if ADAPTER_E18_DRIVER_EXTUART
|
||||
config ADAPTER_E18_DRIVER
|
||||
string "E18 device extra uart driver path"
|
||||
default "/dev/extuart_dev1"
|
||||
endif
|
||||
|
||||
endif
|
||||
|
|
|
@ -42,6 +42,9 @@ char *cmd_set_ch = "AT+CH=11"; /*set channel as 11*/
|
|||
|
||||
static int E18HardwareModeGet()
|
||||
{
|
||||
#ifdef ADD_NUTTX_FETURES
|
||||
return E18_AS_HEX_MODE;
|
||||
#else
|
||||
int ret = 0;
|
||||
int pin_fd;
|
||||
|
||||
|
@ -62,7 +65,8 @@ static int E18HardwareModeGet()
|
|||
} else {
|
||||
printf(" E18 as HEX mode\n");
|
||||
return E18_AS_HEX_MODE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef ADD_NUTTX_FETURES
|
||||
|
@ -175,9 +179,15 @@ static int E18NetworkModeConfig(struct Adapter *adapter)
|
|||
}
|
||||
|
||||
out:
|
||||
if(E18_AS_AT_MODE == mode){
|
||||
#ifdef ADD_NUTTX_FETURES
|
||||
if(E18_AS_HEX_MODE == mode)
|
||||
#else
|
||||
if(E18_AS_AT_MODE == mode)
|
||||
#endif
|
||||
{
|
||||
AtCmdConfigAndCheck(adapter->agent, cmd_exit, "+OK");
|
||||
}
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -242,7 +252,12 @@ static int E18NetRoleConfig(struct Adapter *adapter)
|
|||
}
|
||||
|
||||
out:
|
||||
if(E18_AS_AT_MODE == mode) {
|
||||
#ifdef ADD_NUTTX_FETURES
|
||||
if(E18_AS_HEX_MODE == mode)
|
||||
#else
|
||||
if(E18_AS_AT_MODE == mode)
|
||||
#endif
|
||||
{
|
||||
AtCmdConfigAndCheck(adapter->agent, cmd_exit, "+OK");
|
||||
}
|
||||
|
||||
|
@ -384,7 +399,12 @@ static int E18Join(struct Adapter *adapter, unsigned char *priv_net_group)
|
|||
|
||||
// }
|
||||
if(!ret){
|
||||
if(E18_AS_AT_MODE == mode) {
|
||||
#ifdef ADD_NUTTX_FETURES
|
||||
if(E18_AS_HEX_MODE == mode)
|
||||
#else
|
||||
if(E18_AS_AT_MODE == mode)
|
||||
#endif
|
||||
{
|
||||
ret = AtCmdConfigAndCheck(adapter->agent, cmd_exit, "+OK");
|
||||
if(ret < 0) {
|
||||
printf("%s %d cmd[%s] config failed!\n",__func__,__LINE__,cmd_exit);
|
||||
|
|
Loading…
Reference in New Issue