libember_slim (as client) does not invoke callback when the node targetted by GetDir is empty

107 views
Skip to first unread message

Arndt Stedler

unread,
Jan 17, 2016, 5:05:07 AM1/17/16
to ember-plus-development
When using libember_slim as a consumer i encountered the following problem:
When traversing a tree using GETDIR i keep track of all requests send and remove it from the list as soon as i got an appropriate answer.
Unfortunately when a device has an empty node and generates a Node answer with nothing in like

0x60 - Application | Container +  0 (Root)                      , 0x0c - length,
0x6b - Application | Container + 11 (RootElementCollection)     , 0x0a - length,
0xa0 - Context     | Container +  0 (Default Element)           , 0x08 - length,
0x6a - Application | Container + 10 (QualifiedNode)             , 0x06 - length,
0xa0 - Context     | Container +  0 (Default Element)           , 0x04 - length,
0x0d - Universal               + 13 (Relative Object)           , 0x02 - length,
0x01, 0x03 - data

libember_slim does not invoke a callback. 
Due to this the application cannot distinguish between the device is NOT answering at all and an empty node is returned...
BUT if there is at least one property set in the answer/container like 'isOnline=true': like in

0x60 - Application | Container +  0 (Root)                      , 0x15 - length,
0x6b - Application | Container + 11 (RootElementCollection)     , 0x13 - length,
0xa0 - Context     | Container +  0 (Default Element)           , 0x11 - length,
0x6a - Application | Container + 10 (QualifiedNode)             , 0x0f - length,
0xa0 - Context     | Container +  0 (Default Element)           , 0x04 - length,
0x0d - Universal               + 13 (Relative Object)           , 0x02 - length,
0x01, 0x03 - data,
0xa1 - Context     | Container +  1 (Contents)                  , 0x07 - length,
0x31 - Universal   | Container + 17 (Set)                       , 0x05 - length,
0xa3 - Context     | Container +  3 (isOnline)                  , 0x03 - length,
0x01 - Universal               +  1 (Boolean)                   , 0x01 - length,
0xff - data

a callback is made and everything is fine.

I think libember_slim should made a callback even for empty nodes.


Message has been deleted

Arndt Stedler

unread,
Oct 1, 2017, 7:19:42 AM10/1/17
to ember-plus-development
Ok, i solved the problem. 
In libemberSlim a callback is made ONLY when a Node has content.
In emberasyncreader.c (readByte_Length) you can check whether the incoming container has a tagnumber of 1 or 2, a tag preamble of 0x80 and the prevois container is of type Node or Qualifiednode, and if so, a message will be send out or it is just part of the path. in any other case a onNode message must be generated when the parent container is released.

Now it works as expected.
VisToolMK2 EmberTreeWidget::onItemDoubleClicked (true,true) @SapphireMk2_(Arndt)/Sapphire/GPIOs
VisToolMK2 Tree::GetDir(Sapphire/GPIOs);
VisToolMK2 SendOut GetDir for Sapphire/GPIOs (1/4)
VisToolMK2 Reading: << fe 00 0e 00 01 c0 01 02 14 02 60 80 6b 80 a0 80 6a 80 a0 04 0d 02 01 04 00 00 00 00 00 00 00 00 93 fd db ff
VisToolMK2 Got EMPTY Node: 0x01 0x04 
Reply all
Reply to author
Forward
0 new messages