BACnetStack_AddDevice
bool BACnetStack_AddDevice(const uint32_t deviceInstance);Adds the main device.
Call it once, before any other configuration call.
Adds the main device. Call this exactly ONCE, passing the device instance to assign. This must be the first configuration call - objects, properties and services all attach to this device.
A SECOND CALL IS REJECTED and returns false. To model further logical devices behind a virtual router, use BACnetStack_AddDeviceToVirtualNetwork() instead.
APDU_Timeout and Number_Of_APDU_Retries default to 10000 ms and 3 when the application does not serve them through the unsigned integer property callback. A confirmed request (and a confirmed event notification) is then sent up to four times, so a request to a peer that never answers fails after four APDU_Timeouts (40 s at the default timeout). To send once and never retransmit, serve Number_Of_APDU_Retries as 0 through the same callback.
BACnet reference: ANSI/ASHRAE 135-2024 clause 12.11 (Device Object Type).
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The device instance of the BACnet device being added. Must be between 0 and 4194302 inclusive (22 bits); 4194303 is the reserved “unknown instance” value and is rejected. |
Returns
Section titled “Returns”True if successful. False if a device has already been added, if deviceInstance is out of range, or on allocation failure. The reason is reported through the debug-message callback.
Topic: Device and services. Declared in CASBACnetStackDLL.h.