kentd wrote:
gibbocool wrote:
Hi danny, cheers for the information.
I think the QueryConfiguration is what I need, but I'm having trouble getting a response from the nodemanager. I'm sending the queryConfiguration to component JAUS_NODE_MANAGER, and setting the queryField to JAUS_SUBSYSTEM_CONFIGURATION but i'm not getting any reportConfiguration messages. Any ideas?
gibbocool
Okay... looking through the source code for the Node Manager, I think I see what may be the issue for you here. If you are sending a QueryConfiguration with a type of JAUS_SUBSYSTEM_CONFIGURATION, the NM checks that the SubsystemCommunicationInterface is enabled, i.e. you have some active subsystem interface. The reason for this is that the SUBSYSTEM_CONFIGURATION is usually used during discovery and only flows between node managers / communicators on the subsystem level. There isn't an easy fix to this (without hacking the NM). One thing you can do is enable the subsystem interface, but that may not be possible. Have you tried the nodeManagerGetAddressList() function? I believe that should work but haven't had a chance to try it.
gibbocool wrote:
I cant find the nodeManagerGetAddressList() function, but I did find:
JausAddressList *nodeManagerGetComponentAddressList(NodeManagerInterface, unsigned char);
Unfortunately I dont know how to call it since I dont know how to put in the correct arguments.
I dont understand how people have been discovering the system before now? Have they just been hard coding node ID's, and instance ID's? I guess for many systems that would be fine, but my system depends on discovering what nodes / components / instances are connected.
I just realized that looking up components on the system table is not covered by any of the OpenJAUS tutorials (shame on us, I'll get that rectified in the future). But that would still not address your particular issue.
Typically, when you are trying to find the JAUS Address of another entity, you know it's Component ID (as specified in the JAUS RA). Using the component ID, a component can query the NodeManager (where the system tree is held and managed) for the JAUS Address of an entity that matches the specified information. To do so you would use the following function defined in the OJ Component Template:
| Code: |
JausBoolean ojCmptLookupAddress(OjCmpt ojCmpt, JausAddress address);
|
This takes the ojCmpt object to operate on and a JausAddress. This JausAddress is special. It should be populated with all the information known about the entity you are searching for (i.e. the subsystem ID if you know it, the node ID if you know it, the cmpt ID)... any zeros in this address are treated as wildcards. The response from the nodeManager is put into that JausAddress entity and True/False is returned if a valid entity is found.
We originally designed the system to support returning a list of possible entities (if more than one match was found), but found that was cumbersome to use and not useful to most developers. Therefore the "list" interface is not exposed currently through the ojCmpt template. Therefore sending 0.0.0.0 will not work.
So, if you absolutely need to get a list of all components on a given system, then I don't think we have a good mechanism in place to do that right now. I think the best solution is to remove the check in the NodeManager that is stopping it from responding to a QueryConfiguration request.
A better long-term solution would be to add a function for this to the ojCmpt template which can query the NM for the information over the UDP port or handle the sending & receiving of the QueryConfiguration message for the component.
All that said... if you go into NodeManagerComponent.cpp (in /libopenJaus/src/nodeManager)... go to line 1300 and comment out that IF statement (and the accompanying ELSE) and I think your Query/Report should start working.
I hope that helps!