0

How to map the DeviceId and busName in ControlPanelController in the same time?

asked 2014-10-07 04:58:06 -0800

StannisLin gravatar image

updated 2015-01-31 23:37:36 -0800

Hi,

I am programming a ControlPanel App via C++. I can get the

  1. DeviceId of a controllee device (ControlPanelDevice) via AboutClient when announceHandlerCallback has been triggered.

  2. busName in ControlPanelController when ControlPanelListenerImpl::sessionEstablished be called.

But I can not get a DeviceId in ControlPanelDevice. My question is:

  1. How to map the DeviceId and busName in ControlPanelController?

  2. Can I get ControlPanelController's rootContainer (buy busName) and deviceId in the same time?

Thanks.


[Update]

I have a idea and already finished it for busName - deviceId mapping and managing of the controllee device. There are two new class which are BusIdMap and IdData for busName, deviceId, and ControlPanelDevice managing in my App.

My idea as the following:

  1. Define a map object in global for busName and deviceId mapping at main code file: std::map<string, MyDevContextClass> aliveControllee; //busName, MyDevContextObj

  2. Manage this map obj in announceHandlerCallback, ControlPanelListenerImpl, and main loop et al.

It works well in my ControlPanelController App, but it seems not a safety solution.

Does any AllJoyn framework API could help me to do busName - deviceId mapping and managing ??


[Update]

My new question of this implement:

https://ask.allseenalliance.org/question/1911/how-to-get-the-alive-status-of-a-controlpanel-device-in-quickly-alljoyn-1402/

edit retag flag offensive close merge delete

Comments

I'm using a similar mechanism - storing both busName and DeviceId when the Announce callback is called, then looking them up when needed.

anszom ( 2014-11-04 04:07:02 -0800 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2014-11-07 15:45:42 -0800

bspencer gravatar image

You are on the right path, there is no API or tracking a DeviceId to BusId mapping. You need to do the book keeping yourself. AllJoyn as a software stack does't care about the DeviceId, it just needs to know who to deliver an AllJoyn Message to, hence the BusId information that it uses to lookup how to route the packet to the destination. The Service frameworks make higher level use of information that is sent from other service frameworks. Their eventually may be a helper set of APIs that helps manage the information that one typically needs in a complex application, but at this time it does not exist.

edit flag offensive delete publish link more
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

Asked: 2014-10-07 04:58:06 -0800

Seen: 108 times

Last updated: Jan 31 '15