Lines Matching refs:index

83 static void update_min_measured(uint16_t obj_inst_id, int index)  in update_min_measured()  argument
85 min_measured_value[index] = sensor_value[index]; in update_min_measured()
89 static void update_max_measured(uint16_t obj_inst_id, int index) in update_max_measured() argument
91 max_measured_value[index] = sensor_value[index]; in update_max_measured()
139 int index, i = 0, j = 0; in current_sensor_create() local
142 for (index = 0; index < MAX_INSTANCE_COUNT; index++) { in current_sensor_create()
143 if (inst[index].obj && inst[index].obj_inst_id == obj_inst_id) { in current_sensor_create()
151 for (index = 0; index < MAX_INSTANCE_COUNT; index++) { in current_sensor_create()
152 if (!inst[index].obj) { in current_sensor_create()
157 if (index >= MAX_INSTANCE_COUNT) { in current_sensor_create()
164 units[index][0] = '\0'; in current_sensor_create()
165 min_measured_value[index] = INT32_MAX; in current_sensor_create()
166 max_measured_value[index] = -INT32_MAX; in current_sensor_create()
167 min_range_value[index] = 0; in current_sensor_create()
168 max_range_value[index] = 0; in current_sensor_create()
169 calibration_coefficient[index] = 1; in current_sensor_create()
170 app_type[index][0] = '\0'; in current_sensor_create()
172 (void)memset(res[index], 0, in current_sensor_create()
173 sizeof(res[index][0]) * ARRAY_SIZE(res[index])); in current_sensor_create()
174 init_res_instance(res_inst[index], ARRAY_SIZE(res_inst[index])); in current_sensor_create()
177 INIT_OBJ_RES(SENSOR_VALUE_RID, res[index], i, res_inst[index], j, 1, in current_sensor_create()
178 false, true, &sensor_value[index], sizeof(*sensor_value), in current_sensor_create()
180 INIT_OBJ_RES_DATA_LEN(SENSOR_UNITS_RID, res[index], i, res_inst[index], j, in current_sensor_create()
181 units[index], UNIT_STR_MAX_SIZE, 0); in current_sensor_create()
182 INIT_OBJ_RES_DATA(MIN_MEASURED_VALUE_RID, res[index], i, in current_sensor_create()
183 res_inst[index], j, &min_measured_value[index], in current_sensor_create()
185 INIT_OBJ_RES_DATA(MAX_MEASURED_VALUE_RID, res[index], i, in current_sensor_create()
186 res_inst[index], j, &max_measured_value[index], in current_sensor_create()
188 INIT_OBJ_RES_DATA(MIN_RANGE_VALUE_RID, res[index], i, res_inst[index], in current_sensor_create()
189 j, &min_range_value[index], sizeof(*min_range_value)); in current_sensor_create()
190 INIT_OBJ_RES_DATA(MAX_RANGE_VALUE_RID, res[index], i, res_inst[index], in current_sensor_create()
191 j, &max_range_value[index], sizeof(*max_range_value)); in current_sensor_create()
192 INIT_OBJ_RES_EXECUTE(RESET_MIN_MAX_MEASURED_VALUES_RID, res[index], i, in current_sensor_create()
194 INIT_OBJ_RES_DATA(CURRENT_CALIBRATION_RID, res[index], i, in current_sensor_create()
195 res_inst[index], j, &calibration_coefficient[index], in current_sensor_create()
197 INIT_OBJ_RES_DATA_LEN(APPLICATION_TYPE_RID, res[index], i, res_inst[index], in current_sensor_create()
198 j, app_type[index], APP_TYPE_STR_MAX_SIZE, 0); in current_sensor_create()
201 INIT_OBJ_RES_OPTDATA(TIMESTAMP_RID, res[index], i, res_inst[index], j); in current_sensor_create()
202 INIT_OBJ_RES_OPTDATA(FRACTIONAL_TIMESTAMP_RID, res[index], i, in current_sensor_create()
203 res_inst[index], j); in current_sensor_create()
204 INIT_OBJ_RES_OPTDATA(MEASUREMENT_QUALITY_INDICATOR_RID, res[index], i, in current_sensor_create()
205 res_inst[index], j); in current_sensor_create()
206 INIT_OBJ_RES_OPTDATA(MEASUREMENT_QUALITY_LEVEL_RID, res[index], i, in current_sensor_create()
207 res_inst[index], j); in current_sensor_create()
210 inst[index].resources = res[index]; in current_sensor_create()
211 inst[index].resource_count = i; in current_sensor_create()
213 return &inst[index]; in current_sensor_create()