BACnetStack_UpdateDeviceInstance
bool BACnetStack_UpdateDeviceInstance( const uint32_t oldDeviceInstance, const uint32_t newDeviceInstance);Changes a device’s instance number, in the database and - for a device on a virtual network - in the virtual router’s mapping.
newDeviceInstance is range-checked as BACnetStack_AddDevice() checks its instance: a value above 4194302 (including the reserved 4194303) is rejected and nothing is changed.
For a device on a virtual network, the router mapping is checked before the database is renamed, so a refused call leaves both the database and the virtual router’s mapping as they were; on success both carry the new instance.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
oldDeviceInstance |
in | The instance of the device to change. Must exist. |
newDeviceInstance |
in | The new device instance, 0 to 4194302 inclusive. Must not already be in use by another device, and must differ from oldDeviceInstance - an update to the same value is rejected. |
Returns
Section titled “Returns”True if successful, false if failed. The reason is reported through the debug-message callback.
Topic: Device and services. Declared in CASBACnetStackDLL.h.