func (body *UnsupportedMessage) Unpack(data []byte) (uint, error) {
	if len(body.Data) < len(data) {
		body.Data = make([]byte, len(data))
	}
	return uint(copy(body.Data, data)), nil
}
Unpack initializes the structure by parsing the given data.
package cemi
import (
	"fmt"
	"github.com/vapourismo/knx-go/knx/util"
)
type MessageCode uint8
const (
	LBusmonIndCode MessageCode = 0x2B
	LDataReqCode MessageCode = 0x11
	LDataIndCode MessageCode = 0x29
	LDataConCode MessageCode = 0x2E
	LRawReqCode MessageCode = 0x10
	LRawIndCode MessageCode = 0x2D
	LRawConCode MessageCode = 0x2F
)
func (code MessageCode) String() string {
	switch code {
	case LBusmonIndCode:
		return "LBusmon.ind"
	case LDataReqCode:
		return "LData.req"
	case LDataIndCode:
		return "LData.ind"
	case LDataConCode:
		return "LData.con"
	case LRawReqCode:
		return "LRaw.req"
	case LRawIndCode:
		return "LRaw.ind"
	case LRawConCode:
		return "LRaw.con"
	default:
		return fmt.Sprintf("%#x", uint8(code))
	}
}
type Info []byte
func (info Info) Size() uint {
	if len(info) > 255 {
		return 256
	}
	return 1 + uint(len(info))
}
func (info Info) Pack(buffer []byte) {
	if len(info) > 255 {
		buffer[0] = 255
	} else {
		buffer[0] = byte(len(info))
	}
	copy(buffer[1:], info[:buffer[0]])
}
func (info *Info) Unpack(data []byte) (n uint, err error) {
	var length uint8
	n, err = util.Unpack(data, &length)
	if err != nil {
		return
	}
	if length > 0 {
		buf := make([]byte, length)
		n += uint(copy(buf, data[n:n+uint(length)]))
		*info = Info(buf)
	} else {
		*info = nil
	}
	return
}
type Message interface {
	util.Packable
	MessageCode() MessageCode
}
type UnsupportedMessage struct {
	Code MessageCode
	Data []byte
}
func (body *UnsupportedMessage) Size() uint {
	return uint(len(body.Data))
}
func (body *UnsupportedMessage) MessageCode() MessageCode {
	return body.Code
}
func (body *UnsupportedMessage) Pack(buffer []byte) {
	copy(buffer, body.Data)
}