Updated: October 28, 2024 |
Sensors that aren't already supported by the Sensor Framework for QNX SDP can be provided by an external sensor driver library.
You may provide a library that supports an external sensor. To use an external sensor driver library, you must:
Optionally, you can provide implementations for these function types:
For more information about the specifics to implement, see external_sensor_api.h in Sensor Library Reference for each of the functions.sensor_external_sensor_t external_sensor_defs = { open: my_external_open_sensor, close: my_external_close_sensor, init: my_external_init_sensor, deinit: my_external_deinit_sensor, start_streaming: my_start_streaming_sensor, stop_streaming: my_stop_streaming_sensor, get_packet: my_get_packet, get_buffer_requirements: my_get_buffer_requirements, get_time: my_gettime, parse_config: my_parse_config, set_sensor_metadata: my_set_sensor_metadata, get_metadata_limits: my_get_metadata_limits, fill_format_info: my_fill_format };
#define EXTERNAL_SENSOR_API_IMPLEMENT #include <sensor/external_sensor_api.h>
An example of an external sensor driver implementation is available with the Sensor Framework for QNX SDP from the QNX Software Center. See the source directory for more information in your host installation at $QNX_BASE/source/adas-sensor-examples-version.zip. After you extract the ZIP file, you'll find the example at extraction_directory/source_package_adas_sensor/lib/sensor_drivers/external_sensor_example.