Note: Commands without sensor_id will apply to all sensors
Commands:
list List all sensors
enable [sensor_id] Enable specified sensor
disable [sensor_id] Disable specified sensor
read [sensor_id] Read sensor data once
monitor [sensor_id] Monitor sensor data continuously
Monitor Options:
-i, --interval <ms> Set sampling interval (default: 1000ms)
-c, --count <num> Set number of readings (default: infinite)
-t, --time <sec> Set monitoring duration in seconds (default: infinite)
```
if (readAll) {
printf("----------------------------------------\n");
}
for (int32_t i = 0; i < numSensors; i++) {
int32_t currentSensorId = readAll ? g_sensorInfo.sensorId : sensorId;
if (readCount >= 0) {
printf("\nTrying to read data from sensor %d (%s):\n", currentSensorId, GetSensorName(currentSensorId));
}
int32_t ret = g_sensorDev->ReadData(currentSensorId, events);
if (ret != 0) {
printf("Failed to read sensor %d (%s) data%s\n",
currentSensorId, GetSensorName(currentSensorId),
readCount >= 0 ? (", ret=" + std::to_string(ret)).c_str() : "");
if (readCount >= 0) {
fflush(stdout);
}
continue;
}