internal I2cDeviceConnection(I2cDriver driver, int deviceAddress, II2cDeviceConnectionReporter i2CDeviceConnectionReporter = null) { this.driver = driver; this.deviceAddress = deviceAddress; this.i2cDeviceConnectionReporter = i2CDeviceConnectionReporter; this.i2cDeviceConnectionReporter?.SetSource(typeof(II2cDeviceConnectionReporter), this); this.i2cDeviceConnectionReporter?.Connect(deviceAddress); }
/// <summary> /// Connects the specified device address. /// </summary> /// <param name="deviceAddress">The device address.</param> /// <param name="i2CDeviceConnectionReporter">The i2 c device connection reporter.</param> /// <returns> /// The device connection. /// </returns> public I2cDeviceConnection Connect(int deviceAddress, II2cDeviceConnectionReporter i2CDeviceConnectionReporter = null) { return(new I2cDeviceConnection(this, deviceAddress, i2CDeviceConnectionReporter)); }