1078-解析104...
This commit is contained in:
@@ -10,6 +10,7 @@ import com.genersoft.iot.vmp.jt1078.proc.response.Rs;
|
|||||||
import com.genersoft.iot.vmp.jt1078.service.Ijt1078Service;
|
import com.genersoft.iot.vmp.jt1078.service.Ijt1078Service;
|
||||||
import com.genersoft.iot.vmp.jt1078.session.Session;
|
import com.genersoft.iot.vmp.jt1078.session.Session;
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
|
import io.netty.buffer.ByteBufUtil;
|
||||||
import org.springframework.context.ApplicationEvent;
|
import org.springframework.context.ApplicationEvent;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
@@ -30,8 +31,9 @@ public class J0104 extends Re {
|
|||||||
@Override
|
@Override
|
||||||
protected Rs decode0(ByteBuf buf, Header header, Session session) {
|
protected Rs decode0(ByteBuf buf, Header header, Session session) {
|
||||||
respNo = buf.readUnsignedShort();
|
respNo = buf.readUnsignedShort();
|
||||||
|
System.err.println("应答流水号: " + respNo);
|
||||||
paramLength = (int) buf.readUnsignedByte();
|
paramLength = (int) buf.readUnsignedByte();
|
||||||
|
System.err.println("参数项个数: " + paramLength);
|
||||||
if (paramLength <= 0) {
|
if (paramLength <= 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -48,12 +50,10 @@ public class J0104 extends Re {
|
|||||||
System.out.println("========");
|
System.out.println("========");
|
||||||
for (int i = 0; i < paramLength; i++) {
|
for (int i = 0; i < paramLength; i++) {
|
||||||
long id = buf.readUnsignedInt();
|
long id = buf.readUnsignedInt();
|
||||||
System.out.println(id);
|
|
||||||
short length = buf.readUnsignedByte();
|
short length = buf.readUnsignedByte();
|
||||||
if (allFieldMap.containsKey(id)) {
|
if (allFieldMap.containsKey(id)) {
|
||||||
Field field = allFieldMap.get(id);
|
Field field = allFieldMap.get(id);
|
||||||
field.setAccessible(true);
|
field.setAccessible(true);
|
||||||
System.out.println(field.getGenericType());
|
|
||||||
try {
|
try {
|
||||||
switch (field.getGenericType().toString()) {
|
switch (field.getGenericType().toString()) {
|
||||||
case "class java.lang.Long":
|
case "class java.lang.Long":
|
||||||
@@ -73,8 +73,6 @@ public class J0104 extends Re {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
System.out.println(respNo);
|
|
||||||
System.out.println(paramLength);
|
|
||||||
System.out.println(deviceConfig.toString());
|
System.out.println(deviceConfig.toString());
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user