Simplify Modem DB Delete by Using DB_Flags #363
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed change
Contrary to the Insteon Specification, it appears the DB Flags can be used in the Delete command. While using 0x00 for the flags worked in most circumstances, it appears that in some cases for an unknown reason the Delete command would fail on USB Dongle style PLMs. It is possible that the command was also failing on other PLM styles as well and was not noticed or reported.
Using the DB_Flags is a net win, 1) it simplifies the delete functionality significantly and 2) it seems to solve the problem wherein entries could not be deleted.
This change removes the complicated Command_Seq wherein the modem first had to be searched for records to delete, the records were deleted and any necessary restored records were restored.
Now, the delete function simply takes an entry and deletes it. If a nack is return, it is likely that the entry does not exist on the device and a clear error message is returned to the user.
Additional information
Checklist