public SocManager(GPIOSettings settings, int connectionSpeed, int bufferSize) {
		if (lock == null) {
			lock = new ReentrantLock();
		}
		if (GPIO == null) {
			Timer timer = new Timer(1000);
			while (Spi.wiringPiSPISetup(0, connectionSpeed) == -1) {
				try {
					Runtime.getRuntime().exec("gpio load spi " + bufferSize);
				} catch (IOException e) {
					Logger.logError("Could not load SPI with specified "
							+ "buffer: " + bufferSize);
					break;
				}
				Tools.waitForMs(100);
				if (timer.hasExpired()) {
					Logger.logError("Could not set up connection: "
							+ "timed out");
				}
			}
			GPIO = GpioFactory.getInstance();
		}
		this.settings = settings;
	}