func (znp *Znp) SysGpio(operation Operation, value uint8) (rsp *SysGpioResponse, err error) {
	req := &SysGpio{Operation: operation, Value: value}
	err = znp.SendSync(unp.S_SYS, 0x0E, req, &rsp)
	return
}
control the 4 GPIO pins on the CC2530-ZNP build.
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)
}
func (znp *Znp) SapiZbSystemReset() {
	znp.SendAsync(unp.S_SAPI, 0x09, nil, nil)
}
func (znp *Znp) SapiZbStartRequest() (rsp *EmptyResponse, err error) {
	err = znp.SendSync(unp.S_SAPI, 0x00, nil, &rsp)
	return
}
func (znp *Znp) SapiZbPermitJoiningRequest(destination string, timeout uint8) (rsp *StatusResponse, err error) {
	req := &SapiZbPermitJoiningRequest{Destination: destination, Timeout: timeout}
	err = znp.SendSync(unp.S_SAPI, 0x08, req, &rsp)
	return
}
func (znp *Znp) SapiZbBindDevice(create uint8, commandId uint16, destination string) (rsp *EmptyResponse, err error) {
	req := &SapiZbBindDevice{Create: create, CommandID: commandId, Destination: destination}
	err = znp.SendSync(unp.S_SAPI, 0x01, req, &rsp)
	return
}
func (znp *Znp) SapiZbAllowBind(timeout uint8) (rsp *EmptyResponse, err error) {
	req := &SapiZbAllowBind{Timeout: timeout}
	err = znp.SendSync(unp.S_SAPI, 0x02, req, &rsp)
	return
}
func (znp *Znp) SapiZbSendDataRequest(destination string, commandID uint16, handle uint8,
	ack uint8, radius uint8, data []uint8) (rsp *EmptyResponse, err error) {
	req := &SapiZbSendDataRequest{Destination: destination, CommandID: commandID,
		Handle: handle, Ack: ack, Radius: radius, Data: data}
	err = znp.SendSync(unp.S_SAPI, 0x03, req, &rsp)
	return
}
func (znp *Znp) SapiZbReadConfiguration(configID uint8) (rsp *SapiZbReadConfigurationResponse, err error) {
	req := &SapiZbReadConfiguration{ConfigID: configID}
	err = znp.SendSync(unp.S_SAPI, 0x04, req, &rsp)
	return
}
func (znp *Znp) SapiZbWriteConfiguration(configID uint8, value []uint8) (rsp *StatusResponse, err error) {
	req := &SapiZbWriteConfiguration{ConfigID: configID, Value: value}
	err = znp.SendSync(unp.S_SAPI, 0x05, req, &rsp)
	return
}
func (znp *Znp) SapiZbGetDeviceInfo(param uint8) (rsp *SapiZbGetDeviceInfoResponse, err error) {
	req := &SapiZbGetDeviceInfo{Param: param}
	err = znp.SendSync(unp.S_SAPI, 0x06, req, &rsp)
	return
}
func (znp *Znp) SapiZbFindDeviceRequest(searchKey string) (rsp *EmptyResponse, err error) {
	req := &SapiZbFindDeviceRequest{SearchKey: searchKey}
	err = znp.SendSync(unp.S_SAPI, 0x07, req, &rsp)
	return
}
func (znp *Znp) SysResetReq(resetType byte) {
	req := &SysResetReq{resetType}
	znp.SendAsync(unp.S_SYS, 0x00, req, nil)
}
func (znp *Znp) SysPing() (rsp *SysPingResponse, err error) {
	err = znp.SendSync(unp.S_SYS, 0x01, nil, &rsp)
	return
}
func (znp *Znp) SysVersion() (rsp *SysVersionResponse, err error) {
	err = znp.SendSync(unp.S_SYS, 0x02, nil, &rsp)
	return
}
func (znp *Znp) SysSetExtAddr(addr zigbee.IEEEAddress) (rsp *StatusResponse, err error) {
	req := &SysSetExtAddr{ExtAddress: addr.HexPrefixedString()}
	err = znp.SendSync(unp.S_SYS, 0x03, req, &rsp)
	return
}
func (znp *Znp) SysGetExtAddr() (rsp *SysGetExtAddrResponse, err error) {
	err = znp.SendSync(unp.S_SYS, 0x04, nil, &rsp)
	return
}
func (znp *Znp) SysRamRead(address uint16, len uint8) (rsp *SysRamReadResponse, err error) {
	req := &SysRamRead{Address: address, Len: len}
	err = znp.SendSync(unp.S_SYS, 0x05, req, &rsp)
	return
}
func (znp *Znp) SysRamWrite(address uint16, value []uint8) (rsp *StatusResponse, err error) {
	req := &SysRamWrite{Address: address, Value: value}
	err = znp.SendSync(unp.S_SYS, 0x06, req, &rsp)
	return
}
func (znp *Znp) SysOsalNvItemInit(id uint16, itemLen uint16, initData []uint8) (rsp *StatusResponse, err error) {
	req := &SysOsalNvItemInit{ID: id, ItemLen: itemLen, InitData: initData}
	err = znp.SendSync(unp.S_SYS, 0x07, req, &rsp)
	return
}
func (znp *Znp) SysOsalNvDelete(id uint16, itemLen uint16) (rsp *StatusResponse, err error) {
	req := &SysOsalNvDelete{ID: id, ItemLen: itemLen}
	err = znp.SendSync(unp.S_SYS, 0x12, req, &rsp)
	return
}
func (znp *Znp) SysOsalNvLength(id uint16) (rsp *SysOsalNvLengthResponse, err error) {
	req := &SysOsalNvLength{ID: id}
	err = znp.SendSync(unp.S_SYS, 0x13, req, &rsp)
	return
}
func (znp *Znp) SysOsalStartTimer(id uint8, timeout uint16) (rsp *StatusResponse, err error) {
	req := &SysOsalStartTimer{ID: id, Timeout: timeout}
	err = znp.SendSync(unp.S_SYS, 0x0A, req, &rsp)
	return
}
func (znp *Znp) SysOsalStopTimer(id uint8) (rsp *StatusResponse, err error) {
	req := &SysOsalStopTimer{ID: id}
	err = znp.SendSync(unp.S_SYS, 0x0B, req, &rsp)
	return
}
func (znp *Znp) SysRandom() (rsp *SysRandomResponse, err error) {
	err = znp.SendSync(unp.S_SYS, 0x0C, nil, &rsp)
	return
}
func (znp *Znp) SysAdcRead(channel Channel, resolution Resolution) (rsp *SysAdcReadResponse, err error) {
	req := &SysAdcRead{Channel: channel, Resolution: resolution}
	err = znp.SendSync(unp.S_SYS, 0x0D, req, &rsp)
	return
}