Protocol: GT06 Alternative

smsoousa8 years ago

Hello Anton.
Would you like your help to assist me in how can I include two more codes for blocking in the Gt06ProtocolEncoder.java protocol? I know I need to compile the file and then import it to the server, but I am not able to compile the java file already with the command changes. Can you help me? Thank you

Anton Tananaev8 years ago

Please provide more details on what codes you are talking about.

smsoousa8 years ago
        boolean alternative = Context.getIdentityManager().lookupAttributeBoolean(
                command.getDeviceId(), "gt06.alternative", false, true);

        switch (command.getType()) {
            case Command.TYPE_ENGINE_STOP:
                return encodeContent(alternative ? "DYD,123456#" : "Relay,1#" : "My Code");
            case Command.TYPE_ENGINE_RESUME:
                return encodeContent(alternative ? "HFYD,123456#" : "Relay,0#" : "My Code");
            case Command.TYPE_CUSTOM:
                return encodeContent(command.getString(Command.KEY_DATA));
Anton Tananaev8 years ago

I understood that part. I need to know what "My Code" you are planning to use and why you need it.

smsoousa8 years ago

As well as the alternative protocol commands gt06:

DYD, 123456 # / Relay, 1 #
HFYD, 123456 # / Relay, 0 #

I'm working with a crawler that is the same protocol, however the lock commands change, to:

#Cortar,888888#
#Religar,888888#

So I would like to implement these commands so that locks can be possible for this model.

It would look something like this:

        switch (command.getType()) {
            case Command.TYPE_ENGINE_STOP:
                return encodeContent(alternative ? "DYD,123456#" : "Relay,1#" : "#Cortar,888888#");
            case Command.TYPE_ENGINE_RESUME:
                return encodeContent(alternative ? "HFYD,123456#" : "Relay,0#" : "#Religar,888888#");
            case Command.TYPE_CUSTOM:
                return encodeContent(command.getString(Command.KEY_DATA));
Anton Tananaev8 years ago

Is "888888" a password? What is the device called?

smsoousa8 years ago

Yes, it is a new crawler model manufactured in Brazil.

mini1 mini2

The protocol is the same as the GT06

Anton Tananaev8 years ago

I guess we can change "alternative" parameter to accept different values, not just boolean.

smsoousa8 years ago

Do you have any idea how to do it? For example create a field in the device settings, if it is a gt06, where we can inform the lock and unlock command for the device in question.

Anton Tananaev8 years ago

Same way that it's already done for this and other protocols.

smsoousa8 years ago

Ok, in that case how to proceed? Can you do the inclusion in the code and share? Or does it help me in how to perform the procedure?

Anton Tananaev8 years ago

Send us an email if you need help.

smsoousa8 years ago

Okay, I'll send you an email asking for help. Thank you Anton!

Ronald7 years ago

smsoousa found a solution? Facing a similar issue