Please provide more details on what codes you are talking about.
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));
I understood that part. I need to know what "My Code" you are planning to use and why you need it.
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));
Is "888888" a password? What is the device called?
Yes, it is a new crawler model manufactured in Brazil.
The protocol is the same as the GT06
I guess we can change "alternative" parameter to accept different values, not just boolean.
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.
Same way that it's already done for this and other protocols.
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?
Send us an email if you need help.
Okay, I'll send you an email asking for help. Thank you Anton!
smsoousa found a solution? Facing a similar issue
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