This commit is contained in:
wgzAIIT
2022-07-28 14:29:18 +08:00
11 changed files with 99 additions and 16 deletions
@@ -571,6 +571,10 @@ config NSH_DISABLE_CO2ZG09
bool "Disable the sensor zg09."
default n
config NSH_DISABLE_CO2G8S
bool "Disable the sensor g8-s."
default n
config NSH_DISABLE_PM1_0PS5308
bool "Disable the pm1.0 function of the sensor ps5308."
default n
@@ -1478,6 +1478,10 @@ int nsh_foreach_var(FAR struct nsh_vtbl_s *vtbl, nsh_foreach_var_t cb,
int cmd_Co2Zg09(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
#endif
#if defined(CONFIG_APPLICATION_SENSOR_CO2_G8S) && !defined(CONFIG_NSH_DISABLE_CO2G8S)
int cmd_Co2G8S(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
#endif
#if defined(CONFIG_APPLICATION_SENSOR_PM1_0_PS5308) && !defined(CONFIG_NSH_DISABLE_PM1_0PS5308)
int cmd_Pm10Ps5308(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
#endif
@@ -138,6 +138,21 @@ int cmd_Co2Zg09(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
}
#endif
/****************************************************************************
* Name: cmd_Co2g8s
****************************************************************************/
#if defined(CONFIG_APPLICATION_SENSOR_CO2_G8S) && !defined(CONFIG_NSH_DISABLE_CO2G8S)
extern void Co2G8s(void);
int cmd_Co2G8S(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
nsh_output(vtbl, "Hello, world!\n");
FrameworkInit();
Co2G8s();
return OK;
}
#endif
/****************************************************************************
* Name: cmd_Pm10Ps5308
****************************************************************************/
@@ -624,6 +624,10 @@ static const struct cmdmap_s g_cmdmap[] =
{ "zg09", cmd_Co2Zg09, 1, 1, "[get the concentration of co2 with sensor ZG09.]" },
#endif
#if defined(CONFIG_APPLICATION_SENSOR_CO2_G8S) && !defined(CONFIG_NSH_DISABLE_CO2G8S)
{ "g8s", cmd_Co2G8S, 1, 1, "[get the concentration of co2 with sensor G8S.]" },
#endif
#if defined(CONFIG_APPLICATION_SENSOR_PM1_0_PS5308) && !defined(CONFIG_NSH_DISABLE_PM1_0PS5308)
{ "pm1.0", cmd_Pm10Ps5308, 1, 1, "[get pm1.0 with sensor Ps5308.]" },
#endif