{"id":15063623,"url":"https://github.com/bacnet-ex/bacstack","last_synced_at":"2026-03-12T23:31:49.785Z","repository":{"id":248568512,"uuid":"829059969","full_name":"bacnet-ex/bacstack","owner":"bacnet-ex","description":"Low level BACnet stack for Elixir. For now, this is a read-only mirror of a private Git repository.","archived":false,"fork":false,"pushed_at":"2026-03-10T22:24:31.000Z","size":1175,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-03-11T03:58:09.296Z","etag":null,"topics":["bacnet","bacnet-client","bacnet-ip","bacnet-library","elixir","elixir-lang","ip","ipv4","udp"],"latest_commit_sha":null,"homepage":"https://bacnet-ex.github.io/bacstack/","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bacnet-ex.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-07-15T17:12:49.000Z","updated_at":"2026-03-10T22:24:35.000Z","dependencies_parsed_at":"2024-07-15T21:21:24.954Z","dependency_job_id":"7e983ef4-eb7d-4d0a-809b-7a583cb6780d","html_url":"https://github.com/bacnet-ex/bacstack","commit_stats":null,"previous_names":["bacnet-ex/bacstack"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bacnet-ex/bacstack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bacnet-ex%2Fbacstack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bacnet-ex%2Fbacstack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bacnet-ex%2Fbacstack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bacnet-ex%2Fbacstack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bacnet-ex","download_url":"https://codeload.github.com/bacnet-ex/bacstack/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bacnet-ex%2Fbacstack/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30449043,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T21:31:01.033Z","status":"ssl_error","status_checked_at":"2026-03-12T21:30:43.161Z","response_time":114,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bacnet","bacnet-client","bacnet-ip","bacnet-library","elixir","elixir-lang","ip","ipv4","udp"],"created_at":"2024-09-25T00:04:59.596Z","updated_at":"2026-03-12T23:31:49.775Z","avatar_url":"https://github.com/bacnet-ex.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BACstack\n\nBACstack is a low-level Elixir implementation for the ASHRAE standard 135, BACnet - Building Automation and Controller network.\nThis implementation supports ASHRAE 135-xxxx\u003c!-- TODO --\u003e and BACnet/IPv4. Support for other transport layers (such as BACnet/SC, BACnet/MSTP)\ncan be straight forward added on top of it.\n\nAs this is a low-level implementation, users of this library are required to do the heavy-lifting of the BACnet stack,\nsuch as automatically replying to Who-Is services, applying hard application timeout constraints, synchronizing time, etc.\n\n\u003c!--If you're looking for a high level Elixir abstraction on top of this library, check out [BACnex].\nBACnex is a high level abstraction on top of this library, that offers the high level features of a regular BACnet stack.--\u003e\n\n## Installation\n\nWhile v0.0.1 has been released to [Hex](https://hex.pm/packages/bacstack) to provide a minimal BACnet client featureset,\nit is recommended to install it through GitHub (you can also pin it to a commit hash).\nNew changes, bugfixes and features are not released to Hex until bacstack has reached a more stable and complete featureset.\n\nThe package can be installed by adding `bacstack` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:bacstack, github: \"bacnet-ex/bacstack\"}\n  ]\nend\n```\n\nThe documentation can be found at \u003chttps://bacnet-ex.github.io/bacstack/\u003e.\n\n\u003c!--\nIf [available in Hex](https://hex.pm/docs/publish), the package can be installed\nby adding `bacstack` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:bacstack, \"~\u003e 0.1.0\"}\n  ]\nend\n```\n\nDocumentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)\nand published on [HexDocs](https://hexdocs.pm). Once published, the docs can\nbe found at \u003chttps://hexdocs.pm/bacstack\u003e.\n--\u003e\n\n## Getting Started\n\nFirst start a transport (specify callback), start `Segmentator`, start `SegmentsStore` and finally start `Client`,\nspecifying all three previously started processes.\n\nIn the following example, we will use registered processes for ease of use. You can also use `:via` tuple for\nan alternative to locally registered names (or simply no registration at all).\nHowever since we need to \"link\" the processes, names make it a lot easier.\nThough the transport module does allow to use a function or MFA callback instead,\nso \"linking\" can be implementation by the user as desired.\n\nWe use the IPv4 transport and it will automatically determine a network interface to use.\nYou can also specify the network interface directly, if you want to or the wrong interface is selected.\nRefer to the documentation for more information.\n\n```elixir\nalias BACnet.Stack.Client\nalias BACnet.Stack.Segmentator\nalias BACnet.Stack.SegmentsStore\nalias BACnet.Stack.Transport.IPv4Transport\n\nIPv4Transport.open(Client, name: IPv4Transport)\nSegmentator.start_link(name: Segmentator)\nSegmentsStore.start_link(name: SegmentsStore)\nClient.start_link(\n  name: Client,\n  segmentator: Segmentator,\n  segments_store: SegmentsStore,\n  transport: IPv4Transport\n)\n```\n\nIn a more production environment these processes should be started under a supervisor\nand also where possible, you should specify the supervisor for the modules to use (i.e. IPv4 transport).\n\nYou can now use the `Client` module to interact with the BACnet network (i.e. send Who-Is messages).\nYou can also receive BACnet traffic by specifying a notification receiver when starting `Client`.\n\nSee also the `ClientHelper` module for functions orientated around helping you to send BACnet service requests.\n\nIf you need to interact with a remote BACnet network, you may want to register yourself as a Foreign Device.\nFor that case, you can start an additional process `ForeignDevice` and specify the BBMD.\nPlease note that the `Client` needs to be started on the correct network interface where the BBMD is reachable.\n\n```elixir\nalias BACnet.Stack.ForeignDevice\n\nForeignDevice.start_link(bbmd: {bbmd_ip, 0xBAC0}, client: Client)\n```\n\n## Character Sets\n\nThis library uses the library [Codepagex](https://hex.pm/packages/codepagex) to implement character set conversion.\nBy default, Codepagex only generates conversion code for fast conversion algorithms to and from UTF-8 (such as ISO-8859-1).\n\nIf you need to use other character sets, such as CP932 (JIS-X-0208) or CP850 (DBCS), you will have to configure  Codepagex accordingly.\nRefer to their documentation for the necessary steps.\n\n## Time Zone\n\nWhen using this library, there are some functions that take or return `DateTime` structs.\nInside the library, there is a default timezone that will be used, when you don't particularily set/override the timezone.\nThe default timezone is an application environment configuration that is used across the library and can be used\nto set a different timezone than the default `Etc/UTC`. Where applicable,\nyou can still override the default timezone locally (i.e. `BACnetDateTime.to_datetime/3`).\n\n```elixir\nconfig :bacstack, :default_timezone, \"Etc/UTC\"\n```\n\nPlease note, for timezones other than `UTC`, you still need to set a timezone database for Elixir to work with.\nFor example, with the library [Tzdata](https://hex.pm/packages/tzdata) it's just a matter of configuration:\n\n```elixir\nconfig :elixir, :time_zone_database, Tzdata.TimeZoneDatabase\n```\n\n## Extensibility\n\nSome parts of this library can be extended at compile-time to provide additional value. Let's explore them.\n\n### Errors\n\nAbort Reason, Error Class, Error Code and Reject Reason can be extended at compile-time by the library user.\nThis allows to provide forward compatibility for new revisions at early stages.\n\nSimply configure the key `:additional_abort_reason`, `:additional_error_class`,\n`:additional_error_code`  and/or `:additional_reject_reason` of the application `:bacstack`\nto be a keyword or map and use the name as key and the integer protocol value as value.\n\n### Object Properties\n\nFor each object the available properties can be extended at compile-time by the library user.\nThis may be done to add new properties or even proprietary properties to an object type.\n\nConfigure the key `:objects_additional_properties` of the application `:bacstack` and\nsupply proper quoted expression (Elixir AST) to a keyword list or map,\nwith the object type as key.\n\nPlease note that the properties must be known (either already supplied by the library\nor added by the library user using `additional_property_identifiers`).\n\nFor example:\n\n```elixir\nconfig :bacstack, :objects_additional_properties,\n  loop:\n    (quote do\n        field(:loop_enable, boolean(), encode_as: :enumerated)\n\n        field(:loop_mode, :bacnet_loop | :plc_loop,\n          bac_type: {:in_list, [:bacnet_loop, :plc_loop]},\n          annotation: [\n            encoder: \u0026{:enumerated, if(\u00261 == :plc_loop, do: 1, else: 0)},\n            decoder: \u0026if(\u00261.value == 1, do: :plc_loop, else: :bacnet_loop)\n          ]\n        )\n      end)\n```\n\nSee the documentation to `ObjectsMacro.bac_object/2` for more information and the allowed/expected expression.\n\n### Object Types\n\nThe known object types can be extended at compile-time by the library.\nThat does not automatically implement the new object types, however makes it possible to do so.\nIt can be done to provide forward compatibility for new revisions at early stages.\n\nSimply configure the key `:additional_object_type` of the application `:bacstack`\nto be a keyword or map and use the name as key and the integer protocol value as value.\n\nYou'll also want to extend object types supported through `:additional_object_types_supported`.\nThe struct `BACnet.Protocol.Device.ObjectTypesSupported` is automatically adjusted and up-to-date at compile time.\n\n### Property Identifiers\n\nThe known property identifiers can be extended at compile-time by the library user.\nThis can be done to add new properties or even proprietary property identifiers.\n\nSimply configure the key `:additional_property_identifiers` of the application `:bacstack`\nto be a keyword or map and use the name as key and the integer protocol value as value.\n\nFor example:\n\n```elixir\nconfig :bacstack, :additional_property_identifiers, loop_enable: 523, loop_mode: 524\n```\n\n### Services\n\nBoth confirmed and unconfirmed service choices known can be extended at compile-time by the library user.\nThat does not mean though, that the services are implemented. It can be done though, to provide forward\ncompatibility for new revisions at early stages.\n\nSimply configure the key `:additional_confirmed_service_choice` and/or `:additional_unconfirmed_service_choice`\nof the application `:bacstack` to be a keyword or map and use the name as key and the integer protocol value as value.\n\nYou'll also want to extend services supported through `:additional_services_supported`.\nThe struct `BACnet.Protocol.Device.ServicesSupported` is automatically adjusted and up-to-date at compile time.\n\n## Status of BACnet objects implementation\n\n| Object Type                  | Representation | Execute | Intrinsic Reporting |\n|------------------------------|----------------|---------|---------------------|\n| Accumulator                  |    135-2012    |    -    |          -          |\n| Analog Input                 |    135-2012    |    -    |          -          |\n| Analog Output                |    135-2012    |    -    |          -          |\n| Analog Value                 |    135-2012    |    -    |          -          |\n| Averaging                    |    135-2012    |    -    |          -          |\n| Binary Input                 |    135-2012    |    -    |          -          |\n| Binary Output                |    135-2012    |    -    |          -          |\n| Binary Value                 |    135-2012    |    -    |          -          |\n| Calendar                     |    135-2012    |    -    |          -          |\n| Command                      |    135-2012    |    -    |          -          |\n| Device                       |    135-2012    |    -    |          -          |\n| Event Enrollment             |    135-2012    |    -    |          -          |\n| File                         |    135-2012    |    -    |          -          |\n| Group                        |    135-2012    |    -    |          -          |\n| Life Safety Point            |       N/A      |    -    |          -          |\n| Life Safety Zone             |       N/A      |    -    |          -          |\n| Loop                         |    135-2012    |    -    |          -          |\n| Multistate Input             |    135-2012    |    -    |          -          |\n| Multistate Output            |    135-2012    |    -    |          -          |\n| Multistate Value             |    135-2012    |    -    |          -          |\n| Notification Class           |    135-2012    |    -    |          -          |\n| Program                      |    135-2012    |    -    |          -          |\n| Pulse Converter              |    135-2012    |    -    |          -          |\n| Schedule                     |    135-2012    |    -    |          -          |\n| Event Log                    |    135-2012    |    -    |          -          |\n| Trend Log                    |    135-2012    |    -    |          -          |\n| Trend Log Multiple           |    135-2012    |    -    |          -          |\n| Load Control                 |        -       |    -    |          -          |\n| Access Point                 |       N/A      |    -    |          -          |\n| Access Zone                  |       N/A      |    -    |          -          |\n| Access User                  |       N/A      |    -    |          -          |\n| Access Rights                |       N/A      |    -    |          -          |\n| Access Credential            |       N/A      |    -    |          -          |\n| Credential Data Input        |       N/A      |    -    |          -          |\n| Structured View              |    135-2012    |    -    |          -          |\n| Character String Value       |    135-2012    |    -    |          -          |\n| DateTime Value               |    135-2012    |    -    |          -          |\n| Large Analog Value           |    135-2012    |    -    |          -          |\n| Bitstring                    |    135-2012    |    -    |          -          |\n| Octet String Value           |    135-2012    |    -    |          -          |\n| Time Value                   |    135-2012    |    -    |          -          |\n| Integer Value                |    135-2012    |    -    |          -          |\n| Positive Integer Value       |    135-2012    |    -    |          -          |\n| Date Value                   |    135-2012    |    -    |          -          |\n| DateTime Pattern Value       |    135-2012    |    -    |          -          |\n| Time Pattern Value           |    135-2012    |    -    |          -          |\n| Date Pattern Value           |    135-2012    |    -    |          -          |\n| Network Security             |       N/A      |    -    |          -          |\n| Global Group                 |        -       |    -    |          -          |\n| Notification Forwarder       |        -       |    -    |          -          |\n| Alert Enrollment             |        -       |    -    |          -          |\n| Channel                      |        -       |    -    |          -          |\n| Lighting Output              |        -       |    -    |          -          |\n\n## Status of BACnet services implementation\n\n| Service Name                 | Receive | Send  | ACK (Pos/Neg)  |\n|------------------------------|---------|-------|----------------|\n| Confirmed COV                |    x    |   x   |  Simple/Error  |\n| Unconfirmed COV              |    x    |   x   |                |\n| Confirmed Event              |    x    |   x   |  Simple/Error  |\n| Unconfirmed Event            |    x    |   x   |                |\n| Acknowledge Alarm            |    x    |   x   |  Simple/Error  |\n| Get Alarm Summary            |    x    |   x   |     x/Error    |\n| Get Enrollment Summary       |    x    |   x   |     x/Error    |\n| Get Event Information        |    x    |   x   |     x/Error    |\n| Life Safety Operation        |    x    |   x   |  Simple/Error  |\n| Subscribe COV                |    x    |   x   |  Simple/Error  |\n| Subscribe COV Property       |    x    |   x   |  Simple/Error  |\n| Atomic Read File             |    x    |   x   |     x/Error    |\n| Atomic Write File            |    x    |   x   |     x/Error    |\n| Add List Element             |    x    |   x   |    Simple/x    |\n| Remove List Element          |    x    |   x   |    Simple/x    |\n| Create Object                |    x    |   x   |       x/x      |\n| Delete Object                |    x    |   x   |    Simple/x    |\n| Read Property                |    x    |   x   |     x/Error    |\n| Read Property Multiple       |    x    |   x   |     x/Error    |\n| Read Range                   |    x    |   x   |     x/Error    |\n| Write Property               |    x    |   x   |  Simple/Error  |\n| Write Property Multiple      |    x    |   x   |    Simple/x    |\n| Write Group                  |    x    |   x   |                |\n| Device Communication Control |    x    |   x   |  Simple/Error  |\n| Confirmed Private Transfer   |    x    |   x   |       x/x      |\n| Unconfirmed Private Transfer |    x    |   x   |                |\n| Reinitialize Device          |    x    |   x   |  Simple/Error  |\n| Confirmed Text Message       |    x    |   x   |  Simple/Error  |\n| Unconfirmed Text Message     |    x    |   x   |                |\n| Time Synchronization         |    x    |   x   |                |\n| UTC Time Synchronization     |    x    |   x   |                |\n| Who-Has                      |    x    |   x   |                |\n| I-Have                       |    x    |   x   |                |\n| Who-Is                       |    x    |   x   |                |\n| I-Am                         |    x    |   x   |                |\n| VT Open                      |   N/A   |  N/A  |                |\n| VT Close                     |   N/A   |  N/A  |                |\n| VT Data                      |   N/A   |  N/A  |                |\n\n## Status of Event Algorithms Implementation\n\n| Event Algorithm            | Implemented |\n|----------------------------|-------------|\n| Buffer Ready               |   135-2012  |\n| Change Of Bitstring        |   135-2012  |\n| Change Of Character String |   135-2012  |\n| Change Of Life Safety      |   135-2012  |\n| Change Of State            |   135-2012  |\n| Change Of Status Flags     |   135-2012  |\n| Change Of Value            |   135-2012  |\n| Command Failure            |   135-2012  |\n| Complex Event Type         |     N/A     |\n| Double Out Of Range        |   135-2012  |\n| Extended                   |     N/A     |\n| Floating Limit             |   135-2012  |\n| Out Of Range               |   135-2012  |\n| Signed Out Of Range        |   135-2012  |\n| Unsigned Out Of Range      |   135-2012  |\n| Unsigned Range             |   135-2012  |\n\n## Status of Fault Algorithms Implementation\n\n| Fault Algorithm        | Implemented |\n|------------------------|-------------|\n| Fault Character String |   135-2012  |\n| Fault Extended         |     N/A     |\n| Fault Life Safety      |   135-2012  |\n| Fault State            |   135-2012  |\n| Fault Status Flags     |   135-2012  |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbacnet-ex%2Fbacstack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbacnet-ex%2Fbacstack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbacnet-ex%2Fbacstack/lists"}