forked from alexbeltran/gobacnet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathiam.go
More file actions
24 lines (21 loc) · 620 Bytes
/
iam.go
File metadata and controls
24 lines (21 loc) · 620 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package gobacnet
import (
"github.com/alexbeltran/gobacnet/encoding"
bactype "github.com/alexbeltran/gobacnet/types"
)
func (c *Client) iAm(dest bactype.Address) error {
enc := encoding.NewEncoder()
enc.NPDU(
bactype.NPDU{
Version: bactype.ProtocolVersion,
Destination: &dest,
IsNetworkLayerMessage: false,
ExpectingReply: false,
Priority: bactype.Normal,
HopCount: bactype.DefaultHopCount,
})
// iams := []bactype.ObjectID{bactype.ObjectID{Instance: 1, Type: 5}}
// enc.IAm(iams)
_, err := c.send(dest, enc.Bytes())
return err
}