Subscription: in create monitored item Bad_IndexRangeNoData and Bad_IndexRangeInvalid cases switched
In fill_response_subscription_create_monitored_items
Bad_IndexRangeNoData and Bad_IndexRangeInvalid cases switched:
/* Create monitored item */
/* From part 4:
When a user adds a monitored item that the user is denied read access to, the add operation for
the item shall succeed and the bad status Bad_NotReadable or Bad_UserAccessDenied shall be
returned in the Publish response.
The same procedure shall be applied for an IndexRange that does not deliver data
for the current value but could deliver data in the future.
*/
IF l_sc /= e_sc_ok & (l_sc = e_sc_bad_not_readable or
l_sc = e_sc_bad_user_access_denied or
l_sc = e_sc_bad_index_range_invalid)
THEN
/* For PublishResponse */
l_valueSc <-- getall_conv_StatusCode_To_RawStatusCode(l_sc);
l_sc := e_sc_ok
END;
The specification indicates we should return Bad_IndexRangeNoData in a PublishResponse in some cases:
If the ArrayDimensions have a fixed length that can not change and no data exists within the range of indexes specified, Bad_IndexRangeNoData is returned in CreateMonitoredItems. Otherwise if the length of the array is dynamic, the Server shall return this status in a Publish response for the MonitoredItem if no data exists within the range.
But we consider e_sc_bad_index_range_invalid instead of bad_index_range_no_data in the code.
Edited by Vincent Monfort