i going to add bitrek protocol support. need someone's help on this.
to begin connection we need to send.
If the server accepts the connection, it responds with 1 binary byte with the value 1.
Otherwise sends 0.
please any one help. how to do this in JAVA
int length = buf.readableBytes();
String imei = buf.toString(3, 15, StandardCharsets.US_ASCII);
DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, imei);
if (channel != null) {
ByteBuf response = Unpooled.buffer(1);
if (deviceSession != null) {
response.writeByte(1);
} else {
response.writeByte(0);
}
channel.writeAndFlush(new NetworkMessage(response, remoteAddress));
}
return deviceSession;
in this code. i am getting IMEI. but response.writeByte(1); not sending it responds with 1 binary byte with the value 1. please help me.
Thanks in advance
Debug the code and check logs. Your code seems fine.
problem with the device. fixed. now getting data. thanks for the support
i going to add bitrek protocol support. need someone's help on this.
to begin connection we need to send.
If the server accepts the connection, it responds with 1 binary byte with the value 1.
Otherwise sends 0.
please any one help. how to do this in JAVA
int length = buf.readableBytes(); String imei = buf.toString(3, 15, StandardCharsets.US_ASCII); DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, imei); if (channel != null) { ByteBuf response = Unpooled.buffer(1); if (deviceSession != null) { response.writeByte(1); } else { response.writeByte(0); } channel.writeAndFlush(new NetworkMessage(response, remoteAddress)); } return deviceSession;
in this code. i am getting IMEI. but response.writeByte(1); not sending it responds with 1 binary byte with the value 1. please help me.
Thanks in advance