forked from project-chip/connectedhomeip
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add android dummy stub for java matter controller application (projec…
- Loading branch information
1 parent
c6d38ab
commit 6077853
Showing
16 changed files
with
433 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Copyright (c) 2020-2021 Project CHIP Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
#TODO: Decouple Android Bluetooth stuff from ChipDeviceController.Java, remove dummy implemenation here. | ||
#TODO: Decouple Android Logging from from ChipDeviceController.Java, remove dummy implemenation here. | ||
|
||
import("//build_overrides/build.gni") | ||
import("//build_overrides/chip.gni") | ||
import("${build_root}/config/android_abi.gni") | ||
import("${chip_root}/build/chip/java/rules.gni") | ||
|
||
android_library("stub_src") { | ||
output_name = "Android.jar" | ||
|
||
sources = [ | ||
"android/bluetooth/BluetoothGatt.java", | ||
"android/bluetooth/BluetoothGattCallback.java", | ||
"android/bluetooth/BluetoothGattCharacteristic.java", | ||
"android/bluetooth/BluetoothGattDescriptor.java", | ||
"android/bluetooth/BluetoothGattService.java", | ||
"android/bluetooth/BluetoothProfile.java", | ||
"android/os/Build.java", | ||
"android/util/Log.java", | ||
] | ||
|
||
javac_flags = [ "-Xlint:deprecation" ] | ||
} |
53 changes: 53 additions & 0 deletions
53
third_party/java_deps/stub_src/android/bluetooth/BluetoothGatt.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* | ||
* Copyright (c) 2023 Project CHIP Authors | ||
* Copyright (c) 2015-2017 Nest Labs, Inc. | ||
* All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/** BluetoothGatt.java Stub file to allow compiling standalone, without Android SDK. */ | ||
package android.bluetooth; | ||
|
||
import java.util.List; | ||
import java.util.UUID; | ||
|
||
// Stub class to allow standalone compilation without Android | ||
public final class BluetoothGatt { | ||
|
||
public static final int GATT_SUCCESS = 0; | ||
|
||
public void close() {} | ||
|
||
public BluetoothGattService getService(UUID uuid) { | ||
return null; | ||
} | ||
|
||
public List<BluetoothGattService> getServices() { | ||
return null; | ||
} | ||
|
||
public boolean setCharacteristicNotification( | ||
BluetoothGattCharacteristic characteristic, boolean enable) { | ||
return false; | ||
} | ||
|
||
public boolean writeCharacteristic(BluetoothGattCharacteristic characteristic) { | ||
return false; | ||
} | ||
|
||
public boolean writeDescriptor(BluetoothGattDescriptor descriptor) { | ||
return false; | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
third_party/java_deps/stub_src/android/bluetooth/BluetoothGattCallback.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* | ||
* Copyright (c) 2023 Project CHIP Authors | ||
* Copyright (c) 2015-2017 Nest Labs, Inc. | ||
* All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/** BluetoothGattCallback.java Stub file to allow compiling standalone, without Android SDK. */ | ||
package android.bluetooth; | ||
|
||
// Stub class to allow standalone compilation without Android | ||
public abstract class BluetoothGattCallback { | ||
public void onCharacteristicChanged( | ||
BluetoothGatt gatt, BluetoothGattCharacteristic characteristic) {} | ||
|
||
public void onCharacteristicRead( | ||
BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) {} | ||
|
||
public void onCharacteristicWrite( | ||
BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) {} | ||
|
||
public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState) {} | ||
|
||
public void onDescriptorRead( | ||
BluetoothGatt gatt, BluetoothGattDescriptor descriptor, int status) {} | ||
|
||
public void onDescriptorWrite( | ||
BluetoothGatt gatt, BluetoothGattDescriptor descriptor, int status) {} | ||
|
||
public void onServicesDiscovered(BluetoothGatt gatt, int status) {} | ||
} |
50 changes: 50 additions & 0 deletions
50
third_party/java_deps/stub_src/android/bluetooth/BluetoothGattCharacteristic.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* | ||
* Copyright (c) 2023 Project CHIP Authors | ||
* Copyright (c) 2015-2017 Nest Labs, Inc. | ||
* All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/** | ||
* BluetoothGattCharacteristic.java Stub file to allow compiling standalone, without Android SDK. | ||
*/ | ||
package android.bluetooth; | ||
|
||
import java.util.UUID; | ||
|
||
// Stub class to allow standalone compilation without Android | ||
public class BluetoothGattCharacteristic { | ||
protected UUID mUuid; | ||
|
||
public BluetoothGattDescriptor getDescriptor(UUID uuid) { | ||
return null; | ||
} | ||
|
||
public BluetoothGattService getService() { | ||
return null; | ||
} | ||
|
||
public UUID getUuid() { | ||
return mUuid; | ||
} | ||
|
||
public byte[] getValue() { | ||
return null; | ||
} | ||
|
||
public boolean setValue(byte[] value) { | ||
return false; | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
third_party/java_deps/stub_src/android/bluetooth/BluetoothGattDescriptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* | ||
* Copyright (c) 2023 Project CHIP Authors | ||
* Copyright (c) 2015-2017 Nest Labs, Inc. | ||
* All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/** BluetoothGattDescriptor.java Stub file to allow compiling standalone, without Android SDK. */ | ||
package android.bluetooth; | ||
|
||
import java.util.UUID; | ||
|
||
// Stub class to allow standalone compilation without Android | ||
public class BluetoothGattDescriptor { | ||
public static final byte[] ENABLE_NOTIFICATION_VALUE = {0x01, 0x00}; | ||
|
||
public static final byte[] ENABLE_INDICATION_VALUE = {0x02, 0x00}; | ||
|
||
public static final byte[] DISABLE_NOTIFICATION_VALUE = {0x00, 0x00}; | ||
|
||
protected UUID mUuid; | ||
|
||
public BluetoothGattCharacteristic getCharacteristic() { | ||
return null; | ||
} | ||
|
||
public UUID getUuid() { | ||
return mUuid; | ||
} | ||
|
||
public byte[] getValue() { | ||
return null; | ||
} | ||
|
||
public boolean setValue(byte[] value) { | ||
return true; | ||
} | ||
} |
Oops, something went wrong.