You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/08/08 02:50:00 UTC

[GitHub] [incubator-nuttx-apps] lupyuen opened a new pull request, #1256: testing/sensortest: Update device path

lupyuen opened a new pull request, #1256:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1256

   ## Summary
   
   Device Paths for NuttX Sensors are now named `/dev/sensor/sensor_...` according to [drivers/sensors/sensor.c](https://github.com/apache/incubator-nuttx/blob/3fdd036ba6eee2ffd76cfba561ab1b044e3275e2/drivers/sensors/sensor.c#L49):
   
   ```c
   #define DEVNAME_FMT        "/dev/sensor/sensor_%s%s%d"
   ```
   
   `sensortest` fails to open any sensor because it's using the old Device Path:
   
   ```text
   nsh> sensortest -n 1 baro0
   Failed to open device:/dev/sensor/baro0, ret:No such file or directory
   
   nsh> sensortest -n 1 sensor_baro0
   The sensor node name:sensor_baro0 is invalid
   
   nsh> ls /dev/sensor
   /dev/sensor:
    sensor_baro0
    sensor_humi0
   ```
   
   This patch updates the Device Path in `sensortest` so that it can open the sensor correctly.
   
   Hi @Donny9 I hope this patch is correct? Thanks!
   
   ## Impact
   
   After applying the patch, `sensortest` can access the sensor correctly at `/dev/sensor/sensor_...`
   
   ## Testing
   
   Tested with [BME280 Driver](https://github.com/lupyuen/bme280-nuttx) on BL602:
   
   ```text
   nsh> sensortest -n 1 baro0
   SensorTest: Test /dev/sensor/sensor_baro0 with interval(1000000us), latency(0us)
   baro0: timestamp:14060000 value1:1007.14 value2:29.73
   SensorTest: Received message: baro0, number:1/1
   
   nsh> sensortest -n 1 humi0
   SensorTest: Test /dev/sensor/sensor_humi0 with interval(1000000us), latency(0us)
   humi0: timestamp:20940000 value:74.96
   SensorTest: Received message: humi0, number:1/1
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx-apps] Donny9 commented on pull request #1256: testing/sensortest: Update device path

Posted by GitBox <gi...@apache.org>.
Donny9 commented on PR #1256:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1256#issuecomment-1207634789

   > Thanks, I'll cancel this PR.
   
   @lupyuen  LGTM, we need this patch, and i will commit a new patch about "/dev/sensor/" -> "/dev/topic/", because this directory contains all topics, not just sensors.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx-apps] Donny9 commented on a diff in pull request #1256: testing/sensortest: Update device path

Posted by GitBox <gi...@apache.org>.
Donny9 commented on code in PR #1256:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1256#discussion_r939801671


##########
testing/sensortest/sensortest.c:
##########
@@ -37,7 +37,7 @@
  ****************************************************************************/
 
 #define ARRAYSIZE(a)       (sizeof(a) / sizeof(a)[0])
-#define DEVNAME_FMT        "/dev/sensor/%s"
+#define DEVNAME_FMT        "/dev/sensor/sensor_%s"

Review Comment:
   revert. let's add prefix "sensor_" for g_sensor_info.name. And using sensor_baro0 to test sensor device.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx-apps] lupyuen commented on pull request #1256: testing/sensortest: Update device path

Posted by GitBox <gi...@apache.org>.
lupyuen commented on PR #1256:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1256#issuecomment-1207631761

   Thanks, I'll cancel this PR.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx-apps] lupyuen closed pull request #1256: testing/sensortest: Update device path

Posted by GitBox <gi...@apache.org>.
lupyuen closed pull request #1256: testing/sensortest: Update device path
URL: https://github.com/apache/incubator-nuttx-apps/pull/1256


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx-apps] xiaoxiang781216 merged pull request #1256: testing/sensortest: Update device path

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged PR #1256:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1256


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org