• Home
  • Raw
  • Download

Lines Matching refs:asp

152 _sensors_port_discard_sensors(AndroidSensorsPort* asp)  in _sensors_port_discard_sensors()  argument
154 if (asp->sensors != NULL) { in _sensors_port_discard_sensors()
156 for (n = 0; n < asp->sensors_count; n++) { in _sensors_port_discard_sensors()
157 if (asp->sensors[n] != NULL) { in _sensors_port_discard_sensors()
158 free(asp->sensors[n]->sensor_name); in _sensors_port_discard_sensors()
159 AFREE(asp->sensors[n]); in _sensors_port_discard_sensors()
162 free(asp->sensors); in _sensors_port_discard_sensors()
163 asp->sensors = NULL; in _sensors_port_discard_sensors()
165 asp->sensors_count = 0; in _sensors_port_discard_sensors()
171 _sensors_port_free(AndroidSensorsPort* asp) in _sensors_port_free() argument
173 if (asp != NULL) { in _sensors_port_free()
174 _sensors_port_discard_sensors(asp); in _sensors_port_free()
175 if (asp->sdkctl != NULL) { in _sensors_port_free()
176 sdkctl_socket_release(asp->sdkctl); in _sensors_port_free()
178 AFREE(asp); in _sensors_port_free()
185 _sensors_port_save_sensors(AndroidSensorsPort* asp, const SensorEntry* list) in _sensors_port_save_sensors() argument
191 asp->sensors = malloc(sizeof(SensorDescriptor*) * count); in _sensors_port_save_sensors()
208 asp->sensors[asp->sensors_count++] = desc; in _sensors_port_save_sensors()
217 D("Sensors: Emulating %d sensors", asp->sensors_count); in _sensors_port_save_sensors()
223 _sensor_from_sdkctl_id(AndroidSensorsPort* asp, int id) in _sensor_from_sdkctl_id() argument
226 for (n = 0; n < asp->sensors_count; n++) { in _sensor_from_sdkctl_id()
227 if (asp->sensors[n]->sensor_id == id) { in _sensor_from_sdkctl_id()
228 return asp->sensors[n]; in _sensor_from_sdkctl_id()
241 _sensors_port_start(AndroidSensorsPort* asp) in _sensors_port_start() argument
245 if (!sdkctl_socket_is_port_ready(asp->sdkctl)) { in _sensors_port_start()
253 sensors_port_disable_sensor(asp, "all"); in _sensors_port_start()
256 for (n = 0; n < asp->sensors_count; n++) { in _sensors_port_start()
257 if (android_sensors_get_sensor_status(asp->sensors[n]->emulator_id) == 1) { in _sensors_port_start()
259 sensors_port_enable_sensor(asp, asp->sensors[n]->sensor_name); in _sensors_port_start()
261 asp->sensors[n]->sensor_name); in _sensors_port_start()
267 sdkctl_message_send(asp->sdkctl, SDKCTL_SENSORS_START, NULL, 0); in _sensors_port_start()
283 AndroidSensorsPort* const asp = (AndroidSensorsPort*)(query_opaque); in _on_sensor_list_query() local
295 _sensors_port_save_sensors(asp, list); in _on_sensor_list_query()
298 _sensors_port_start(asp); in _on_sensor_list_query()
309 _on_sensor_event(AndroidSensorsPort* asp, const SensorEvent* event) in _on_sensor_event() argument
313 _sensor_from_sdkctl_id(asp, event->sensor_id); in _on_sensor_event()
332 AndroidSensorsPort* const asp = (AndroidSensorsPort*)client_opaque; in _on_sensors_socket_connection() local
337 _sensors_port_discard_sensors(asp); in _on_sensors_socket_connection()
354 AndroidSensorsPort* const asp = (AndroidSensorsPort*)client_opaque; in _on_sensors_port_connection() local
360 sdkctl_query_build_and_send(asp->sdkctl, SDKCTL_SENSORS_QUERY_LIST, in _on_sensors_port_connection()
362 _on_sensor_list_query, asp, in _on_sensors_port_connection()
369 _sensors_port_discard_sensors(asp); in _on_sensors_port_connection()
374 _sensors_port_start(asp); in _on_sensors_port_connection()
417 AndroidSensorsPort* const asp = (AndroidSensorsPort*)client_opaque; in _on_sensors_message() local
420 _on_sensor_event(asp, (const SensorEvent*)msg_data); in _on_sensors_message()
436 AndroidSensorsPort* asp; in sensors_port_create() local
438 ANEW0(asp); in sensors_port_create()
439 asp->opaque = opaque; in sensors_port_create()
440 asp->sensors = NULL; in sensors_port_create()
441 asp->sensors_count = 0; in sensors_port_create()
442 asp->sdkctl = sdkctl_socket_new(SDKCTL_SENSORS_TIMEOUT, "sensors", in sensors_port_create()
445 _on_sensors_message, asp); in sensors_port_create()
446 sdkctl_init_recycler(asp->sdkctl, 76, 8); in sensors_port_create()
447 sdkctl_socket_connect(asp->sdkctl, SDKCTL_DEFAULT_TCP_PORT, in sensors_port_create()
449 return asp; in sensors_port_create()
453 sensors_port_destroy(AndroidSensorsPort* asp) in sensors_port_destroy() argument
455 if (asp->sdkctl != NULL) { in sensors_port_destroy()
456 sdkctl_socket_disconnect(asp->sdkctl); in sensors_port_destroy()
458 _sensors_port_free(asp); in sensors_port_destroy()
462 sensors_port_enable_sensor(AndroidSensorsPort* asp, const char* name) in sensors_port_enable_sensor() argument
464 if (asp->sdkctl != NULL && sdkctl_socket_is_port_ready(asp->sdkctl)) { in sensors_port_enable_sensor()
465 SDKCtlMessage* const msg = sdkctl_message_send(asp->sdkctl, in sensors_port_enable_sensor()
476 sensors_port_disable_sensor(AndroidSensorsPort* asp, const char* name) in sensors_port_disable_sensor() argument
478 if (asp->sdkctl != NULL && sdkctl_socket_is_port_ready(asp->sdkctl)) { in sensors_port_disable_sensor()
479 SDKCtlMessage* const msg = sdkctl_message_send(asp->sdkctl, in sensors_port_disable_sensor()