Lines Matching refs:index

79 static void update_min_measured(uint16_t obj_inst_id, int index)  in update_min_measured()  argument
81 min_measured_value[index] = sensor_value[index]; in update_min_measured()
86 static void update_max_measured(uint16_t obj_inst_id, int index) in update_max_measured() argument
88 max_measured_value[index] = sensor_value[index]; in update_max_measured()
135 int index, i = 0, j = 0; in temp_sensor_create() local
138 for (index = 0; index < MAX_INSTANCE_COUNT; index++) { in temp_sensor_create()
139 if (inst[index].obj && inst[index].obj_inst_id == obj_inst_id) { in temp_sensor_create()
146 for (index = 0; index < MAX_INSTANCE_COUNT; index++) { in temp_sensor_create()
147 if (!inst[index].obj) { in temp_sensor_create()
152 if (index >= MAX_INSTANCE_COUNT) { in temp_sensor_create()
159 sensor_value[index] = 0; in temp_sensor_create()
160 units[index][0] = '\0'; in temp_sensor_create()
161 min_measured_value[index] = INT32_MAX; in temp_sensor_create()
162 max_measured_value[index] = -INT32_MAX; in temp_sensor_create()
163 min_range_value[index] = 0; in temp_sensor_create()
164 max_range_value[index] = 0; in temp_sensor_create()
166 (void)memset(res[index], 0, in temp_sensor_create()
167 sizeof(res[index][0]) * ARRAY_SIZE(res[index])); in temp_sensor_create()
168 init_res_instance(res_inst[index], ARRAY_SIZE(res_inst[index])); in temp_sensor_create()
171 INIT_OBJ_RES(SENSOR_VALUE_RID, res[index], i, in temp_sensor_create()
172 res_inst[index], j, 1, false, true, in temp_sensor_create()
173 &sensor_value[index], sizeof(*sensor_value), in temp_sensor_create()
175 INIT_OBJ_RES_DATA_LEN(SENSOR_UNITS_RID, res[index], i, res_inst[index], j, in temp_sensor_create()
176 units[index], UNIT_STR_MAX_SIZE, 0); in temp_sensor_create()
177 INIT_OBJ_RES_DATA(MIN_MEASURED_VALUE_RID, res[index], i, in temp_sensor_create()
178 res_inst[index], j, &min_measured_value[index], in temp_sensor_create()
180 INIT_OBJ_RES_DATA(MAX_MEASURED_VALUE_RID, res[index], i, in temp_sensor_create()
181 res_inst[index], j, &max_measured_value[index], in temp_sensor_create()
183 INIT_OBJ_RES_DATA(MIN_RANGE_VALUE_RID, res[index], i, in temp_sensor_create()
184 res_inst[index], j, &min_range_value[index], in temp_sensor_create()
186 INIT_OBJ_RES_DATA(MAX_RANGE_VALUE_RID, res[index], i, in temp_sensor_create()
187 res_inst[index], j, &max_range_value[index], in temp_sensor_create()
190 res[index], i, reset_min_max_measured_values_cb); in temp_sensor_create()
192 INIT_OBJ_RES_OPTDATA(APPLICATION_TYPE_RID, res[index], i, in temp_sensor_create()
193 res_inst[index], j); in temp_sensor_create()
194 INIT_OBJ_RES_OPTDATA(TIMESTAMP_RID, res[index], i, res_inst[index], j); in temp_sensor_create()
195 INIT_OBJ_RES_OPTDATA(FRACTIONAL_TIMESTAMP_RID, res[index], i, in temp_sensor_create()
196 res_inst[index], j); in temp_sensor_create()
197 INIT_OBJ_RES_OPTDATA(MEASUREMENT_QUALITY_INDICATOR_RID, res[index], in temp_sensor_create()
198 i, res_inst[index], j); in temp_sensor_create()
199 INIT_OBJ_RES_OPTDATA(MEASUREMENT_QUALITY_LEVEL_RID, res[index], i, in temp_sensor_create()
200 res_inst[index], j); in temp_sensor_create()
203 inst[index].resources = res[index]; in temp_sensor_create()
204 inst[index].resource_count = i; in temp_sensor_create()
206 return &inst[index]; in temp_sensor_create()