1078-设置电话本+电话回拨

This commit is contained in:
648540858
2024-05-02 05:21:50 +08:00
parent 16bc3dabd6
commit 734f0c7e04
8 changed files with 305 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
package com.genersoft.iot.vmp.jt1078.proc.response;
import com.genersoft.iot.vmp.jt1078.annotation.MsgId;
import com.genersoft.iot.vmp.jt1078.bean.JTTextSign;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import java.nio.charset.Charset;
/**
* 电话回拨
*/
@MsgId(id = "8400")
public class J8400 extends Rs {
/**
* 标志, 0'普通通话,1'监听
*/
private int sign;
/**
* 电话号码
*/
private String phoneNumber;
@Override
public ByteBuf encode() {
ByteBuf buffer = Unpooled.buffer();
buffer.writeByte(sign);
buffer.writeCharSequence(phoneNumber, Charset.forName("GBK"));
return buffer;
}
public int getSign() {
return sign;
}
public void setSign(int sign) {
this.sign = sign;
}
public String getPhoneNumber() {
return phoneNumber;
}
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
}

View File

@@ -0,0 +1,57 @@
package com.genersoft.iot.vmp.jt1078.proc.response;
import com.genersoft.iot.vmp.jt1078.annotation.MsgId;
import com.genersoft.iot.vmp.jt1078.bean.JTPhoneBookContact;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import java.nio.charset.Charset;
import java.util.List;
/**
* 设置电话本
*/
@MsgId(id = "8401")
public class J8401 extends Rs {
/**
* 设置类型:
* 0: 删除终端上所有存储的联系人,
* 1: 表示更新电话本$ 删除终端中已有全部联系人并追加消 息中的联系人,
* 2: 表示追加电话本,
* 3: 表示修改电话本$以联系人为索引
*/
private int type;
/**
* 联系人
*/
private List<JTPhoneBookContact> phoneBookContactList;
@Override
public ByteBuf encode() {
ByteBuf buffer = Unpooled.buffer();
buffer.writeByte(type);
buffer.writeByte(phoneBookContactList.size());
for (JTPhoneBookContact jtPhoneBookContact : phoneBookContactList) {
buffer.writeBytes(jtPhoneBookContact.encode());
}
return buffer;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public List<JTPhoneBookContact> getPhoneBookContactList() {
return phoneBookContactList;
}
public void setPhoneBookContactList(List<JTPhoneBookContact> phoneBookContactList) {
this.phoneBookContactList = phoneBookContactList;
}
}