update_data_flags
The update_data_flags function is used to add and delete items from a session. Adding items to a session is necessary to receive events from them.
svc=core/update_data_flags¶ms={"spec":[
{
"type":"<text>",
"data":<long|text|[long]>,
"flags":<long>,
"mode":<uint>,
"max_items":<uint>
}
]}
Parameters
Name | Description |
---|---|
spec | The array of units with a configuration for requesting the modification of items that are in the session. |
type | The method of transferring items to the session:
|
data | Data. This parameter depends on the previous one. |
flags | The flags that define what information about items should be added to the session. The item flags of each type are described in the Data format section. |
mode | The flag application mode:
The flags are specified to monitor changes in the specific properties of the item. The number of specified flags depends on your needs. If you want to receive all events, all flags should be specified. You can receive the events using the avl_evts function. |
max_items | The maximum number of subscribed items. Available only when type='type'. |
Returned result
[ /* array of items*/
{
"i":<long>, /* ID */
"d":{ /* other fields */
...
},
"f":<long> /* applied flags with properties */
},
...
]
The “d” field format depends on the returned item type. If the “2” flag mode is indicated when sending this request, the null value is returned to the “d” field. The formats of all item types are described in the Data format section.
Possible error codes:
Code | Description |
---|---|
4 | Wrong input parameters or error updating flags. |