1

Get the commands that each unit

Тема: Get the commands that each unit

Hello team,

I have a little problem, I 'm developing an app to get the commands with each unit counts but can not find a function for java . Any suggestions or opinion. Thank you very much.

2

Get the commands that each unit

Re: Get the commands that each unit

Hello.
Sorry, I can't clearly understand what do you mean by "commands with each unit counts". Please select which unit's data you want to receive from server here http://sdk.wialon.com/wiki/en/sidebar/r … ormat/unit

Mobile Development
Gurtam
3

Get the commands that each unit

Re: Get the commands that each unit

kopa

No, I need to know about the implementation of method getCommands() in java the packages is "com.wialon.item" classes "Unit"

4

Get the commands that each unit

Re: Get the commands that each unit

Denisse
You can find it at the Unit.class.

Mobile Development
Gurtam
5

Get the commands that each unit

Re: Get the commands that each unit

kopa

Woow, thank you very much. I am very grateful.

6

Get the commands that each unit

Re: Get the commands that each unit

kopa

Sorry Kopa, but I dont understand the implementation of class Unit for get ListCommands of each unit. Can I help you, please?

7

Get the commands that each unit

(02/09/2016 23:34:15 отредактировано Denisse)

Re: Get the commands that each unit

deal kopa


Can I help you? with an example for get the list commands of each unit, I have of ID of ech unit but I dont understand as join them. Suggest please. My app is in java.

8

Get the commands that each unit

Re: Get the commands that each unit

You can look at unit search example , but for commands you need to add data flags:
1.

Unit.dataFlag.commandAliases

if you want to get all commands by

Unit.getCommands()

2.

Unit.dataFlag.commands

if you want to get commands, which available for executing by

Unit.getCommandDefinitionsPlugin()

And finally your search items call will look like:

session.searchItems(searchSpec, 1, Item.dataFlag.base.getValue()|Unit.dataFlag.commandAliases.getValue()|Unit.dataFlag.commands.getValue(), 0, Integer.MAX_VALUE, new SearchResponseHandler())

Aftrer at SearchResponseHandler you can iterate items and get commands:

public void onSuccessSearch(Item... items) {
                super.onSuccessSearch(items);
                //TODO: Your code
                for (Item item : items){
                        ((Unit)item).getCommands();
                        ((Unit)item).getCommandDefinitionsPlugin();
            }
}
Mobile Development
Gurtam
9

Get the commands that each unit

Re: Get the commands that each unit

kopa

Thank you very much.

And one question more, If I want get Properties Basics of  each unit for example telephone, deviceId and namedevice, same I have to get add some flag? or need to add some more.

10

Get the commands that each unit

Re: Get the commands that each unit

Denisse yes, you need to add flag. You can find descriptions of them for each type at  data format section

Mobile Development
Gurtam
11

Get the commands that each unit

Re: Get the commands that each unit

kopa

Sorry Kopa, but Can I help you? with example for get the PhoneNumber of each Unit, please.

I am very grateful.

12

Get the commands that each unit

Re: Get the commands that each unit

Denisse
Unit's phone number is under a data flag with value 0x100 or at  java unit's class is under a constant with value

Unit.dataFlag.restricted

To get first or second phone number use methods:

Unit.getPhoneNumber();
Unit.getPhoneNumber2();
Mobile Development
Gurtam
13

Get the commands that each unit

Re: Get the commands that each unit

kopa

I am very grateful for this help. Thank you very much.

14

Get the commands that each unit

Re: Get the commands that each unit

Denisse you are welcome.

Mobile Development
Gurtam