Currently, if the target GPIO port is opened when the node starts, the node exits with an error status.
This PR checks the status of the target GPIO port, closes it if it is in use, and tries to open it on node boot.
Before merging this PR, the node should exit with a message like Failed to initialize GPIO trigger. ... while should not after merging
Remarks
Even if there is another process that uses a specified GPIO port properly, the ownership of the GPIO port is forcely taken by this sensor_trigger node. This PR intends to make sensor_trigger node work properly under the condition that some processes (including previous run of sensor_trigger) exit unexpectedly and the target GPIO port is not closed correctly.
Pre-Review Checklist for the PR Author
PR Author should check the checkboxes below when creating the PR.
[x] Assign PR to reviewer
Checklist for the PR Reviewer
Reviewers should check the checkboxes below before approval.
[ ] Commits are properly organized and messages are according to the guideline
[ ] (Optional) Unit tests have been written for new behavior
[ ] PR title describes the changes
Post-Review Checklist for the PR Author
PR Author should check the checkboxes below before merging.
[ ] All open points are addressed and tracked via issues or tickets
CI Checks
Build and test for PR: Required to pass before the merge.
PR Type
Related Links
Description
Currently, if the target GPIO port is opened when the node starts, the node exits with an error status. This PR checks the status of the target GPIO port, closes it if it is in use, and tries to open it on node boot.
Review Procedure
Before merging this PR, the node should exit with a message like
Failed to initialize GPIO trigger. ...
while should not after mergingRemarks
Even if there is another process that uses a specified GPIO port properly, the ownership of the GPIO port is forcely taken by this
sensor_trigger
node. This PR intends to makesensor_trigger
node work properly under the condition that some processes (including previous run ofsensor_trigger
) exit unexpectedly and the target GPIO port is not closed correctly.Pre-Review Checklist for the PR Author
PR Author should check the checkboxes below when creating the PR.
Checklist for the PR Reviewer
Reviewers should check the checkboxes below before approval.
Post-Review Checklist for the PR Author
PR Author should check the checkboxes below before merging.
CI Checks