Files
bacnet_stack/apps/gtk-discover
Steve Karg 9b6173995c Fixed compiler warning format '%u' expects argument of type 'unsigned int', but argument 4 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=] by casting or increasing format specifier size and casting. (#1092)
* Fixed compiler warning format '%u' expects argument of type 'unsigned int', but argument 4 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=] by casting or increasing format specifier size and casting. Increased the size of the name string to handle larger possible integers.

* Fixed copied code that no longer needs static function scope variables for text names.
2025-09-12 15:08:47 -05:00
..

BACnet GTK Discovery Application

A GTK-based graphical application for discovering BACnet devices, objects, and properties on a network.

Features

  • Device Discovery: Browse and discover BACnet devices on the network
  • Object Discovery: View all objects within a selected BACnet device
  • Property Inspection: Examine properties of individual BACnet objects
  • Three-Pane Interface:
    • Left pane: Device list with device ID, name, model, and address
    • Top-right pane: Object list for selected device
    • Bottom-right pane: Property list for selected object

Prerequisites

GTK+ 3.0 Development Libraries

The application requires GTK+ 3.0 development libraries to be installed:

Ubuntu/Debian:

sudo apt-get update
sudo apt-get install libgtk-3-dev pkg-config

Fedora/RHEL/CentOS:

sudo yum install gtk3-devel pkgconfig
# or for newer versions:
sudo dnf install gtk3-devel pkgconfig

openSUSE:

sudo zypper install gtk3-devel pkg-config

Arch Linux:

sudo pacman -S gtk3 pkgconfig

Building

The BACnet stack library must be built first. The apps/Makefile helps with the various options. From the project root folder:

make gtk-discover

Running

Execute the built application:

./bin/bacdiscover-gtk

Usage

  1. Device View: The left pane shows discovered BACnet devices.

  2. Object View: Click on a device in the left pane to view its objects in the top-right pane. Objects show:

    • Object type (Analog Input, Binary Output, etc.)
    • Object instance number
    • Object name
  3. Property View: Click on an object to view its properties in the bottom-right pane, including:

    • Property name
    • Property value
  4. Toolbar Functions:

    • Discover Devices: network device discovery using Who-Is requests
    • Refresh: refreshing current device data

Architecture

The application is structured with:

  • GTK Components: ListStore models for each tree view
  • BACnet Integration: Uses the BACnet Stack library
  • Three-Pane Layout: Resizable paned windows for optimal viewing

Troubleshooting

Build Issues:

  1. GTK not found: Ensure GTK+ 3.0 development packages are installed
  2. BACnet library missing: Build the BACnet library first: make -C apps/lib all
  3. pkg-config issues: Install pkg-config package for your distribution

Runtime Issues:

  1. Application won't start: Check that all required libraries are installed
  2. Segmentation faults: Build with debug symbols: make debug

Files

  • main.c - Main application source code
  • Makefile - Build configuration
  • README.md - This documentation

Future Enhancements

  • Property editing capabilities
  • Device configuration management
  • Trending and logging
  • Alarm and event handling
  • Export/import functionality
  • Multiple datalink support configuration
  • Network diagnostics and monitoring