gobacnet

package module
v0.0.0-...-1d4abbb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2020 License: GPL-2.0 Imports: 12 Imported by: 0

README

goBACnet

Build Status GoDoc

gobacnet is a client for bacnet written exclusively with go. The goal is to only offer a client and a test server application.

NOTE: This code is very experimental and therefore should not be used in anything you want working. There are many changes being made and I cannot guarantee compatibility between versions. Many features of the protocol are missing and will be added overtime.

Installation

Part of this library is a command line client. To install from source run:

go get -u gitee.com/azhw/gobacnet/baccli

For usage run:

baccli --help

Features

Below are features that are intended to be completed for the library and for the command line interface ordered in no particular manner. If you would like a feature not in the list below add a discussion on github for it.

Library

  • Who Is
  • Read Property
  • Read Multiple Property
  • Read Range
  • Write Property
  • Write Property Multiple
  • Who Has
  • Change of Value Notification
  • Event Notification
  • Subscribe Change of Value
  • Atomic Read File
  • Atomic Write File

Command Line Interface

  • Who Is
  • Read Property
  • Read Multiple Property
  • Read Range
  • Write Property
  • Write Property Multiple
  • Who Has
  • Atomic Read File
  • Atomic Write File

Contributing

Contributions are more then welcome for this project. Use golint for formatting and be sure to include test coverage on any new additions.

License

This library is heavily based on the BACnet-Stack library originally written by Steve Karg and therefore is released under the same license as his project. This includes the exception which allows for this library to be linked by proprietary code without that code becoming GPL. This exception was taken from the original BACnet stack and is included in every file.

The exception is as follows:

    "As a special exception, if other files instantiate
     templates or use macros or inline functions from
     this file, or you compile this file and link it
     with other works to produce a work based on this file,
     this file does not by itself cause the resulting work
     to be covered by the GNU General Public License.
     However the source code for this file must still be
     made available in accordance with section (3) of the
     GNU General Public License."

Documentation

Index

Constants

View Source
const ArrayAll = 0xFFFFFFFF

ArrayAll is used when reading/writting to a property to read/write the entire array

View Source
const DefaultPort = 0xBAC0

DefaultPort that BacnetIP will use if a port is not given. Valid ports for the bacnet protocol is between 0xBAC0 and 0xBAC9

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(inter string, port int) (*Client, error)

NewClient creates a new client with the given interface and port.

func (*Client) Close

func (c *Client) Close()

Close free resources for the client. Always call this function when using NewClient

func (*Client) Objects

func (c *Client) Objects(dev bactype.Device) (bactype.Device, error)

Objects retrieves all of the objects within the given device and returns a device with these objects. Along with the list of objects, it will also gather additional information from the object such as the name and description of the objects. The device returned contains all of the name and description fields for all objects

func (*Client) ReadMultiProperty

ReadMultipleProperty uses the given device and read property request to read from a device. Along with being able to read multiple properties from a device, it can also read these properties from multiple objects. This is a good feature to read all present values of every object in the device. This is a batch operation compared to a ReadProperty and should be used in place when reading more than two objects/properties.

func (*Client) ReadProperty

ReadProperty reads a single property from a single object in the given device.

func (*Client) WhoIs

func (c *Client) WhoIs(low, high int) ([]types.Device, error)

WhoIs finds all devices with ids between the provided low and high values. Use constant ArrayAll for both fields to scan the entire network at once. Using ArrayAll is highly discouraged for most networks since it can lead to a high congested network.

Directories

Path Synopsis
cmd
utsm is the Unconfirmed Transaction State Manager.
utsm is the Unconfirmed Transaction State Manager.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL