This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Questions regarding Mesh Android app:

thanks for the answer on the previous post.

What I came to know from our firmware engineer was that your initial version of the Android app could not support

1. multiple subscriptions for the nodes and

2. also adding clients

But he said he read somewhere that this functionality is there in the Android library but is disabled.

Can you tell me the handlers and data structures to do these 2 things in my version of the app?

Parents
  • Hi,

    1. The app supports mulitple subscriptions and is not disabled.

    2. Adding clients is not supported yet in the app. That's something that will be implemented in the near future. This is a more complex functionality that will need some time to build. Unfortunately its not something I can explain here. You will have to do it manually in your UI by creating the Models you need for this.

  • I was trying to send data to the mesh using the method of:

    mMeshManagerApi.setGenericOnOffUnacknowledged(mMeshManagerApi.getProvisionedNodes().get(5),
                    genericOnOffServerModel,
                    new byte[]{0x00, 0x05},
                    0,
                    null,
                    null,
                    null,
                    isLightOn);

    I've declared the model as:

    GenericOnOffServerModel genericOnOffServerModel = new GenericOnOffServerModel(0x1000);

    However, I get the error of model not having a binding with an app key like below:

    java.lang.IllegalArgumentException: Please bind an app key to this model to control this model!
            at no.nordicsemi.android.meshprovisioner.MeshManagerApi.setGenericOnOffUnacknowledged(MeshManagerApi.java:881)
            at no.nordicsemi.android.nrfmeshprovisioner.MainFragment.send(MainFragment.java:72)
            at no.nordicsemi.android.nrfmeshprovisioner.MainFragment_ViewBinding$1.doClick(MainFragment_ViewBinding.java:30)

    I then used the method mentioned in MeshManagerApi as:

    mMeshManagerApi.bindAppKey(mMeshManagerApi.getProvisionedNodes().get(5),
    new byte[]{0x00, 0x05},
    genericOnOffServerModel,
    0);

    It doesn't work. Am I doing something wrong?
    Also what should I enter in AppKeyIndex? Where is this array and how do I get it?
  • I was seeing that activity itself. I could see:

    final MeshModel model = mViewModel.getMeshModel().getValue();
            if(model != null){
                if(model instanceof GenericOnOffServerModel) {

    On line 326. But it uses ConfigurationModel

    But there is no sendBindAppKey() over there.

  • You can find it on line 261 in ModelConfigurationActivity.java

    sendBindAppKey(appKeyIndex)
  • It worked. I can send a generic on-off set to the node. Didn't require sendBindAppKey(Index);

    On a side note, there is no such function sendBindAppKey(Index); exists in that Activity.

    Also, regarding Generic on-off Get, where do I get the value (true/false) of server model in the element?

    Bcoz, 

    public void getGenericOnOff(final ProvisionedMeshNode node, final MeshModel model, final byte[] dstAddress, final int appKeyIndex)

    Doesn't return any Boolean value.

  • That's great, its impossible that the line is not there, if that's the case the app won't be able to bind a key at all. I have refactored some of the api calls locally probably this is why. I suppose you are not using 1.0 version of the app because you can find it here. When you send a GenericOnOffGet message you will get a GenericOnOffStatus. You should read up the spec and follow the example app. 

  • Correct. It's 

    mViewModel.bindAppKey(appKeyIndex);

    and not

    sendBindAppKey(appKeyIndex);

    like you said in the prev. comment.

    I'll have a look at Get and See. Where is this GenericOnOffStatus? In which structure? In the example, you have used mViewModel and not MeshManagerApi.

Reply Children
No Data
Related