protected void UpdateConnect() { if (connect != _connect) { if (connect) { if (native == null) { Log("Peripheral not available, cannot connect"); connect = false; } else { Debug.Assert(conn == null); Log("Connecting..."); conn = native.Connect(); } } else { if (conn != null) { conn.Disconnect(); conn = null; } } _connect = connect; } }
public BLEConnection Connect() { BLEConnection conn = BLENativeConnect(manager, this); conn.manager = manager; return(conn); }
public BLEVibrationDeviceMultipleThreads(BLEConnection bleConnection) { this.numberOfMotors = NUMBER_OF_MOTORS; motorThreads = new MotorThread[numberOfMotors]; motorLocks = new object[numberOfMotors]; motors = new BLEMotor[numberOfMotors]; for (int i = 0; i < motors.Length; i++) { motors[i] = new BLEMotor(bleConnection, 4 + i); } }
public void SetBLEConnection(BLEConnection connection) { bleCommunication = connection; }