BITREK Protocol Support

Babu Paavalan 7 years ago

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

Anton Tananaev 7 years ago

Debug the code and check logs. Your code seems fine.

Babu Paavalan 7 years ago

Protocol Details -> https://www.dropbox.com/s/3usu9bmnyuoycmw/BITREK_protocol_EN.pdf?dl=0

please help me to add this in traccar

Babu Paavalan 7 years ago

problem with the device. fixed. now getting data. thanks for the support