I'm searching a guide/tutorial to learn how to develop an app for android lollipop that simulates an peripheral bluetooth with some service and characteristic.
And another app that writes and reads characteristics from the peripheral.
I try to make it by my self, but I have found some problem and my apps crashed.
Can you suggest me some tutorial ? :)
EDIT : I know the question above is an off-topic question, but I follow this example test enter link description here, and I have implemented my personal "MyActivity", but the result is that the peripheral doesn't notify to my application the characterists's changes.
Through the debug I can see that the peripheral's onCharacteristicWriteRequest callback is called, then in this callback I edit my service's characteristic:
MineCharacteristic.setValue(payload);
ble.getGattServer().notifyCharacteristicChanged(device,MineCharacteristic, false);`
But on the other side on the central role smarthphone the onCharacteristicChanged callback is never called :/
In MyActivity I also add this descriptor to minecharacteristic :
BluetoothGattDescriptor clientCharacteristiConfiguration = new BluetoothGattDescriptor(UUID.fromString(CostantUUid.clientCharacteristiConfiguration), BluetoothGattDescriptor.PERMISSION_WRITE | BluetoothGattDescriptor.PERMISSION_READ );
MineCharacteristic.addDescriptor(clientCharacteristiConfiguration);
0 comments:
Post a Comment