Skip to content

Conversation

@Otpvondoiats
Copy link
Contributor

Summary

1. Sensor Device Information Query (Commit: 81edbcf)

  • Added -i option to retrieve and display sensor device information based on topic
  • Displays comprehensive sensor metadata including name, vendor, version, power consumption, measurement ranges, resolution, delay parameters, and FIFO capacity

2. Sensor Flush Functionality (Commit: 415ed6c)

  • Implemented -f option to flush sensor driver data
  • Changed record-to-file option from -f to -s to avoid conflict
  • Supports flushing multiple topics simultaneously with comma-separated topic names
  • Uses poll() with POLLPRI events to wait for SENSOR_EVENT_FLUSH_COMPLETE notification
  • Provides detailed result reporting showing success/failure status for each flushed topic
  • Includes timeout mechanism (default: 5 seconds) to prevent indefinite waiting

3. Flush Error Reporting Enhancement (Commit: c62dd40)

  • Added detailed error messages when flush operation fails
  • Reports topic name, instance, and error code for failed flush attempts
  • Improves debugging experience by providing immediate failure feedback

Impact

User Impact:

  • New command-line options:
    • -i: Get sensor device information
    • -f: Flush sensor data (previously used for file recording)
    • -s: Record to file (moved from -f)
  • Breaking change: Users relying on -f for file recording must switch to -s

Functionality Impact:

  • Enables runtime sensor capability inspection
  • Provides explicit flush control for sensor data pipelines
  • Improves observability with detailed error messages
  • No impact on existing subscription/listening functionality

Build Impact:

  • No new dependencies introduced
  • All changes are within system/uorb/listener.c
  • Memory allocations use standard calloc() with proper cleanup

Documentation Impact:

  • Help text updated to reflect new options and option changes
  • Usage examples provided in commit messages

Testing

ap> uorb_listener -i sensor_accel
Topic [sensor_accel0] info:
        name:BMI270 Accelerometer
        vendor:Bosch
        version:3
        power:0.010000
        max_range:78.480003
        resolution:0.002400
        min_delay:20000
        max_delay:40000
        fifo_reserved_event_count:40
        fifo_max_event_count:40

ap> uorb_listener -f sensor_accel
Result:
        Topic [sensor_accel0] flush: SUCCESS.
Total number of flush topics: 1
ap> uorb_listener -f sensor_accel,sensor_gyro
Result:
        Topic [sensor_gyro0] flush: SUCCESS.
        Topic [sensor_accel0] flush: SUCCESS.
Total number of flush topics: 2
ap> uorb_listener -i sensor_accel,sensor_gyro
Topic [sensor_gyro0] info:
        name:BMI270 Gyroscope
        vendor:Bosch
        version:3
        power:0.410000
        max_range:34.910000
        resolution:0.001060
        min_delay:20000
        max_delay:40000
        fifo_reserved_event_count:40
        fifo_max_event_count:40

Topic [sensor_accel0] info:
        name:BMI270 Accelerometer
        vendor:Bosch
        version:3
        power:0.010000
        max_range:78.480003
        resolution:0.002400
        min_delay:20000
        max_delay:40000
        fifo_reserved_event_count:40
        fifo_max_event_count:40

ap>

add get sensor device information based on topic.

Signed-off-by: likun17 <likun17@xiaomi.com>
uorb/listener.c: Added flush function.
aurora:/ # uorb_listener -f sensor_accel_uncal,sensor_mag_uncal,sensor_aaa
Waited for 5 seconds without flush complete event. Giving up. err:25

Result:
        Topic [sensor_mag_uncal0] flush: FAILURE. [-1]
        Topic [sensor_accel_uncal0] flush: SUCCESS.
Total number of flush topics: 1/2

Signed-off-by: likun17 <likun17@xiaomi.com>
Copy link
Contributor

@acassis acassis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uorb/listener:Added flush failure prompt information.

Signed-off-by: likun17 <likun17@xiaomi.com>
@Otpvondoiats
Copy link
Contributor Author

@Otpvondoiats please update the Documentation: https://nuttx.apache.org/docs/latest/applications/system/uorb/index.html#uorb-listener

Okay, it will be synced to the document shortly.

@Otpvondoiats
Copy link
Contributor Author

@acassis hi,I've merged your comment into the last submission.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants