Drivers from resource in Java SDK

Topic: Drivers from resource in Java SDK

Good day,
I have a detail with the java SDK since I want to take out the drivers that are registered in the account, but I only get the resources and I do not know how to activate the view of the drivers. Like to be able to join them to a unit: this is my code:

private void searchDrivers(){
        //Create new search specification
        SearchSpec searchSpec=new SearchSpec();
        Resource recurso = new Resource();
        //Set items type to search avl_units
        //Set property name to search
        //Set property value mask to search all units
        //Set sort type by units name
        //Send search by created search specification with items base data flag and from 0 to maximum number
        session.searchItems(searchSpec, 1, Item.dataFlag.base.getValue() | Resource.accessFlag.viewDrivers.getValue() | Resource.dataFlag.drivers.getValue() | Resource.accessFlag.viewDriverUnits.getValue() , 0, Integer.MAX_VALUE, new SearchResponseHandler() {
            public void onSuccessSearch(Item... items) {
                // Search succeed
                System.out.println("Search items is successful");
            public void onFailure(int errorCode, Throwable throwableError) {
                super.onFailure(errorCode, throwableError);
                // search item failed, print error

    private void printDriversNames(Item... items){

        if (items!=null && items.length>0) {
            System.out.println(String.format("%d units found\r\nPrinting their names...", items.length));
            //Print items names
            for (Item item : items) {
                System.out.println(String.format("\t%s", ((Resource) item).getId()));
        //return ListaUnidades;

I hope you can help me with this topic, thank you.


Drivers from resource in Java SDK

Re: Drivers from resource in Java SDK

Can you help me, please?


Drivers from resource in Java SDK

Re: Drivers from resource in Java SDK

Denisse Hello. The drivers are not implemented in the Java SDK. You can add them following the example with Sensors or CommandDefinitions at Unit.class or Notifications and Reports at Resource.class.

Mobile Development