package com.hdl.sdk.link.core.bean;
|
|
import androidx.annotation.NonNull;
|
|
import com.hdl.sdk.link.common.utils.LogUtils;
|
import com.hdl.sdk.link.common.utils.gson.GsonConvert;
|
import com.hdl.sdk.link.core.utils.ByteUtils;
|
|
import java.io.Serializable;
|
|
/**
|
* Created by hxb on 2021/12/19.
|
*/
|
public class BusProResponse implements Serializable {
|
/**
|
* 原生主题
|
*/
|
private String topic;
|
/**
|
* 原生数据
|
*/
|
private byte []data;
|
|
/**
|
* 网关Oid
|
*/
|
private String oid;
|
/**
|
* IP地址
|
*/
|
private String ipAddress;
|
// 源子网号
|
private byte sourceSubnetId;
|
// 源设备号
|
private byte sourceDeviceId ;
|
//设备类型
|
private byte[]deviceType;
|
//操作码
|
private byte[] command ;
|
//目标子网号
|
private byte desSubnetId;
|
//目标设备号
|
private byte desDeviceId;
|
|
private byte []extraBytes;
|
|
/**
|
* 获取原生主题
|
*
|
* @return
|
*/
|
public String getTopic() {
|
return topic;
|
}
|
|
/**
|
* 设置原生主题
|
*
|
* @param topic
|
*/
|
public void setTopic(String topic) {
|
this.topic = topic;
|
}
|
|
/**
|
* 获取原生数据
|
*
|
* @return
|
*/
|
public byte []getData() {
|
return data;
|
}
|
|
/**
|
* 设置原生数据
|
*
|
* @param data
|
*/
|
public void setData(byte []data) {
|
this.data=data;
|
}
|
|
/**
|
* 获取网关主要信息,可能是oid,可能是网关Id,可能是mac
|
*
|
* @return
|
*/
|
public String getOid() {
|
return oid;
|
}
|
|
/**
|
* 设置Oid
|
*
|
* @param
|
*/
|
public void setOid(String oid) {
|
this.oid = oid;
|
}
|
|
public byte getSourceSubnetId() {
|
return sourceSubnetId;
|
}
|
|
public void setSourceSubnetId(byte sourceSubnetId) {
|
this.sourceSubnetId = sourceSubnetId;
|
}
|
|
public byte getSourceDeviceId() {
|
return sourceDeviceId;
|
}
|
|
public void setSourceDeviceId(byte sourceDeviceId) {
|
this.sourceDeviceId = sourceDeviceId;
|
}
|
|
public byte[] getDeviceType() {
|
return deviceType;
|
}
|
|
public void setDeviceType(byte[] deviceType) {
|
this.deviceType = deviceType;
|
}
|
|
public byte[] getCommand() {
|
return command;
|
}
|
|
public void setCommand(byte[] command) {
|
this.command = command;
|
}
|
|
public byte getDesSubnetId() {
|
return desSubnetId;
|
}
|
|
public void setDesSubnetId(byte desSubnetId) {
|
this.desSubnetId = desSubnetId;
|
}
|
|
public byte getDesDeviceId() {
|
return desDeviceId;
|
}
|
|
public void setDesDeviceId(byte desDeviceId) {
|
this.desDeviceId = desDeviceId;
|
}
|
|
public byte[] getExtraBytes() {
|
return extraBytes;
|
}
|
|
public void setExtraBytes(byte[] extraBytes) {
|
this.extraBytes = extraBytes;
|
}
|
|
/**
|
* IP地址
|
* @return
|
*/
|
public String getIpAddress() {
|
return ipAddress;
|
}
|
|
/**
|
* IP地址
|
* @param ipAddress
|
*/
|
public void setIpAddress(String ipAddress) {
|
this.ipAddress = ipAddress;
|
}
|
|
@Override
|
public String toString() {
|
return String.format("IP地址 %s、源子网号 %s、源设备号 %s、设备类型 %s、操作码 %s、目标子网号 %s、目标设备号 %s、附加数据 %s",getIpAddress(), ByteUtils.encodeHexString(getSourceSubnetId()), ByteUtils.encodeHexString(getSourceDeviceId()), ByteUtils.encodeHexString(getDeviceType()), ByteUtils.encodeHexString(getCommand()), ByteUtils.encodeHexString(getDesSubnetId()),ByteUtils.encodeHexString (getDesDeviceId()), ByteUtils.encodeHexString(getExtraBytes()));
|
}
|
}
|