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.mock; //from w w w . jav a 2 s. co m import java.util.UUID; import houtbecke.rs.le.LeGattCharacteristic; import houtbecke.rs.le.LeGattService; import houtbecke.rs.le.interceptor.InterceptingLeGattService; import houtbecke.rs.le.interceptor.InterceptingLeRemoteDevice; public class LeGattServiceMock implements LeGattService { LeMockController mockController; Integer key; public LeGattServiceMock(Integer key, LeMockController mockController) { this.key = key; this.mockController = mockController; } @Override public UUID getUuid() { return mockController.serviceGetUuid(this); } @Override public LeGattCharacteristic getCharacteristic(UUID uuid) { return mockController.serviceGetCharacteristic(this, uuid); } @Override public boolean enableCharacteristicNotification(UUID characteristic) { return mockController.serviceEnableCharacteristicNotification(this, characteristic); } @Override public boolean equals(Object o) { while (o instanceof InterceptingLeGattService) o = ((InterceptingLeGattService)o).leGattService; if (o instanceof LeGattServiceMock) return ((LeGattServiceMock)o).key.equals(key); return o == this; } @Override public int hashCode() { return key.hashCode(); } }