func (m *Meter) ioctl() error {
	data := [9]byte{}
	copy(data[1:], key[0:])  
	_, _, err := syscall.Syscall(syscall.SYS_IOCTL, m.file.Fd(), hidiocsfeature9, uintptr(unsafe.Pointer(&data)))
	if err != 0 {
		return errors.Wrap(syscall.Errno(err), "ioctl failed")
	}
	return nil
}
ioctl writes into the device file. We need to write 9 bytes where the first byte specifies the report number.
In this case 0x00.
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
}
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()
}
func (m *Meter) initKey() {
	_, err := rand.Read(key[:])
	if err != nil {
		panic(err)
	}
}