내 안드로이드 응용 프로그램에서 BLE 장치가 안드로이드 전화에 연결되면 BLE 연결이 성공적으로 작동합니다. 연결된 BLE 장치 이름을 프로그래밍 방식으로 변경하는 방법 ; 같은 여기프로그래밍 방식으로 연결된 BLE 장치 이름을 Android에서 어떻게 변경합니까?
private static final UUID Device_Name_UUID = UUID.fromString("00002a00-0000-1000-8000-00805f9b34fb");
private static final UUID Write_UUID = UUID.fromString("00001800-0000-1000-8000-00805f9b34fb");
public void Device_Name(){
BluetoothGattService Name_Service = mBluetoothGatt.getService(Write_UUID);
if(Name_Service == null) {
Log.d(TAG, "Name_Service service not found!");
return;
}
BluetoothGattCharacteristic DeviceName = Name_Service.getCharacteristic(Device_Name_UUID);
if(DeviceName == null) {
Log.d(TAG, "DeviceName charateristic not found!");
return;
}
}
Log.v(TAG, "readCharacteristic(DeviceName) = " + mBluetoothGatt.readCharacteristic(DeviceName));
String i = "123";
DeviceName.setValue(i);
Log.v(TAG, "writeCharacteristic(DeviceName) = " + mBluetoothGatt.writeCharacteristic(DeviceName));
Log.v(TAG, "writeCharacteristic(DeviceName) = " + mBluetoothGatt.writeCharacteristic(DeviceName));
mBluetoothGatt.writeCharacteristic (장치 이름) 아래의 샘플 코드 메서드는 항상 거짓을 반환합니다.
는 일부 연구 후에 나는 솔루션 아래의 발견 당신은 keyfobdemo.c 내부 KeyFobApp_Init()에 아래의 코드를 추가하여 장치 이름의 쓰기 권한을 추가 CC2541의 열쇠 고리의 펌웨어를 수정해야
:
를uint8 devNamePermission = GATT_PERMIT_READ|GATT_PERMIT_WRITE;
GGS_SetParameter(GGS_W_PERMIT_DEVICE_NAME_ATT, sizeof (uint8), &devNamePermission);
내 권한은 어디에 추가해야합니까?
아무도 내게이 persmissions를 추가하는 방법을 말해 줄 수 있습니까?
미리 감사드립니다.
감사합니다. – sandeepmaaram