summaryrefslogtreecommitdiff
path: root/examples_test.go
blob: 1320cd66890833f6176ce2c497edc57bb7280512 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package soundbox_test

import (
	"fmt"
	"log"

	"xengineering.eu/soundbox"
)

// ExampleSoundbox demonstrates how to instantiate a Soundbox struct. The used
// MAC address if from a private range according to
// https://www.rfc-editor.org/rfc/rfc9542.html#name-48-bit-mac-documentation-va.
func ExampleSoundbox() {
	s, err := soundbox.NewSoundbox("00:00:5E:00:53:01")
	if err != nil {
		log.Fatal(err)
	}

	fmt.Printf("Soundbox with MAC address %v", s.HardwareAddr)
	// Output: Soundbox with MAC address 00:00:5e:00:53:01
}