Table of Contents
leishen_m10p_close
Closes a Leishen M10P sensor.
Description
The leishen_m10p_close function closes a Leishen M10P sensor, releasing any allocated resources. Once the sensor has been closed, the sensor handle is no longer valid and may not be used.
Prototype
t_error leishen_m10p_close(t_ranging_sensor sensor);
Parameters
t_ranging_sensor sensor
A handle to the sensor, as returned by leishen_m10p_open.
Return value
The return value is 0 if the sensor is closed successfully. Otherwise a negative
error code is returned. Error codes are
defined in quanser_errors.h
. A suitable error message
may be retrieved using msg_get_error_message.
Error codes
QERR_INVALID_ARGUMENT
An invalid Leishen M10P sensor handle was passed as an argument. Once a sensor has been closed using leishen_m10p_close the handle is invalid.
Requirements
Include Files |
Libraries |
---|---|
quanser_ranging_sensor.h |
quanser_devices.lib;quanser_communications.lib;quanser_runtime.lib;quanser_common.lib |
Examples
t_ranging_sensor lidar; t_error result = leishen_m10p_open("serial://localhost:0?baud='512000',word='8',parity='none',stop='1',flow='none',device='/dev/lidar'", RANGING_DISTANCE_LONG, &lidar); if (result == 0) { ... leishen_m10p_close(lidar); } else { TCHAR message[512]; msg_get_error_message(NULL, result, message, sizeof(message)); _tprintf(_T("Failed to open RPLidar. %s (error %d)\n"), message, -result); }
See Also
Copyright ©2024 Quanser Inc. This page was generated 2024-10-17. Submit feedback to Quanser about this page.
Link to this page.