Asset Parameter Initialization
mstocum
Posts: 120
What exactly is the correct way to set the correct initial values for a parameter? I'm currently using the ONLINE DATA_EVENT and DATA_INITIALIZED CHANNEL_EVENTS to query the module, and store them using KeySetValue() in the COMMAND DATA_EVENT.
Then in SynchronizeAssetParameters() I'm trying to synchronize the values like this:
The problem I'm seeing is that everything is being set with a zero value, and nothing gets initialized until I query the module after RMS has started up. What is the "correct" way to set initial values after a reboot?
Then in SynchronizeAssetParameters() I'm trying to synchronize the values like this:
RmsAssetParameterEnqueueSetValue(assetClientKey, 'filter.consumption', KeyGetValue('filter.consumption'));
The problem I'm seeing is that everything is being set with a zero value, and nothing gets initialized until I query the module after RMS has started up. What is the "correct" way to set initial values after a reboot?
0
Comments
uKeys[nIdx].cName is never set, so KeySetValue() doesn't actually accomplish anything. Changing the code to this:
gets things working better. Things still aren't setting properly, but at least it's sending the right commands. I think there may be an issue with queued parameter updates not being set.
ETA: I solved the last issue I had, see this thread http://www.amxforums.com/showthread.php?9575-RmsAssetParameterEnqueueSetValue()-doesn-t-work
// Add it
IF(nKeyCount < MAX_KEYS)
{
nKeyCount++
uKeys[nKeyCount].cName = cKey <<< THIS LINE IS MISSING
RETURN(nKeyCount)
}
I will report this to the development team for further investigation and fix.
Thanks!