#include <uabase/statuscodes.h>
#include "custom_provider_store.h"
struct custom_eu_range {
uint32_t eu_low;
uint32_t eu_high;
};
static uint32_t g_custom_provider_values[3];
static struct custom_eu_range g_custom_provider_ranges[3];
int custom_store_set_initial_value(unsigned int idx, uint32_t value) {
if (idx >= countof(g_custom_provider_values)) return -1;
g_custom_provider_values[idx] = value;
return 0;
}
int custom_store_set_range(unsigned int idx, uint32_t low, uint32_t high)
{
if (idx >= countof(g_custom_provider_values)) return -1;
g_custom_provider_ranges[idx].eu_low = low;
g_custom_provider_ranges[idx].eu_high = high;
return 0;
}
void custom_store_get_value(
void *store,
ua_node_t node,
unsigned int idx,
bool source_ts,
struct ua_indexrange *range,
unsigned int num_ranges,
struct ua_datavalue *result)
{
UA_UNUSED(node);
UA_UNUSED(range);
UA_UNUSED(store);
if (idx >= countof(g_custom_provider_values)) {
return;
}
if (num_ranges > 0) {
return;
}
}
{
uint32_t newval;
UA_UNUSED(range);
UA_UNUSED(store);
UA_UNUSED(node);
}
}
newval = value->
value.value.ui32;
if (newval > g_custom_provider_ranges[idx].eu_high ||
newval < g_custom_provider_ranges[idx].eu_low) {
}
g_custom_provider_values[idx] = newval;
return 0;
}