func (znp *Znp) SapiZbSystemReset() {
	znp.SendAsync(unp.S_SAPI, 0x09, nil, nil)
}
=======MAC======= is not supported on my device
=======SAPI=======
package znp
import (
	"fmt"
	"github.com/function61/hautomo/pkg/ezstack/zigbee"
	"github.com/function61/hautomo/pkg/ezstack/znp/unp"
)
func (znp *Znp) AfRegister(endPoint zigbee.EndpointId, appProfID uint16, appDeviceID uint16, addDevVer uint8,
	latencyReq Latency, appInClusterList []uint16, appOutClusterList []uint16) (rsp *StatusResponse, err error) {
	req := &AfRegister{EndPoint: endPoint, AppProfID: appProfID, AppDeviceID: appDeviceID,
		AddDevVer: addDevVer, LatencyReq: latencyReq, AppInClusterList: appInClusterList, AppOutClusterList: appOutClusterList}
	err = znp.SendSync(unp.S_AF, 0x00, req, &rsp)
	return
}
func (znp *Znp) AfDataRequest(dstAddr string, dstEndpoint zigbee.EndpointId, srcEndpoint zigbee.EndpointId, clusterId uint16,
	transId uint8, options *AfDataRequestOptions, radius uint8, data []uint8) (rsp *StatusResponse, err error) {
	req := &AfDataRequest{DstAddr: dstAddr, DstEndpoint: dstEndpoint, SrcEndpoint: srcEndpoint,
		ClusterID: clusterId, TransID: transId, Options: options, Radius: radius, Data: data}
	err = znp.SendSync(unp.S_AF, 0x01, req, &rsp)
	return
}
func (znp *Znp) AfDataRequestExt(dstAddrMode AddrMode, dstAddr string, dstEndpoint zigbee.EndpointId, dstPanId uint16,
	srcEndpoint zigbee.EndpointId, clusterId uint16, transId uint8, options *AfDataRequestOptions, radius uint8,
	data []uint8) (rsp *StatusResponse, err error) {
	req := &AfDataRequestExt{DstAddrMode: dstAddrMode, DstAddr: dstAddr, DstEndpoint: dstEndpoint, DstPanID: dstPanId, SrcEndpoint: srcEndpoint,
		ClusterID: clusterId, TransID: transId, Options: options, Radius: radius, Data: data}
	err = znp.SendSync(unp.S_AF, 0x02, req, &rsp)
	return
}
func (znp *Znp) AfDataRequestSrcRtg(dstAddr string, dstEndpoint zigbee.EndpointId, srcEndpoint zigbee.EndpointId, clusterId uint16,
	transId uint8, options *AfDataRequestSrcRtgOptions, radius uint8, relayList []string, data []uint8) (rsp *StatusResponse, err error) {
	req := &AfDataRequestSrcRtg{DstAddr: dstAddr, DstEndpoint: dstEndpoint, SrcEndpoint: srcEndpoint,
		ClusterID: clusterId, TransID: transId, Options: options, Radius: radius, RelayList: relayList, Data: data}
	err = znp.SendSync(unp.S_AF, 0x03, req, &rsp)
	return
}
func (znp *Znp) AfInterPanCtl(command InterPanCommand, data AfInterPanCtlData) (rsp *StatusResponse, err error) {
	req := &AfInterPanCtl{Command: command, Data: data}
	err = znp.SendSync(unp.S_AF, 0x10, req, &rsp)
	return
}
func (znp *Znp) AfDataStore(index uint16, data []uint8) (rsp *StatusResponse, err error) {
	req := &AfDataStore{Index: index, Data: data}
	err = znp.SendSync(unp.S_AF, 0x11, req, &rsp)
	return
}
func (znp *Znp) AfDataRetrieve(timestamp uint32, index uint16, length uint8) (rsp *AfDataRetrieveResponse, err error) {
	req := &AfDataRetrieve{Timestamp: timestamp, Index: index, Length: length}
	err = znp.SendSync(unp.S_AF, 0x12, req, &rsp)
	return
}
func (znp *Znp) AfApsfConfigSet(endpoint zigbee.EndpointId, frameDelay uint8, windowSize uint8) (rsp *StatusResponse, err error) {
	req := &AfApsfConfigSet{Endpoint: endpoint, FrameDelay: frameDelay, WindowSize: windowSize}
	err = znp.SendSync(unp.S_AF, 0x13, req, &rsp)
	return
}
func (znp *Znp) AppMsg(appEndpoint zigbee.EndpointId, dstAddr string, dstEndpoint zigbee.EndpointId, clusterID uint16,
	message []uint8) (rsp *StatusResponse, err error) {
	req := &AppMsg{AppEndpoint: appEndpoint, DstAddr: dstAddr, DstEndpoint: dstEndpoint,
		ClusterID: clusterID, Message: message}
	err = znp.SendSync(unp.S_APP, 0x00, req, &rsp)
	return
}
func (znp *Znp) AppUserTest(srcEndpoint zigbee.EndpointId, commandId uint16, parameter1 uint16, parameter2 uint16) (rsp *StatusResponse, err error) {
	req := &AppUserTest{SrcEndpoint: srcEndpoint, CommandID: commandId, Parameter1: parameter1, Parameter2: parameter2}
	err = znp.SendSync(unp.S_APP, 0x01, req, &rsp)
	return
}
func (znp *Znp) DebugSetThreshold(componentId uint8, threshold uint8) (rsp *StatusResponse, err error) {
	req := &DebugSetThreshold{ComponentID: componentId, Threshold: threshold}
	err = znp.SendSync(unp.S_DBG, 0x00, req, &rsp)
	return
}
func (znp *Znp) DebugMsg(str string) {
	req := &DebugMsg{String: str}
	znp.SendAsync(unp.S_DBG, 0x00, req, nil)
}