Allowing an Actor to Receive System Events | developer.brewmp.com Allowing an Actor to Receive System Events | developer.brewmp.com

Developer

Allowing an Actor to Receive System Events

According to the uiOne SDK Tutorial (page 154) it should be possible by setting the node located at /trig/config/actors//eventmask to the correct mask. However, when I try to set this node to the correct value using IVFSNODE_SetData it returns the error code 1 (EFAILED) which indicates that the node could not be written. When I adjusted the code to read the data at that node it still fails and I’m returned the error code 22 (ERESOURCENOTFOUND).

The following code is what I’ve been using while trying to set/read the designated node to the correct value and it is located in the constructor of my actor model (what would be CircleModel_New in the Circle Actor example that is distributed with the uiOne SDK).

IVfsContainer* _root = NULL;
if ( IACTORCONTEXT_GetRoot(_context, &_root) == SUCCESS )
{
AECHAR* _path[6];
AEECLSID _dataType = AEEIID_VFS_STRING_DATA;
AECHAR _buff[100];
int _size = 100;
int _err = SUCCESS;

_path[0] = Str2WStr("trig");
_path[1] = Str2WStr("config");
_path[2] = Str2WStr("actors");
_path[3] = Str2WStr("actorname");
_path[4] = Str2WStr("eventmask");
_path[5] = NULL;

STRTOWSTR("0x40000000", _buff, _size*sizeof(AECHAR));
//_err = IVFSNODE_GetData(_root, _path, &_dataType, _buff, &_size);
_err = IVFSNODE_SetData(_root, _path, _dataType, _buff, _size);

IVFSNODE_Release(_root);
}

I believe the problem is related to not being able to find the correct “config” branch under the trig folder because when I try to “walk” the path with the following code (placed at the same location of the previous code) that’s where it fails, but that could also be a bug in my code because I did an extensive amount of typecasting.

IVfsContainer* _root = NULL;
if ( IACTORCONTEXT_GetRoot(_context, &_root) == SUCCESS )
{
AECHAR* _path[6];
AEECLSID _dataType = AEEIID_VFS_STRING_DATA;
AECHAR _buff[100];
int _size = 100;
int _err = SUCCESS;

_path[0] = Str2WStr("trig");
_path[1] = Str2WStr("config");
_path[2] = Str2WStr("actors");
_path[3] = Str2WStr("actorname");
_path[4] = Str2WStr("eventmask");
_path[5] = NULL;

IVfsContainer* _at = _root;
for (int i = 0; i < 5; ++i)
{
IVfsNode* _next = NULL;
_next = IVFSSTRUCTCONTAINER_Child((IVfsStructContainer*)_at, _path[i]);
if ( _next )
{
_at = (IVfsContainer*)_next;
}
else
{
//No _next Node
break;
}
}
IVFSNODE_Release(_root);
}

Did you try just setting the node at the VFS path /trig/config/actors/actor name/eventmask to the corresponding mask of the event name(s) that you're trying to catch? I tried setting this node in my trig at both /trig/config/actors/actor name/eventmask and /config/actors/actor name/eventmask but didn't have success with either. I was trying to get EVT_APP_SUSPEND & EVT_APP_RESUME sent to my actor.
This is an aside, but it would be really helpful if Qualcomm would supply more examples to its developer community for uiOne that covered more areas like this. For as much hype as uiOne is getting, I feel like the developer community is really getting left out in the pasture.

Did you try just setting the node at the VFS path /trig/config/actors/actor name/eventmask to the corresponding mask of the event name(s) that you're trying to catch? I tried setting this node in my trig at both /trig/config/actors/actor name/eventmask and /config/actors/actor name/eventmask but didn't have success with either. I was trying to get EVT_APP_SUSPEND & EVT_APP_RESUME sent to my actor.
This is an aside, but it would be really helpful if Qualcomm would supply more examples to its developer community for uiOne that covered more areas like this. For as much hype as uiOne is getting, I feel like the developer community is really getting left out in the pasture.

Before posting the question I did try setting the event mask for /trig/config/actors//eventmask, however it couldn't find the node. That's why I had originally tried to "walk" up the node structure.

Before posting the question I did try setting the event mask for /trig/config/actors//eventmask, however it couldn't find the node. That's why I had originally tried to "walk" up the node structure.

Please any one can tell how to debug the CircleActor using the VC++ by putting the break points..

Please any one can tell how to debug the CircleActor using the VC++ by putting the break points..