datalink

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultPort = 0xBAC0 //47808

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

func FindCIDRAddress

func FindCIDRAddress(inter string) (string, error)

FindCIDRAddress find out CIDR address from net interface

func IPPortToAddress

func IPPortToAddress(ip net.IP, port int) *btypes.Address

IPPortToAddress converts a given udp address into a bacnet address

func UDPToAddress

func UDPToAddress(n *net.UDPAddr) *btypes.Address

UDPToAddress converts a given udp address into a bacnet address

Types

type DataLink interface {
	GetMyAddress() *btypes.Address
	GetBroadcastAddress() *btypes.Address
	Send(data []byte, npdu *btypes.NPDU, dest *btypes.Address) (int, error)
	Receive(data []byte) (*btypes.Address, int, error)
	Close() error
}
func NewUDPDataLink(inter string, port int) (link DataLink, err error)

NewUDPDataLink returns udp listener pass in your iface port by name, see an alternative NewUDPDataLinkFromIP if you wish to pass in by ip and subnet

  • inter: eth0
  • addr: 47808

func NewUDPDataLinkFromIP

func NewUDPDataLinkFromIP(addr string, subNet, port int) (link DataLink, err error)

NewUDPDataLinkFromIP returns udp listener

  • addr: 192.168.15.10
  • subNet: 24
  • addr: 47808

Jump to

Keyboard shortcuts

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