how to add attribute to device record from protocol decoder.

mbodea20073 years ago

Hello,
How can I add an attribute to a device record from a protocol decoder ?
Like : add key "testScore" , ( int value) to device, when a new position is created, AND save device new attributes ?

Thx.

Anton Tananaev3 years ago

Something like this:

position.set("testScore", value);
mbodea20073 years ago

... yes, but this will only add key to the position, not also to the device attributes record (where I need it to remain until it will arrive a different value from gps device, to update the device record) Thx

Anton Tananaev3 years ago

That doesn't make sense to me. Why would you want to store it in the device?

mbodea20073 years ago

... because, in a mobile app, at some point I'll have device record available, but maybe not have yet position data to retrieve the key. The key being a characteristics of device... I will try to find a workaround to use position attributes to retrieve the key when positions are available. Thx.