Back to project page LeBlue.
The source code is released under:
Apache License
If you think the Android project LeBlue listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package houtbecke.rs.le.interceptor; /*w w w . j av a2 s . c o m*/ import java.util.UUID; import houtbecke.rs.le.LeCharacteristicListener; import houtbecke.rs.le.LeGattCharacteristic; import houtbecke.rs.le.LeRemoteDevice; public class InterceptingLeCharacteristicListener extends BaseIntercepting implements LeCharacteristicListener { public final LeCharacteristicListener leCharacteristicListener; public InterceptingLeCharacteristicListener(LeCharacteristicListener leCharacteristicListener, LeInterceptor leInterceptor) { super(leInterceptor); this.leCharacteristicListener = leCharacteristicListener; } @Override public void leCharacteristicChanged(UUID uuid, LeRemoteDevice remoteDevice, LeGattCharacteristic characteristic) { synchronized(leInterceptor) { InterceptingLeRemoteDevice iLeRemoteDevice = leInterceptor.getInterceptingLeRemoteDevice(remoteDevice); InterceptingLeGattCharacteristic iLeGattCharacteristic = leInterceptor.getInterceptingLeGattCharacteristic(characteristic); leCharacteristicListener.leCharacteristicChanged(uuid,iLeRemoteDevice,iLeGattCharacteristic ); leInterceptor.characteristicChanged(this, uuid, iLeRemoteDevice,iLeGattCharacteristic ); } } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null) return false; while (o instanceof InterceptingLeCharacteristicListener) o = ((InterceptingLeCharacteristicListener) o).leCharacteristicListener; return o instanceof LeCharacteristicListener && o.equals(leCharacteristicListener); } @Override public int hashCode() { return leCharacteristicListener.hashCode(); } }