func (m *Meter) Open(path string) (err error) {
	atomic.StoreInt32(&m.opened, 1)
	m.initKey()
	m.file, err = os.OpenFile(path, os.O_RDWR, 0644)
	if err != nil || m.file == nil {
		return errors.Wrapf(err, "Failed to open '%v'", path)
	}
	log.Printf("Device '%v' opened", m.file.Name())
	return m.ioctl()
}
Open will open the device file specified in the path which is usually something like /dev/hidraw2.
package meter
import (
	"os"
	"syscall"
	"unsafe"
	"log"
	"math"
	"crypto/rand"
	"sync/atomic"
	"github.com/pkg/errors"
)
const (
	meterTemp       byte    = 0x42
	meterCO2        byte    = 0x50
	hidiocsfeature9 uintptr = 0xc0094806
)
var key = [8]byte{}
type Meter struct {
	file   *os.File
	opened int32
}
type Measurement struct {
	Temperature float64
	Co2         int
}