Closed bytedreamer closed 12 months ago
I disagree. If the reader is defined but not present I think it's perfectly reasonable to comset a reader to that address. This scenario happens today in the real world where people ship a reader at address 0 and in the field it has to be moved to a different address. It is realistic IMO to encounter situations where the EAC has already had the reader defined at it's destination address.
Good point about replacing reader scenario. There is an underlining collection of devices that requires unique addresses for each bus. In order to ensure data integrity, it is necessary for the EAC not to have multiple devices with the same address. With this change, the EAC can still perform a reader replacement. The OSDP.Net library would need the following steps to implement.
I may add a helper function in the future to reduce the steps involved with a swapping device addresses. This is how osdp_COMSET has always been done in the test console, except for step 1. The change I made is to explicitly enforce the unique address constraint. This will ensure that the EAC does the require steps shown above. Otherwise, the EAC could experience unexpected behavior after sending the osdp_COMSET command to an existing device on that address.
The library should prevent sending a request to change to an address that is already assigned to an existing reader.