API Reference
This is the per-function reference for the Customer API of the CAS BACnet Stack: the BACnetStack_* functions your application calls, and the callback signatures your application implements and registers with them.
It is written for advanced integrators who work below the level of the getting-started material. **If you are starting out, begin with the Quick Start and the example projects** on Chipkin’s GitHub. Come back here when you need the exact contract of a function.
How this reference is organized
Section titled “How this reference is organized”Every exported function belongs to one topic, and each topic page starts with an overview of how its functions fit together:
- Version, information and settings
- Main loop and reset
- Device and services
- Objects and properties
- Schedules, calendars, trend logs and other object configuration
- Alarms and events
- Data link and system callbacks
- Property value callbacks
- Service callbacks
- Client requests
- Client response hooks
- BACnet/IP: BBMD and foreign devices
- Routing and virtual networks
- BACnet/SC
- Enumerations
The Files list also has the two headers themselves. CASBACnetStackDLL.h lists every exported function in one place, and BACnetCallbackInterface.h has the signatures of the callbacks your application implements: the FPCallback* and FPHook* types passed to the BACnetStack_RegisterCallback* and BACnetStack_RegisterHook* functions.
Find a function by task
Section titled “Find a function by task”
Guides
Section titled “Guides”The task-oriented guides to how the pieces fit together are chapters of the manual. Each one links into this reference for per-function detail.
- Stack lifecycle
- Serving property values
- Acting as a client
- COV, alarms and events, and trend logs
- Data links overview
Rules that apply to every function
Section titled “Rules that apply to every function”The full rules are on the API conventions page. The rules most integrations depend on are:
- By default the stack is single-threaded. Make every
BACnetStack_*call, includingBACnetStack_Tick(), from the same thread, or build withSTACK_OPTION_THREAD_SAFE(see the API conventions page). - Call
BACnetStack_Tick()repeatedly. Incoming messages are processed, and timers, retries and timeouts advance, only inside it. (ABACnetStack_Send*call transmits immediately through the send message callback.) Register the send and receive message callbacks before the first tick. - A
falsereturn means the call did not succeed. The return value does not say why. In a build withSTACK_OPTION_API_DEBUG_LOGGING(on in the prebuilt libraries and the npm package), the debug message callback reports the reason. - There is one stack per process, and no explicit initialization call. Make your first call from
main()or later, never from a static initializer.
Enumerations
Section titled “Enumerations”Parameters such as objectType, propertyIdentifier and errorCode, and the enumerated property values passed through the property callbacks, are plain integers that carry BACnet enumeration values. The Enumerations section lists the BACnet enumerations, the bit numbers of the bit strings (such as the service numbers BACnetStack_SetServiceEnabled() takes) and the datatype codes, with their values in numeric order and the parameters that refer to them.
What is not covered
Section titled “What is not covered”The test-tool interface (BACnetStackTestTool_*) exists only in test-tool builds, and is not part of the Customer API. The stack’s internal classes are not documented here.