Lines Matching full:sensitivity

46 /* sensor_later_config including arbitrate/set interval/sensitivity
136 /* search from all clients, arbitrate the sensitivity */ in arbitrate_sensitivity()
138 LOG_DBG("arbitrate sensitivity, sensor:%s for each conn:%p, idx:%d, sens:%d", in arbitrate_sensitivity()
140 conn->sensitivity[index]); in arbitrate_sensitivity()
144 if (conn->sensitivity[index] < min_sensitivity) { in arbitrate_sensitivity()
145 min_sensitivity = conn->sensitivity[index]; in arbitrate_sensitivity()
148 LOG_DBG("arbitrate sensitivity, sensor:%s, min_sensitivity:%d", in arbitrate_sensitivity()
152 * by any client, in this case, return sensitivity 0 in arbitrate_sensitivity()
157 static int set_arbitrate_sensitivity(struct sensing_sensor *sensor, int index, uint32_t sensitivity) in set_arbitrate_sensitivity() argument
160 struct sensor_value threshold = {.val1 = sensitivity}; in set_arbitrate_sensitivity()
163 /* update sensor sensitivity */ in set_arbitrate_sensitivity()
164 sensor->sensitivity[index] = sensitivity; in set_arbitrate_sensitivity()
167 threshold.val1 = MIN(sensor->sensitivity[i], threshold.val1); in set_arbitrate_sensitivity()
176 uint32_t sensitivity = arbitrate_sensitivity(sensor, index); in config_sensitivity() local
178 LOG_INF("config sensitivity, sensor:%s, index:%d, sensitivity:%d", in config_sensitivity()
179 sensor->dev->name, index, sensitivity); in config_sensitivity()
181 return set_arbitrate_sensitivity(sensor, index, sensitivity); in config_sensitivity()
197 LOG_WRN("sensor:%s config sensitivity index:%d error:%d", in config_sensor()
277 memset(conn->sensitivity, 0x00, sizeof(conn->sensitivity)); in init_connection()
443 int set_sensitivity(struct sensing_connection *conn, int8_t index, uint32_t sensitivity) in set_sensitivity() argument
447 __ASSERT(conn && conn->source, "set sensitivity, connection or reporter not be NULL"); in set_sensitivity()
449 LOG_INF("set sensitivity, sensor:%s, index:%d, sensitivity:%d, count:%d", in set_sensitivity()
451 sensitivity, conn->source->sensitivity_count); in set_sensitivity()
454 LOG_ERR("sensor:%s sensitivity index:%d invalid", conn->source->dev->name, index); in set_sensitivity()
460 conn->sensitivity[i] = sensitivity; in set_sensitivity()
463 conn->sensitivity[index] = sensitivity; in set_sensitivity()
469 int get_sensitivity(struct sensing_connection *conn, int8_t index, uint32_t *sensitivity) in get_sensitivity() argument
473 __ASSERT(conn && conn->source, "get sensitivity, connection or reporter not be NULL"); in get_sensitivity()
475 *sensitivity = UINT32_MAX; in get_sensitivity()
478 LOG_ERR("sensor:%s sensitivity index:%d invalid", conn->source->dev->name, index); in get_sensitivity()
483 /* each sensitivity index value should be same for global sensitivity */ in get_sensitivity()
485 if (conn->sensitivity[i] != conn->sensitivity[0]) { in get_sensitivity()
486 LOG_ERR("sensitivity[%d]:%d should be same as sensitivity:%d", in get_sensitivity()
487 i, conn->sensitivity[i], conn->sensitivity[0]); in get_sensitivity()
491 *sensitivity = conn->sensitivity[0]; in get_sensitivity()
493 *sensitivity = conn->sensitivity[index]; in get_sensitivity()
496 LOG_INF("get_sensitivity, sensor:%s, index:%d, sensitivity:%d, count:%d", in get_sensitivity()
498 *sensitivity, conn->source->sensitivity_count); in get_sensitivity()