Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
SampleConsoleServer: Instance of MyEvent is in namespace 0
March 1, 2024
14:54, EET
Avatar
Manfred Hausmann
Member
Members
Forum Posts: 18
Member Since:
September 21, 2018
sp_UserOfflineSmall Offline

Hi

There is a difference between SDK 4.10.6-24 and 5.1.0-116 regarding the namespace of instances.
SDK 4.10.6-24: MyEventType ev = createEvent(MyEventType.class); the event was in the namespace of MyNodeManager; ev.getNodeManager() returned MyNodeManager
SDK 5.1.0-116: MyEventType ev = createEvent(MyEventType.class); the event is in the server namespace; ev.getNodeManager() returns NodeMangerRoot

Is this an intended change?
In the change history of version 5.1.0-116 I cannot find any reference to this.

Best regards,
Manfred

March 1, 2024
16:20, EET
Avatar
Matti Siponen
Moderator
Members

Moderators
Forum Posts: 349
Member Since:
February 11, 2020
sp_UserOfflineSmall Offline

Hello,

From 5.x.x onwards, the NodeManager of a created Node is selected based on its NodeId. For one-shot Events, the NodeId.NULL is used, which is ns=0;i=0 to be exact, for which the RootNodeManager is selected.

March 1, 2024
18:32, EET
Avatar
Manfred Hausmann
Member
Members
Forum Posts: 18
Member Since:
September 21, 2018
sp_UserOfflineSmall Offline

Hi Matti

Thanks for your swift reply.
The explanation makes sense to me.

The sample server that comes with the SDK is therefore no longer able to set MyVariable or MyProperty because the methods MyEventType.setMyVariable(…) and also MyEventType.setMyProperty(…) do not find the components MyVariable resp. MyProperty via browse name. This is because MyEventType is created in MyNodeManager.NAMESPACE. You might want to correct this problem with the next release.

Best regards,
Manfred

March 4, 2024
11:05, EET
Avatar
Matti Siponen
Moderator
Members

Moderators
Forum Posts: 349
Member Since:
February 11, 2020
sp_UserOfflineSmall Offline

Hello,

I can confirm that this bug exists in the current release of the SDK. Thank you for reporting it to us. It will be fixed in the next release of the SDK.

You can fix this by modifying the getMyPropertyNode and getMyVariableNode methods of MyEventType class. They’re relying on the getNodeManager().getNamespaceIndex() to get the NamespaceIndex for the QualifiedName. Calling that returns 0, which is incorrect, so you can replace the getNodeManager().getNamespaceIndex() calls with a constant value of 2, which is the NamespaceIndex of MyNodeManager.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 1919

Currently Online:
38 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Heikki Tahvanainen: 402

hbrackel: 144

rocket science: 88

pramanj: 86

Francesco Zambon: 83

Ibrahim: 78

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

Member Stats:

Guest Posters: 0

Members: 726

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1529

Posts: 6471

Newest Members:

gabriellabachus, Deakin, KTP25Zof, Wojciech Kubala, efrennowell431, wilfredostuart, caitlynfajardo, jeromechubb7, franciscagrimwad, adult_gallery

Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0

Administrators: admin: 1