func (d *hidDescriptor) bytes() []byte {
	buf := new(bytes.Buffer)
	binary.Write(buf, binary.LittleEndian, d)
	return buf.Bytes()
}
bytes converts the descriptor structure to byte array format.
package fidati
import (
	"bytes"
	"encoding/binary"
	"errors"
	"fmt"
	"github.com/f-secure-foundry/tamago/soc/imx6/usb"
	"github.com/gsora/fidati/internal/flog"
	"github.com/gsora/fidati/u2fhid"
)
const (
	hidRequestSetIdle           = 10
	hidRequestTypeGetDescriptor = 0x21
	descriptorTypeGetReport     = 0x22
)
type hidDescriptor struct {
	Length               uint8
	Type                 uint8
	bcdHID               uint16
	CountryCode          uint8
	NumDescriptors       uint8
	ReportDescriptorType uint8
	DescriptorLength     uint16
}
func (d *hidDescriptor) setDefaults() {
	d.Length = 0x09
	d.Type = 0x21
	d.bcdHID = 0x101
}