Exemple #1
0
celix_status_t deviceManager_driverAdded(void * handle, service_reference_pt ref, void * service) {
	celix_status_t status = CELIX_SUCCESS;

	device_manager_pt manager = handle;
	logHelper_log(manager->loghelper, OSGI_LOGSERVICE_DEBUG, "DEVICE_MANAGER: Add driver");
	driver_attributes_pt attributes = NULL;

	status = driverAttributes_create(ref, service, &attributes);
	if (status == CELIX_SUCCESS) {
		hashMap_put(manager->drivers, ref, attributes);
	}
	else{
		driverAttributes_destroy(attributes);
	}
	return status;
}
Exemple #2
0
celix_status_t deviceManager_driverAdded(void * handle, service_reference_pt ref, void * service) {
	celix_status_t status = CELIX_SUCCESS;

	printf("DEVICE_MANAGER: Add driver\n");
	device_manager_pt manager = handle;
	apr_pool_t *pool = NULL;
	driver_attributes_pt attributes = NULL;

	status = apr_pool_create(&pool, manager->pool);
	if (status == CELIX_SUCCESS) {
		status = driverAttributes_create(pool, ref, service, &attributes);
		if (status == CELIX_SUCCESS) {
			hashMap_put(manager->drivers, ref, attributes);
		}
	}
	return status;
}