From 9ec24496944ca80253415de2467ff6f2cf286a57 Mon Sep 17 00:00:00 2001 From: iAMD Date: Fri, 23 Sep 2022 10:28:33 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E9=87=8D=E6=9E=84=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=20(#3)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 29 +- .idea/libraries/Dart_SDK.xml | 19 - .idea/modules.xml | 10 - .../example_lib_main_dart.xml | 6 - .idea/workspace.xml | 45 - .metadata | 27 +- CHANGELOG.md | 5 + LICENSE | 2 +- README.md | 6 +- analysis_options.yaml | 19 +- android/.gitignore | 1 + android/build.gradle | 21 +- android/gradle.properties | 3 - .../gradle/wrapper/gradle-wrapper.properties | 5 - android/src/main/AndroidManifest.xml | 13 +- .../MessageOuterClass.java | 17215 ---------------- .../bluetooth_low_energy/pigeon/Api.java | 930 + .../proto/Advertisement.java | 2198 ++ .../proto/AdvertisementOrBuilder.java | 153 + .../proto/BluetoothLowEnergyException.java | 559 + .../BluetoothLowEnergyExceptionOrBuilder.java | 21 + .../proto/BluetoothState.java | 122 + .../proto/GattCharacteristic.java | 934 + .../proto/GattCharacteristicOrBuilder.java | 54 + .../proto/GattDescriptor.java | 674 + .../proto/GattDescriptorOrBuilder.java | 30 + .../proto/GattService.java | 674 + .../proto/GattServiceOrBuilder.java | 30 + .../bluetooth_low_energy/proto/Messages.java | 148 + .../proto/Peripheral.java | 550 + .../proto/PeripheralOrBuilder.java | 21 + .../proto/ServiceData.java | 677 + .../proto/ServiceDataOrBuilder.java | 30 + .../bluetooth_low_energy/proto/UUID.java | 559 + .../proto/UUIDOrBuilder.java | 21 + .../BluetoothLowEnergyException.kt | 3 + .../BluetoothLowEnergyPlugin.kt | 651 +- .../ConnectArgumentsKt.kt | 45 - .../bluetooth_low_energy/DiscoveryKt.kt | 96 - .../bluetooth_low_energy/GATTKt.kt | 125 - .../GattCharacteristicKt.kt | 193 - .../GattCharacteristicNotifyArgumentsKt.kt | 96 - .../GattCharacteristicReadArgumentsKt.kt | 79 - .../GattCharacteristicValueKt.kt | 96 - .../GattCharacteristicWriteArgumentsKt.kt | 113 - .../GattConnectionLostKt.kt | 62 - .../bluetooth_low_energy/GattDescriptorKt.kt | 62 - .../GattDescriptorReadArgumentsKt.kt | 96 - .../GattDescriptorWriteArgumentsKt.kt | 113 - .../GattDisconnectArgumentsKt.kt | 45 - .../bluetooth_low_energy/GattServiceKt.kt | 125 - .../bluetooth_low_energy/MessageKt.kt | 340 - .../MyBluetoothGattCallback.kt | 163 + .../MyBroadcastReceiver.kt | 19 + .../MyCentralManagerHostApi.kt | 87 + .../MyGattCharacteristicHostApi.kt | 103 + .../MyGattDescriptorHostApi.kt | 47 + .../MyGattServiceHostApi.kt | 47 + .../MyPeripheralHostApi.kt | 34 + .../MyRequestPermissionsResultListener.kt | 19 + .../bluetooth_low_energy/MyScanCallback.kt | 81 + .../bluetooth_low_energy/NativeGATT.kt | 5 - .../NativeGattCharacteristic.kt | 5 - .../NativeGattDescriptor.kt | 5 - .../bluetooth_low_energy/NativeGattService.kt | 5 - .../bluetooth_low_energy/NativeValue.kt | 7 - .../StartDiscoveryArgumentsKt.kt | 96 - .../proto/AdvertisementKt.kt | 395 + .../proto/BluetoothLowEnergyExceptionKt.kt | 46 + .../proto/GattCharacteristicKt.kt | 141 + .../proto/GattDescriptorKt.kt | 73 + .../proto/GattServiceKt.kt | 73 + .../MessagesKt.kt} | 0 .../proto/PeripheralKt.kt | 63 + .../proto/ServiceDataKt.kt | 73 + .../bluetooth_low_energy/proto/UUIDKt.kt | 46 + bluetooth_low_energy.iml | 19 - example/.gitignore | 1 + example/.metadata | 10 - example/README.md | 8 +- example/analysis_options.yaml | 29 + example/android/.gitignore | 2 + example/android/app/build.gradle | 20 +- .../android/app/src/debug/AndroidManifest.xml | 3 +- .../android/app/src/main/AndroidManifest.xml | 11 +- .../app/src/main/res/values-night/styles.xml | 4 +- .../app/src/main/res/values/styles.xml | 4 +- .../app/src/profile/AndroidManifest.xml | 3 +- example/android/build.gradle | 8 +- .../gradle/wrapper/gradle-wrapper.properties | 3 +- example/fonts/IBMPlexMono-Bold.ttf | Bin 112548 -> 0 bytes example/fonts/IBMPlexMono-Italic.ttf | Bin 118560 -> 0 bytes example/fonts/IBMPlexMono-Regular.ttf | Bin 110308 -> 0 bytes example/ios/.gitignore | 1 + example/ios/Flutter/AppFrameworkInfo.plist | 2 +- example/ios/Podfile | 2 +- example/ios/Podfile.lock | 14 +- example/ios/Runner.xcodeproj/project.pbxproj | 84 +- .../xcshareddata/xcschemes/Runner.xcscheme | 10 +- example/ios/Runner/Info.plist | 6 +- example/lib/main.dart | 501 +- example/pubspec.lock | 170 +- example/pubspec.yaml | 38 +- example/test/widget_test.dart | 23 +- ios/Classes/MyCentralManagerDelegate.swift | 117 + ios/Classes/MyCentralManagerHostApi.swift | 58 + ios/Classes/MyGattCharacteristicHostApi.swift | 52 + ios/Classes/MyGattDescriptorHostApi.swift | 37 + ios/Classes/MyGattServiceHostApi.swift | 29 + ios/Classes/MyPeripheralDelegate.swift | 184 + ios/Classes/MyPeripheralHostApi.swift | 35 + ios/Classes/NativeGATT.swift | 18 - ios/Classes/NativeGattCharacteristic.swift | 18 - ios/Classes/NativeGattDescriptor.swift | 12 - ios/Classes/NativeGattService.swift | 18 - ios/Classes/NativeValue.swift | 17 - .../SwiftBluetoothLowEnergyPlugin.swift | 567 +- ios/Classes/message.pb.swift | 1540 -- ios/Classes/pigeon/Api.h | 99 + ios/Classes/pigeon/Api.m | 860 + ios/Classes/proto/messages.pb.swift | 674 + ios/bluetooth_low_energy.podspec | 14 +- lib/bluetooth_low_energy.dart | 28 +- lib/src/advertisement.dart | 16 + lib/src/api.dart | 142 + lib/src/bluetooth.dart | 40 - lib/src/bluetooth_state.dart | 5 + lib/src/central.dart | 56 - lib/src/central_manager.dart | 19 + lib/src/discovery.dart | 29 - lib/src/exception.dart | 9 + lib/src/extension.dart | 127 - lib/src/gatt.dart | 42 - lib/src/gatt_characteristic.dart | 115 +- lib/src/gatt_descriptor.dart | 59 +- lib/src/gatt_service.dart | 19 +- lib/src/impl.dart | 607 + lib/src/message.pb.dart | 2018 -- lib/src/message.pbenum.dart | 124 - lib/src/message.pbjson.dart | 442 - lib/src/message.pbserver.dart | 8 - lib/src/peripheral.dart | 8 + lib/src/pigeon.dart | 1 + lib/src/pigeon/api.g.dart | 753 + lib/src/proto.dart | 1 + lib/src/proto/messages.pb.dart | 634 + lib/src/proto/messages.pbenum.dart | 28 + lib/src/proto/messages.pbjson.dart | 125 + lib/src/proto/messages.pbserver.dart | 9 + lib/src/util.dart | 12 - lib/src/uuid.dart | 35 +- pigeon/api.dart | 119 + proto/message.proto | 135 - proto/messages.proto | 61 + pubspec.lock | 175 - pubspec.yaml | 31 +- scripts/run_pigeon.sh | 34 + scripts/run_protoc.sh | 53 + test/bluetooth_low_energy_test.dart | 520 - test/pigeon/test_api.g.dart | 469 + 160 files changed, 16034 insertions(+), 26183 deletions(-) delete mode 100644 .idea/libraries/Dart_SDK.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/runConfigurations/example_lib_main_dart.xml delete mode 100644 .idea/workspace.xml delete mode 100644 android/gradle.properties delete mode 100644 android/gradle/wrapper/gradle-wrapper.properties delete mode 100644 android/src/main/java/dev/yanshouwang/bluetooth_low_energy/MessageOuterClass.java create mode 100644 android/src/main/java/dev/yanshouwang/bluetooth_low_energy/pigeon/Api.java create mode 100644 android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/Advertisement.java create mode 100644 android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/AdvertisementOrBuilder.java create mode 100644 android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/BluetoothLowEnergyException.java create mode 100644 android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/BluetoothLowEnergyExceptionOrBuilder.java create mode 100644 android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/BluetoothState.java create mode 100644 android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/GattCharacteristic.java create mode 100644 android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/GattCharacteristicOrBuilder.java create mode 100644 android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/GattDescriptor.java create mode 100644 android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/GattDescriptorOrBuilder.java create mode 100644 android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/GattService.java create mode 100644 android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/GattServiceOrBuilder.java create mode 100644 android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/Messages.java create mode 100644 android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/Peripheral.java create mode 100644 android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/PeripheralOrBuilder.java create mode 100644 android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/ServiceData.java create mode 100644 android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/ServiceDataOrBuilder.java create mode 100644 android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/UUID.java create mode 100644 android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/UUIDOrBuilder.java create mode 100644 android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/BluetoothLowEnergyException.kt delete mode 100644 android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/ConnectArgumentsKt.kt delete mode 100644 android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/DiscoveryKt.kt delete mode 100644 android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GATTKt.kt delete mode 100644 android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattCharacteristicKt.kt delete mode 100644 android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattCharacteristicNotifyArgumentsKt.kt delete mode 100644 android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattCharacteristicReadArgumentsKt.kt delete mode 100644 android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattCharacteristicValueKt.kt delete mode 100644 android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattCharacteristicWriteArgumentsKt.kt delete mode 100644 android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattConnectionLostKt.kt delete mode 100644 android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattDescriptorKt.kt delete mode 100644 android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattDescriptorReadArgumentsKt.kt delete mode 100644 android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattDescriptorWriteArgumentsKt.kt delete mode 100644 android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattDisconnectArgumentsKt.kt delete mode 100644 android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattServiceKt.kt delete mode 100644 android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MessageKt.kt create mode 100644 android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MyBluetoothGattCallback.kt create mode 100644 android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MyBroadcastReceiver.kt create mode 100644 android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MyCentralManagerHostApi.kt create mode 100644 android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MyGattCharacteristicHostApi.kt create mode 100644 android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MyGattDescriptorHostApi.kt create mode 100644 android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MyGattServiceHostApi.kt create mode 100644 android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MyPeripheralHostApi.kt create mode 100644 android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MyRequestPermissionsResultListener.kt create mode 100644 android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MyScanCallback.kt delete mode 100644 android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/NativeGATT.kt delete mode 100644 android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/NativeGattCharacteristic.kt delete mode 100644 android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/NativeGattDescriptor.kt delete mode 100644 android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/NativeGattService.kt delete mode 100644 android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/NativeValue.kt delete mode 100644 android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/StartDiscoveryArgumentsKt.kt create mode 100644 android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/proto/AdvertisementKt.kt create mode 100644 android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/proto/BluetoothLowEnergyExceptionKt.kt create mode 100644 android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/proto/GattCharacteristicKt.kt create mode 100644 android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/proto/GattDescriptorKt.kt create mode 100644 android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/proto/GattServiceKt.kt rename android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/{MessageOuterClassKt.kt => proto/MessagesKt.kt} (100%) create mode 100644 android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/proto/PeripheralKt.kt create mode 100644 android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/proto/ServiceDataKt.kt create mode 100644 android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/proto/UUIDKt.kt delete mode 100644 bluetooth_low_energy.iml delete mode 100644 example/.metadata create mode 100644 example/analysis_options.yaml delete mode 100644 example/fonts/IBMPlexMono-Bold.ttf delete mode 100644 example/fonts/IBMPlexMono-Italic.ttf delete mode 100644 example/fonts/IBMPlexMono-Regular.ttf create mode 100644 ios/Classes/MyCentralManagerDelegate.swift create mode 100644 ios/Classes/MyCentralManagerHostApi.swift create mode 100644 ios/Classes/MyGattCharacteristicHostApi.swift create mode 100644 ios/Classes/MyGattDescriptorHostApi.swift create mode 100644 ios/Classes/MyGattServiceHostApi.swift create mode 100644 ios/Classes/MyPeripheralDelegate.swift create mode 100644 ios/Classes/MyPeripheralHostApi.swift delete mode 100644 ios/Classes/NativeGATT.swift delete mode 100644 ios/Classes/NativeGattCharacteristic.swift delete mode 100644 ios/Classes/NativeGattDescriptor.swift delete mode 100644 ios/Classes/NativeGattService.swift delete mode 100644 ios/Classes/NativeValue.swift delete mode 100644 ios/Classes/message.pb.swift create mode 100644 ios/Classes/pigeon/Api.h create mode 100644 ios/Classes/pigeon/Api.m create mode 100644 ios/Classes/proto/messages.pb.swift create mode 100644 lib/src/advertisement.dart create mode 100644 lib/src/api.dart delete mode 100644 lib/src/bluetooth.dart create mode 100644 lib/src/bluetooth_state.dart delete mode 100644 lib/src/central.dart create mode 100644 lib/src/central_manager.dart delete mode 100644 lib/src/discovery.dart create mode 100644 lib/src/exception.dart delete mode 100644 lib/src/extension.dart delete mode 100644 lib/src/gatt.dart create mode 100644 lib/src/impl.dart delete mode 100644 lib/src/message.pb.dart delete mode 100644 lib/src/message.pbenum.dart delete mode 100644 lib/src/message.pbjson.dart delete mode 100644 lib/src/message.pbserver.dart create mode 100644 lib/src/peripheral.dart create mode 100644 lib/src/pigeon.dart create mode 100644 lib/src/pigeon/api.g.dart create mode 100644 lib/src/proto.dart create mode 100644 lib/src/proto/messages.pb.dart create mode 100644 lib/src/proto/messages.pbenum.dart create mode 100644 lib/src/proto/messages.pbjson.dart create mode 100644 lib/src/proto/messages.pbserver.dart delete mode 100644 lib/src/util.dart create mode 100644 pigeon/api.dart delete mode 100644 proto/message.proto create mode 100644 proto/messages.proto delete mode 100644 pubspec.lock create mode 100644 scripts/run_pigeon.sh create mode 100644 scripts/run_protoc.sh delete mode 100644 test/bluetooth_low_energy_test.dart create mode 100644 test/pigeon/test_api.g.dart diff --git a/.gitignore b/.gitignore index e9dc58d..96486fd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,30 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp .DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. +/pubspec.lock +**/doc/api/ .dart_tool/ - .packages -.pub/ - build/ diff --git a/.idea/libraries/Dart_SDK.xml b/.idea/libraries/Dart_SDK.xml deleted file mode 100644 index 9f43bdb..0000000 --- a/.idea/libraries/Dart_SDK.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 8ba3f75..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/.idea/runConfigurations/example_lib_main_dart.xml b/.idea/runConfigurations/example_lib_main_dart.xml deleted file mode 100644 index 5fd9159..0000000 --- a/.idea/runConfigurations/example_lib_main_dart.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 9b1f7e7..0000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.metadata b/.metadata index 8534257..8472cba 100644 --- a/.metadata +++ b/.metadata @@ -1,10 +1,33 @@ # This file tracks properties of this Flutter project. # Used by Flutter tool to assess capabilities and perform upgrades etc. # -# This file should be version controlled and should not be manually edited. +# This file should be version controlled. version: - revision: 02c026b03cd31dd3f867e5faeb7e104cce174c5f + revision: f1875d570e39de09040c8f79aa13cc56baab8db1 channel: stable project_type: plugin + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 + base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 + - platform: android + create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 + base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 + - platform: ios + create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 + base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/CHANGELOG.md b/CHANGELOG.md index e42a40d..f8882a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 1.0.0 + +- Upgrade to flutter 3.x. +- Rewrite the whole project with pigeon. + ## 0.1.0 - Add implementations on iOS. diff --git a/LICENSE b/LICENSE index 752d28b..436615a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021 yanshouwang +Copyright (c) 2022 yanshouwang Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index a90e310..cfaf442 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ -# Bluetooth Low Energy +# bluetooth_low_energy A bluetooth low energy plugin for flutter, which can be used to develope central role apps. ## Features ### Central APIs -- [x] Discover advertisements. -- [x] Connect/Disconnect to GATTs. +- [x] Scan advertisements. +- [x] Connect/Disconnect to peripherals. - [x] Read/Write/Notify characteristics. - [x] Read/Write descriptors. diff --git a/analysis_options.yaml b/analysis_options.yaml index 108d105..a290743 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1 +1,18 @@ -include: package:pedantic/analysis_options.yaml +include: package:flutter_lints/flutter.yaml + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options + +analyzer: + exclude: + - "**/*.g.dart" + - "**/*.pb.dart" + - "**/*.pbenum.dart" + - "**/*.pbjson.dart" + - "**/*.pbserver.dart" + - "**/*.mocks.dart" + +linter: + rules: + prefer_single_quotes: true + require_trailing_commas: true \ No newline at end of file diff --git a/android/.gitignore b/android/.gitignore index c6cbe56..161bdcd 100644 --- a/android/.gitignore +++ b/android/.gitignore @@ -6,3 +6,4 @@ .DS_Store /build /captures +.cxx diff --git a/android/build.gradle b/android/build.gradle index 0871e66..d8c2d5d 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -2,15 +2,14 @@ group 'dev.yanshouwang.bluetooth_low_energy' version '1.0-SNAPSHOT' buildscript { - ext.kotlin_version = '1.5.21' + ext.kotlin_version = '1.6.10' repositories { google() mavenCentral() - maven { url 'https://mirrors.cloud.tencent.com/nexus/repository/maven-public/' } } dependencies { - classpath 'com.android.tools.build:gradle:4.1.0' + classpath 'com.android.tools.build:gradle:7.1.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -19,7 +18,6 @@ rootProject.allprojects { repositories { google() mavenCentral() - maven { url 'https://mirrors.cloud.tencent.com/nexus/repository/maven-public/' } } } @@ -27,11 +25,21 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { - compileSdkVersion 30 + compileSdkVersion 31 + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = '1.8' + } sourceSets { main.java.srcDirs += 'src/main/kotlin' } + defaultConfig { minSdkVersion 21 } @@ -39,5 +47,6 @@ android { dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation 'com.google.protobuf:protobuf-kotlin:3.17.3' + implementation 'com.google.protobuf:protobuf-kotlin:3.19.4' + implementation 'com.google.guava:guava:31.1-android' } diff --git a/android/gradle.properties b/android/gradle.properties deleted file mode 100644 index 94adc3a..0000000 --- a/android/gradle.properties +++ /dev/null @@ -1,3 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M -android.useAndroidX=true -android.enableJetifier=true diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 3c9d085..0000000 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index fce4a44..6e656ca 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -1,7 +1,12 @@ + package="dev.yanshouwang.bluetooth_low_energy"> + - - - + + + + + diff --git a/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/MessageOuterClass.java b/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/MessageOuterClass.java deleted file mode 100644 index b56fdeb..0000000 --- a/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/MessageOuterClass.java +++ /dev/null @@ -1,17215 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: message.proto - -package dev.yanshouwang.bluetooth_low_energy; - -public final class MessageOuterClass { - private MessageOuterClass() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - /** - * Protobuf enum {@code dev.yanshouwang.bluetooth_low_energy.MessageCategory} - */ - public enum MessageCategory - implements com.google.protobuf.ProtocolMessageEnum { - /** - * BLUETOOTH_STATE = 0; - */ - BLUETOOTH_STATE(0), - /** - * CENTRAL_START_DISCOVERY = 1; - */ - CENTRAL_START_DISCOVERY(1), - /** - * CENTRAL_STOP_DISCOVERY = 2; - */ - CENTRAL_STOP_DISCOVERY(2), - /** - * CENTRAL_DISCOVERED = 3; - */ - CENTRAL_DISCOVERED(3), - /** - * CENTRAL_CONNECT = 4; - */ - CENTRAL_CONNECT(4), - /** - * GATT_DISCONNECT = 5; - */ - GATT_DISCONNECT(5), - /** - * GATT_CONNECTION_LOST = 6; - */ - GATT_CONNECTION_LOST(6), - /** - * GATT_CHARACTERISTIC_READ = 7; - */ - GATT_CHARACTERISTIC_READ(7), - /** - * GATT_CHARACTERISTIC_WRITE = 8; - */ - GATT_CHARACTERISTIC_WRITE(8), - /** - * GATT_CHARACTERISTIC_NOTIFY = 9; - */ - GATT_CHARACTERISTIC_NOTIFY(9), - /** - * GATT_DESCRIPTOR_READ = 10; - */ - GATT_DESCRIPTOR_READ(10), - /** - * GATT_DESCRIPTOR_WRITE = 11; - */ - GATT_DESCRIPTOR_WRITE(11), - UNRECOGNIZED(-1), - ; - - /** - * BLUETOOTH_STATE = 0; - */ - public static final int BLUETOOTH_STATE_VALUE = 0; - /** - * CENTRAL_START_DISCOVERY = 1; - */ - public static final int CENTRAL_START_DISCOVERY_VALUE = 1; - /** - * CENTRAL_STOP_DISCOVERY = 2; - */ - public static final int CENTRAL_STOP_DISCOVERY_VALUE = 2; - /** - * CENTRAL_DISCOVERED = 3; - */ - public static final int CENTRAL_DISCOVERED_VALUE = 3; - /** - * CENTRAL_CONNECT = 4; - */ - public static final int CENTRAL_CONNECT_VALUE = 4; - /** - * GATT_DISCONNECT = 5; - */ - public static final int GATT_DISCONNECT_VALUE = 5; - /** - * GATT_CONNECTION_LOST = 6; - */ - public static final int GATT_CONNECTION_LOST_VALUE = 6; - /** - * GATT_CHARACTERISTIC_READ = 7; - */ - public static final int GATT_CHARACTERISTIC_READ_VALUE = 7; - /** - * GATT_CHARACTERISTIC_WRITE = 8; - */ - public static final int GATT_CHARACTERISTIC_WRITE_VALUE = 8; - /** - * GATT_CHARACTERISTIC_NOTIFY = 9; - */ - public static final int GATT_CHARACTERISTIC_NOTIFY_VALUE = 9; - /** - * GATT_DESCRIPTOR_READ = 10; - */ - public static final int GATT_DESCRIPTOR_READ_VALUE = 10; - /** - * GATT_DESCRIPTOR_WRITE = 11; - */ - public static final int GATT_DESCRIPTOR_WRITE_VALUE = 11; - - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static MessageCategory valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static MessageCategory forNumber(int value) { - switch (value) { - case 0: return BLUETOOTH_STATE; - case 1: return CENTRAL_START_DISCOVERY; - case 2: return CENTRAL_STOP_DISCOVERY; - case 3: return CENTRAL_DISCOVERED; - case 4: return CENTRAL_CONNECT; - case 5: return GATT_DISCONNECT; - case 6: return GATT_CONNECTION_LOST; - case 7: return GATT_CHARACTERISTIC_READ; - case 8: return GATT_CHARACTERISTIC_WRITE; - case 9: return GATT_CHARACTERISTIC_NOTIFY; - case 10: return GATT_DESCRIPTOR_READ; - case 11: return GATT_DESCRIPTOR_WRITE; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - MessageCategory> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public MessageCategory findValueByNumber(int number) { - return MessageCategory.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.getDescriptor().getEnumTypes().get(0); - } - - private static final MessageCategory[] VALUES = values(); - - public static MessageCategory valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private MessageCategory(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:dev.yanshouwang.bluetooth_low_energy.MessageCategory) - } - - /** - * Protobuf enum {@code dev.yanshouwang.bluetooth_low_energy.BluetoothState} - */ - public enum BluetoothState - implements com.google.protobuf.ProtocolMessageEnum { - /** - * UNSUPPORTED = 0; - */ - UNSUPPORTED(0), - /** - * POWERED_OFF = 1; - */ - POWERED_OFF(1), - /** - * POWERED_ON = 2; - */ - POWERED_ON(2), - UNRECOGNIZED(-1), - ; - - /** - * UNSUPPORTED = 0; - */ - public static final int UNSUPPORTED_VALUE = 0; - /** - * POWERED_OFF = 1; - */ - public static final int POWERED_OFF_VALUE = 1; - /** - * POWERED_ON = 2; - */ - public static final int POWERED_ON_VALUE = 2; - - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static BluetoothState valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static BluetoothState forNumber(int value) { - switch (value) { - case 0: return UNSUPPORTED; - case 1: return POWERED_OFF; - case 2: return POWERED_ON; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - BluetoothState> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public BluetoothState findValueByNumber(int number) { - return BluetoothState.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.getDescriptor().getEnumTypes().get(1); - } - - private static final BluetoothState[] VALUES = values(); - - public static BluetoothState valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private BluetoothState(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:dev.yanshouwang.bluetooth_low_energy.BluetoothState) - } - - public interface MessageOrBuilder extends - // @@protoc_insertion_point(interface_extends:dev.yanshouwang.bluetooth_low_energy.Message) - com.google.protobuf.MessageOrBuilder { - - /** - * .dev.yanshouwang.bluetooth_low_energy.MessageCategory category = 1; - * @return The enum numeric value on the wire for category. - */ - int getCategoryValue(); - /** - * .dev.yanshouwang.bluetooth_low_energy.MessageCategory category = 1; - * @return The category. - */ - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.MessageCategory getCategory(); - - /** - * .dev.yanshouwang.bluetooth_low_energy.BluetoothState state = 2; - * @return Whether the state field is set. - */ - boolean hasState(); - /** - * .dev.yanshouwang.bluetooth_low_energy.BluetoothState state = 2; - * @return The enum numeric value on the wire for state. - */ - int getStateValue(); - /** - * .dev.yanshouwang.bluetooth_low_energy.BluetoothState state = 2; - * @return The state. - */ - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.BluetoothState getState(); - - /** - * .dev.yanshouwang.bluetooth_low_energy.StartDiscoveryArguments startDiscoveryArguments = 3; - * @return Whether the startDiscoveryArguments field is set. - */ - boolean hasStartDiscoveryArguments(); - /** - * .dev.yanshouwang.bluetooth_low_energy.StartDiscoveryArguments startDiscoveryArguments = 3; - * @return The startDiscoveryArguments. - */ - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments getStartDiscoveryArguments(); - /** - * .dev.yanshouwang.bluetooth_low_energy.StartDiscoveryArguments startDiscoveryArguments = 3; - */ - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArgumentsOrBuilder getStartDiscoveryArgumentsOrBuilder(); - - /** - * .dev.yanshouwang.bluetooth_low_energy.Discovery discovery = 4; - * @return Whether the discovery field is set. - */ - boolean hasDiscovery(); - /** - * .dev.yanshouwang.bluetooth_low_energy.Discovery discovery = 4; - * @return The discovery. - */ - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery getDiscovery(); - /** - * .dev.yanshouwang.bluetooth_low_energy.Discovery discovery = 4; - */ - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.DiscoveryOrBuilder getDiscoveryOrBuilder(); - - /** - * .dev.yanshouwang.bluetooth_low_energy.ConnectArguments connectArguments = 5; - * @return Whether the connectArguments field is set. - */ - boolean hasConnectArguments(); - /** - * .dev.yanshouwang.bluetooth_low_energy.ConnectArguments connectArguments = 5; - * @return The connectArguments. - */ - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments getConnectArguments(); - /** - * .dev.yanshouwang.bluetooth_low_energy.ConnectArguments connectArguments = 5; - */ - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArgumentsOrBuilder getConnectArgumentsOrBuilder(); - - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDisconnectArguments disconnectArguments = 6; - * @return Whether the disconnectArguments field is set. - */ - boolean hasDisconnectArguments(); - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDisconnectArguments disconnectArguments = 6; - * @return The disconnectArguments. - */ - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments getDisconnectArguments(); - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDisconnectArguments disconnectArguments = 6; - */ - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArgumentsOrBuilder getDisconnectArgumentsOrBuilder(); - - /** - * .dev.yanshouwang.bluetooth_low_energy.GattConnectionLost connectionLost = 7; - * @return Whether the connectionLost field is set. - */ - boolean hasConnectionLost(); - /** - * .dev.yanshouwang.bluetooth_low_energy.GattConnectionLost connectionLost = 7; - * @return The connectionLost. - */ - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost getConnectionLost(); - /** - * .dev.yanshouwang.bluetooth_low_energy.GattConnectionLost connectionLost = 7; - */ - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLostOrBuilder getConnectionLostOrBuilder(); - - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicReadArguments characteristicReadArguments = 8; - * @return Whether the characteristicReadArguments field is set. - */ - boolean hasCharacteristicReadArguments(); - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicReadArguments characteristicReadArguments = 8; - * @return The characteristicReadArguments. - */ - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments getCharacteristicReadArguments(); - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicReadArguments characteristicReadArguments = 8; - */ - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArgumentsOrBuilder getCharacteristicReadArgumentsOrBuilder(); - - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicWriteArguments characteristicWriteArguments = 9; - * @return Whether the characteristicWriteArguments field is set. - */ - boolean hasCharacteristicWriteArguments(); - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicWriteArguments characteristicWriteArguments = 9; - * @return The characteristicWriteArguments. - */ - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments getCharacteristicWriteArguments(); - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicWriteArguments characteristicWriteArguments = 9; - */ - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArgumentsOrBuilder getCharacteristicWriteArgumentsOrBuilder(); - - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicNotifyArguments characteristicNotifyArguments = 10; - * @return Whether the characteristicNotifyArguments field is set. - */ - boolean hasCharacteristicNotifyArguments(); - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicNotifyArguments characteristicNotifyArguments = 10; - * @return The characteristicNotifyArguments. - */ - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments getCharacteristicNotifyArguments(); - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicNotifyArguments characteristicNotifyArguments = 10; - */ - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArgumentsOrBuilder getCharacteristicNotifyArgumentsOrBuilder(); - - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicValue characteristicValue = 11; - * @return Whether the characteristicValue field is set. - */ - boolean hasCharacteristicValue(); - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicValue characteristicValue = 11; - * @return The characteristicValue. - */ - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue getCharacteristicValue(); - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicValue characteristicValue = 11; - */ - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValueOrBuilder getCharacteristicValueOrBuilder(); - - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDescriptorReadArguments descriptorReadArguments = 12; - * @return Whether the descriptorReadArguments field is set. - */ - boolean hasDescriptorReadArguments(); - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDescriptorReadArguments descriptorReadArguments = 12; - * @return The descriptorReadArguments. - */ - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments getDescriptorReadArguments(); - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDescriptorReadArguments descriptorReadArguments = 12; - */ - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArgumentsOrBuilder getDescriptorReadArgumentsOrBuilder(); - - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDescriptorWriteArguments descriptorWriteArguments = 13; - * @return Whether the descriptorWriteArguments field is set. - */ - boolean hasDescriptorWriteArguments(); - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDescriptorWriteArguments descriptorWriteArguments = 13; - * @return The descriptorWriteArguments. - */ - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments getDescriptorWriteArguments(); - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDescriptorWriteArguments descriptorWriteArguments = 13; - */ - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArgumentsOrBuilder getDescriptorWriteArgumentsOrBuilder(); - - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message.ValueCase getValueCase(); - } - /** - * Protobuf type {@code dev.yanshouwang.bluetooth_low_energy.Message} - */ - public static final class Message extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:dev.yanshouwang.bluetooth_low_energy.Message) - MessageOrBuilder { - private static final long serialVersionUID = 0L; - // Use Message.newBuilder() to construct. - private Message(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Message() { - category_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Message(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Message( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - int rawValue = input.readEnum(); - - category_ = rawValue; - break; - } - case 16: { - int rawValue = input.readEnum(); - valueCase_ = 2; - value_ = rawValue; - break; - } - case 26: { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments.Builder subBuilder = null; - if (valueCase_ == 3) { - subBuilder = ((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments) value_).toBuilder(); - } - value_ = - input.readMessage(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments) value_); - value_ = subBuilder.buildPartial(); - } - valueCase_ = 3; - break; - } - case 34: { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery.Builder subBuilder = null; - if (valueCase_ == 4) { - subBuilder = ((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery) value_).toBuilder(); - } - value_ = - input.readMessage(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery) value_); - value_ = subBuilder.buildPartial(); - } - valueCase_ = 4; - break; - } - case 42: { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments.Builder subBuilder = null; - if (valueCase_ == 5) { - subBuilder = ((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments) value_).toBuilder(); - } - value_ = - input.readMessage(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments) value_); - value_ = subBuilder.buildPartial(); - } - valueCase_ = 5; - break; - } - case 50: { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments.Builder subBuilder = null; - if (valueCase_ == 6) { - subBuilder = ((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments) value_).toBuilder(); - } - value_ = - input.readMessage(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments) value_); - value_ = subBuilder.buildPartial(); - } - valueCase_ = 6; - break; - } - case 58: { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost.Builder subBuilder = null; - if (valueCase_ == 7) { - subBuilder = ((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost) value_).toBuilder(); - } - value_ = - input.readMessage(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost) value_); - value_ = subBuilder.buildPartial(); - } - valueCase_ = 7; - break; - } - case 66: { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments.Builder subBuilder = null; - if (valueCase_ == 8) { - subBuilder = ((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments) value_).toBuilder(); - } - value_ = - input.readMessage(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments) value_); - value_ = subBuilder.buildPartial(); - } - valueCase_ = 8; - break; - } - case 74: { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments.Builder subBuilder = null; - if (valueCase_ == 9) { - subBuilder = ((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments) value_).toBuilder(); - } - value_ = - input.readMessage(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments) value_); - value_ = subBuilder.buildPartial(); - } - valueCase_ = 9; - break; - } - case 82: { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments.Builder subBuilder = null; - if (valueCase_ == 10) { - subBuilder = ((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments) value_).toBuilder(); - } - value_ = - input.readMessage(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments) value_); - value_ = subBuilder.buildPartial(); - } - valueCase_ = 10; - break; - } - case 90: { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue.Builder subBuilder = null; - if (valueCase_ == 11) { - subBuilder = ((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue) value_).toBuilder(); - } - value_ = - input.readMessage(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue) value_); - value_ = subBuilder.buildPartial(); - } - valueCase_ = 11; - break; - } - case 98: { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments.Builder subBuilder = null; - if (valueCase_ == 12) { - subBuilder = ((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments) value_).toBuilder(); - } - value_ = - input.readMessage(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments) value_); - value_ = subBuilder.buildPartial(); - } - valueCase_ = 12; - break; - } - case 106: { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments.Builder subBuilder = null; - if (valueCase_ == 13) { - subBuilder = ((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments) value_).toBuilder(); - } - value_ = - input.readMessage(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments) value_); - value_ = subBuilder.buildPartial(); - } - valueCase_ = 13; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_Message_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_Message_fieldAccessorTable - .ensureFieldAccessorsInitialized( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message.class, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message.Builder.class); - } - - private int valueCase_ = 0; - private java.lang.Object value_; - public enum ValueCase - implements com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - STATE(2), - STARTDISCOVERYARGUMENTS(3), - DISCOVERY(4), - CONNECTARGUMENTS(5), - DISCONNECTARGUMENTS(6), - CONNECTIONLOST(7), - CHARACTERISTICREADARGUMENTS(8), - CHARACTERISTICWRITEARGUMENTS(9), - CHARACTERISTICNOTIFYARGUMENTS(10), - CHARACTERISTICVALUE(11), - DESCRIPTORREADARGUMENTS(12), - DESCRIPTORWRITEARGUMENTS(13), - VALUE_NOT_SET(0); - private final int value; - private ValueCase(int value) { - this.value = value; - } - /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static ValueCase valueOf(int value) { - return forNumber(value); - } - - public static ValueCase forNumber(int value) { - switch (value) { - case 2: return STATE; - case 3: return STARTDISCOVERYARGUMENTS; - case 4: return DISCOVERY; - case 5: return CONNECTARGUMENTS; - case 6: return DISCONNECTARGUMENTS; - case 7: return CONNECTIONLOST; - case 8: return CHARACTERISTICREADARGUMENTS; - case 9: return CHARACTERISTICWRITEARGUMENTS; - case 10: return CHARACTERISTICNOTIFYARGUMENTS; - case 11: return CHARACTERISTICVALUE; - case 12: return DESCRIPTORREADARGUMENTS; - case 13: return DESCRIPTORWRITEARGUMENTS; - case 0: return VALUE_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public ValueCase - getValueCase() { - return ValueCase.forNumber( - valueCase_); - } - - public static final int CATEGORY_FIELD_NUMBER = 1; - private int category_; - /** - * .dev.yanshouwang.bluetooth_low_energy.MessageCategory category = 1; - * @return The enum numeric value on the wire for category. - */ - @java.lang.Override public int getCategoryValue() { - return category_; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.MessageCategory category = 1; - * @return The category. - */ - @java.lang.Override public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.MessageCategory getCategory() { - @SuppressWarnings("deprecation") - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.MessageCategory result = dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.MessageCategory.valueOf(category_); - return result == null ? dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.MessageCategory.UNRECOGNIZED : result; - } - - public static final int STATE_FIELD_NUMBER = 2; - /** - * .dev.yanshouwang.bluetooth_low_energy.BluetoothState state = 2; - * @return Whether the state field is set. - */ - public boolean hasState() { - return valueCase_ == 2; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.BluetoothState state = 2; - * @return The enum numeric value on the wire for state. - */ - public int getStateValue() { - if (valueCase_ == 2) { - return (java.lang.Integer) value_; - } - return 0; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.BluetoothState state = 2; - * @return The state. - */ - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.BluetoothState getState() { - if (valueCase_ == 2) { - @SuppressWarnings("deprecation") - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.BluetoothState result = dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.BluetoothState.valueOf( - (java.lang.Integer) value_); - return result == null ? dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.BluetoothState.UNRECOGNIZED : result; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.BluetoothState.UNSUPPORTED; - } - - public static final int STARTDISCOVERYARGUMENTS_FIELD_NUMBER = 3; - /** - * .dev.yanshouwang.bluetooth_low_energy.StartDiscoveryArguments startDiscoveryArguments = 3; - * @return Whether the startDiscoveryArguments field is set. - */ - @java.lang.Override - public boolean hasStartDiscoveryArguments() { - return valueCase_ == 3; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.StartDiscoveryArguments startDiscoveryArguments = 3; - * @return The startDiscoveryArguments. - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments getStartDiscoveryArguments() { - if (valueCase_ == 3) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments.getDefaultInstance(); - } - /** - * .dev.yanshouwang.bluetooth_low_energy.StartDiscoveryArguments startDiscoveryArguments = 3; - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArgumentsOrBuilder getStartDiscoveryArgumentsOrBuilder() { - if (valueCase_ == 3) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments.getDefaultInstance(); - } - - public static final int DISCOVERY_FIELD_NUMBER = 4; - /** - * .dev.yanshouwang.bluetooth_low_energy.Discovery discovery = 4; - * @return Whether the discovery field is set. - */ - @java.lang.Override - public boolean hasDiscovery() { - return valueCase_ == 4; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.Discovery discovery = 4; - * @return The discovery. - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery getDiscovery() { - if (valueCase_ == 4) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery.getDefaultInstance(); - } - /** - * .dev.yanshouwang.bluetooth_low_energy.Discovery discovery = 4; - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.DiscoveryOrBuilder getDiscoveryOrBuilder() { - if (valueCase_ == 4) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery.getDefaultInstance(); - } - - public static final int CONNECTARGUMENTS_FIELD_NUMBER = 5; - /** - * .dev.yanshouwang.bluetooth_low_energy.ConnectArguments connectArguments = 5; - * @return Whether the connectArguments field is set. - */ - @java.lang.Override - public boolean hasConnectArguments() { - return valueCase_ == 5; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.ConnectArguments connectArguments = 5; - * @return The connectArguments. - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments getConnectArguments() { - if (valueCase_ == 5) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments.getDefaultInstance(); - } - /** - * .dev.yanshouwang.bluetooth_low_energy.ConnectArguments connectArguments = 5; - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArgumentsOrBuilder getConnectArgumentsOrBuilder() { - if (valueCase_ == 5) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments.getDefaultInstance(); - } - - public static final int DISCONNECTARGUMENTS_FIELD_NUMBER = 6; - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDisconnectArguments disconnectArguments = 6; - * @return Whether the disconnectArguments field is set. - */ - @java.lang.Override - public boolean hasDisconnectArguments() { - return valueCase_ == 6; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDisconnectArguments disconnectArguments = 6; - * @return The disconnectArguments. - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments getDisconnectArguments() { - if (valueCase_ == 6) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments.getDefaultInstance(); - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDisconnectArguments disconnectArguments = 6; - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArgumentsOrBuilder getDisconnectArgumentsOrBuilder() { - if (valueCase_ == 6) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments.getDefaultInstance(); - } - - public static final int CONNECTIONLOST_FIELD_NUMBER = 7; - /** - * .dev.yanshouwang.bluetooth_low_energy.GattConnectionLost connectionLost = 7; - * @return Whether the connectionLost field is set. - */ - @java.lang.Override - public boolean hasConnectionLost() { - return valueCase_ == 7; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattConnectionLost connectionLost = 7; - * @return The connectionLost. - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost getConnectionLost() { - if (valueCase_ == 7) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost.getDefaultInstance(); - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattConnectionLost connectionLost = 7; - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLostOrBuilder getConnectionLostOrBuilder() { - if (valueCase_ == 7) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost.getDefaultInstance(); - } - - public static final int CHARACTERISTICREADARGUMENTS_FIELD_NUMBER = 8; - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicReadArguments characteristicReadArguments = 8; - * @return Whether the characteristicReadArguments field is set. - */ - @java.lang.Override - public boolean hasCharacteristicReadArguments() { - return valueCase_ == 8; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicReadArguments characteristicReadArguments = 8; - * @return The characteristicReadArguments. - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments getCharacteristicReadArguments() { - if (valueCase_ == 8) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments.getDefaultInstance(); - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicReadArguments characteristicReadArguments = 8; - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArgumentsOrBuilder getCharacteristicReadArgumentsOrBuilder() { - if (valueCase_ == 8) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments.getDefaultInstance(); - } - - public static final int CHARACTERISTICWRITEARGUMENTS_FIELD_NUMBER = 9; - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicWriteArguments characteristicWriteArguments = 9; - * @return Whether the characteristicWriteArguments field is set. - */ - @java.lang.Override - public boolean hasCharacteristicWriteArguments() { - return valueCase_ == 9; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicWriteArguments characteristicWriteArguments = 9; - * @return The characteristicWriteArguments. - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments getCharacteristicWriteArguments() { - if (valueCase_ == 9) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments.getDefaultInstance(); - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicWriteArguments characteristicWriteArguments = 9; - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArgumentsOrBuilder getCharacteristicWriteArgumentsOrBuilder() { - if (valueCase_ == 9) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments.getDefaultInstance(); - } - - public static final int CHARACTERISTICNOTIFYARGUMENTS_FIELD_NUMBER = 10; - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicNotifyArguments characteristicNotifyArguments = 10; - * @return Whether the characteristicNotifyArguments field is set. - */ - @java.lang.Override - public boolean hasCharacteristicNotifyArguments() { - return valueCase_ == 10; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicNotifyArguments characteristicNotifyArguments = 10; - * @return The characteristicNotifyArguments. - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments getCharacteristicNotifyArguments() { - if (valueCase_ == 10) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments.getDefaultInstance(); - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicNotifyArguments characteristicNotifyArguments = 10; - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArgumentsOrBuilder getCharacteristicNotifyArgumentsOrBuilder() { - if (valueCase_ == 10) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments.getDefaultInstance(); - } - - public static final int CHARACTERISTICVALUE_FIELD_NUMBER = 11; - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicValue characteristicValue = 11; - * @return Whether the characteristicValue field is set. - */ - @java.lang.Override - public boolean hasCharacteristicValue() { - return valueCase_ == 11; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicValue characteristicValue = 11; - * @return The characteristicValue. - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue getCharacteristicValue() { - if (valueCase_ == 11) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue.getDefaultInstance(); - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicValue characteristicValue = 11; - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValueOrBuilder getCharacteristicValueOrBuilder() { - if (valueCase_ == 11) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue.getDefaultInstance(); - } - - public static final int DESCRIPTORREADARGUMENTS_FIELD_NUMBER = 12; - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDescriptorReadArguments descriptorReadArguments = 12; - * @return Whether the descriptorReadArguments field is set. - */ - @java.lang.Override - public boolean hasDescriptorReadArguments() { - return valueCase_ == 12; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDescriptorReadArguments descriptorReadArguments = 12; - * @return The descriptorReadArguments. - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments getDescriptorReadArguments() { - if (valueCase_ == 12) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments.getDefaultInstance(); - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDescriptorReadArguments descriptorReadArguments = 12; - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArgumentsOrBuilder getDescriptorReadArgumentsOrBuilder() { - if (valueCase_ == 12) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments.getDefaultInstance(); - } - - public static final int DESCRIPTORWRITEARGUMENTS_FIELD_NUMBER = 13; - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDescriptorWriteArguments descriptorWriteArguments = 13; - * @return Whether the descriptorWriteArguments field is set. - */ - @java.lang.Override - public boolean hasDescriptorWriteArguments() { - return valueCase_ == 13; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDescriptorWriteArguments descriptorWriteArguments = 13; - * @return The descriptorWriteArguments. - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments getDescriptorWriteArguments() { - if (valueCase_ == 13) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments.getDefaultInstance(); - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDescriptorWriteArguments descriptorWriteArguments = 13; - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArgumentsOrBuilder getDescriptorWriteArgumentsOrBuilder() { - if (valueCase_ == 13) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments.getDefaultInstance(); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (category_ != dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.MessageCategory.BLUETOOTH_STATE.getNumber()) { - output.writeEnum(1, category_); - } - if (valueCase_ == 2) { - output.writeEnum(2, ((java.lang.Integer) value_)); - } - if (valueCase_ == 3) { - output.writeMessage(3, (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments) value_); - } - if (valueCase_ == 4) { - output.writeMessage(4, (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery) value_); - } - if (valueCase_ == 5) { - output.writeMessage(5, (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments) value_); - } - if (valueCase_ == 6) { - output.writeMessage(6, (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments) value_); - } - if (valueCase_ == 7) { - output.writeMessage(7, (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost) value_); - } - if (valueCase_ == 8) { - output.writeMessage(8, (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments) value_); - } - if (valueCase_ == 9) { - output.writeMessage(9, (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments) value_); - } - if (valueCase_ == 10) { - output.writeMessage(10, (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments) value_); - } - if (valueCase_ == 11) { - output.writeMessage(11, (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue) value_); - } - if (valueCase_ == 12) { - output.writeMessage(12, (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments) value_); - } - if (valueCase_ == 13) { - output.writeMessage(13, (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments) value_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (category_ != dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.MessageCategory.BLUETOOTH_STATE.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, category_); - } - if (valueCase_ == 2) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, ((java.lang.Integer) value_)); - } - if (valueCase_ == 3) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments) value_); - } - if (valueCase_ == 4) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery) value_); - } - if (valueCase_ == 5) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments) value_); - } - if (valueCase_ == 6) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments) value_); - } - if (valueCase_ == 7) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost) value_); - } - if (valueCase_ == 8) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(8, (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments) value_); - } - if (valueCase_ == 9) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(9, (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments) value_); - } - if (valueCase_ == 10) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(10, (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments) value_); - } - if (valueCase_ == 11) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(11, (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue) value_); - } - if (valueCase_ == 12) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(12, (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments) value_); - } - if (valueCase_ == 13) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(13, (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments) value_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message)) { - return super.equals(obj); - } - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message other = (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message) obj; - - if (category_ != other.category_) return false; - if (!getValueCase().equals(other.getValueCase())) return false; - switch (valueCase_) { - case 2: - if (getStateValue() - != other.getStateValue()) return false; - break; - case 3: - if (!getStartDiscoveryArguments() - .equals(other.getStartDiscoveryArguments())) return false; - break; - case 4: - if (!getDiscovery() - .equals(other.getDiscovery())) return false; - break; - case 5: - if (!getConnectArguments() - .equals(other.getConnectArguments())) return false; - break; - case 6: - if (!getDisconnectArguments() - .equals(other.getDisconnectArguments())) return false; - break; - case 7: - if (!getConnectionLost() - .equals(other.getConnectionLost())) return false; - break; - case 8: - if (!getCharacteristicReadArguments() - .equals(other.getCharacteristicReadArguments())) return false; - break; - case 9: - if (!getCharacteristicWriteArguments() - .equals(other.getCharacteristicWriteArguments())) return false; - break; - case 10: - if (!getCharacteristicNotifyArguments() - .equals(other.getCharacteristicNotifyArguments())) return false; - break; - case 11: - if (!getCharacteristicValue() - .equals(other.getCharacteristicValue())) return false; - break; - case 12: - if (!getDescriptorReadArguments() - .equals(other.getDescriptorReadArguments())) return false; - break; - case 13: - if (!getDescriptorWriteArguments() - .equals(other.getDescriptorWriteArguments())) return false; - break; - case 0: - default: - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + CATEGORY_FIELD_NUMBER; - hash = (53 * hash) + category_; - switch (valueCase_) { - case 2: - hash = (37 * hash) + STATE_FIELD_NUMBER; - hash = (53 * hash) + getStateValue(); - break; - case 3: - hash = (37 * hash) + STARTDISCOVERYARGUMENTS_FIELD_NUMBER; - hash = (53 * hash) + getStartDiscoveryArguments().hashCode(); - break; - case 4: - hash = (37 * hash) + DISCOVERY_FIELD_NUMBER; - hash = (53 * hash) + getDiscovery().hashCode(); - break; - case 5: - hash = (37 * hash) + CONNECTARGUMENTS_FIELD_NUMBER; - hash = (53 * hash) + getConnectArguments().hashCode(); - break; - case 6: - hash = (37 * hash) + DISCONNECTARGUMENTS_FIELD_NUMBER; - hash = (53 * hash) + getDisconnectArguments().hashCode(); - break; - case 7: - hash = (37 * hash) + CONNECTIONLOST_FIELD_NUMBER; - hash = (53 * hash) + getConnectionLost().hashCode(); - break; - case 8: - hash = (37 * hash) + CHARACTERISTICREADARGUMENTS_FIELD_NUMBER; - hash = (53 * hash) + getCharacteristicReadArguments().hashCode(); - break; - case 9: - hash = (37 * hash) + CHARACTERISTICWRITEARGUMENTS_FIELD_NUMBER; - hash = (53 * hash) + getCharacteristicWriteArguments().hashCode(); - break; - case 10: - hash = (37 * hash) + CHARACTERISTICNOTIFYARGUMENTS_FIELD_NUMBER; - hash = (53 * hash) + getCharacteristicNotifyArguments().hashCode(); - break; - case 11: - hash = (37 * hash) + CHARACTERISTICVALUE_FIELD_NUMBER; - hash = (53 * hash) + getCharacteristicValue().hashCode(); - break; - case 12: - hash = (37 * hash) + DESCRIPTORREADARGUMENTS_FIELD_NUMBER; - hash = (53 * hash) + getDescriptorReadArguments().hashCode(); - break; - case 13: - hash = (37 * hash) + DESCRIPTORWRITEARGUMENTS_FIELD_NUMBER; - hash = (53 * hash) + getDescriptorWriteArguments().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code dev.yanshouwang.bluetooth_low_energy.Message} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:dev.yanshouwang.bluetooth_low_energy.Message) - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.MessageOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_Message_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_Message_fieldAccessorTable - .ensureFieldAccessorsInitialized( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message.class, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message.Builder.class); - } - - // Construct using dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - category_ = 0; - - valueCase_ = 0; - value_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_Message_descriptor; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message getDefaultInstanceForType() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message.getDefaultInstance(); - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message build() { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message buildPartial() { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message result = new dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message(this); - result.category_ = category_; - if (valueCase_ == 2) { - result.value_ = value_; - } - if (valueCase_ == 3) { - if (startDiscoveryArgumentsBuilder_ == null) { - result.value_ = value_; - } else { - result.value_ = startDiscoveryArgumentsBuilder_.build(); - } - } - if (valueCase_ == 4) { - if (discoveryBuilder_ == null) { - result.value_ = value_; - } else { - result.value_ = discoveryBuilder_.build(); - } - } - if (valueCase_ == 5) { - if (connectArgumentsBuilder_ == null) { - result.value_ = value_; - } else { - result.value_ = connectArgumentsBuilder_.build(); - } - } - if (valueCase_ == 6) { - if (disconnectArgumentsBuilder_ == null) { - result.value_ = value_; - } else { - result.value_ = disconnectArgumentsBuilder_.build(); - } - } - if (valueCase_ == 7) { - if (connectionLostBuilder_ == null) { - result.value_ = value_; - } else { - result.value_ = connectionLostBuilder_.build(); - } - } - if (valueCase_ == 8) { - if (characteristicReadArgumentsBuilder_ == null) { - result.value_ = value_; - } else { - result.value_ = characteristicReadArgumentsBuilder_.build(); - } - } - if (valueCase_ == 9) { - if (characteristicWriteArgumentsBuilder_ == null) { - result.value_ = value_; - } else { - result.value_ = characteristicWriteArgumentsBuilder_.build(); - } - } - if (valueCase_ == 10) { - if (characteristicNotifyArgumentsBuilder_ == null) { - result.value_ = value_; - } else { - result.value_ = characteristicNotifyArgumentsBuilder_.build(); - } - } - if (valueCase_ == 11) { - if (characteristicValueBuilder_ == null) { - result.value_ = value_; - } else { - result.value_ = characteristicValueBuilder_.build(); - } - } - if (valueCase_ == 12) { - if (descriptorReadArgumentsBuilder_ == null) { - result.value_ = value_; - } else { - result.value_ = descriptorReadArgumentsBuilder_.build(); - } - } - if (valueCase_ == 13) { - if (descriptorWriteArgumentsBuilder_ == null) { - result.value_ = value_; - } else { - result.value_ = descriptorWriteArgumentsBuilder_.build(); - } - } - result.valueCase_ = valueCase_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message) { - return mergeFrom((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message other) { - if (other == dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message.getDefaultInstance()) return this; - if (other.category_ != 0) { - setCategoryValue(other.getCategoryValue()); - } - switch (other.getValueCase()) { - case STATE: { - setStateValue(other.getStateValue()); - break; - } - case STARTDISCOVERYARGUMENTS: { - mergeStartDiscoveryArguments(other.getStartDiscoveryArguments()); - break; - } - case DISCOVERY: { - mergeDiscovery(other.getDiscovery()); - break; - } - case CONNECTARGUMENTS: { - mergeConnectArguments(other.getConnectArguments()); - break; - } - case DISCONNECTARGUMENTS: { - mergeDisconnectArguments(other.getDisconnectArguments()); - break; - } - case CONNECTIONLOST: { - mergeConnectionLost(other.getConnectionLost()); - break; - } - case CHARACTERISTICREADARGUMENTS: { - mergeCharacteristicReadArguments(other.getCharacteristicReadArguments()); - break; - } - case CHARACTERISTICWRITEARGUMENTS: { - mergeCharacteristicWriteArguments(other.getCharacteristicWriteArguments()); - break; - } - case CHARACTERISTICNOTIFYARGUMENTS: { - mergeCharacteristicNotifyArguments(other.getCharacteristicNotifyArguments()); - break; - } - case CHARACTERISTICVALUE: { - mergeCharacteristicValue(other.getCharacteristicValue()); - break; - } - case DESCRIPTORREADARGUMENTS: { - mergeDescriptorReadArguments(other.getDescriptorReadArguments()); - break; - } - case DESCRIPTORWRITEARGUMENTS: { - mergeDescriptorWriteArguments(other.getDescriptorWriteArguments()); - break; - } - case VALUE_NOT_SET: { - break; - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int valueCase_ = 0; - private java.lang.Object value_; - public ValueCase - getValueCase() { - return ValueCase.forNumber( - valueCase_); - } - - public Builder clearValue() { - valueCase_ = 0; - value_ = null; - onChanged(); - return this; - } - - - private int category_ = 0; - /** - * .dev.yanshouwang.bluetooth_low_energy.MessageCategory category = 1; - * @return The enum numeric value on the wire for category. - */ - @java.lang.Override public int getCategoryValue() { - return category_; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.MessageCategory category = 1; - * @param value The enum numeric value on the wire for category to set. - * @return This builder for chaining. - */ - public Builder setCategoryValue(int value) { - - category_ = value; - onChanged(); - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.MessageCategory category = 1; - * @return The category. - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.MessageCategory getCategory() { - @SuppressWarnings("deprecation") - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.MessageCategory result = dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.MessageCategory.valueOf(category_); - return result == null ? dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.MessageCategory.UNRECOGNIZED : result; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.MessageCategory category = 1; - * @param value The category to set. - * @return This builder for chaining. - */ - public Builder setCategory(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.MessageCategory value) { - if (value == null) { - throw new NullPointerException(); - } - - category_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.MessageCategory category = 1; - * @return This builder for chaining. - */ - public Builder clearCategory() { - - category_ = 0; - onChanged(); - return this; - } - - /** - * .dev.yanshouwang.bluetooth_low_energy.BluetoothState state = 2; - * @return Whether the state field is set. - */ - @java.lang.Override - public boolean hasState() { - return valueCase_ == 2; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.BluetoothState state = 2; - * @return The enum numeric value on the wire for state. - */ - @java.lang.Override - public int getStateValue() { - if (valueCase_ == 2) { - return ((java.lang.Integer) value_).intValue(); - } - return 0; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.BluetoothState state = 2; - * @param value The enum numeric value on the wire for state to set. - * @return This builder for chaining. - */ - public Builder setStateValue(int value) { - valueCase_ = 2; - value_ = value; - onChanged(); - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.BluetoothState state = 2; - * @return The state. - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.BluetoothState getState() { - if (valueCase_ == 2) { - @SuppressWarnings("deprecation") - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.BluetoothState result = dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.BluetoothState.valueOf( - (java.lang.Integer) value_); - return result == null ? dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.BluetoothState.UNRECOGNIZED : result; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.BluetoothState.UNSUPPORTED; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.BluetoothState state = 2; - * @param value The state to set. - * @return This builder for chaining. - */ - public Builder setState(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.BluetoothState value) { - if (value == null) { - throw new NullPointerException(); - } - valueCase_ = 2; - value_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.BluetoothState state = 2; - * @return This builder for chaining. - */ - public Builder clearState() { - if (valueCase_ == 2) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - return this; - } - - private com.google.protobuf.SingleFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArgumentsOrBuilder> startDiscoveryArgumentsBuilder_; - /** - * .dev.yanshouwang.bluetooth_low_energy.StartDiscoveryArguments startDiscoveryArguments = 3; - * @return Whether the startDiscoveryArguments field is set. - */ - @java.lang.Override - public boolean hasStartDiscoveryArguments() { - return valueCase_ == 3; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.StartDiscoveryArguments startDiscoveryArguments = 3; - * @return The startDiscoveryArguments. - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments getStartDiscoveryArguments() { - if (startDiscoveryArgumentsBuilder_ == null) { - if (valueCase_ == 3) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments.getDefaultInstance(); - } else { - if (valueCase_ == 3) { - return startDiscoveryArgumentsBuilder_.getMessage(); - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments.getDefaultInstance(); - } - } - /** - * .dev.yanshouwang.bluetooth_low_energy.StartDiscoveryArguments startDiscoveryArguments = 3; - */ - public Builder setStartDiscoveryArguments(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments value) { - if (startDiscoveryArgumentsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - value_ = value; - onChanged(); - } else { - startDiscoveryArgumentsBuilder_.setMessage(value); - } - valueCase_ = 3; - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.StartDiscoveryArguments startDiscoveryArguments = 3; - */ - public Builder setStartDiscoveryArguments( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments.Builder builderForValue) { - if (startDiscoveryArgumentsBuilder_ == null) { - value_ = builderForValue.build(); - onChanged(); - } else { - startDiscoveryArgumentsBuilder_.setMessage(builderForValue.build()); - } - valueCase_ = 3; - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.StartDiscoveryArguments startDiscoveryArguments = 3; - */ - public Builder mergeStartDiscoveryArguments(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments value) { - if (startDiscoveryArgumentsBuilder_ == null) { - if (valueCase_ == 3 && - value_ != dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments.getDefaultInstance()) { - value_ = dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments.newBuilder((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments) value_) - .mergeFrom(value).buildPartial(); - } else { - value_ = value; - } - onChanged(); - } else { - if (valueCase_ == 3) { - startDiscoveryArgumentsBuilder_.mergeFrom(value); - } - startDiscoveryArgumentsBuilder_.setMessage(value); - } - valueCase_ = 3; - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.StartDiscoveryArguments startDiscoveryArguments = 3; - */ - public Builder clearStartDiscoveryArguments() { - if (startDiscoveryArgumentsBuilder_ == null) { - if (valueCase_ == 3) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - } else { - if (valueCase_ == 3) { - valueCase_ = 0; - value_ = null; - } - startDiscoveryArgumentsBuilder_.clear(); - } - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.StartDiscoveryArguments startDiscoveryArguments = 3; - */ - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments.Builder getStartDiscoveryArgumentsBuilder() { - return getStartDiscoveryArgumentsFieldBuilder().getBuilder(); - } - /** - * .dev.yanshouwang.bluetooth_low_energy.StartDiscoveryArguments startDiscoveryArguments = 3; - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArgumentsOrBuilder getStartDiscoveryArgumentsOrBuilder() { - if ((valueCase_ == 3) && (startDiscoveryArgumentsBuilder_ != null)) { - return startDiscoveryArgumentsBuilder_.getMessageOrBuilder(); - } else { - if (valueCase_ == 3) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments.getDefaultInstance(); - } - } - /** - * .dev.yanshouwang.bluetooth_low_energy.StartDiscoveryArguments startDiscoveryArguments = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArgumentsOrBuilder> - getStartDiscoveryArgumentsFieldBuilder() { - if (startDiscoveryArgumentsBuilder_ == null) { - if (!(valueCase_ == 3)) { - value_ = dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments.getDefaultInstance(); - } - startDiscoveryArgumentsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArgumentsOrBuilder>( - (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments) value_, - getParentForChildren(), - isClean()); - value_ = null; - } - valueCase_ = 3; - onChanged();; - return startDiscoveryArgumentsBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.DiscoveryOrBuilder> discoveryBuilder_; - /** - * .dev.yanshouwang.bluetooth_low_energy.Discovery discovery = 4; - * @return Whether the discovery field is set. - */ - @java.lang.Override - public boolean hasDiscovery() { - return valueCase_ == 4; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.Discovery discovery = 4; - * @return The discovery. - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery getDiscovery() { - if (discoveryBuilder_ == null) { - if (valueCase_ == 4) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery.getDefaultInstance(); - } else { - if (valueCase_ == 4) { - return discoveryBuilder_.getMessage(); - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery.getDefaultInstance(); - } - } - /** - * .dev.yanshouwang.bluetooth_low_energy.Discovery discovery = 4; - */ - public Builder setDiscovery(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery value) { - if (discoveryBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - value_ = value; - onChanged(); - } else { - discoveryBuilder_.setMessage(value); - } - valueCase_ = 4; - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.Discovery discovery = 4; - */ - public Builder setDiscovery( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery.Builder builderForValue) { - if (discoveryBuilder_ == null) { - value_ = builderForValue.build(); - onChanged(); - } else { - discoveryBuilder_.setMessage(builderForValue.build()); - } - valueCase_ = 4; - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.Discovery discovery = 4; - */ - public Builder mergeDiscovery(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery value) { - if (discoveryBuilder_ == null) { - if (valueCase_ == 4 && - value_ != dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery.getDefaultInstance()) { - value_ = dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery.newBuilder((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery) value_) - .mergeFrom(value).buildPartial(); - } else { - value_ = value; - } - onChanged(); - } else { - if (valueCase_ == 4) { - discoveryBuilder_.mergeFrom(value); - } - discoveryBuilder_.setMessage(value); - } - valueCase_ = 4; - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.Discovery discovery = 4; - */ - public Builder clearDiscovery() { - if (discoveryBuilder_ == null) { - if (valueCase_ == 4) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - } else { - if (valueCase_ == 4) { - valueCase_ = 0; - value_ = null; - } - discoveryBuilder_.clear(); - } - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.Discovery discovery = 4; - */ - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery.Builder getDiscoveryBuilder() { - return getDiscoveryFieldBuilder().getBuilder(); - } - /** - * .dev.yanshouwang.bluetooth_low_energy.Discovery discovery = 4; - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.DiscoveryOrBuilder getDiscoveryOrBuilder() { - if ((valueCase_ == 4) && (discoveryBuilder_ != null)) { - return discoveryBuilder_.getMessageOrBuilder(); - } else { - if (valueCase_ == 4) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery.getDefaultInstance(); - } - } - /** - * .dev.yanshouwang.bluetooth_low_energy.Discovery discovery = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.DiscoveryOrBuilder> - getDiscoveryFieldBuilder() { - if (discoveryBuilder_ == null) { - if (!(valueCase_ == 4)) { - value_ = dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery.getDefaultInstance(); - } - discoveryBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.DiscoveryOrBuilder>( - (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery) value_, - getParentForChildren(), - isClean()); - value_ = null; - } - valueCase_ = 4; - onChanged();; - return discoveryBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArgumentsOrBuilder> connectArgumentsBuilder_; - /** - * .dev.yanshouwang.bluetooth_low_energy.ConnectArguments connectArguments = 5; - * @return Whether the connectArguments field is set. - */ - @java.lang.Override - public boolean hasConnectArguments() { - return valueCase_ == 5; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.ConnectArguments connectArguments = 5; - * @return The connectArguments. - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments getConnectArguments() { - if (connectArgumentsBuilder_ == null) { - if (valueCase_ == 5) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments.getDefaultInstance(); - } else { - if (valueCase_ == 5) { - return connectArgumentsBuilder_.getMessage(); - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments.getDefaultInstance(); - } - } - /** - * .dev.yanshouwang.bluetooth_low_energy.ConnectArguments connectArguments = 5; - */ - public Builder setConnectArguments(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments value) { - if (connectArgumentsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - value_ = value; - onChanged(); - } else { - connectArgumentsBuilder_.setMessage(value); - } - valueCase_ = 5; - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.ConnectArguments connectArguments = 5; - */ - public Builder setConnectArguments( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments.Builder builderForValue) { - if (connectArgumentsBuilder_ == null) { - value_ = builderForValue.build(); - onChanged(); - } else { - connectArgumentsBuilder_.setMessage(builderForValue.build()); - } - valueCase_ = 5; - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.ConnectArguments connectArguments = 5; - */ - public Builder mergeConnectArguments(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments value) { - if (connectArgumentsBuilder_ == null) { - if (valueCase_ == 5 && - value_ != dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments.getDefaultInstance()) { - value_ = dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments.newBuilder((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments) value_) - .mergeFrom(value).buildPartial(); - } else { - value_ = value; - } - onChanged(); - } else { - if (valueCase_ == 5) { - connectArgumentsBuilder_.mergeFrom(value); - } - connectArgumentsBuilder_.setMessage(value); - } - valueCase_ = 5; - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.ConnectArguments connectArguments = 5; - */ - public Builder clearConnectArguments() { - if (connectArgumentsBuilder_ == null) { - if (valueCase_ == 5) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - } else { - if (valueCase_ == 5) { - valueCase_ = 0; - value_ = null; - } - connectArgumentsBuilder_.clear(); - } - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.ConnectArguments connectArguments = 5; - */ - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments.Builder getConnectArgumentsBuilder() { - return getConnectArgumentsFieldBuilder().getBuilder(); - } - /** - * .dev.yanshouwang.bluetooth_low_energy.ConnectArguments connectArguments = 5; - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArgumentsOrBuilder getConnectArgumentsOrBuilder() { - if ((valueCase_ == 5) && (connectArgumentsBuilder_ != null)) { - return connectArgumentsBuilder_.getMessageOrBuilder(); - } else { - if (valueCase_ == 5) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments.getDefaultInstance(); - } - } - /** - * .dev.yanshouwang.bluetooth_low_energy.ConnectArguments connectArguments = 5; - */ - private com.google.protobuf.SingleFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArgumentsOrBuilder> - getConnectArgumentsFieldBuilder() { - if (connectArgumentsBuilder_ == null) { - if (!(valueCase_ == 5)) { - value_ = dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments.getDefaultInstance(); - } - connectArgumentsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArgumentsOrBuilder>( - (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments) value_, - getParentForChildren(), - isClean()); - value_ = null; - } - valueCase_ = 5; - onChanged();; - return connectArgumentsBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArgumentsOrBuilder> disconnectArgumentsBuilder_; - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDisconnectArguments disconnectArguments = 6; - * @return Whether the disconnectArguments field is set. - */ - @java.lang.Override - public boolean hasDisconnectArguments() { - return valueCase_ == 6; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDisconnectArguments disconnectArguments = 6; - * @return The disconnectArguments. - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments getDisconnectArguments() { - if (disconnectArgumentsBuilder_ == null) { - if (valueCase_ == 6) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments.getDefaultInstance(); - } else { - if (valueCase_ == 6) { - return disconnectArgumentsBuilder_.getMessage(); - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments.getDefaultInstance(); - } - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDisconnectArguments disconnectArguments = 6; - */ - public Builder setDisconnectArguments(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments value) { - if (disconnectArgumentsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - value_ = value; - onChanged(); - } else { - disconnectArgumentsBuilder_.setMessage(value); - } - valueCase_ = 6; - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDisconnectArguments disconnectArguments = 6; - */ - public Builder setDisconnectArguments( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments.Builder builderForValue) { - if (disconnectArgumentsBuilder_ == null) { - value_ = builderForValue.build(); - onChanged(); - } else { - disconnectArgumentsBuilder_.setMessage(builderForValue.build()); - } - valueCase_ = 6; - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDisconnectArguments disconnectArguments = 6; - */ - public Builder mergeDisconnectArguments(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments value) { - if (disconnectArgumentsBuilder_ == null) { - if (valueCase_ == 6 && - value_ != dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments.getDefaultInstance()) { - value_ = dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments.newBuilder((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments) value_) - .mergeFrom(value).buildPartial(); - } else { - value_ = value; - } - onChanged(); - } else { - if (valueCase_ == 6) { - disconnectArgumentsBuilder_.mergeFrom(value); - } - disconnectArgumentsBuilder_.setMessage(value); - } - valueCase_ = 6; - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDisconnectArguments disconnectArguments = 6; - */ - public Builder clearDisconnectArguments() { - if (disconnectArgumentsBuilder_ == null) { - if (valueCase_ == 6) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - } else { - if (valueCase_ == 6) { - valueCase_ = 0; - value_ = null; - } - disconnectArgumentsBuilder_.clear(); - } - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDisconnectArguments disconnectArguments = 6; - */ - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments.Builder getDisconnectArgumentsBuilder() { - return getDisconnectArgumentsFieldBuilder().getBuilder(); - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDisconnectArguments disconnectArguments = 6; - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArgumentsOrBuilder getDisconnectArgumentsOrBuilder() { - if ((valueCase_ == 6) && (disconnectArgumentsBuilder_ != null)) { - return disconnectArgumentsBuilder_.getMessageOrBuilder(); - } else { - if (valueCase_ == 6) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments.getDefaultInstance(); - } - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDisconnectArguments disconnectArguments = 6; - */ - private com.google.protobuf.SingleFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArgumentsOrBuilder> - getDisconnectArgumentsFieldBuilder() { - if (disconnectArgumentsBuilder_ == null) { - if (!(valueCase_ == 6)) { - value_ = dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments.getDefaultInstance(); - } - disconnectArgumentsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArgumentsOrBuilder>( - (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments) value_, - getParentForChildren(), - isClean()); - value_ = null; - } - valueCase_ = 6; - onChanged();; - return disconnectArgumentsBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLostOrBuilder> connectionLostBuilder_; - /** - * .dev.yanshouwang.bluetooth_low_energy.GattConnectionLost connectionLost = 7; - * @return Whether the connectionLost field is set. - */ - @java.lang.Override - public boolean hasConnectionLost() { - return valueCase_ == 7; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattConnectionLost connectionLost = 7; - * @return The connectionLost. - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost getConnectionLost() { - if (connectionLostBuilder_ == null) { - if (valueCase_ == 7) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost.getDefaultInstance(); - } else { - if (valueCase_ == 7) { - return connectionLostBuilder_.getMessage(); - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost.getDefaultInstance(); - } - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattConnectionLost connectionLost = 7; - */ - public Builder setConnectionLost(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost value) { - if (connectionLostBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - value_ = value; - onChanged(); - } else { - connectionLostBuilder_.setMessage(value); - } - valueCase_ = 7; - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattConnectionLost connectionLost = 7; - */ - public Builder setConnectionLost( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost.Builder builderForValue) { - if (connectionLostBuilder_ == null) { - value_ = builderForValue.build(); - onChanged(); - } else { - connectionLostBuilder_.setMessage(builderForValue.build()); - } - valueCase_ = 7; - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattConnectionLost connectionLost = 7; - */ - public Builder mergeConnectionLost(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost value) { - if (connectionLostBuilder_ == null) { - if (valueCase_ == 7 && - value_ != dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost.getDefaultInstance()) { - value_ = dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost.newBuilder((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost) value_) - .mergeFrom(value).buildPartial(); - } else { - value_ = value; - } - onChanged(); - } else { - if (valueCase_ == 7) { - connectionLostBuilder_.mergeFrom(value); - } - connectionLostBuilder_.setMessage(value); - } - valueCase_ = 7; - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattConnectionLost connectionLost = 7; - */ - public Builder clearConnectionLost() { - if (connectionLostBuilder_ == null) { - if (valueCase_ == 7) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - } else { - if (valueCase_ == 7) { - valueCase_ = 0; - value_ = null; - } - connectionLostBuilder_.clear(); - } - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattConnectionLost connectionLost = 7; - */ - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost.Builder getConnectionLostBuilder() { - return getConnectionLostFieldBuilder().getBuilder(); - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattConnectionLost connectionLost = 7; - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLostOrBuilder getConnectionLostOrBuilder() { - if ((valueCase_ == 7) && (connectionLostBuilder_ != null)) { - return connectionLostBuilder_.getMessageOrBuilder(); - } else { - if (valueCase_ == 7) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost.getDefaultInstance(); - } - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattConnectionLost connectionLost = 7; - */ - private com.google.protobuf.SingleFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLostOrBuilder> - getConnectionLostFieldBuilder() { - if (connectionLostBuilder_ == null) { - if (!(valueCase_ == 7)) { - value_ = dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost.getDefaultInstance(); - } - connectionLostBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLostOrBuilder>( - (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost) value_, - getParentForChildren(), - isClean()); - value_ = null; - } - valueCase_ = 7; - onChanged();; - return connectionLostBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArgumentsOrBuilder> characteristicReadArgumentsBuilder_; - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicReadArguments characteristicReadArguments = 8; - * @return Whether the characteristicReadArguments field is set. - */ - @java.lang.Override - public boolean hasCharacteristicReadArguments() { - return valueCase_ == 8; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicReadArguments characteristicReadArguments = 8; - * @return The characteristicReadArguments. - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments getCharacteristicReadArguments() { - if (characteristicReadArgumentsBuilder_ == null) { - if (valueCase_ == 8) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments.getDefaultInstance(); - } else { - if (valueCase_ == 8) { - return characteristicReadArgumentsBuilder_.getMessage(); - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments.getDefaultInstance(); - } - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicReadArguments characteristicReadArguments = 8; - */ - public Builder setCharacteristicReadArguments(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments value) { - if (characteristicReadArgumentsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - value_ = value; - onChanged(); - } else { - characteristicReadArgumentsBuilder_.setMessage(value); - } - valueCase_ = 8; - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicReadArguments characteristicReadArguments = 8; - */ - public Builder setCharacteristicReadArguments( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments.Builder builderForValue) { - if (characteristicReadArgumentsBuilder_ == null) { - value_ = builderForValue.build(); - onChanged(); - } else { - characteristicReadArgumentsBuilder_.setMessage(builderForValue.build()); - } - valueCase_ = 8; - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicReadArguments characteristicReadArguments = 8; - */ - public Builder mergeCharacteristicReadArguments(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments value) { - if (characteristicReadArgumentsBuilder_ == null) { - if (valueCase_ == 8 && - value_ != dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments.getDefaultInstance()) { - value_ = dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments.newBuilder((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments) value_) - .mergeFrom(value).buildPartial(); - } else { - value_ = value; - } - onChanged(); - } else { - if (valueCase_ == 8) { - characteristicReadArgumentsBuilder_.mergeFrom(value); - } - characteristicReadArgumentsBuilder_.setMessage(value); - } - valueCase_ = 8; - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicReadArguments characteristicReadArguments = 8; - */ - public Builder clearCharacteristicReadArguments() { - if (characteristicReadArgumentsBuilder_ == null) { - if (valueCase_ == 8) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - } else { - if (valueCase_ == 8) { - valueCase_ = 0; - value_ = null; - } - characteristicReadArgumentsBuilder_.clear(); - } - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicReadArguments characteristicReadArguments = 8; - */ - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments.Builder getCharacteristicReadArgumentsBuilder() { - return getCharacteristicReadArgumentsFieldBuilder().getBuilder(); - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicReadArguments characteristicReadArguments = 8; - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArgumentsOrBuilder getCharacteristicReadArgumentsOrBuilder() { - if ((valueCase_ == 8) && (characteristicReadArgumentsBuilder_ != null)) { - return characteristicReadArgumentsBuilder_.getMessageOrBuilder(); - } else { - if (valueCase_ == 8) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments.getDefaultInstance(); - } - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicReadArguments characteristicReadArguments = 8; - */ - private com.google.protobuf.SingleFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArgumentsOrBuilder> - getCharacteristicReadArgumentsFieldBuilder() { - if (characteristicReadArgumentsBuilder_ == null) { - if (!(valueCase_ == 8)) { - value_ = dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments.getDefaultInstance(); - } - characteristicReadArgumentsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArgumentsOrBuilder>( - (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments) value_, - getParentForChildren(), - isClean()); - value_ = null; - } - valueCase_ = 8; - onChanged();; - return characteristicReadArgumentsBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArgumentsOrBuilder> characteristicWriteArgumentsBuilder_; - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicWriteArguments characteristicWriteArguments = 9; - * @return Whether the characteristicWriteArguments field is set. - */ - @java.lang.Override - public boolean hasCharacteristicWriteArguments() { - return valueCase_ == 9; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicWriteArguments characteristicWriteArguments = 9; - * @return The characteristicWriteArguments. - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments getCharacteristicWriteArguments() { - if (characteristicWriteArgumentsBuilder_ == null) { - if (valueCase_ == 9) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments.getDefaultInstance(); - } else { - if (valueCase_ == 9) { - return characteristicWriteArgumentsBuilder_.getMessage(); - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments.getDefaultInstance(); - } - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicWriteArguments characteristicWriteArguments = 9; - */ - public Builder setCharacteristicWriteArguments(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments value) { - if (characteristicWriteArgumentsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - value_ = value; - onChanged(); - } else { - characteristicWriteArgumentsBuilder_.setMessage(value); - } - valueCase_ = 9; - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicWriteArguments characteristicWriteArguments = 9; - */ - public Builder setCharacteristicWriteArguments( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments.Builder builderForValue) { - if (characteristicWriteArgumentsBuilder_ == null) { - value_ = builderForValue.build(); - onChanged(); - } else { - characteristicWriteArgumentsBuilder_.setMessage(builderForValue.build()); - } - valueCase_ = 9; - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicWriteArguments characteristicWriteArguments = 9; - */ - public Builder mergeCharacteristicWriteArguments(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments value) { - if (characteristicWriteArgumentsBuilder_ == null) { - if (valueCase_ == 9 && - value_ != dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments.getDefaultInstance()) { - value_ = dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments.newBuilder((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments) value_) - .mergeFrom(value).buildPartial(); - } else { - value_ = value; - } - onChanged(); - } else { - if (valueCase_ == 9) { - characteristicWriteArgumentsBuilder_.mergeFrom(value); - } - characteristicWriteArgumentsBuilder_.setMessage(value); - } - valueCase_ = 9; - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicWriteArguments characteristicWriteArguments = 9; - */ - public Builder clearCharacteristicWriteArguments() { - if (characteristicWriteArgumentsBuilder_ == null) { - if (valueCase_ == 9) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - } else { - if (valueCase_ == 9) { - valueCase_ = 0; - value_ = null; - } - characteristicWriteArgumentsBuilder_.clear(); - } - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicWriteArguments characteristicWriteArguments = 9; - */ - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments.Builder getCharacteristicWriteArgumentsBuilder() { - return getCharacteristicWriteArgumentsFieldBuilder().getBuilder(); - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicWriteArguments characteristicWriteArguments = 9; - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArgumentsOrBuilder getCharacteristicWriteArgumentsOrBuilder() { - if ((valueCase_ == 9) && (characteristicWriteArgumentsBuilder_ != null)) { - return characteristicWriteArgumentsBuilder_.getMessageOrBuilder(); - } else { - if (valueCase_ == 9) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments.getDefaultInstance(); - } - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicWriteArguments characteristicWriteArguments = 9; - */ - private com.google.protobuf.SingleFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArgumentsOrBuilder> - getCharacteristicWriteArgumentsFieldBuilder() { - if (characteristicWriteArgumentsBuilder_ == null) { - if (!(valueCase_ == 9)) { - value_ = dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments.getDefaultInstance(); - } - characteristicWriteArgumentsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArgumentsOrBuilder>( - (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments) value_, - getParentForChildren(), - isClean()); - value_ = null; - } - valueCase_ = 9; - onChanged();; - return characteristicWriteArgumentsBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArgumentsOrBuilder> characteristicNotifyArgumentsBuilder_; - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicNotifyArguments characteristicNotifyArguments = 10; - * @return Whether the characteristicNotifyArguments field is set. - */ - @java.lang.Override - public boolean hasCharacteristicNotifyArguments() { - return valueCase_ == 10; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicNotifyArguments characteristicNotifyArguments = 10; - * @return The characteristicNotifyArguments. - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments getCharacteristicNotifyArguments() { - if (characteristicNotifyArgumentsBuilder_ == null) { - if (valueCase_ == 10) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments.getDefaultInstance(); - } else { - if (valueCase_ == 10) { - return characteristicNotifyArgumentsBuilder_.getMessage(); - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments.getDefaultInstance(); - } - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicNotifyArguments characteristicNotifyArguments = 10; - */ - public Builder setCharacteristicNotifyArguments(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments value) { - if (characteristicNotifyArgumentsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - value_ = value; - onChanged(); - } else { - characteristicNotifyArgumentsBuilder_.setMessage(value); - } - valueCase_ = 10; - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicNotifyArguments characteristicNotifyArguments = 10; - */ - public Builder setCharacteristicNotifyArguments( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments.Builder builderForValue) { - if (characteristicNotifyArgumentsBuilder_ == null) { - value_ = builderForValue.build(); - onChanged(); - } else { - characteristicNotifyArgumentsBuilder_.setMessage(builderForValue.build()); - } - valueCase_ = 10; - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicNotifyArguments characteristicNotifyArguments = 10; - */ - public Builder mergeCharacteristicNotifyArguments(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments value) { - if (characteristicNotifyArgumentsBuilder_ == null) { - if (valueCase_ == 10 && - value_ != dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments.getDefaultInstance()) { - value_ = dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments.newBuilder((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments) value_) - .mergeFrom(value).buildPartial(); - } else { - value_ = value; - } - onChanged(); - } else { - if (valueCase_ == 10) { - characteristicNotifyArgumentsBuilder_.mergeFrom(value); - } - characteristicNotifyArgumentsBuilder_.setMessage(value); - } - valueCase_ = 10; - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicNotifyArguments characteristicNotifyArguments = 10; - */ - public Builder clearCharacteristicNotifyArguments() { - if (characteristicNotifyArgumentsBuilder_ == null) { - if (valueCase_ == 10) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - } else { - if (valueCase_ == 10) { - valueCase_ = 0; - value_ = null; - } - characteristicNotifyArgumentsBuilder_.clear(); - } - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicNotifyArguments characteristicNotifyArguments = 10; - */ - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments.Builder getCharacteristicNotifyArgumentsBuilder() { - return getCharacteristicNotifyArgumentsFieldBuilder().getBuilder(); - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicNotifyArguments characteristicNotifyArguments = 10; - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArgumentsOrBuilder getCharacteristicNotifyArgumentsOrBuilder() { - if ((valueCase_ == 10) && (characteristicNotifyArgumentsBuilder_ != null)) { - return characteristicNotifyArgumentsBuilder_.getMessageOrBuilder(); - } else { - if (valueCase_ == 10) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments.getDefaultInstance(); - } - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicNotifyArguments characteristicNotifyArguments = 10; - */ - private com.google.protobuf.SingleFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArgumentsOrBuilder> - getCharacteristicNotifyArgumentsFieldBuilder() { - if (characteristicNotifyArgumentsBuilder_ == null) { - if (!(valueCase_ == 10)) { - value_ = dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments.getDefaultInstance(); - } - characteristicNotifyArgumentsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArgumentsOrBuilder>( - (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments) value_, - getParentForChildren(), - isClean()); - value_ = null; - } - valueCase_ = 10; - onChanged();; - return characteristicNotifyArgumentsBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValueOrBuilder> characteristicValueBuilder_; - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicValue characteristicValue = 11; - * @return Whether the characteristicValue field is set. - */ - @java.lang.Override - public boolean hasCharacteristicValue() { - return valueCase_ == 11; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicValue characteristicValue = 11; - * @return The characteristicValue. - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue getCharacteristicValue() { - if (characteristicValueBuilder_ == null) { - if (valueCase_ == 11) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue.getDefaultInstance(); - } else { - if (valueCase_ == 11) { - return characteristicValueBuilder_.getMessage(); - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue.getDefaultInstance(); - } - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicValue characteristicValue = 11; - */ - public Builder setCharacteristicValue(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue value) { - if (characteristicValueBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - value_ = value; - onChanged(); - } else { - characteristicValueBuilder_.setMessage(value); - } - valueCase_ = 11; - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicValue characteristicValue = 11; - */ - public Builder setCharacteristicValue( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue.Builder builderForValue) { - if (characteristicValueBuilder_ == null) { - value_ = builderForValue.build(); - onChanged(); - } else { - characteristicValueBuilder_.setMessage(builderForValue.build()); - } - valueCase_ = 11; - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicValue characteristicValue = 11; - */ - public Builder mergeCharacteristicValue(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue value) { - if (characteristicValueBuilder_ == null) { - if (valueCase_ == 11 && - value_ != dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue.getDefaultInstance()) { - value_ = dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue.newBuilder((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue) value_) - .mergeFrom(value).buildPartial(); - } else { - value_ = value; - } - onChanged(); - } else { - if (valueCase_ == 11) { - characteristicValueBuilder_.mergeFrom(value); - } - characteristicValueBuilder_.setMessage(value); - } - valueCase_ = 11; - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicValue characteristicValue = 11; - */ - public Builder clearCharacteristicValue() { - if (characteristicValueBuilder_ == null) { - if (valueCase_ == 11) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - } else { - if (valueCase_ == 11) { - valueCase_ = 0; - value_ = null; - } - characteristicValueBuilder_.clear(); - } - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicValue characteristicValue = 11; - */ - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue.Builder getCharacteristicValueBuilder() { - return getCharacteristicValueFieldBuilder().getBuilder(); - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicValue characteristicValue = 11; - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValueOrBuilder getCharacteristicValueOrBuilder() { - if ((valueCase_ == 11) && (characteristicValueBuilder_ != null)) { - return characteristicValueBuilder_.getMessageOrBuilder(); - } else { - if (valueCase_ == 11) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue.getDefaultInstance(); - } - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicValue characteristicValue = 11; - */ - private com.google.protobuf.SingleFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValueOrBuilder> - getCharacteristicValueFieldBuilder() { - if (characteristicValueBuilder_ == null) { - if (!(valueCase_ == 11)) { - value_ = dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue.getDefaultInstance(); - } - characteristicValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValueOrBuilder>( - (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue) value_, - getParentForChildren(), - isClean()); - value_ = null; - } - valueCase_ = 11; - onChanged();; - return characteristicValueBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArgumentsOrBuilder> descriptorReadArgumentsBuilder_; - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDescriptorReadArguments descriptorReadArguments = 12; - * @return Whether the descriptorReadArguments field is set. - */ - @java.lang.Override - public boolean hasDescriptorReadArguments() { - return valueCase_ == 12; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDescriptorReadArguments descriptorReadArguments = 12; - * @return The descriptorReadArguments. - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments getDescriptorReadArguments() { - if (descriptorReadArgumentsBuilder_ == null) { - if (valueCase_ == 12) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments.getDefaultInstance(); - } else { - if (valueCase_ == 12) { - return descriptorReadArgumentsBuilder_.getMessage(); - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments.getDefaultInstance(); - } - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDescriptorReadArguments descriptorReadArguments = 12; - */ - public Builder setDescriptorReadArguments(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments value) { - if (descriptorReadArgumentsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - value_ = value; - onChanged(); - } else { - descriptorReadArgumentsBuilder_.setMessage(value); - } - valueCase_ = 12; - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDescriptorReadArguments descriptorReadArguments = 12; - */ - public Builder setDescriptorReadArguments( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments.Builder builderForValue) { - if (descriptorReadArgumentsBuilder_ == null) { - value_ = builderForValue.build(); - onChanged(); - } else { - descriptorReadArgumentsBuilder_.setMessage(builderForValue.build()); - } - valueCase_ = 12; - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDescriptorReadArguments descriptorReadArguments = 12; - */ - public Builder mergeDescriptorReadArguments(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments value) { - if (descriptorReadArgumentsBuilder_ == null) { - if (valueCase_ == 12 && - value_ != dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments.getDefaultInstance()) { - value_ = dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments.newBuilder((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments) value_) - .mergeFrom(value).buildPartial(); - } else { - value_ = value; - } - onChanged(); - } else { - if (valueCase_ == 12) { - descriptorReadArgumentsBuilder_.mergeFrom(value); - } - descriptorReadArgumentsBuilder_.setMessage(value); - } - valueCase_ = 12; - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDescriptorReadArguments descriptorReadArguments = 12; - */ - public Builder clearDescriptorReadArguments() { - if (descriptorReadArgumentsBuilder_ == null) { - if (valueCase_ == 12) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - } else { - if (valueCase_ == 12) { - valueCase_ = 0; - value_ = null; - } - descriptorReadArgumentsBuilder_.clear(); - } - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDescriptorReadArguments descriptorReadArguments = 12; - */ - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments.Builder getDescriptorReadArgumentsBuilder() { - return getDescriptorReadArgumentsFieldBuilder().getBuilder(); - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDescriptorReadArguments descriptorReadArguments = 12; - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArgumentsOrBuilder getDescriptorReadArgumentsOrBuilder() { - if ((valueCase_ == 12) && (descriptorReadArgumentsBuilder_ != null)) { - return descriptorReadArgumentsBuilder_.getMessageOrBuilder(); - } else { - if (valueCase_ == 12) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments.getDefaultInstance(); - } - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDescriptorReadArguments descriptorReadArguments = 12; - */ - private com.google.protobuf.SingleFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArgumentsOrBuilder> - getDescriptorReadArgumentsFieldBuilder() { - if (descriptorReadArgumentsBuilder_ == null) { - if (!(valueCase_ == 12)) { - value_ = dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments.getDefaultInstance(); - } - descriptorReadArgumentsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArgumentsOrBuilder>( - (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments) value_, - getParentForChildren(), - isClean()); - value_ = null; - } - valueCase_ = 12; - onChanged();; - return descriptorReadArgumentsBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArgumentsOrBuilder> descriptorWriteArgumentsBuilder_; - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDescriptorWriteArguments descriptorWriteArguments = 13; - * @return Whether the descriptorWriteArguments field is set. - */ - @java.lang.Override - public boolean hasDescriptorWriteArguments() { - return valueCase_ == 13; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDescriptorWriteArguments descriptorWriteArguments = 13; - * @return The descriptorWriteArguments. - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments getDescriptorWriteArguments() { - if (descriptorWriteArgumentsBuilder_ == null) { - if (valueCase_ == 13) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments.getDefaultInstance(); - } else { - if (valueCase_ == 13) { - return descriptorWriteArgumentsBuilder_.getMessage(); - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments.getDefaultInstance(); - } - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDescriptorWriteArguments descriptorWriteArguments = 13; - */ - public Builder setDescriptorWriteArguments(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments value) { - if (descriptorWriteArgumentsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - value_ = value; - onChanged(); - } else { - descriptorWriteArgumentsBuilder_.setMessage(value); - } - valueCase_ = 13; - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDescriptorWriteArguments descriptorWriteArguments = 13; - */ - public Builder setDescriptorWriteArguments( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments.Builder builderForValue) { - if (descriptorWriteArgumentsBuilder_ == null) { - value_ = builderForValue.build(); - onChanged(); - } else { - descriptorWriteArgumentsBuilder_.setMessage(builderForValue.build()); - } - valueCase_ = 13; - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDescriptorWriteArguments descriptorWriteArguments = 13; - */ - public Builder mergeDescriptorWriteArguments(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments value) { - if (descriptorWriteArgumentsBuilder_ == null) { - if (valueCase_ == 13 && - value_ != dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments.getDefaultInstance()) { - value_ = dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments.newBuilder((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments) value_) - .mergeFrom(value).buildPartial(); - } else { - value_ = value; - } - onChanged(); - } else { - if (valueCase_ == 13) { - descriptorWriteArgumentsBuilder_.mergeFrom(value); - } - descriptorWriteArgumentsBuilder_.setMessage(value); - } - valueCase_ = 13; - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDescriptorWriteArguments descriptorWriteArguments = 13; - */ - public Builder clearDescriptorWriteArguments() { - if (descriptorWriteArgumentsBuilder_ == null) { - if (valueCase_ == 13) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - } else { - if (valueCase_ == 13) { - valueCase_ = 0; - value_ = null; - } - descriptorWriteArgumentsBuilder_.clear(); - } - return this; - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDescriptorWriteArguments descriptorWriteArguments = 13; - */ - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments.Builder getDescriptorWriteArgumentsBuilder() { - return getDescriptorWriteArgumentsFieldBuilder().getBuilder(); - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDescriptorWriteArguments descriptorWriteArguments = 13; - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArgumentsOrBuilder getDescriptorWriteArgumentsOrBuilder() { - if ((valueCase_ == 13) && (descriptorWriteArgumentsBuilder_ != null)) { - return descriptorWriteArgumentsBuilder_.getMessageOrBuilder(); - } else { - if (valueCase_ == 13) { - return (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments) value_; - } - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments.getDefaultInstance(); - } - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDescriptorWriteArguments descriptorWriteArguments = 13; - */ - private com.google.protobuf.SingleFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArgumentsOrBuilder> - getDescriptorWriteArgumentsFieldBuilder() { - if (descriptorWriteArgumentsBuilder_ == null) { - if (!(valueCase_ == 13)) { - value_ = dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments.getDefaultInstance(); - } - descriptorWriteArgumentsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArgumentsOrBuilder>( - (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments) value_, - getParentForChildren(), - isClean()); - value_ = null; - } - valueCase_ = 13; - onChanged();; - return descriptorWriteArgumentsBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:dev.yanshouwang.bluetooth_low_energy.Message) - } - - // @@protoc_insertion_point(class_scope:dev.yanshouwang.bluetooth_low_energy.Message) - private static final dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message(); - } - - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Message parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Message(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface StartDiscoveryArgumentsOrBuilder extends - // @@protoc_insertion_point(interface_extends:dev.yanshouwang.bluetooth_low_energy.StartDiscoveryArguments) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated string services = 1; - * @return A list containing the services. - */ - java.util.List - getServicesList(); - /** - * repeated string services = 1; - * @return The count of services. - */ - int getServicesCount(); - /** - * repeated string services = 1; - * @param index The index of the element to return. - * @return The services at the given index. - */ - java.lang.String getServices(int index); - /** - * repeated string services = 1; - * @param index The index of the value to return. - * @return The bytes of the services at the given index. - */ - com.google.protobuf.ByteString - getServicesBytes(int index); - } - /** - * Protobuf type {@code dev.yanshouwang.bluetooth_low_energy.StartDiscoveryArguments} - */ - public static final class StartDiscoveryArguments extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:dev.yanshouwang.bluetooth_low_energy.StartDiscoveryArguments) - StartDiscoveryArgumentsOrBuilder { - private static final long serialVersionUID = 0L; - // Use StartDiscoveryArguments.newBuilder() to construct. - private StartDiscoveryArguments(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private StartDiscoveryArguments() { - services_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new StartDiscoveryArguments(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private StartDiscoveryArguments( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - services_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - services_.add(s); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - services_ = services_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_StartDiscoveryArguments_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_StartDiscoveryArguments_fieldAccessorTable - .ensureFieldAccessorsInitialized( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments.class, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments.Builder.class); - } - - public static final int SERVICES_FIELD_NUMBER = 1; - private com.google.protobuf.LazyStringList services_; - /** - * repeated string services = 1; - * @return A list containing the services. - */ - public com.google.protobuf.ProtocolStringList - getServicesList() { - return services_; - } - /** - * repeated string services = 1; - * @return The count of services. - */ - public int getServicesCount() { - return services_.size(); - } - /** - * repeated string services = 1; - * @param index The index of the element to return. - * @return The services at the given index. - */ - public java.lang.String getServices(int index) { - return services_.get(index); - } - /** - * repeated string services = 1; - * @param index The index of the value to return. - * @return The bytes of the services at the given index. - */ - public com.google.protobuf.ByteString - getServicesBytes(int index) { - return services_.getByteString(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < services_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, services_.getRaw(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < services_.size(); i++) { - dataSize += computeStringSizeNoTag(services_.getRaw(i)); - } - size += dataSize; - size += 1 * getServicesList().size(); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments)) { - return super.equals(obj); - } - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments other = (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments) obj; - - if (!getServicesList() - .equals(other.getServicesList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getServicesCount() > 0) { - hash = (37 * hash) + SERVICES_FIELD_NUMBER; - hash = (53 * hash) + getServicesList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code dev.yanshouwang.bluetooth_low_energy.StartDiscoveryArguments} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:dev.yanshouwang.bluetooth_low_energy.StartDiscoveryArguments) - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArgumentsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_StartDiscoveryArguments_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_StartDiscoveryArguments_fieldAccessorTable - .ensureFieldAccessorsInitialized( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments.class, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments.Builder.class); - } - - // Construct using dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - services_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_StartDiscoveryArguments_descriptor; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments getDefaultInstanceForType() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments.getDefaultInstance(); - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments build() { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments buildPartial() { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments result = new dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments(this); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - services_ = services_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.services_ = services_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments) { - return mergeFrom((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments other) { - if (other == dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments.getDefaultInstance()) return this; - if (!other.services_.isEmpty()) { - if (services_.isEmpty()) { - services_ = other.services_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureServicesIsMutable(); - services_.addAll(other.services_); - } - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private com.google.protobuf.LazyStringList services_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureServicesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - services_ = new com.google.protobuf.LazyStringArrayList(services_); - bitField0_ |= 0x00000001; - } - } - /** - * repeated string services = 1; - * @return A list containing the services. - */ - public com.google.protobuf.ProtocolStringList - getServicesList() { - return services_.getUnmodifiableView(); - } - /** - * repeated string services = 1; - * @return The count of services. - */ - public int getServicesCount() { - return services_.size(); - } - /** - * repeated string services = 1; - * @param index The index of the element to return. - * @return The services at the given index. - */ - public java.lang.String getServices(int index) { - return services_.get(index); - } - /** - * repeated string services = 1; - * @param index The index of the value to return. - * @return The bytes of the services at the given index. - */ - public com.google.protobuf.ByteString - getServicesBytes(int index) { - return services_.getByteString(index); - } - /** - * repeated string services = 1; - * @param index The index to set the value at. - * @param value The services to set. - * @return This builder for chaining. - */ - public Builder setServices( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureServicesIsMutable(); - services_.set(index, value); - onChanged(); - return this; - } - /** - * repeated string services = 1; - * @param value The services to add. - * @return This builder for chaining. - */ - public Builder addServices( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureServicesIsMutable(); - services_.add(value); - onChanged(); - return this; - } - /** - * repeated string services = 1; - * @param values The services to add. - * @return This builder for chaining. - */ - public Builder addAllServices( - java.lang.Iterable values) { - ensureServicesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, services_); - onChanged(); - return this; - } - /** - * repeated string services = 1; - * @return This builder for chaining. - */ - public Builder clearServices() { - services_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * repeated string services = 1; - * @param value The bytes of the services to add. - * @return This builder for chaining. - */ - public Builder addServicesBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureServicesIsMutable(); - services_.add(value); - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:dev.yanshouwang.bluetooth_low_energy.StartDiscoveryArguments) - } - - // @@protoc_insertion_point(class_scope:dev.yanshouwang.bluetooth_low_energy.StartDiscoveryArguments) - private static final dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments(); - } - - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public StartDiscoveryArguments parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new StartDiscoveryArguments(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface DiscoveryOrBuilder extends - // @@protoc_insertion_point(interface_extends:dev.yanshouwang.bluetooth_low_energy.Discovery) - com.google.protobuf.MessageOrBuilder { - - /** - * string uuid = 1; - * @return The uuid. - */ - java.lang.String getUuid(); - /** - * string uuid = 1; - * @return The bytes for uuid. - */ - com.google.protobuf.ByteString - getUuidBytes(); - - /** - * sint32 rssi = 2; - * @return The rssi. - */ - int getRssi(); - - /** - * bytes advertisements = 3; - * @return The advertisements. - */ - com.google.protobuf.ByteString getAdvertisements(); - - /** - * bool connectable = 4; - * @return The connectable. - */ - boolean getConnectable(); - } - /** - * Protobuf type {@code dev.yanshouwang.bluetooth_low_energy.Discovery} - */ - public static final class Discovery extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:dev.yanshouwang.bluetooth_low_energy.Discovery) - DiscoveryOrBuilder { - private static final long serialVersionUID = 0L; - // Use Discovery.newBuilder() to construct. - private Discovery(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Discovery() { - uuid_ = ""; - advertisements_ = com.google.protobuf.ByteString.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Discovery(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Discovery( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - uuid_ = s; - break; - } - case 16: { - - rssi_ = input.readSInt32(); - break; - } - case 26: { - - advertisements_ = input.readBytes(); - break; - } - case 32: { - - connectable_ = input.readBool(); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_Discovery_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_Discovery_fieldAccessorTable - .ensureFieldAccessorsInitialized( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery.class, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery.Builder.class); - } - - public static final int UUID_FIELD_NUMBER = 1; - private volatile java.lang.Object uuid_; - /** - * string uuid = 1; - * @return The uuid. - */ - @java.lang.Override - public java.lang.String getUuid() { - java.lang.Object ref = uuid_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uuid_ = s; - return s; - } - } - /** - * string uuid = 1; - * @return The bytes for uuid. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getUuidBytes() { - java.lang.Object ref = uuid_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - uuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int RSSI_FIELD_NUMBER = 2; - private int rssi_; - /** - * sint32 rssi = 2; - * @return The rssi. - */ - @java.lang.Override - public int getRssi() { - return rssi_; - } - - public static final int ADVERTISEMENTS_FIELD_NUMBER = 3; - private com.google.protobuf.ByteString advertisements_; - /** - * bytes advertisements = 3; - * @return The advertisements. - */ - @java.lang.Override - public com.google.protobuf.ByteString getAdvertisements() { - return advertisements_; - } - - public static final int CONNECTABLE_FIELD_NUMBER = 4; - private boolean connectable_; - /** - * bool connectable = 4; - * @return The connectable. - */ - @java.lang.Override - public boolean getConnectable() { - return connectable_; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getUuidBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uuid_); - } - if (rssi_ != 0) { - output.writeSInt32(2, rssi_); - } - if (!advertisements_.isEmpty()) { - output.writeBytes(3, advertisements_); - } - if (connectable_ != false) { - output.writeBool(4, connectable_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getUuidBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, uuid_); - } - if (rssi_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeSInt32Size(2, rssi_); - } - if (!advertisements_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(3, advertisements_); - } - if (connectable_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(4, connectable_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery)) { - return super.equals(obj); - } - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery other = (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery) obj; - - if (!getUuid() - .equals(other.getUuid())) return false; - if (getRssi() - != other.getRssi()) return false; - if (!getAdvertisements() - .equals(other.getAdvertisements())) return false; - if (getConnectable() - != other.getConnectable()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + UUID_FIELD_NUMBER; - hash = (53 * hash) + getUuid().hashCode(); - hash = (37 * hash) + RSSI_FIELD_NUMBER; - hash = (53 * hash) + getRssi(); - hash = (37 * hash) + ADVERTISEMENTS_FIELD_NUMBER; - hash = (53 * hash) + getAdvertisements().hashCode(); - hash = (37 * hash) + CONNECTABLE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getConnectable()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code dev.yanshouwang.bluetooth_low_energy.Discovery} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:dev.yanshouwang.bluetooth_low_energy.Discovery) - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.DiscoveryOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_Discovery_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_Discovery_fieldAccessorTable - .ensureFieldAccessorsInitialized( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery.class, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery.Builder.class); - } - - // Construct using dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - uuid_ = ""; - - rssi_ = 0; - - advertisements_ = com.google.protobuf.ByteString.EMPTY; - - connectable_ = false; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_Discovery_descriptor; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery getDefaultInstanceForType() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery.getDefaultInstance(); - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery build() { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery buildPartial() { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery result = new dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery(this); - result.uuid_ = uuid_; - result.rssi_ = rssi_; - result.advertisements_ = advertisements_; - result.connectable_ = connectable_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery) { - return mergeFrom((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery other) { - if (other == dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery.getDefaultInstance()) return this; - if (!other.getUuid().isEmpty()) { - uuid_ = other.uuid_; - onChanged(); - } - if (other.getRssi() != 0) { - setRssi(other.getRssi()); - } - if (other.getAdvertisements() != com.google.protobuf.ByteString.EMPTY) { - setAdvertisements(other.getAdvertisements()); - } - if (other.getConnectable() != false) { - setConnectable(other.getConnectable()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object uuid_ = ""; - /** - * string uuid = 1; - * @return The uuid. - */ - public java.lang.String getUuid() { - java.lang.Object ref = uuid_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uuid_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string uuid = 1; - * @return The bytes for uuid. - */ - public com.google.protobuf.ByteString - getUuidBytes() { - java.lang.Object ref = uuid_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - uuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string uuid = 1; - * @param value The uuid to set. - * @return This builder for chaining. - */ - public Builder setUuid( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - uuid_ = value; - onChanged(); - return this; - } - /** - * string uuid = 1; - * @return This builder for chaining. - */ - public Builder clearUuid() { - - uuid_ = getDefaultInstance().getUuid(); - onChanged(); - return this; - } - /** - * string uuid = 1; - * @param value The bytes for uuid to set. - * @return This builder for chaining. - */ - public Builder setUuidBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - uuid_ = value; - onChanged(); - return this; - } - - private int rssi_ ; - /** - * sint32 rssi = 2; - * @return The rssi. - */ - @java.lang.Override - public int getRssi() { - return rssi_; - } - /** - * sint32 rssi = 2; - * @param value The rssi to set. - * @return This builder for chaining. - */ - public Builder setRssi(int value) { - - rssi_ = value; - onChanged(); - return this; - } - /** - * sint32 rssi = 2; - * @return This builder for chaining. - */ - public Builder clearRssi() { - - rssi_ = 0; - onChanged(); - return this; - } - - private com.google.protobuf.ByteString advertisements_ = com.google.protobuf.ByteString.EMPTY; - /** - * bytes advertisements = 3; - * @return The advertisements. - */ - @java.lang.Override - public com.google.protobuf.ByteString getAdvertisements() { - return advertisements_; - } - /** - * bytes advertisements = 3; - * @param value The advertisements to set. - * @return This builder for chaining. - */ - public Builder setAdvertisements(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - advertisements_ = value; - onChanged(); - return this; - } - /** - * bytes advertisements = 3; - * @return This builder for chaining. - */ - public Builder clearAdvertisements() { - - advertisements_ = getDefaultInstance().getAdvertisements(); - onChanged(); - return this; - } - - private boolean connectable_ ; - /** - * bool connectable = 4; - * @return The connectable. - */ - @java.lang.Override - public boolean getConnectable() { - return connectable_; - } - /** - * bool connectable = 4; - * @param value The connectable to set. - * @return This builder for chaining. - */ - public Builder setConnectable(boolean value) { - - connectable_ = value; - onChanged(); - return this; - } - /** - * bool connectable = 4; - * @return This builder for chaining. - */ - public Builder clearConnectable() { - - connectable_ = false; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:dev.yanshouwang.bluetooth_low_energy.Discovery) - } - - // @@protoc_insertion_point(class_scope:dev.yanshouwang.bluetooth_low_energy.Discovery) - private static final dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery(); - } - - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Discovery parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Discovery(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface ConnectArgumentsOrBuilder extends - // @@protoc_insertion_point(interface_extends:dev.yanshouwang.bluetooth_low_energy.ConnectArguments) - com.google.protobuf.MessageOrBuilder { - - /** - * string uuid = 1; - * @return The uuid. - */ - java.lang.String getUuid(); - /** - * string uuid = 1; - * @return The bytes for uuid. - */ - com.google.protobuf.ByteString - getUuidBytes(); - } - /** - * Protobuf type {@code dev.yanshouwang.bluetooth_low_energy.ConnectArguments} - */ - public static final class ConnectArguments extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:dev.yanshouwang.bluetooth_low_energy.ConnectArguments) - ConnectArgumentsOrBuilder { - private static final long serialVersionUID = 0L; - // Use ConnectArguments.newBuilder() to construct. - private ConnectArguments(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ConnectArguments() { - uuid_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ConnectArguments(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ConnectArguments( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - uuid_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_ConnectArguments_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_ConnectArguments_fieldAccessorTable - .ensureFieldAccessorsInitialized( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments.class, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments.Builder.class); - } - - public static final int UUID_FIELD_NUMBER = 1; - private volatile java.lang.Object uuid_; - /** - * string uuid = 1; - * @return The uuid. - */ - @java.lang.Override - public java.lang.String getUuid() { - java.lang.Object ref = uuid_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uuid_ = s; - return s; - } - } - /** - * string uuid = 1; - * @return The bytes for uuid. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getUuidBytes() { - java.lang.Object ref = uuid_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - uuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getUuidBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uuid_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getUuidBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, uuid_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments)) { - return super.equals(obj); - } - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments other = (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments) obj; - - if (!getUuid() - .equals(other.getUuid())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + UUID_FIELD_NUMBER; - hash = (53 * hash) + getUuid().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code dev.yanshouwang.bluetooth_low_energy.ConnectArguments} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:dev.yanshouwang.bluetooth_low_energy.ConnectArguments) - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArgumentsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_ConnectArguments_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_ConnectArguments_fieldAccessorTable - .ensureFieldAccessorsInitialized( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments.class, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments.Builder.class); - } - - // Construct using dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - uuid_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_ConnectArguments_descriptor; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments getDefaultInstanceForType() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments.getDefaultInstance(); - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments build() { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments buildPartial() { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments result = new dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments(this); - result.uuid_ = uuid_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments) { - return mergeFrom((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments other) { - if (other == dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments.getDefaultInstance()) return this; - if (!other.getUuid().isEmpty()) { - uuid_ = other.uuid_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object uuid_ = ""; - /** - * string uuid = 1; - * @return The uuid. - */ - public java.lang.String getUuid() { - java.lang.Object ref = uuid_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uuid_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string uuid = 1; - * @return The bytes for uuid. - */ - public com.google.protobuf.ByteString - getUuidBytes() { - java.lang.Object ref = uuid_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - uuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string uuid = 1; - * @param value The uuid to set. - * @return This builder for chaining. - */ - public Builder setUuid( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - uuid_ = value; - onChanged(); - return this; - } - /** - * string uuid = 1; - * @return This builder for chaining. - */ - public Builder clearUuid() { - - uuid_ = getDefaultInstance().getUuid(); - onChanged(); - return this; - } - /** - * string uuid = 1; - * @param value The bytes for uuid to set. - * @return This builder for chaining. - */ - public Builder setUuidBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - uuid_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:dev.yanshouwang.bluetooth_low_energy.ConnectArguments) - } - - // @@protoc_insertion_point(class_scope:dev.yanshouwang.bluetooth_low_energy.ConnectArguments) - private static final dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments(); - } - - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ConnectArguments parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ConnectArguments(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface GATTOrBuilder extends - // @@protoc_insertion_point(interface_extends:dev.yanshouwang.bluetooth_low_energy.GATT) - com.google.protobuf.MessageOrBuilder { - - /** - * string key = 1; - * @return The key. - */ - java.lang.String getKey(); - /** - * string key = 1; - * @return The bytes for key. - */ - com.google.protobuf.ByteString - getKeyBytes(); - - /** - * int32 maximumWriteLength = 2; - * @return The maximumWriteLength. - */ - int getMaximumWriteLength(); - - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattService services = 3; - */ - java.util.List - getServicesList(); - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattService services = 3; - */ - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService getServices(int index); - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattService services = 3; - */ - int getServicesCount(); - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattService services = 3; - */ - java.util.List - getServicesOrBuilderList(); - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattService services = 3; - */ - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattServiceOrBuilder getServicesOrBuilder( - int index); - } - /** - * Protobuf type {@code dev.yanshouwang.bluetooth_low_energy.GATT} - */ - public static final class GATT extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:dev.yanshouwang.bluetooth_low_energy.GATT) - GATTOrBuilder { - private static final long serialVersionUID = 0L; - // Use GATT.newBuilder() to construct. - private GATT(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private GATT() { - key_ = ""; - services_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new GATT(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private GATT( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - key_ = s; - break; - } - case 16: { - - maximumWriteLength_ = input.readInt32(); - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - services_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - services_.add( - input.readMessage(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - services_ = java.util.Collections.unmodifiableList(services_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GATT_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GATT_fieldAccessorTable - .ensureFieldAccessorsInitialized( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT.class, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT.Builder.class); - } - - public static final int KEY_FIELD_NUMBER = 1; - private volatile java.lang.Object key_; - /** - * string key = 1; - * @return The key. - */ - @java.lang.Override - public java.lang.String getKey() { - java.lang.Object ref = key_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - key_ = s; - return s; - } - } - /** - * string key = 1; - * @return The bytes for key. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getKeyBytes() { - java.lang.Object ref = key_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - key_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int MAXIMUMWRITELENGTH_FIELD_NUMBER = 2; - private int maximumWriteLength_; - /** - * int32 maximumWriteLength = 2; - * @return The maximumWriteLength. - */ - @java.lang.Override - public int getMaximumWriteLength() { - return maximumWriteLength_; - } - - public static final int SERVICES_FIELD_NUMBER = 3; - private java.util.List services_; - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattService services = 3; - */ - @java.lang.Override - public java.util.List getServicesList() { - return services_; - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattService services = 3; - */ - @java.lang.Override - public java.util.List - getServicesOrBuilderList() { - return services_; - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattService services = 3; - */ - @java.lang.Override - public int getServicesCount() { - return services_.size(); - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattService services = 3; - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService getServices(int index) { - return services_.get(index); - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattService services = 3; - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattServiceOrBuilder getServicesOrBuilder( - int index) { - return services_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getKeyBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); - } - if (maximumWriteLength_ != 0) { - output.writeInt32(2, maximumWriteLength_); - } - for (int i = 0; i < services_.size(); i++) { - output.writeMessage(3, services_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getKeyBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); - } - if (maximumWriteLength_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, maximumWriteLength_); - } - for (int i = 0; i < services_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, services_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT)) { - return super.equals(obj); - } - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT other = (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT) obj; - - if (!getKey() - .equals(other.getKey())) return false; - if (getMaximumWriteLength() - != other.getMaximumWriteLength()) return false; - if (!getServicesList() - .equals(other.getServicesList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + KEY_FIELD_NUMBER; - hash = (53 * hash) + getKey().hashCode(); - hash = (37 * hash) + MAXIMUMWRITELENGTH_FIELD_NUMBER; - hash = (53 * hash) + getMaximumWriteLength(); - if (getServicesCount() > 0) { - hash = (37 * hash) + SERVICES_FIELD_NUMBER; - hash = (53 * hash) + getServicesList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code dev.yanshouwang.bluetooth_low_energy.GATT} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:dev.yanshouwang.bluetooth_low_energy.GATT) - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATTOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GATT_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GATT_fieldAccessorTable - .ensureFieldAccessorsInitialized( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT.class, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT.Builder.class); - } - - // Construct using dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getServicesFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - key_ = ""; - - maximumWriteLength_ = 0; - - if (servicesBuilder_ == null) { - services_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - servicesBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GATT_descriptor; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT getDefaultInstanceForType() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT.getDefaultInstance(); - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT build() { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT buildPartial() { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT result = new dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT(this); - int from_bitField0_ = bitField0_; - result.key_ = key_; - result.maximumWriteLength_ = maximumWriteLength_; - if (servicesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - services_ = java.util.Collections.unmodifiableList(services_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.services_ = services_; - } else { - result.services_ = servicesBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT) { - return mergeFrom((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT other) { - if (other == dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT.getDefaultInstance()) return this; - if (!other.getKey().isEmpty()) { - key_ = other.key_; - onChanged(); - } - if (other.getMaximumWriteLength() != 0) { - setMaximumWriteLength(other.getMaximumWriteLength()); - } - if (servicesBuilder_ == null) { - if (!other.services_.isEmpty()) { - if (services_.isEmpty()) { - services_ = other.services_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureServicesIsMutable(); - services_.addAll(other.services_); - } - onChanged(); - } - } else { - if (!other.services_.isEmpty()) { - if (servicesBuilder_.isEmpty()) { - servicesBuilder_.dispose(); - servicesBuilder_ = null; - services_ = other.services_; - bitField0_ = (bitField0_ & ~0x00000001); - servicesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getServicesFieldBuilder() : null; - } else { - servicesBuilder_.addAllMessages(other.services_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object key_ = ""; - /** - * string key = 1; - * @return The key. - */ - public java.lang.String getKey() { - java.lang.Object ref = key_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - key_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string key = 1; - * @return The bytes for key. - */ - public com.google.protobuf.ByteString - getKeyBytes() { - java.lang.Object ref = key_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - key_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string key = 1; - * @param value The key to set. - * @return This builder for chaining. - */ - public Builder setKey( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - key_ = value; - onChanged(); - return this; - } - /** - * string key = 1; - * @return This builder for chaining. - */ - public Builder clearKey() { - - key_ = getDefaultInstance().getKey(); - onChanged(); - return this; - } - /** - * string key = 1; - * @param value The bytes for key to set. - * @return This builder for chaining. - */ - public Builder setKeyBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - key_ = value; - onChanged(); - return this; - } - - private int maximumWriteLength_ ; - /** - * int32 maximumWriteLength = 2; - * @return The maximumWriteLength. - */ - @java.lang.Override - public int getMaximumWriteLength() { - return maximumWriteLength_; - } - /** - * int32 maximumWriteLength = 2; - * @param value The maximumWriteLength to set. - * @return This builder for chaining. - */ - public Builder setMaximumWriteLength(int value) { - - maximumWriteLength_ = value; - onChanged(); - return this; - } - /** - * int32 maximumWriteLength = 2; - * @return This builder for chaining. - */ - public Builder clearMaximumWriteLength() { - - maximumWriteLength_ = 0; - onChanged(); - return this; - } - - private java.util.List services_ = - java.util.Collections.emptyList(); - private void ensureServicesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - services_ = new java.util.ArrayList(services_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattServiceOrBuilder> servicesBuilder_; - - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattService services = 3; - */ - public java.util.List getServicesList() { - if (servicesBuilder_ == null) { - return java.util.Collections.unmodifiableList(services_); - } else { - return servicesBuilder_.getMessageList(); - } - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattService services = 3; - */ - public int getServicesCount() { - if (servicesBuilder_ == null) { - return services_.size(); - } else { - return servicesBuilder_.getCount(); - } - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattService services = 3; - */ - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService getServices(int index) { - if (servicesBuilder_ == null) { - return services_.get(index); - } else { - return servicesBuilder_.getMessage(index); - } - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattService services = 3; - */ - public Builder setServices( - int index, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService value) { - if (servicesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureServicesIsMutable(); - services_.set(index, value); - onChanged(); - } else { - servicesBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattService services = 3; - */ - public Builder setServices( - int index, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService.Builder builderForValue) { - if (servicesBuilder_ == null) { - ensureServicesIsMutable(); - services_.set(index, builderForValue.build()); - onChanged(); - } else { - servicesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattService services = 3; - */ - public Builder addServices(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService value) { - if (servicesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureServicesIsMutable(); - services_.add(value); - onChanged(); - } else { - servicesBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattService services = 3; - */ - public Builder addServices( - int index, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService value) { - if (servicesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureServicesIsMutable(); - services_.add(index, value); - onChanged(); - } else { - servicesBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattService services = 3; - */ - public Builder addServices( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService.Builder builderForValue) { - if (servicesBuilder_ == null) { - ensureServicesIsMutable(); - services_.add(builderForValue.build()); - onChanged(); - } else { - servicesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattService services = 3; - */ - public Builder addServices( - int index, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService.Builder builderForValue) { - if (servicesBuilder_ == null) { - ensureServicesIsMutable(); - services_.add(index, builderForValue.build()); - onChanged(); - } else { - servicesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattService services = 3; - */ - public Builder addAllServices( - java.lang.Iterable values) { - if (servicesBuilder_ == null) { - ensureServicesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, services_); - onChanged(); - } else { - servicesBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattService services = 3; - */ - public Builder clearServices() { - if (servicesBuilder_ == null) { - services_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - servicesBuilder_.clear(); - } - return this; - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattService services = 3; - */ - public Builder removeServices(int index) { - if (servicesBuilder_ == null) { - ensureServicesIsMutable(); - services_.remove(index); - onChanged(); - } else { - servicesBuilder_.remove(index); - } - return this; - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattService services = 3; - */ - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService.Builder getServicesBuilder( - int index) { - return getServicesFieldBuilder().getBuilder(index); - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattService services = 3; - */ - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattServiceOrBuilder getServicesOrBuilder( - int index) { - if (servicesBuilder_ == null) { - return services_.get(index); } else { - return servicesBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattService services = 3; - */ - public java.util.List - getServicesOrBuilderList() { - if (servicesBuilder_ != null) { - return servicesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(services_); - } - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattService services = 3; - */ - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService.Builder addServicesBuilder() { - return getServicesFieldBuilder().addBuilder( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService.getDefaultInstance()); - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattService services = 3; - */ - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService.Builder addServicesBuilder( - int index) { - return getServicesFieldBuilder().addBuilder( - index, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService.getDefaultInstance()); - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattService services = 3; - */ - public java.util.List - getServicesBuilderList() { - return getServicesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattServiceOrBuilder> - getServicesFieldBuilder() { - if (servicesBuilder_ == null) { - servicesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattServiceOrBuilder>( - services_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - services_ = null; - } - return servicesBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:dev.yanshouwang.bluetooth_low_energy.GATT) - } - - // @@protoc_insertion_point(class_scope:dev.yanshouwang.bluetooth_low_energy.GATT) - private static final dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT(); - } - - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GATT parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GATT(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface GattServiceOrBuilder extends - // @@protoc_insertion_point(interface_extends:dev.yanshouwang.bluetooth_low_energy.GattService) - com.google.protobuf.MessageOrBuilder { - - /** - * string key = 1; - * @return The key. - */ - java.lang.String getKey(); - /** - * string key = 1; - * @return The bytes for key. - */ - com.google.protobuf.ByteString - getKeyBytes(); - - /** - * string uuid = 2; - * @return The uuid. - */ - java.lang.String getUuid(); - /** - * string uuid = 2; - * @return The bytes for uuid. - */ - com.google.protobuf.ByteString - getUuidBytes(); - - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattCharacteristic characteristics = 3; - */ - java.util.List - getCharacteristicsList(); - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattCharacteristic characteristics = 3; - */ - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic getCharacteristics(int index); - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattCharacteristic characteristics = 3; - */ - int getCharacteristicsCount(); - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattCharacteristic characteristics = 3; - */ - java.util.List - getCharacteristicsOrBuilderList(); - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattCharacteristic characteristics = 3; - */ - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicOrBuilder getCharacteristicsOrBuilder( - int index); - } - /** - * Protobuf type {@code dev.yanshouwang.bluetooth_low_energy.GattService} - */ - public static final class GattService extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:dev.yanshouwang.bluetooth_low_energy.GattService) - GattServiceOrBuilder { - private static final long serialVersionUID = 0L; - // Use GattService.newBuilder() to construct. - private GattService(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private GattService() { - key_ = ""; - uuid_ = ""; - characteristics_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new GattService(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private GattService( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - key_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - uuid_ = s; - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - characteristics_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - characteristics_.add( - input.readMessage(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - characteristics_ = java.util.Collections.unmodifiableList(characteristics_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattService_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattService_fieldAccessorTable - .ensureFieldAccessorsInitialized( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService.class, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService.Builder.class); - } - - public static final int KEY_FIELD_NUMBER = 1; - private volatile java.lang.Object key_; - /** - * string key = 1; - * @return The key. - */ - @java.lang.Override - public java.lang.String getKey() { - java.lang.Object ref = key_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - key_ = s; - return s; - } - } - /** - * string key = 1; - * @return The bytes for key. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getKeyBytes() { - java.lang.Object ref = key_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - key_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int UUID_FIELD_NUMBER = 2; - private volatile java.lang.Object uuid_; - /** - * string uuid = 2; - * @return The uuid. - */ - @java.lang.Override - public java.lang.String getUuid() { - java.lang.Object ref = uuid_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uuid_ = s; - return s; - } - } - /** - * string uuid = 2; - * @return The bytes for uuid. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getUuidBytes() { - java.lang.Object ref = uuid_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - uuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CHARACTERISTICS_FIELD_NUMBER = 3; - private java.util.List characteristics_; - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattCharacteristic characteristics = 3; - */ - @java.lang.Override - public java.util.List getCharacteristicsList() { - return characteristics_; - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattCharacteristic characteristics = 3; - */ - @java.lang.Override - public java.util.List - getCharacteristicsOrBuilderList() { - return characteristics_; - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattCharacteristic characteristics = 3; - */ - @java.lang.Override - public int getCharacteristicsCount() { - return characteristics_.size(); - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattCharacteristic characteristics = 3; - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic getCharacteristics(int index) { - return characteristics_.get(index); - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattCharacteristic characteristics = 3; - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicOrBuilder getCharacteristicsOrBuilder( - int index) { - return characteristics_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getKeyBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); - } - if (!getUuidBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, uuid_); - } - for (int i = 0; i < characteristics_.size(); i++) { - output.writeMessage(3, characteristics_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getKeyBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); - } - if (!getUuidBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, uuid_); - } - for (int i = 0; i < characteristics_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, characteristics_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService)) { - return super.equals(obj); - } - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService other = (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService) obj; - - if (!getKey() - .equals(other.getKey())) return false; - if (!getUuid() - .equals(other.getUuid())) return false; - if (!getCharacteristicsList() - .equals(other.getCharacteristicsList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + KEY_FIELD_NUMBER; - hash = (53 * hash) + getKey().hashCode(); - hash = (37 * hash) + UUID_FIELD_NUMBER; - hash = (53 * hash) + getUuid().hashCode(); - if (getCharacteristicsCount() > 0) { - hash = (37 * hash) + CHARACTERISTICS_FIELD_NUMBER; - hash = (53 * hash) + getCharacteristicsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code dev.yanshouwang.bluetooth_low_energy.GattService} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:dev.yanshouwang.bluetooth_low_energy.GattService) - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattServiceOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattService_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattService_fieldAccessorTable - .ensureFieldAccessorsInitialized( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService.class, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService.Builder.class); - } - - // Construct using dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getCharacteristicsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - key_ = ""; - - uuid_ = ""; - - if (characteristicsBuilder_ == null) { - characteristics_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - characteristicsBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattService_descriptor; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService getDefaultInstanceForType() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService.getDefaultInstance(); - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService build() { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService buildPartial() { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService result = new dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService(this); - int from_bitField0_ = bitField0_; - result.key_ = key_; - result.uuid_ = uuid_; - if (characteristicsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - characteristics_ = java.util.Collections.unmodifiableList(characteristics_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.characteristics_ = characteristics_; - } else { - result.characteristics_ = characteristicsBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService) { - return mergeFrom((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService other) { - if (other == dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService.getDefaultInstance()) return this; - if (!other.getKey().isEmpty()) { - key_ = other.key_; - onChanged(); - } - if (!other.getUuid().isEmpty()) { - uuid_ = other.uuid_; - onChanged(); - } - if (characteristicsBuilder_ == null) { - if (!other.characteristics_.isEmpty()) { - if (characteristics_.isEmpty()) { - characteristics_ = other.characteristics_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureCharacteristicsIsMutable(); - characteristics_.addAll(other.characteristics_); - } - onChanged(); - } - } else { - if (!other.characteristics_.isEmpty()) { - if (characteristicsBuilder_.isEmpty()) { - characteristicsBuilder_.dispose(); - characteristicsBuilder_ = null; - characteristics_ = other.characteristics_; - bitField0_ = (bitField0_ & ~0x00000001); - characteristicsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getCharacteristicsFieldBuilder() : null; - } else { - characteristicsBuilder_.addAllMessages(other.characteristics_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object key_ = ""; - /** - * string key = 1; - * @return The key. - */ - public java.lang.String getKey() { - java.lang.Object ref = key_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - key_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string key = 1; - * @return The bytes for key. - */ - public com.google.protobuf.ByteString - getKeyBytes() { - java.lang.Object ref = key_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - key_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string key = 1; - * @param value The key to set. - * @return This builder for chaining. - */ - public Builder setKey( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - key_ = value; - onChanged(); - return this; - } - /** - * string key = 1; - * @return This builder for chaining. - */ - public Builder clearKey() { - - key_ = getDefaultInstance().getKey(); - onChanged(); - return this; - } - /** - * string key = 1; - * @param value The bytes for key to set. - * @return This builder for chaining. - */ - public Builder setKeyBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - key_ = value; - onChanged(); - return this; - } - - private java.lang.Object uuid_ = ""; - /** - * string uuid = 2; - * @return The uuid. - */ - public java.lang.String getUuid() { - java.lang.Object ref = uuid_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uuid_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string uuid = 2; - * @return The bytes for uuid. - */ - public com.google.protobuf.ByteString - getUuidBytes() { - java.lang.Object ref = uuid_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - uuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string uuid = 2; - * @param value The uuid to set. - * @return This builder for chaining. - */ - public Builder setUuid( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - uuid_ = value; - onChanged(); - return this; - } - /** - * string uuid = 2; - * @return This builder for chaining. - */ - public Builder clearUuid() { - - uuid_ = getDefaultInstance().getUuid(); - onChanged(); - return this; - } - /** - * string uuid = 2; - * @param value The bytes for uuid to set. - * @return This builder for chaining. - */ - public Builder setUuidBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - uuid_ = value; - onChanged(); - return this; - } - - private java.util.List characteristics_ = - java.util.Collections.emptyList(); - private void ensureCharacteristicsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - characteristics_ = new java.util.ArrayList(characteristics_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicOrBuilder> characteristicsBuilder_; - - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattCharacteristic characteristics = 3; - */ - public java.util.List getCharacteristicsList() { - if (characteristicsBuilder_ == null) { - return java.util.Collections.unmodifiableList(characteristics_); - } else { - return characteristicsBuilder_.getMessageList(); - } - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattCharacteristic characteristics = 3; - */ - public int getCharacteristicsCount() { - if (characteristicsBuilder_ == null) { - return characteristics_.size(); - } else { - return characteristicsBuilder_.getCount(); - } - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattCharacteristic characteristics = 3; - */ - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic getCharacteristics(int index) { - if (characteristicsBuilder_ == null) { - return characteristics_.get(index); - } else { - return characteristicsBuilder_.getMessage(index); - } - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattCharacteristic characteristics = 3; - */ - public Builder setCharacteristics( - int index, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic value) { - if (characteristicsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCharacteristicsIsMutable(); - characteristics_.set(index, value); - onChanged(); - } else { - characteristicsBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattCharacteristic characteristics = 3; - */ - public Builder setCharacteristics( - int index, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic.Builder builderForValue) { - if (characteristicsBuilder_ == null) { - ensureCharacteristicsIsMutable(); - characteristics_.set(index, builderForValue.build()); - onChanged(); - } else { - characteristicsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattCharacteristic characteristics = 3; - */ - public Builder addCharacteristics(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic value) { - if (characteristicsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCharacteristicsIsMutable(); - characteristics_.add(value); - onChanged(); - } else { - characteristicsBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattCharacteristic characteristics = 3; - */ - public Builder addCharacteristics( - int index, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic value) { - if (characteristicsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCharacteristicsIsMutable(); - characteristics_.add(index, value); - onChanged(); - } else { - characteristicsBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattCharacteristic characteristics = 3; - */ - public Builder addCharacteristics( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic.Builder builderForValue) { - if (characteristicsBuilder_ == null) { - ensureCharacteristicsIsMutable(); - characteristics_.add(builderForValue.build()); - onChanged(); - } else { - characteristicsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattCharacteristic characteristics = 3; - */ - public Builder addCharacteristics( - int index, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic.Builder builderForValue) { - if (characteristicsBuilder_ == null) { - ensureCharacteristicsIsMutable(); - characteristics_.add(index, builderForValue.build()); - onChanged(); - } else { - characteristicsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattCharacteristic characteristics = 3; - */ - public Builder addAllCharacteristics( - java.lang.Iterable values) { - if (characteristicsBuilder_ == null) { - ensureCharacteristicsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, characteristics_); - onChanged(); - } else { - characteristicsBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattCharacteristic characteristics = 3; - */ - public Builder clearCharacteristics() { - if (characteristicsBuilder_ == null) { - characteristics_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - characteristicsBuilder_.clear(); - } - return this; - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattCharacteristic characteristics = 3; - */ - public Builder removeCharacteristics(int index) { - if (characteristicsBuilder_ == null) { - ensureCharacteristicsIsMutable(); - characteristics_.remove(index); - onChanged(); - } else { - characteristicsBuilder_.remove(index); - } - return this; - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattCharacteristic characteristics = 3; - */ - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic.Builder getCharacteristicsBuilder( - int index) { - return getCharacteristicsFieldBuilder().getBuilder(index); - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattCharacteristic characteristics = 3; - */ - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicOrBuilder getCharacteristicsOrBuilder( - int index) { - if (characteristicsBuilder_ == null) { - return characteristics_.get(index); } else { - return characteristicsBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattCharacteristic characteristics = 3; - */ - public java.util.List - getCharacteristicsOrBuilderList() { - if (characteristicsBuilder_ != null) { - return characteristicsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(characteristics_); - } - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattCharacteristic characteristics = 3; - */ - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic.Builder addCharacteristicsBuilder() { - return getCharacteristicsFieldBuilder().addBuilder( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic.getDefaultInstance()); - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattCharacteristic characteristics = 3; - */ - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic.Builder addCharacteristicsBuilder( - int index) { - return getCharacteristicsFieldBuilder().addBuilder( - index, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic.getDefaultInstance()); - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattCharacteristic characteristics = 3; - */ - public java.util.List - getCharacteristicsBuilderList() { - return getCharacteristicsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicOrBuilder> - getCharacteristicsFieldBuilder() { - if (characteristicsBuilder_ == null) { - characteristicsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicOrBuilder>( - characteristics_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - characteristics_ = null; - } - return characteristicsBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:dev.yanshouwang.bluetooth_low_energy.GattService) - } - - // @@protoc_insertion_point(class_scope:dev.yanshouwang.bluetooth_low_energy.GattService) - private static final dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService(); - } - - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GattService parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GattService(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface GattCharacteristicOrBuilder extends - // @@protoc_insertion_point(interface_extends:dev.yanshouwang.bluetooth_low_energy.GattCharacteristic) - com.google.protobuf.MessageOrBuilder { - - /** - * string key = 1; - * @return The key. - */ - java.lang.String getKey(); - /** - * string key = 1; - * @return The bytes for key. - */ - com.google.protobuf.ByteString - getKeyBytes(); - - /** - * string uuid = 2; - * @return The uuid. - */ - java.lang.String getUuid(); - /** - * string uuid = 2; - * @return The bytes for uuid. - */ - com.google.protobuf.ByteString - getUuidBytes(); - - /** - * bool canRead = 3; - * @return The canRead. - */ - boolean getCanRead(); - - /** - * bool canWrite = 4; - * @return The canWrite. - */ - boolean getCanWrite(); - - /** - * bool canWriteWithoutResponse = 5; - * @return The canWriteWithoutResponse. - */ - boolean getCanWriteWithoutResponse(); - - /** - * bool canNotify = 6; - * @return The canNotify. - */ - boolean getCanNotify(); - - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattDescriptor descriptors = 7; - */ - java.util.List - getDescriptorsList(); - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattDescriptor descriptors = 7; - */ - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor getDescriptors(int index); - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattDescriptor descriptors = 7; - */ - int getDescriptorsCount(); - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattDescriptor descriptors = 7; - */ - java.util.List - getDescriptorsOrBuilderList(); - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattDescriptor descriptors = 7; - */ - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorOrBuilder getDescriptorsOrBuilder( - int index); - } - /** - * Protobuf type {@code dev.yanshouwang.bluetooth_low_energy.GattCharacteristic} - */ - public static final class GattCharacteristic extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:dev.yanshouwang.bluetooth_low_energy.GattCharacteristic) - GattCharacteristicOrBuilder { - private static final long serialVersionUID = 0L; - // Use GattCharacteristic.newBuilder() to construct. - private GattCharacteristic(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private GattCharacteristic() { - key_ = ""; - uuid_ = ""; - descriptors_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new GattCharacteristic(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private GattCharacteristic( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - key_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - uuid_ = s; - break; - } - case 24: { - - canRead_ = input.readBool(); - break; - } - case 32: { - - canWrite_ = input.readBool(); - break; - } - case 40: { - - canWriteWithoutResponse_ = input.readBool(); - break; - } - case 48: { - - canNotify_ = input.readBool(); - break; - } - case 58: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - descriptors_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - descriptors_.add( - input.readMessage(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - descriptors_ = java.util.Collections.unmodifiableList(descriptors_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristic_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristic_fieldAccessorTable - .ensureFieldAccessorsInitialized( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic.class, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic.Builder.class); - } - - public static final int KEY_FIELD_NUMBER = 1; - private volatile java.lang.Object key_; - /** - * string key = 1; - * @return The key. - */ - @java.lang.Override - public java.lang.String getKey() { - java.lang.Object ref = key_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - key_ = s; - return s; - } - } - /** - * string key = 1; - * @return The bytes for key. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getKeyBytes() { - java.lang.Object ref = key_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - key_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int UUID_FIELD_NUMBER = 2; - private volatile java.lang.Object uuid_; - /** - * string uuid = 2; - * @return The uuid. - */ - @java.lang.Override - public java.lang.String getUuid() { - java.lang.Object ref = uuid_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uuid_ = s; - return s; - } - } - /** - * string uuid = 2; - * @return The bytes for uuid. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getUuidBytes() { - java.lang.Object ref = uuid_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - uuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CANREAD_FIELD_NUMBER = 3; - private boolean canRead_; - /** - * bool canRead = 3; - * @return The canRead. - */ - @java.lang.Override - public boolean getCanRead() { - return canRead_; - } - - public static final int CANWRITE_FIELD_NUMBER = 4; - private boolean canWrite_; - /** - * bool canWrite = 4; - * @return The canWrite. - */ - @java.lang.Override - public boolean getCanWrite() { - return canWrite_; - } - - public static final int CANWRITEWITHOUTRESPONSE_FIELD_NUMBER = 5; - private boolean canWriteWithoutResponse_; - /** - * bool canWriteWithoutResponse = 5; - * @return The canWriteWithoutResponse. - */ - @java.lang.Override - public boolean getCanWriteWithoutResponse() { - return canWriteWithoutResponse_; - } - - public static final int CANNOTIFY_FIELD_NUMBER = 6; - private boolean canNotify_; - /** - * bool canNotify = 6; - * @return The canNotify. - */ - @java.lang.Override - public boolean getCanNotify() { - return canNotify_; - } - - public static final int DESCRIPTORS_FIELD_NUMBER = 7; - private java.util.List descriptors_; - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattDescriptor descriptors = 7; - */ - @java.lang.Override - public java.util.List getDescriptorsList() { - return descriptors_; - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattDescriptor descriptors = 7; - */ - @java.lang.Override - public java.util.List - getDescriptorsOrBuilderList() { - return descriptors_; - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattDescriptor descriptors = 7; - */ - @java.lang.Override - public int getDescriptorsCount() { - return descriptors_.size(); - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattDescriptor descriptors = 7; - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor getDescriptors(int index) { - return descriptors_.get(index); - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattDescriptor descriptors = 7; - */ - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorOrBuilder getDescriptorsOrBuilder( - int index) { - return descriptors_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getKeyBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); - } - if (!getUuidBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, uuid_); - } - if (canRead_ != false) { - output.writeBool(3, canRead_); - } - if (canWrite_ != false) { - output.writeBool(4, canWrite_); - } - if (canWriteWithoutResponse_ != false) { - output.writeBool(5, canWriteWithoutResponse_); - } - if (canNotify_ != false) { - output.writeBool(6, canNotify_); - } - for (int i = 0; i < descriptors_.size(); i++) { - output.writeMessage(7, descriptors_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getKeyBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); - } - if (!getUuidBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, uuid_); - } - if (canRead_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(3, canRead_); - } - if (canWrite_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(4, canWrite_); - } - if (canWriteWithoutResponse_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(5, canWriteWithoutResponse_); - } - if (canNotify_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(6, canNotify_); - } - for (int i = 0; i < descriptors_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, descriptors_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic)) { - return super.equals(obj); - } - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic other = (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic) obj; - - if (!getKey() - .equals(other.getKey())) return false; - if (!getUuid() - .equals(other.getUuid())) return false; - if (getCanRead() - != other.getCanRead()) return false; - if (getCanWrite() - != other.getCanWrite()) return false; - if (getCanWriteWithoutResponse() - != other.getCanWriteWithoutResponse()) return false; - if (getCanNotify() - != other.getCanNotify()) return false; - if (!getDescriptorsList() - .equals(other.getDescriptorsList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + KEY_FIELD_NUMBER; - hash = (53 * hash) + getKey().hashCode(); - hash = (37 * hash) + UUID_FIELD_NUMBER; - hash = (53 * hash) + getUuid().hashCode(); - hash = (37 * hash) + CANREAD_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getCanRead()); - hash = (37 * hash) + CANWRITE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getCanWrite()); - hash = (37 * hash) + CANWRITEWITHOUTRESPONSE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getCanWriteWithoutResponse()); - hash = (37 * hash) + CANNOTIFY_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getCanNotify()); - if (getDescriptorsCount() > 0) { - hash = (37 * hash) + DESCRIPTORS_FIELD_NUMBER; - hash = (53 * hash) + getDescriptorsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code dev.yanshouwang.bluetooth_low_energy.GattCharacteristic} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:dev.yanshouwang.bluetooth_low_energy.GattCharacteristic) - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristic_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristic_fieldAccessorTable - .ensureFieldAccessorsInitialized( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic.class, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic.Builder.class); - } - - // Construct using dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getDescriptorsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - key_ = ""; - - uuid_ = ""; - - canRead_ = false; - - canWrite_ = false; - - canWriteWithoutResponse_ = false; - - canNotify_ = false; - - if (descriptorsBuilder_ == null) { - descriptors_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - descriptorsBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristic_descriptor; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic getDefaultInstanceForType() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic.getDefaultInstance(); - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic build() { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic buildPartial() { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic result = new dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic(this); - int from_bitField0_ = bitField0_; - result.key_ = key_; - result.uuid_ = uuid_; - result.canRead_ = canRead_; - result.canWrite_ = canWrite_; - result.canWriteWithoutResponse_ = canWriteWithoutResponse_; - result.canNotify_ = canNotify_; - if (descriptorsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - descriptors_ = java.util.Collections.unmodifiableList(descriptors_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.descriptors_ = descriptors_; - } else { - result.descriptors_ = descriptorsBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic) { - return mergeFrom((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic other) { - if (other == dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic.getDefaultInstance()) return this; - if (!other.getKey().isEmpty()) { - key_ = other.key_; - onChanged(); - } - if (!other.getUuid().isEmpty()) { - uuid_ = other.uuid_; - onChanged(); - } - if (other.getCanRead() != false) { - setCanRead(other.getCanRead()); - } - if (other.getCanWrite() != false) { - setCanWrite(other.getCanWrite()); - } - if (other.getCanWriteWithoutResponse() != false) { - setCanWriteWithoutResponse(other.getCanWriteWithoutResponse()); - } - if (other.getCanNotify() != false) { - setCanNotify(other.getCanNotify()); - } - if (descriptorsBuilder_ == null) { - if (!other.descriptors_.isEmpty()) { - if (descriptors_.isEmpty()) { - descriptors_ = other.descriptors_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureDescriptorsIsMutable(); - descriptors_.addAll(other.descriptors_); - } - onChanged(); - } - } else { - if (!other.descriptors_.isEmpty()) { - if (descriptorsBuilder_.isEmpty()) { - descriptorsBuilder_.dispose(); - descriptorsBuilder_ = null; - descriptors_ = other.descriptors_; - bitField0_ = (bitField0_ & ~0x00000001); - descriptorsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getDescriptorsFieldBuilder() : null; - } else { - descriptorsBuilder_.addAllMessages(other.descriptors_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object key_ = ""; - /** - * string key = 1; - * @return The key. - */ - public java.lang.String getKey() { - java.lang.Object ref = key_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - key_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string key = 1; - * @return The bytes for key. - */ - public com.google.protobuf.ByteString - getKeyBytes() { - java.lang.Object ref = key_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - key_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string key = 1; - * @param value The key to set. - * @return This builder for chaining. - */ - public Builder setKey( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - key_ = value; - onChanged(); - return this; - } - /** - * string key = 1; - * @return This builder for chaining. - */ - public Builder clearKey() { - - key_ = getDefaultInstance().getKey(); - onChanged(); - return this; - } - /** - * string key = 1; - * @param value The bytes for key to set. - * @return This builder for chaining. - */ - public Builder setKeyBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - key_ = value; - onChanged(); - return this; - } - - private java.lang.Object uuid_ = ""; - /** - * string uuid = 2; - * @return The uuid. - */ - public java.lang.String getUuid() { - java.lang.Object ref = uuid_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uuid_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string uuid = 2; - * @return The bytes for uuid. - */ - public com.google.protobuf.ByteString - getUuidBytes() { - java.lang.Object ref = uuid_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - uuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string uuid = 2; - * @param value The uuid to set. - * @return This builder for chaining. - */ - public Builder setUuid( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - uuid_ = value; - onChanged(); - return this; - } - /** - * string uuid = 2; - * @return This builder for chaining. - */ - public Builder clearUuid() { - - uuid_ = getDefaultInstance().getUuid(); - onChanged(); - return this; - } - /** - * string uuid = 2; - * @param value The bytes for uuid to set. - * @return This builder for chaining. - */ - public Builder setUuidBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - uuid_ = value; - onChanged(); - return this; - } - - private boolean canRead_ ; - /** - * bool canRead = 3; - * @return The canRead. - */ - @java.lang.Override - public boolean getCanRead() { - return canRead_; - } - /** - * bool canRead = 3; - * @param value The canRead to set. - * @return This builder for chaining. - */ - public Builder setCanRead(boolean value) { - - canRead_ = value; - onChanged(); - return this; - } - /** - * bool canRead = 3; - * @return This builder for chaining. - */ - public Builder clearCanRead() { - - canRead_ = false; - onChanged(); - return this; - } - - private boolean canWrite_ ; - /** - * bool canWrite = 4; - * @return The canWrite. - */ - @java.lang.Override - public boolean getCanWrite() { - return canWrite_; - } - /** - * bool canWrite = 4; - * @param value The canWrite to set. - * @return This builder for chaining. - */ - public Builder setCanWrite(boolean value) { - - canWrite_ = value; - onChanged(); - return this; - } - /** - * bool canWrite = 4; - * @return This builder for chaining. - */ - public Builder clearCanWrite() { - - canWrite_ = false; - onChanged(); - return this; - } - - private boolean canWriteWithoutResponse_ ; - /** - * bool canWriteWithoutResponse = 5; - * @return The canWriteWithoutResponse. - */ - @java.lang.Override - public boolean getCanWriteWithoutResponse() { - return canWriteWithoutResponse_; - } - /** - * bool canWriteWithoutResponse = 5; - * @param value The canWriteWithoutResponse to set. - * @return This builder for chaining. - */ - public Builder setCanWriteWithoutResponse(boolean value) { - - canWriteWithoutResponse_ = value; - onChanged(); - return this; - } - /** - * bool canWriteWithoutResponse = 5; - * @return This builder for chaining. - */ - public Builder clearCanWriteWithoutResponse() { - - canWriteWithoutResponse_ = false; - onChanged(); - return this; - } - - private boolean canNotify_ ; - /** - * bool canNotify = 6; - * @return The canNotify. - */ - @java.lang.Override - public boolean getCanNotify() { - return canNotify_; - } - /** - * bool canNotify = 6; - * @param value The canNotify to set. - * @return This builder for chaining. - */ - public Builder setCanNotify(boolean value) { - - canNotify_ = value; - onChanged(); - return this; - } - /** - * bool canNotify = 6; - * @return This builder for chaining. - */ - public Builder clearCanNotify() { - - canNotify_ = false; - onChanged(); - return this; - } - - private java.util.List descriptors_ = - java.util.Collections.emptyList(); - private void ensureDescriptorsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - descriptors_ = new java.util.ArrayList(descriptors_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorOrBuilder> descriptorsBuilder_; - - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattDescriptor descriptors = 7; - */ - public java.util.List getDescriptorsList() { - if (descriptorsBuilder_ == null) { - return java.util.Collections.unmodifiableList(descriptors_); - } else { - return descriptorsBuilder_.getMessageList(); - } - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattDescriptor descriptors = 7; - */ - public int getDescriptorsCount() { - if (descriptorsBuilder_ == null) { - return descriptors_.size(); - } else { - return descriptorsBuilder_.getCount(); - } - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattDescriptor descriptors = 7; - */ - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor getDescriptors(int index) { - if (descriptorsBuilder_ == null) { - return descriptors_.get(index); - } else { - return descriptorsBuilder_.getMessage(index); - } - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattDescriptor descriptors = 7; - */ - public Builder setDescriptors( - int index, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor value) { - if (descriptorsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDescriptorsIsMutable(); - descriptors_.set(index, value); - onChanged(); - } else { - descriptorsBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattDescriptor descriptors = 7; - */ - public Builder setDescriptors( - int index, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor.Builder builderForValue) { - if (descriptorsBuilder_ == null) { - ensureDescriptorsIsMutable(); - descriptors_.set(index, builderForValue.build()); - onChanged(); - } else { - descriptorsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattDescriptor descriptors = 7; - */ - public Builder addDescriptors(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor value) { - if (descriptorsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDescriptorsIsMutable(); - descriptors_.add(value); - onChanged(); - } else { - descriptorsBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattDescriptor descriptors = 7; - */ - public Builder addDescriptors( - int index, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor value) { - if (descriptorsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDescriptorsIsMutable(); - descriptors_.add(index, value); - onChanged(); - } else { - descriptorsBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattDescriptor descriptors = 7; - */ - public Builder addDescriptors( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor.Builder builderForValue) { - if (descriptorsBuilder_ == null) { - ensureDescriptorsIsMutable(); - descriptors_.add(builderForValue.build()); - onChanged(); - } else { - descriptorsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattDescriptor descriptors = 7; - */ - public Builder addDescriptors( - int index, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor.Builder builderForValue) { - if (descriptorsBuilder_ == null) { - ensureDescriptorsIsMutable(); - descriptors_.add(index, builderForValue.build()); - onChanged(); - } else { - descriptorsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattDescriptor descriptors = 7; - */ - public Builder addAllDescriptors( - java.lang.Iterable values) { - if (descriptorsBuilder_ == null) { - ensureDescriptorsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, descriptors_); - onChanged(); - } else { - descriptorsBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattDescriptor descriptors = 7; - */ - public Builder clearDescriptors() { - if (descriptorsBuilder_ == null) { - descriptors_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - descriptorsBuilder_.clear(); - } - return this; - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattDescriptor descriptors = 7; - */ - public Builder removeDescriptors(int index) { - if (descriptorsBuilder_ == null) { - ensureDescriptorsIsMutable(); - descriptors_.remove(index); - onChanged(); - } else { - descriptorsBuilder_.remove(index); - } - return this; - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattDescriptor descriptors = 7; - */ - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor.Builder getDescriptorsBuilder( - int index) { - return getDescriptorsFieldBuilder().getBuilder(index); - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattDescriptor descriptors = 7; - */ - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorOrBuilder getDescriptorsOrBuilder( - int index) { - if (descriptorsBuilder_ == null) { - return descriptors_.get(index); } else { - return descriptorsBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattDescriptor descriptors = 7; - */ - public java.util.List - getDescriptorsOrBuilderList() { - if (descriptorsBuilder_ != null) { - return descriptorsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(descriptors_); - } - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattDescriptor descriptors = 7; - */ - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor.Builder addDescriptorsBuilder() { - return getDescriptorsFieldBuilder().addBuilder( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor.getDefaultInstance()); - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattDescriptor descriptors = 7; - */ - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor.Builder addDescriptorsBuilder( - int index) { - return getDescriptorsFieldBuilder().addBuilder( - index, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor.getDefaultInstance()); - } - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattDescriptor descriptors = 7; - */ - public java.util.List - getDescriptorsBuilderList() { - return getDescriptorsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorOrBuilder> - getDescriptorsFieldBuilder() { - if (descriptorsBuilder_ == null) { - descriptorsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor.Builder, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorOrBuilder>( - descriptors_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - descriptors_ = null; - } - return descriptorsBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:dev.yanshouwang.bluetooth_low_energy.GattCharacteristic) - } - - // @@protoc_insertion_point(class_scope:dev.yanshouwang.bluetooth_low_energy.GattCharacteristic) - private static final dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic(); - } - - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GattCharacteristic parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GattCharacteristic(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface GattDescriptorOrBuilder extends - // @@protoc_insertion_point(interface_extends:dev.yanshouwang.bluetooth_low_energy.GattDescriptor) - com.google.protobuf.MessageOrBuilder { - - /** - * string key = 1; - * @return The key. - */ - java.lang.String getKey(); - /** - * string key = 1; - * @return The bytes for key. - */ - com.google.protobuf.ByteString - getKeyBytes(); - - /** - * string uuid = 2; - * @return The uuid. - */ - java.lang.String getUuid(); - /** - * string uuid = 2; - * @return The bytes for uuid. - */ - com.google.protobuf.ByteString - getUuidBytes(); - } - /** - * Protobuf type {@code dev.yanshouwang.bluetooth_low_energy.GattDescriptor} - */ - public static final class GattDescriptor extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:dev.yanshouwang.bluetooth_low_energy.GattDescriptor) - GattDescriptorOrBuilder { - private static final long serialVersionUID = 0L; - // Use GattDescriptor.newBuilder() to construct. - private GattDescriptor(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private GattDescriptor() { - key_ = ""; - uuid_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new GattDescriptor(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private GattDescriptor( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - key_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - uuid_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattDescriptor_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattDescriptor_fieldAccessorTable - .ensureFieldAccessorsInitialized( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor.class, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor.Builder.class); - } - - public static final int KEY_FIELD_NUMBER = 1; - private volatile java.lang.Object key_; - /** - * string key = 1; - * @return The key. - */ - @java.lang.Override - public java.lang.String getKey() { - java.lang.Object ref = key_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - key_ = s; - return s; - } - } - /** - * string key = 1; - * @return The bytes for key. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getKeyBytes() { - java.lang.Object ref = key_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - key_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int UUID_FIELD_NUMBER = 2; - private volatile java.lang.Object uuid_; - /** - * string uuid = 2; - * @return The uuid. - */ - @java.lang.Override - public java.lang.String getUuid() { - java.lang.Object ref = uuid_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uuid_ = s; - return s; - } - } - /** - * string uuid = 2; - * @return The bytes for uuid. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getUuidBytes() { - java.lang.Object ref = uuid_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - uuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getKeyBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); - } - if (!getUuidBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, uuid_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getKeyBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); - } - if (!getUuidBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, uuid_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor)) { - return super.equals(obj); - } - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor other = (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor) obj; - - if (!getKey() - .equals(other.getKey())) return false; - if (!getUuid() - .equals(other.getUuid())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + KEY_FIELD_NUMBER; - hash = (53 * hash) + getKey().hashCode(); - hash = (37 * hash) + UUID_FIELD_NUMBER; - hash = (53 * hash) + getUuid().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code dev.yanshouwang.bluetooth_low_energy.GattDescriptor} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:dev.yanshouwang.bluetooth_low_energy.GattDescriptor) - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattDescriptor_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattDescriptor_fieldAccessorTable - .ensureFieldAccessorsInitialized( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor.class, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor.Builder.class); - } - - // Construct using dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - key_ = ""; - - uuid_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattDescriptor_descriptor; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor getDefaultInstanceForType() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor.getDefaultInstance(); - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor build() { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor buildPartial() { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor result = new dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor(this); - result.key_ = key_; - result.uuid_ = uuid_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor) { - return mergeFrom((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor other) { - if (other == dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor.getDefaultInstance()) return this; - if (!other.getKey().isEmpty()) { - key_ = other.key_; - onChanged(); - } - if (!other.getUuid().isEmpty()) { - uuid_ = other.uuid_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object key_ = ""; - /** - * string key = 1; - * @return The key. - */ - public java.lang.String getKey() { - java.lang.Object ref = key_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - key_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string key = 1; - * @return The bytes for key. - */ - public com.google.protobuf.ByteString - getKeyBytes() { - java.lang.Object ref = key_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - key_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string key = 1; - * @param value The key to set. - * @return This builder for chaining. - */ - public Builder setKey( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - key_ = value; - onChanged(); - return this; - } - /** - * string key = 1; - * @return This builder for chaining. - */ - public Builder clearKey() { - - key_ = getDefaultInstance().getKey(); - onChanged(); - return this; - } - /** - * string key = 1; - * @param value The bytes for key to set. - * @return This builder for chaining. - */ - public Builder setKeyBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - key_ = value; - onChanged(); - return this; - } - - private java.lang.Object uuid_ = ""; - /** - * string uuid = 2; - * @return The uuid. - */ - public java.lang.String getUuid() { - java.lang.Object ref = uuid_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uuid_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string uuid = 2; - * @return The bytes for uuid. - */ - public com.google.protobuf.ByteString - getUuidBytes() { - java.lang.Object ref = uuid_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - uuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string uuid = 2; - * @param value The uuid to set. - * @return This builder for chaining. - */ - public Builder setUuid( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - uuid_ = value; - onChanged(); - return this; - } - /** - * string uuid = 2; - * @return This builder for chaining. - */ - public Builder clearUuid() { - - uuid_ = getDefaultInstance().getUuid(); - onChanged(); - return this; - } - /** - * string uuid = 2; - * @param value The bytes for uuid to set. - * @return This builder for chaining. - */ - public Builder setUuidBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - uuid_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:dev.yanshouwang.bluetooth_low_energy.GattDescriptor) - } - - // @@protoc_insertion_point(class_scope:dev.yanshouwang.bluetooth_low_energy.GattDescriptor) - private static final dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor(); - } - - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GattDescriptor parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GattDescriptor(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface GattDisconnectArgumentsOrBuilder extends - // @@protoc_insertion_point(interface_extends:dev.yanshouwang.bluetooth_low_energy.GattDisconnectArguments) - com.google.protobuf.MessageOrBuilder { - - /** - * string key = 1; - * @return The key. - */ - java.lang.String getKey(); - /** - * string key = 1; - * @return The bytes for key. - */ - com.google.protobuf.ByteString - getKeyBytes(); - } - /** - * Protobuf type {@code dev.yanshouwang.bluetooth_low_energy.GattDisconnectArguments} - */ - public static final class GattDisconnectArguments extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:dev.yanshouwang.bluetooth_low_energy.GattDisconnectArguments) - GattDisconnectArgumentsOrBuilder { - private static final long serialVersionUID = 0L; - // Use GattDisconnectArguments.newBuilder() to construct. - private GattDisconnectArguments(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private GattDisconnectArguments() { - key_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new GattDisconnectArguments(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private GattDisconnectArguments( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - key_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattDisconnectArguments_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattDisconnectArguments_fieldAccessorTable - .ensureFieldAccessorsInitialized( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments.class, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments.Builder.class); - } - - public static final int KEY_FIELD_NUMBER = 1; - private volatile java.lang.Object key_; - /** - * string key = 1; - * @return The key. - */ - @java.lang.Override - public java.lang.String getKey() { - java.lang.Object ref = key_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - key_ = s; - return s; - } - } - /** - * string key = 1; - * @return The bytes for key. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getKeyBytes() { - java.lang.Object ref = key_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - key_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getKeyBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getKeyBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments)) { - return super.equals(obj); - } - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments other = (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments) obj; - - if (!getKey() - .equals(other.getKey())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + KEY_FIELD_NUMBER; - hash = (53 * hash) + getKey().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code dev.yanshouwang.bluetooth_low_energy.GattDisconnectArguments} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:dev.yanshouwang.bluetooth_low_energy.GattDisconnectArguments) - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArgumentsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattDisconnectArguments_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattDisconnectArguments_fieldAccessorTable - .ensureFieldAccessorsInitialized( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments.class, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments.Builder.class); - } - - // Construct using dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - key_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattDisconnectArguments_descriptor; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments getDefaultInstanceForType() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments.getDefaultInstance(); - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments build() { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments buildPartial() { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments result = new dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments(this); - result.key_ = key_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments) { - return mergeFrom((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments other) { - if (other == dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments.getDefaultInstance()) return this; - if (!other.getKey().isEmpty()) { - key_ = other.key_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object key_ = ""; - /** - * string key = 1; - * @return The key. - */ - public java.lang.String getKey() { - java.lang.Object ref = key_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - key_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string key = 1; - * @return The bytes for key. - */ - public com.google.protobuf.ByteString - getKeyBytes() { - java.lang.Object ref = key_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - key_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string key = 1; - * @param value The key to set. - * @return This builder for chaining. - */ - public Builder setKey( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - key_ = value; - onChanged(); - return this; - } - /** - * string key = 1; - * @return This builder for chaining. - */ - public Builder clearKey() { - - key_ = getDefaultInstance().getKey(); - onChanged(); - return this; - } - /** - * string key = 1; - * @param value The bytes for key to set. - * @return This builder for chaining. - */ - public Builder setKeyBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - key_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:dev.yanshouwang.bluetooth_low_energy.GattDisconnectArguments) - } - - // @@protoc_insertion_point(class_scope:dev.yanshouwang.bluetooth_low_energy.GattDisconnectArguments) - private static final dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments(); - } - - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GattDisconnectArguments parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GattDisconnectArguments(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface GattConnectionLostOrBuilder extends - // @@protoc_insertion_point(interface_extends:dev.yanshouwang.bluetooth_low_energy.GattConnectionLost) - com.google.protobuf.MessageOrBuilder { - - /** - * string key = 1; - * @return The key. - */ - java.lang.String getKey(); - /** - * string key = 1; - * @return The bytes for key. - */ - com.google.protobuf.ByteString - getKeyBytes(); - - /** - * string error = 2; - * @return The error. - */ - java.lang.String getError(); - /** - * string error = 2; - * @return The bytes for error. - */ - com.google.protobuf.ByteString - getErrorBytes(); - } - /** - * Protobuf type {@code dev.yanshouwang.bluetooth_low_energy.GattConnectionLost} - */ - public static final class GattConnectionLost extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:dev.yanshouwang.bluetooth_low_energy.GattConnectionLost) - GattConnectionLostOrBuilder { - private static final long serialVersionUID = 0L; - // Use GattConnectionLost.newBuilder() to construct. - private GattConnectionLost(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private GattConnectionLost() { - key_ = ""; - error_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new GattConnectionLost(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private GattConnectionLost( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - key_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - error_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattConnectionLost_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattConnectionLost_fieldAccessorTable - .ensureFieldAccessorsInitialized( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost.class, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost.Builder.class); - } - - public static final int KEY_FIELD_NUMBER = 1; - private volatile java.lang.Object key_; - /** - * string key = 1; - * @return The key. - */ - @java.lang.Override - public java.lang.String getKey() { - java.lang.Object ref = key_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - key_ = s; - return s; - } - } - /** - * string key = 1; - * @return The bytes for key. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getKeyBytes() { - java.lang.Object ref = key_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - key_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ERROR_FIELD_NUMBER = 2; - private volatile java.lang.Object error_; - /** - * string error = 2; - * @return The error. - */ - @java.lang.Override - public java.lang.String getError() { - java.lang.Object ref = error_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - error_ = s; - return s; - } - } - /** - * string error = 2; - * @return The bytes for error. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getErrorBytes() { - java.lang.Object ref = error_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - error_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getKeyBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); - } - if (!getErrorBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, error_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getKeyBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); - } - if (!getErrorBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, error_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost)) { - return super.equals(obj); - } - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost other = (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost) obj; - - if (!getKey() - .equals(other.getKey())) return false; - if (!getError() - .equals(other.getError())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + KEY_FIELD_NUMBER; - hash = (53 * hash) + getKey().hashCode(); - hash = (37 * hash) + ERROR_FIELD_NUMBER; - hash = (53 * hash) + getError().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code dev.yanshouwang.bluetooth_low_energy.GattConnectionLost} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:dev.yanshouwang.bluetooth_low_energy.GattConnectionLost) - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLostOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattConnectionLost_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattConnectionLost_fieldAccessorTable - .ensureFieldAccessorsInitialized( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost.class, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost.Builder.class); - } - - // Construct using dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - key_ = ""; - - error_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattConnectionLost_descriptor; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost getDefaultInstanceForType() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost.getDefaultInstance(); - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost build() { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost buildPartial() { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost result = new dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost(this); - result.key_ = key_; - result.error_ = error_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost) { - return mergeFrom((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost other) { - if (other == dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost.getDefaultInstance()) return this; - if (!other.getKey().isEmpty()) { - key_ = other.key_; - onChanged(); - } - if (!other.getError().isEmpty()) { - error_ = other.error_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object key_ = ""; - /** - * string key = 1; - * @return The key. - */ - public java.lang.String getKey() { - java.lang.Object ref = key_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - key_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string key = 1; - * @return The bytes for key. - */ - public com.google.protobuf.ByteString - getKeyBytes() { - java.lang.Object ref = key_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - key_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string key = 1; - * @param value The key to set. - * @return This builder for chaining. - */ - public Builder setKey( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - key_ = value; - onChanged(); - return this; - } - /** - * string key = 1; - * @return This builder for chaining. - */ - public Builder clearKey() { - - key_ = getDefaultInstance().getKey(); - onChanged(); - return this; - } - /** - * string key = 1; - * @param value The bytes for key to set. - * @return This builder for chaining. - */ - public Builder setKeyBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - key_ = value; - onChanged(); - return this; - } - - private java.lang.Object error_ = ""; - /** - * string error = 2; - * @return The error. - */ - public java.lang.String getError() { - java.lang.Object ref = error_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - error_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string error = 2; - * @return The bytes for error. - */ - public com.google.protobuf.ByteString - getErrorBytes() { - java.lang.Object ref = error_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - error_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string error = 2; - * @param value The error to set. - * @return This builder for chaining. - */ - public Builder setError( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - error_ = value; - onChanged(); - return this; - } - /** - * string error = 2; - * @return This builder for chaining. - */ - public Builder clearError() { - - error_ = getDefaultInstance().getError(); - onChanged(); - return this; - } - /** - * string error = 2; - * @param value The bytes for error to set. - * @return This builder for chaining. - */ - public Builder setErrorBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - error_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:dev.yanshouwang.bluetooth_low_energy.GattConnectionLost) - } - - // @@protoc_insertion_point(class_scope:dev.yanshouwang.bluetooth_low_energy.GattConnectionLost) - private static final dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost(); - } - - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GattConnectionLost parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GattConnectionLost(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface GattCharacteristicReadArgumentsOrBuilder extends - // @@protoc_insertion_point(interface_extends:dev.yanshouwang.bluetooth_low_energy.GattCharacteristicReadArguments) - com.google.protobuf.MessageOrBuilder { - - /** - * string gatt_key = 1; - * @return The gattKey. - */ - java.lang.String getGattKey(); - /** - * string gatt_key = 1; - * @return The bytes for gattKey. - */ - com.google.protobuf.ByteString - getGattKeyBytes(); - - /** - * string service_key = 2; - * @return The serviceKey. - */ - java.lang.String getServiceKey(); - /** - * string service_key = 2; - * @return The bytes for serviceKey. - */ - com.google.protobuf.ByteString - getServiceKeyBytes(); - - /** - * string key = 3; - * @return The key. - */ - java.lang.String getKey(); - /** - * string key = 3; - * @return The bytes for key. - */ - com.google.protobuf.ByteString - getKeyBytes(); - } - /** - * Protobuf type {@code dev.yanshouwang.bluetooth_low_energy.GattCharacteristicReadArguments} - */ - public static final class GattCharacteristicReadArguments extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:dev.yanshouwang.bluetooth_low_energy.GattCharacteristicReadArguments) - GattCharacteristicReadArgumentsOrBuilder { - private static final long serialVersionUID = 0L; - // Use GattCharacteristicReadArguments.newBuilder() to construct. - private GattCharacteristicReadArguments(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private GattCharacteristicReadArguments() { - gattKey_ = ""; - serviceKey_ = ""; - key_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new GattCharacteristicReadArguments(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private GattCharacteristicReadArguments( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - gattKey_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - serviceKey_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - key_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicReadArguments_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicReadArguments_fieldAccessorTable - .ensureFieldAccessorsInitialized( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments.class, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments.Builder.class); - } - - public static final int GATT_KEY_FIELD_NUMBER = 1; - private volatile java.lang.Object gattKey_; - /** - * string gatt_key = 1; - * @return The gattKey. - */ - @java.lang.Override - public java.lang.String getGattKey() { - java.lang.Object ref = gattKey_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - gattKey_ = s; - return s; - } - } - /** - * string gatt_key = 1; - * @return The bytes for gattKey. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getGattKeyBytes() { - java.lang.Object ref = gattKey_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - gattKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SERVICE_KEY_FIELD_NUMBER = 2; - private volatile java.lang.Object serviceKey_; - /** - * string service_key = 2; - * @return The serviceKey. - */ - @java.lang.Override - public java.lang.String getServiceKey() { - java.lang.Object ref = serviceKey_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - serviceKey_ = s; - return s; - } - } - /** - * string service_key = 2; - * @return The bytes for serviceKey. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getServiceKeyBytes() { - java.lang.Object ref = serviceKey_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - serviceKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int KEY_FIELD_NUMBER = 3; - private volatile java.lang.Object key_; - /** - * string key = 3; - * @return The key. - */ - @java.lang.Override - public java.lang.String getKey() { - java.lang.Object ref = key_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - key_ = s; - return s; - } - } - /** - * string key = 3; - * @return The bytes for key. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getKeyBytes() { - java.lang.Object ref = key_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - key_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getGattKeyBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, gattKey_); - } - if (!getServiceKeyBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, serviceKey_); - } - if (!getKeyBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, key_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getGattKeyBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, gattKey_); - } - if (!getServiceKeyBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, serviceKey_); - } - if (!getKeyBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, key_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments)) { - return super.equals(obj); - } - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments other = (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments) obj; - - if (!getGattKey() - .equals(other.getGattKey())) return false; - if (!getServiceKey() - .equals(other.getServiceKey())) return false; - if (!getKey() - .equals(other.getKey())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + GATT_KEY_FIELD_NUMBER; - hash = (53 * hash) + getGattKey().hashCode(); - hash = (37 * hash) + SERVICE_KEY_FIELD_NUMBER; - hash = (53 * hash) + getServiceKey().hashCode(); - hash = (37 * hash) + KEY_FIELD_NUMBER; - hash = (53 * hash) + getKey().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code dev.yanshouwang.bluetooth_low_energy.GattCharacteristicReadArguments} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:dev.yanshouwang.bluetooth_low_energy.GattCharacteristicReadArguments) - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArgumentsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicReadArguments_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicReadArguments_fieldAccessorTable - .ensureFieldAccessorsInitialized( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments.class, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments.Builder.class); - } - - // Construct using dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - gattKey_ = ""; - - serviceKey_ = ""; - - key_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicReadArguments_descriptor; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments getDefaultInstanceForType() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments.getDefaultInstance(); - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments build() { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments buildPartial() { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments result = new dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments(this); - result.gattKey_ = gattKey_; - result.serviceKey_ = serviceKey_; - result.key_ = key_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments) { - return mergeFrom((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments other) { - if (other == dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments.getDefaultInstance()) return this; - if (!other.getGattKey().isEmpty()) { - gattKey_ = other.gattKey_; - onChanged(); - } - if (!other.getServiceKey().isEmpty()) { - serviceKey_ = other.serviceKey_; - onChanged(); - } - if (!other.getKey().isEmpty()) { - key_ = other.key_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object gattKey_ = ""; - /** - * string gatt_key = 1; - * @return The gattKey. - */ - public java.lang.String getGattKey() { - java.lang.Object ref = gattKey_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - gattKey_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string gatt_key = 1; - * @return The bytes for gattKey. - */ - public com.google.protobuf.ByteString - getGattKeyBytes() { - java.lang.Object ref = gattKey_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - gattKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string gatt_key = 1; - * @param value The gattKey to set. - * @return This builder for chaining. - */ - public Builder setGattKey( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - gattKey_ = value; - onChanged(); - return this; - } - /** - * string gatt_key = 1; - * @return This builder for chaining. - */ - public Builder clearGattKey() { - - gattKey_ = getDefaultInstance().getGattKey(); - onChanged(); - return this; - } - /** - * string gatt_key = 1; - * @param value The bytes for gattKey to set. - * @return This builder for chaining. - */ - public Builder setGattKeyBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - gattKey_ = value; - onChanged(); - return this; - } - - private java.lang.Object serviceKey_ = ""; - /** - * string service_key = 2; - * @return The serviceKey. - */ - public java.lang.String getServiceKey() { - java.lang.Object ref = serviceKey_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - serviceKey_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string service_key = 2; - * @return The bytes for serviceKey. - */ - public com.google.protobuf.ByteString - getServiceKeyBytes() { - java.lang.Object ref = serviceKey_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - serviceKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string service_key = 2; - * @param value The serviceKey to set. - * @return This builder for chaining. - */ - public Builder setServiceKey( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - serviceKey_ = value; - onChanged(); - return this; - } - /** - * string service_key = 2; - * @return This builder for chaining. - */ - public Builder clearServiceKey() { - - serviceKey_ = getDefaultInstance().getServiceKey(); - onChanged(); - return this; - } - /** - * string service_key = 2; - * @param value The bytes for serviceKey to set. - * @return This builder for chaining. - */ - public Builder setServiceKeyBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - serviceKey_ = value; - onChanged(); - return this; - } - - private java.lang.Object key_ = ""; - /** - * string key = 3; - * @return The key. - */ - public java.lang.String getKey() { - java.lang.Object ref = key_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - key_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string key = 3; - * @return The bytes for key. - */ - public com.google.protobuf.ByteString - getKeyBytes() { - java.lang.Object ref = key_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - key_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string key = 3; - * @param value The key to set. - * @return This builder for chaining. - */ - public Builder setKey( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - key_ = value; - onChanged(); - return this; - } - /** - * string key = 3; - * @return This builder for chaining. - */ - public Builder clearKey() { - - key_ = getDefaultInstance().getKey(); - onChanged(); - return this; - } - /** - * string key = 3; - * @param value The bytes for key to set. - * @return This builder for chaining. - */ - public Builder setKeyBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - key_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:dev.yanshouwang.bluetooth_low_energy.GattCharacteristicReadArguments) - } - - // @@protoc_insertion_point(class_scope:dev.yanshouwang.bluetooth_low_energy.GattCharacteristicReadArguments) - private static final dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments(); - } - - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GattCharacteristicReadArguments parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GattCharacteristicReadArguments(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface GattCharacteristicWriteArgumentsOrBuilder extends - // @@protoc_insertion_point(interface_extends:dev.yanshouwang.bluetooth_low_energy.GattCharacteristicWriteArguments) - com.google.protobuf.MessageOrBuilder { - - /** - * string gatt_key = 1; - * @return The gattKey. - */ - java.lang.String getGattKey(); - /** - * string gatt_key = 1; - * @return The bytes for gattKey. - */ - com.google.protobuf.ByteString - getGattKeyBytes(); - - /** - * string service_key = 2; - * @return The serviceKey. - */ - java.lang.String getServiceKey(); - /** - * string service_key = 2; - * @return The bytes for serviceKey. - */ - com.google.protobuf.ByteString - getServiceKeyBytes(); - - /** - * string key = 3; - * @return The key. - */ - java.lang.String getKey(); - /** - * string key = 3; - * @return The bytes for key. - */ - com.google.protobuf.ByteString - getKeyBytes(); - - /** - * bytes value = 4; - * @return The value. - */ - com.google.protobuf.ByteString getValue(); - - /** - * bool withoutResponse = 5; - * @return The withoutResponse. - */ - boolean getWithoutResponse(); - } - /** - * Protobuf type {@code dev.yanshouwang.bluetooth_low_energy.GattCharacteristicWriteArguments} - */ - public static final class GattCharacteristicWriteArguments extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:dev.yanshouwang.bluetooth_low_energy.GattCharacteristicWriteArguments) - GattCharacteristicWriteArgumentsOrBuilder { - private static final long serialVersionUID = 0L; - // Use GattCharacteristicWriteArguments.newBuilder() to construct. - private GattCharacteristicWriteArguments(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private GattCharacteristicWriteArguments() { - gattKey_ = ""; - serviceKey_ = ""; - key_ = ""; - value_ = com.google.protobuf.ByteString.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new GattCharacteristicWriteArguments(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private GattCharacteristicWriteArguments( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - gattKey_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - serviceKey_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - key_ = s; - break; - } - case 34: { - - value_ = input.readBytes(); - break; - } - case 40: { - - withoutResponse_ = input.readBool(); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicWriteArguments_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicWriteArguments_fieldAccessorTable - .ensureFieldAccessorsInitialized( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments.class, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments.Builder.class); - } - - public static final int GATT_KEY_FIELD_NUMBER = 1; - private volatile java.lang.Object gattKey_; - /** - * string gatt_key = 1; - * @return The gattKey. - */ - @java.lang.Override - public java.lang.String getGattKey() { - java.lang.Object ref = gattKey_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - gattKey_ = s; - return s; - } - } - /** - * string gatt_key = 1; - * @return The bytes for gattKey. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getGattKeyBytes() { - java.lang.Object ref = gattKey_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - gattKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SERVICE_KEY_FIELD_NUMBER = 2; - private volatile java.lang.Object serviceKey_; - /** - * string service_key = 2; - * @return The serviceKey. - */ - @java.lang.Override - public java.lang.String getServiceKey() { - java.lang.Object ref = serviceKey_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - serviceKey_ = s; - return s; - } - } - /** - * string service_key = 2; - * @return The bytes for serviceKey. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getServiceKeyBytes() { - java.lang.Object ref = serviceKey_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - serviceKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int KEY_FIELD_NUMBER = 3; - private volatile java.lang.Object key_; - /** - * string key = 3; - * @return The key. - */ - @java.lang.Override - public java.lang.String getKey() { - java.lang.Object ref = key_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - key_ = s; - return s; - } - } - /** - * string key = 3; - * @return The bytes for key. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getKeyBytes() { - java.lang.Object ref = key_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - key_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int VALUE_FIELD_NUMBER = 4; - private com.google.protobuf.ByteString value_; - /** - * bytes value = 4; - * @return The value. - */ - @java.lang.Override - public com.google.protobuf.ByteString getValue() { - return value_; - } - - public static final int WITHOUTRESPONSE_FIELD_NUMBER = 5; - private boolean withoutResponse_; - /** - * bool withoutResponse = 5; - * @return The withoutResponse. - */ - @java.lang.Override - public boolean getWithoutResponse() { - return withoutResponse_; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getGattKeyBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, gattKey_); - } - if (!getServiceKeyBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, serviceKey_); - } - if (!getKeyBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, key_); - } - if (!value_.isEmpty()) { - output.writeBytes(4, value_); - } - if (withoutResponse_ != false) { - output.writeBool(5, withoutResponse_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getGattKeyBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, gattKey_); - } - if (!getServiceKeyBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, serviceKey_); - } - if (!getKeyBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, key_); - } - if (!value_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(4, value_); - } - if (withoutResponse_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(5, withoutResponse_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments)) { - return super.equals(obj); - } - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments other = (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments) obj; - - if (!getGattKey() - .equals(other.getGattKey())) return false; - if (!getServiceKey() - .equals(other.getServiceKey())) return false; - if (!getKey() - .equals(other.getKey())) return false; - if (!getValue() - .equals(other.getValue())) return false; - if (getWithoutResponse() - != other.getWithoutResponse()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + GATT_KEY_FIELD_NUMBER; - hash = (53 * hash) + getGattKey().hashCode(); - hash = (37 * hash) + SERVICE_KEY_FIELD_NUMBER; - hash = (53 * hash) + getServiceKey().hashCode(); - hash = (37 * hash) + KEY_FIELD_NUMBER; - hash = (53 * hash) + getKey().hashCode(); - hash = (37 * hash) + VALUE_FIELD_NUMBER; - hash = (53 * hash) + getValue().hashCode(); - hash = (37 * hash) + WITHOUTRESPONSE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getWithoutResponse()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code dev.yanshouwang.bluetooth_low_energy.GattCharacteristicWriteArguments} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:dev.yanshouwang.bluetooth_low_energy.GattCharacteristicWriteArguments) - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArgumentsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicWriteArguments_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicWriteArguments_fieldAccessorTable - .ensureFieldAccessorsInitialized( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments.class, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments.Builder.class); - } - - // Construct using dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - gattKey_ = ""; - - serviceKey_ = ""; - - key_ = ""; - - value_ = com.google.protobuf.ByteString.EMPTY; - - withoutResponse_ = false; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicWriteArguments_descriptor; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments getDefaultInstanceForType() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments.getDefaultInstance(); - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments build() { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments buildPartial() { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments result = new dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments(this); - result.gattKey_ = gattKey_; - result.serviceKey_ = serviceKey_; - result.key_ = key_; - result.value_ = value_; - result.withoutResponse_ = withoutResponse_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments) { - return mergeFrom((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments other) { - if (other == dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments.getDefaultInstance()) return this; - if (!other.getGattKey().isEmpty()) { - gattKey_ = other.gattKey_; - onChanged(); - } - if (!other.getServiceKey().isEmpty()) { - serviceKey_ = other.serviceKey_; - onChanged(); - } - if (!other.getKey().isEmpty()) { - key_ = other.key_; - onChanged(); - } - if (other.getValue() != com.google.protobuf.ByteString.EMPTY) { - setValue(other.getValue()); - } - if (other.getWithoutResponse() != false) { - setWithoutResponse(other.getWithoutResponse()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object gattKey_ = ""; - /** - * string gatt_key = 1; - * @return The gattKey. - */ - public java.lang.String getGattKey() { - java.lang.Object ref = gattKey_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - gattKey_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string gatt_key = 1; - * @return The bytes for gattKey. - */ - public com.google.protobuf.ByteString - getGattKeyBytes() { - java.lang.Object ref = gattKey_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - gattKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string gatt_key = 1; - * @param value The gattKey to set. - * @return This builder for chaining. - */ - public Builder setGattKey( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - gattKey_ = value; - onChanged(); - return this; - } - /** - * string gatt_key = 1; - * @return This builder for chaining. - */ - public Builder clearGattKey() { - - gattKey_ = getDefaultInstance().getGattKey(); - onChanged(); - return this; - } - /** - * string gatt_key = 1; - * @param value The bytes for gattKey to set. - * @return This builder for chaining. - */ - public Builder setGattKeyBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - gattKey_ = value; - onChanged(); - return this; - } - - private java.lang.Object serviceKey_ = ""; - /** - * string service_key = 2; - * @return The serviceKey. - */ - public java.lang.String getServiceKey() { - java.lang.Object ref = serviceKey_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - serviceKey_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string service_key = 2; - * @return The bytes for serviceKey. - */ - public com.google.protobuf.ByteString - getServiceKeyBytes() { - java.lang.Object ref = serviceKey_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - serviceKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string service_key = 2; - * @param value The serviceKey to set. - * @return This builder for chaining. - */ - public Builder setServiceKey( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - serviceKey_ = value; - onChanged(); - return this; - } - /** - * string service_key = 2; - * @return This builder for chaining. - */ - public Builder clearServiceKey() { - - serviceKey_ = getDefaultInstance().getServiceKey(); - onChanged(); - return this; - } - /** - * string service_key = 2; - * @param value The bytes for serviceKey to set. - * @return This builder for chaining. - */ - public Builder setServiceKeyBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - serviceKey_ = value; - onChanged(); - return this; - } - - private java.lang.Object key_ = ""; - /** - * string key = 3; - * @return The key. - */ - public java.lang.String getKey() { - java.lang.Object ref = key_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - key_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string key = 3; - * @return The bytes for key. - */ - public com.google.protobuf.ByteString - getKeyBytes() { - java.lang.Object ref = key_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - key_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string key = 3; - * @param value The key to set. - * @return This builder for chaining. - */ - public Builder setKey( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - key_ = value; - onChanged(); - return this; - } - /** - * string key = 3; - * @return This builder for chaining. - */ - public Builder clearKey() { - - key_ = getDefaultInstance().getKey(); - onChanged(); - return this; - } - /** - * string key = 3; - * @param value The bytes for key to set. - * @return This builder for chaining. - */ - public Builder setKeyBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - key_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.ByteString value_ = com.google.protobuf.ByteString.EMPTY; - /** - * bytes value = 4; - * @return The value. - */ - @java.lang.Override - public com.google.protobuf.ByteString getValue() { - return value_; - } - /** - * bytes value = 4; - * @param value The value to set. - * @return This builder for chaining. - */ - public Builder setValue(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - value_ = value; - onChanged(); - return this; - } - /** - * bytes value = 4; - * @return This builder for chaining. - */ - public Builder clearValue() { - - value_ = getDefaultInstance().getValue(); - onChanged(); - return this; - } - - private boolean withoutResponse_ ; - /** - * bool withoutResponse = 5; - * @return The withoutResponse. - */ - @java.lang.Override - public boolean getWithoutResponse() { - return withoutResponse_; - } - /** - * bool withoutResponse = 5; - * @param value The withoutResponse to set. - * @return This builder for chaining. - */ - public Builder setWithoutResponse(boolean value) { - - withoutResponse_ = value; - onChanged(); - return this; - } - /** - * bool withoutResponse = 5; - * @return This builder for chaining. - */ - public Builder clearWithoutResponse() { - - withoutResponse_ = false; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:dev.yanshouwang.bluetooth_low_energy.GattCharacteristicWriteArguments) - } - - // @@protoc_insertion_point(class_scope:dev.yanshouwang.bluetooth_low_energy.GattCharacteristicWriteArguments) - private static final dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments(); - } - - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GattCharacteristicWriteArguments parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GattCharacteristicWriteArguments(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface GattCharacteristicNotifyArgumentsOrBuilder extends - // @@protoc_insertion_point(interface_extends:dev.yanshouwang.bluetooth_low_energy.GattCharacteristicNotifyArguments) - com.google.protobuf.MessageOrBuilder { - - /** - * string gatt_key = 1; - * @return The gattKey. - */ - java.lang.String getGattKey(); - /** - * string gatt_key = 1; - * @return The bytes for gattKey. - */ - com.google.protobuf.ByteString - getGattKeyBytes(); - - /** - * string service_key = 2; - * @return The serviceKey. - */ - java.lang.String getServiceKey(); - /** - * string service_key = 2; - * @return The bytes for serviceKey. - */ - com.google.protobuf.ByteString - getServiceKeyBytes(); - - /** - * string key = 3; - * @return The key. - */ - java.lang.String getKey(); - /** - * string key = 3; - * @return The bytes for key. - */ - com.google.protobuf.ByteString - getKeyBytes(); - - /** - * bool state = 4; - * @return The state. - */ - boolean getState(); - } - /** - * Protobuf type {@code dev.yanshouwang.bluetooth_low_energy.GattCharacteristicNotifyArguments} - */ - public static final class GattCharacteristicNotifyArguments extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:dev.yanshouwang.bluetooth_low_energy.GattCharacteristicNotifyArguments) - GattCharacteristicNotifyArgumentsOrBuilder { - private static final long serialVersionUID = 0L; - // Use GattCharacteristicNotifyArguments.newBuilder() to construct. - private GattCharacteristicNotifyArguments(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private GattCharacteristicNotifyArguments() { - gattKey_ = ""; - serviceKey_ = ""; - key_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new GattCharacteristicNotifyArguments(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private GattCharacteristicNotifyArguments( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - gattKey_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - serviceKey_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - key_ = s; - break; - } - case 32: { - - state_ = input.readBool(); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicNotifyArguments_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicNotifyArguments_fieldAccessorTable - .ensureFieldAccessorsInitialized( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments.class, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments.Builder.class); - } - - public static final int GATT_KEY_FIELD_NUMBER = 1; - private volatile java.lang.Object gattKey_; - /** - * string gatt_key = 1; - * @return The gattKey. - */ - @java.lang.Override - public java.lang.String getGattKey() { - java.lang.Object ref = gattKey_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - gattKey_ = s; - return s; - } - } - /** - * string gatt_key = 1; - * @return The bytes for gattKey. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getGattKeyBytes() { - java.lang.Object ref = gattKey_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - gattKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SERVICE_KEY_FIELD_NUMBER = 2; - private volatile java.lang.Object serviceKey_; - /** - * string service_key = 2; - * @return The serviceKey. - */ - @java.lang.Override - public java.lang.String getServiceKey() { - java.lang.Object ref = serviceKey_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - serviceKey_ = s; - return s; - } - } - /** - * string service_key = 2; - * @return The bytes for serviceKey. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getServiceKeyBytes() { - java.lang.Object ref = serviceKey_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - serviceKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int KEY_FIELD_NUMBER = 3; - private volatile java.lang.Object key_; - /** - * string key = 3; - * @return The key. - */ - @java.lang.Override - public java.lang.String getKey() { - java.lang.Object ref = key_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - key_ = s; - return s; - } - } - /** - * string key = 3; - * @return The bytes for key. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getKeyBytes() { - java.lang.Object ref = key_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - key_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int STATE_FIELD_NUMBER = 4; - private boolean state_; - /** - * bool state = 4; - * @return The state. - */ - @java.lang.Override - public boolean getState() { - return state_; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getGattKeyBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, gattKey_); - } - if (!getServiceKeyBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, serviceKey_); - } - if (!getKeyBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, key_); - } - if (state_ != false) { - output.writeBool(4, state_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getGattKeyBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, gattKey_); - } - if (!getServiceKeyBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, serviceKey_); - } - if (!getKeyBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, key_); - } - if (state_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(4, state_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments)) { - return super.equals(obj); - } - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments other = (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments) obj; - - if (!getGattKey() - .equals(other.getGattKey())) return false; - if (!getServiceKey() - .equals(other.getServiceKey())) return false; - if (!getKey() - .equals(other.getKey())) return false; - if (getState() - != other.getState()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + GATT_KEY_FIELD_NUMBER; - hash = (53 * hash) + getGattKey().hashCode(); - hash = (37 * hash) + SERVICE_KEY_FIELD_NUMBER; - hash = (53 * hash) + getServiceKey().hashCode(); - hash = (37 * hash) + KEY_FIELD_NUMBER; - hash = (53 * hash) + getKey().hashCode(); - hash = (37 * hash) + STATE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getState()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code dev.yanshouwang.bluetooth_low_energy.GattCharacteristicNotifyArguments} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:dev.yanshouwang.bluetooth_low_energy.GattCharacteristicNotifyArguments) - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArgumentsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicNotifyArguments_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicNotifyArguments_fieldAccessorTable - .ensureFieldAccessorsInitialized( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments.class, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments.Builder.class); - } - - // Construct using dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - gattKey_ = ""; - - serviceKey_ = ""; - - key_ = ""; - - state_ = false; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicNotifyArguments_descriptor; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments getDefaultInstanceForType() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments.getDefaultInstance(); - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments build() { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments buildPartial() { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments result = new dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments(this); - result.gattKey_ = gattKey_; - result.serviceKey_ = serviceKey_; - result.key_ = key_; - result.state_ = state_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments) { - return mergeFrom((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments other) { - if (other == dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments.getDefaultInstance()) return this; - if (!other.getGattKey().isEmpty()) { - gattKey_ = other.gattKey_; - onChanged(); - } - if (!other.getServiceKey().isEmpty()) { - serviceKey_ = other.serviceKey_; - onChanged(); - } - if (!other.getKey().isEmpty()) { - key_ = other.key_; - onChanged(); - } - if (other.getState() != false) { - setState(other.getState()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object gattKey_ = ""; - /** - * string gatt_key = 1; - * @return The gattKey. - */ - public java.lang.String getGattKey() { - java.lang.Object ref = gattKey_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - gattKey_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string gatt_key = 1; - * @return The bytes for gattKey. - */ - public com.google.protobuf.ByteString - getGattKeyBytes() { - java.lang.Object ref = gattKey_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - gattKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string gatt_key = 1; - * @param value The gattKey to set. - * @return This builder for chaining. - */ - public Builder setGattKey( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - gattKey_ = value; - onChanged(); - return this; - } - /** - * string gatt_key = 1; - * @return This builder for chaining. - */ - public Builder clearGattKey() { - - gattKey_ = getDefaultInstance().getGattKey(); - onChanged(); - return this; - } - /** - * string gatt_key = 1; - * @param value The bytes for gattKey to set. - * @return This builder for chaining. - */ - public Builder setGattKeyBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - gattKey_ = value; - onChanged(); - return this; - } - - private java.lang.Object serviceKey_ = ""; - /** - * string service_key = 2; - * @return The serviceKey. - */ - public java.lang.String getServiceKey() { - java.lang.Object ref = serviceKey_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - serviceKey_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string service_key = 2; - * @return The bytes for serviceKey. - */ - public com.google.protobuf.ByteString - getServiceKeyBytes() { - java.lang.Object ref = serviceKey_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - serviceKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string service_key = 2; - * @param value The serviceKey to set. - * @return This builder for chaining. - */ - public Builder setServiceKey( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - serviceKey_ = value; - onChanged(); - return this; - } - /** - * string service_key = 2; - * @return This builder for chaining. - */ - public Builder clearServiceKey() { - - serviceKey_ = getDefaultInstance().getServiceKey(); - onChanged(); - return this; - } - /** - * string service_key = 2; - * @param value The bytes for serviceKey to set. - * @return This builder for chaining. - */ - public Builder setServiceKeyBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - serviceKey_ = value; - onChanged(); - return this; - } - - private java.lang.Object key_ = ""; - /** - * string key = 3; - * @return The key. - */ - public java.lang.String getKey() { - java.lang.Object ref = key_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - key_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string key = 3; - * @return The bytes for key. - */ - public com.google.protobuf.ByteString - getKeyBytes() { - java.lang.Object ref = key_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - key_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string key = 3; - * @param value The key to set. - * @return This builder for chaining. - */ - public Builder setKey( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - key_ = value; - onChanged(); - return this; - } - /** - * string key = 3; - * @return This builder for chaining. - */ - public Builder clearKey() { - - key_ = getDefaultInstance().getKey(); - onChanged(); - return this; - } - /** - * string key = 3; - * @param value The bytes for key to set. - * @return This builder for chaining. - */ - public Builder setKeyBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - key_ = value; - onChanged(); - return this; - } - - private boolean state_ ; - /** - * bool state = 4; - * @return The state. - */ - @java.lang.Override - public boolean getState() { - return state_; - } - /** - * bool state = 4; - * @param value The state to set. - * @return This builder for chaining. - */ - public Builder setState(boolean value) { - - state_ = value; - onChanged(); - return this; - } - /** - * bool state = 4; - * @return This builder for chaining. - */ - public Builder clearState() { - - state_ = false; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:dev.yanshouwang.bluetooth_low_energy.GattCharacteristicNotifyArguments) - } - - // @@protoc_insertion_point(class_scope:dev.yanshouwang.bluetooth_low_energy.GattCharacteristicNotifyArguments) - private static final dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments(); - } - - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GattCharacteristicNotifyArguments parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GattCharacteristicNotifyArguments(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface GattCharacteristicValueOrBuilder extends - // @@protoc_insertion_point(interface_extends:dev.yanshouwang.bluetooth_low_energy.GattCharacteristicValue) - com.google.protobuf.MessageOrBuilder { - - /** - * string gatt_key = 1; - * @return The gattKey. - */ - java.lang.String getGattKey(); - /** - * string gatt_key = 1; - * @return The bytes for gattKey. - */ - com.google.protobuf.ByteString - getGattKeyBytes(); - - /** - * string service_key = 2; - * @return The serviceKey. - */ - java.lang.String getServiceKey(); - /** - * string service_key = 2; - * @return The bytes for serviceKey. - */ - com.google.protobuf.ByteString - getServiceKeyBytes(); - - /** - * string key = 3; - * @return The key. - */ - java.lang.String getKey(); - /** - * string key = 3; - * @return The bytes for key. - */ - com.google.protobuf.ByteString - getKeyBytes(); - - /** - * bytes value = 4; - * @return The value. - */ - com.google.protobuf.ByteString getValue(); - } - /** - * Protobuf type {@code dev.yanshouwang.bluetooth_low_energy.GattCharacteristicValue} - */ - public static final class GattCharacteristicValue extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:dev.yanshouwang.bluetooth_low_energy.GattCharacteristicValue) - GattCharacteristicValueOrBuilder { - private static final long serialVersionUID = 0L; - // Use GattCharacteristicValue.newBuilder() to construct. - private GattCharacteristicValue(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private GattCharacteristicValue() { - gattKey_ = ""; - serviceKey_ = ""; - key_ = ""; - value_ = com.google.protobuf.ByteString.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new GattCharacteristicValue(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private GattCharacteristicValue( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - gattKey_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - serviceKey_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - key_ = s; - break; - } - case 34: { - - value_ = input.readBytes(); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicValue_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicValue_fieldAccessorTable - .ensureFieldAccessorsInitialized( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue.class, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue.Builder.class); - } - - public static final int GATT_KEY_FIELD_NUMBER = 1; - private volatile java.lang.Object gattKey_; - /** - * string gatt_key = 1; - * @return The gattKey. - */ - @java.lang.Override - public java.lang.String getGattKey() { - java.lang.Object ref = gattKey_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - gattKey_ = s; - return s; - } - } - /** - * string gatt_key = 1; - * @return The bytes for gattKey. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getGattKeyBytes() { - java.lang.Object ref = gattKey_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - gattKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SERVICE_KEY_FIELD_NUMBER = 2; - private volatile java.lang.Object serviceKey_; - /** - * string service_key = 2; - * @return The serviceKey. - */ - @java.lang.Override - public java.lang.String getServiceKey() { - java.lang.Object ref = serviceKey_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - serviceKey_ = s; - return s; - } - } - /** - * string service_key = 2; - * @return The bytes for serviceKey. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getServiceKeyBytes() { - java.lang.Object ref = serviceKey_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - serviceKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int KEY_FIELD_NUMBER = 3; - private volatile java.lang.Object key_; - /** - * string key = 3; - * @return The key. - */ - @java.lang.Override - public java.lang.String getKey() { - java.lang.Object ref = key_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - key_ = s; - return s; - } - } - /** - * string key = 3; - * @return The bytes for key. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getKeyBytes() { - java.lang.Object ref = key_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - key_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int VALUE_FIELD_NUMBER = 4; - private com.google.protobuf.ByteString value_; - /** - * bytes value = 4; - * @return The value. - */ - @java.lang.Override - public com.google.protobuf.ByteString getValue() { - return value_; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getGattKeyBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, gattKey_); - } - if (!getServiceKeyBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, serviceKey_); - } - if (!getKeyBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, key_); - } - if (!value_.isEmpty()) { - output.writeBytes(4, value_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getGattKeyBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, gattKey_); - } - if (!getServiceKeyBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, serviceKey_); - } - if (!getKeyBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, key_); - } - if (!value_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(4, value_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue)) { - return super.equals(obj); - } - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue other = (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue) obj; - - if (!getGattKey() - .equals(other.getGattKey())) return false; - if (!getServiceKey() - .equals(other.getServiceKey())) return false; - if (!getKey() - .equals(other.getKey())) return false; - if (!getValue() - .equals(other.getValue())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + GATT_KEY_FIELD_NUMBER; - hash = (53 * hash) + getGattKey().hashCode(); - hash = (37 * hash) + SERVICE_KEY_FIELD_NUMBER; - hash = (53 * hash) + getServiceKey().hashCode(); - hash = (37 * hash) + KEY_FIELD_NUMBER; - hash = (53 * hash) + getKey().hashCode(); - hash = (37 * hash) + VALUE_FIELD_NUMBER; - hash = (53 * hash) + getValue().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code dev.yanshouwang.bluetooth_low_energy.GattCharacteristicValue} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:dev.yanshouwang.bluetooth_low_energy.GattCharacteristicValue) - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValueOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicValue_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicValue_fieldAccessorTable - .ensureFieldAccessorsInitialized( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue.class, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue.Builder.class); - } - - // Construct using dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - gattKey_ = ""; - - serviceKey_ = ""; - - key_ = ""; - - value_ = com.google.protobuf.ByteString.EMPTY; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicValue_descriptor; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue getDefaultInstanceForType() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue.getDefaultInstance(); - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue build() { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue buildPartial() { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue result = new dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue(this); - result.gattKey_ = gattKey_; - result.serviceKey_ = serviceKey_; - result.key_ = key_; - result.value_ = value_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue) { - return mergeFrom((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue other) { - if (other == dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue.getDefaultInstance()) return this; - if (!other.getGattKey().isEmpty()) { - gattKey_ = other.gattKey_; - onChanged(); - } - if (!other.getServiceKey().isEmpty()) { - serviceKey_ = other.serviceKey_; - onChanged(); - } - if (!other.getKey().isEmpty()) { - key_ = other.key_; - onChanged(); - } - if (other.getValue() != com.google.protobuf.ByteString.EMPTY) { - setValue(other.getValue()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object gattKey_ = ""; - /** - * string gatt_key = 1; - * @return The gattKey. - */ - public java.lang.String getGattKey() { - java.lang.Object ref = gattKey_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - gattKey_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string gatt_key = 1; - * @return The bytes for gattKey. - */ - public com.google.protobuf.ByteString - getGattKeyBytes() { - java.lang.Object ref = gattKey_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - gattKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string gatt_key = 1; - * @param value The gattKey to set. - * @return This builder for chaining. - */ - public Builder setGattKey( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - gattKey_ = value; - onChanged(); - return this; - } - /** - * string gatt_key = 1; - * @return This builder for chaining. - */ - public Builder clearGattKey() { - - gattKey_ = getDefaultInstance().getGattKey(); - onChanged(); - return this; - } - /** - * string gatt_key = 1; - * @param value The bytes for gattKey to set. - * @return This builder for chaining. - */ - public Builder setGattKeyBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - gattKey_ = value; - onChanged(); - return this; - } - - private java.lang.Object serviceKey_ = ""; - /** - * string service_key = 2; - * @return The serviceKey. - */ - public java.lang.String getServiceKey() { - java.lang.Object ref = serviceKey_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - serviceKey_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string service_key = 2; - * @return The bytes for serviceKey. - */ - public com.google.protobuf.ByteString - getServiceKeyBytes() { - java.lang.Object ref = serviceKey_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - serviceKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string service_key = 2; - * @param value The serviceKey to set. - * @return This builder for chaining. - */ - public Builder setServiceKey( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - serviceKey_ = value; - onChanged(); - return this; - } - /** - * string service_key = 2; - * @return This builder for chaining. - */ - public Builder clearServiceKey() { - - serviceKey_ = getDefaultInstance().getServiceKey(); - onChanged(); - return this; - } - /** - * string service_key = 2; - * @param value The bytes for serviceKey to set. - * @return This builder for chaining. - */ - public Builder setServiceKeyBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - serviceKey_ = value; - onChanged(); - return this; - } - - private java.lang.Object key_ = ""; - /** - * string key = 3; - * @return The key. - */ - public java.lang.String getKey() { - java.lang.Object ref = key_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - key_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string key = 3; - * @return The bytes for key. - */ - public com.google.protobuf.ByteString - getKeyBytes() { - java.lang.Object ref = key_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - key_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string key = 3; - * @param value The key to set. - * @return This builder for chaining. - */ - public Builder setKey( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - key_ = value; - onChanged(); - return this; - } - /** - * string key = 3; - * @return This builder for chaining. - */ - public Builder clearKey() { - - key_ = getDefaultInstance().getKey(); - onChanged(); - return this; - } - /** - * string key = 3; - * @param value The bytes for key to set. - * @return This builder for chaining. - */ - public Builder setKeyBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - key_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.ByteString value_ = com.google.protobuf.ByteString.EMPTY; - /** - * bytes value = 4; - * @return The value. - */ - @java.lang.Override - public com.google.protobuf.ByteString getValue() { - return value_; - } - /** - * bytes value = 4; - * @param value The value to set. - * @return This builder for chaining. - */ - public Builder setValue(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - value_ = value; - onChanged(); - return this; - } - /** - * bytes value = 4; - * @return This builder for chaining. - */ - public Builder clearValue() { - - value_ = getDefaultInstance().getValue(); - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:dev.yanshouwang.bluetooth_low_energy.GattCharacteristicValue) - } - - // @@protoc_insertion_point(class_scope:dev.yanshouwang.bluetooth_low_energy.GattCharacteristicValue) - private static final dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue(); - } - - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GattCharacteristicValue parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GattCharacteristicValue(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface GattDescriptorReadArgumentsOrBuilder extends - // @@protoc_insertion_point(interface_extends:dev.yanshouwang.bluetooth_low_energy.GattDescriptorReadArguments) - com.google.protobuf.MessageOrBuilder { - - /** - * string gatt_key = 1; - * @return The gattKey. - */ - java.lang.String getGattKey(); - /** - * string gatt_key = 1; - * @return The bytes for gattKey. - */ - com.google.protobuf.ByteString - getGattKeyBytes(); - - /** - * string service_key = 2; - * @return The serviceKey. - */ - java.lang.String getServiceKey(); - /** - * string service_key = 2; - * @return The bytes for serviceKey. - */ - com.google.protobuf.ByteString - getServiceKeyBytes(); - - /** - * string characteristic_key = 3; - * @return The characteristicKey. - */ - java.lang.String getCharacteristicKey(); - /** - * string characteristic_key = 3; - * @return The bytes for characteristicKey. - */ - com.google.protobuf.ByteString - getCharacteristicKeyBytes(); - - /** - * string key = 4; - * @return The key. - */ - java.lang.String getKey(); - /** - * string key = 4; - * @return The bytes for key. - */ - com.google.protobuf.ByteString - getKeyBytes(); - } - /** - * Protobuf type {@code dev.yanshouwang.bluetooth_low_energy.GattDescriptorReadArguments} - */ - public static final class GattDescriptorReadArguments extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:dev.yanshouwang.bluetooth_low_energy.GattDescriptorReadArguments) - GattDescriptorReadArgumentsOrBuilder { - private static final long serialVersionUID = 0L; - // Use GattDescriptorReadArguments.newBuilder() to construct. - private GattDescriptorReadArguments(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private GattDescriptorReadArguments() { - gattKey_ = ""; - serviceKey_ = ""; - characteristicKey_ = ""; - key_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new GattDescriptorReadArguments(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private GattDescriptorReadArguments( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - gattKey_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - serviceKey_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - characteristicKey_ = s; - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - key_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattDescriptorReadArguments_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattDescriptorReadArguments_fieldAccessorTable - .ensureFieldAccessorsInitialized( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments.class, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments.Builder.class); - } - - public static final int GATT_KEY_FIELD_NUMBER = 1; - private volatile java.lang.Object gattKey_; - /** - * string gatt_key = 1; - * @return The gattKey. - */ - @java.lang.Override - public java.lang.String getGattKey() { - java.lang.Object ref = gattKey_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - gattKey_ = s; - return s; - } - } - /** - * string gatt_key = 1; - * @return The bytes for gattKey. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getGattKeyBytes() { - java.lang.Object ref = gattKey_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - gattKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SERVICE_KEY_FIELD_NUMBER = 2; - private volatile java.lang.Object serviceKey_; - /** - * string service_key = 2; - * @return The serviceKey. - */ - @java.lang.Override - public java.lang.String getServiceKey() { - java.lang.Object ref = serviceKey_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - serviceKey_ = s; - return s; - } - } - /** - * string service_key = 2; - * @return The bytes for serviceKey. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getServiceKeyBytes() { - java.lang.Object ref = serviceKey_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - serviceKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CHARACTERISTIC_KEY_FIELD_NUMBER = 3; - private volatile java.lang.Object characteristicKey_; - /** - * string characteristic_key = 3; - * @return The characteristicKey. - */ - @java.lang.Override - public java.lang.String getCharacteristicKey() { - java.lang.Object ref = characteristicKey_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - characteristicKey_ = s; - return s; - } - } - /** - * string characteristic_key = 3; - * @return The bytes for characteristicKey. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getCharacteristicKeyBytes() { - java.lang.Object ref = characteristicKey_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - characteristicKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int KEY_FIELD_NUMBER = 4; - private volatile java.lang.Object key_; - /** - * string key = 4; - * @return The key. - */ - @java.lang.Override - public java.lang.String getKey() { - java.lang.Object ref = key_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - key_ = s; - return s; - } - } - /** - * string key = 4; - * @return The bytes for key. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getKeyBytes() { - java.lang.Object ref = key_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - key_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getGattKeyBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, gattKey_); - } - if (!getServiceKeyBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, serviceKey_); - } - if (!getCharacteristicKeyBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, characteristicKey_); - } - if (!getKeyBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, key_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getGattKeyBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, gattKey_); - } - if (!getServiceKeyBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, serviceKey_); - } - if (!getCharacteristicKeyBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, characteristicKey_); - } - if (!getKeyBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, key_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments)) { - return super.equals(obj); - } - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments other = (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments) obj; - - if (!getGattKey() - .equals(other.getGattKey())) return false; - if (!getServiceKey() - .equals(other.getServiceKey())) return false; - if (!getCharacteristicKey() - .equals(other.getCharacteristicKey())) return false; - if (!getKey() - .equals(other.getKey())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + GATT_KEY_FIELD_NUMBER; - hash = (53 * hash) + getGattKey().hashCode(); - hash = (37 * hash) + SERVICE_KEY_FIELD_NUMBER; - hash = (53 * hash) + getServiceKey().hashCode(); - hash = (37 * hash) + CHARACTERISTIC_KEY_FIELD_NUMBER; - hash = (53 * hash) + getCharacteristicKey().hashCode(); - hash = (37 * hash) + KEY_FIELD_NUMBER; - hash = (53 * hash) + getKey().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code dev.yanshouwang.bluetooth_low_energy.GattDescriptorReadArguments} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:dev.yanshouwang.bluetooth_low_energy.GattDescriptorReadArguments) - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArgumentsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattDescriptorReadArguments_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattDescriptorReadArguments_fieldAccessorTable - .ensureFieldAccessorsInitialized( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments.class, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments.Builder.class); - } - - // Construct using dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - gattKey_ = ""; - - serviceKey_ = ""; - - characteristicKey_ = ""; - - key_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattDescriptorReadArguments_descriptor; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments getDefaultInstanceForType() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments.getDefaultInstance(); - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments build() { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments buildPartial() { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments result = new dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments(this); - result.gattKey_ = gattKey_; - result.serviceKey_ = serviceKey_; - result.characteristicKey_ = characteristicKey_; - result.key_ = key_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments) { - return mergeFrom((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments other) { - if (other == dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments.getDefaultInstance()) return this; - if (!other.getGattKey().isEmpty()) { - gattKey_ = other.gattKey_; - onChanged(); - } - if (!other.getServiceKey().isEmpty()) { - serviceKey_ = other.serviceKey_; - onChanged(); - } - if (!other.getCharacteristicKey().isEmpty()) { - characteristicKey_ = other.characteristicKey_; - onChanged(); - } - if (!other.getKey().isEmpty()) { - key_ = other.key_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object gattKey_ = ""; - /** - * string gatt_key = 1; - * @return The gattKey. - */ - public java.lang.String getGattKey() { - java.lang.Object ref = gattKey_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - gattKey_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string gatt_key = 1; - * @return The bytes for gattKey. - */ - public com.google.protobuf.ByteString - getGattKeyBytes() { - java.lang.Object ref = gattKey_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - gattKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string gatt_key = 1; - * @param value The gattKey to set. - * @return This builder for chaining. - */ - public Builder setGattKey( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - gattKey_ = value; - onChanged(); - return this; - } - /** - * string gatt_key = 1; - * @return This builder for chaining. - */ - public Builder clearGattKey() { - - gattKey_ = getDefaultInstance().getGattKey(); - onChanged(); - return this; - } - /** - * string gatt_key = 1; - * @param value The bytes for gattKey to set. - * @return This builder for chaining. - */ - public Builder setGattKeyBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - gattKey_ = value; - onChanged(); - return this; - } - - private java.lang.Object serviceKey_ = ""; - /** - * string service_key = 2; - * @return The serviceKey. - */ - public java.lang.String getServiceKey() { - java.lang.Object ref = serviceKey_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - serviceKey_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string service_key = 2; - * @return The bytes for serviceKey. - */ - public com.google.protobuf.ByteString - getServiceKeyBytes() { - java.lang.Object ref = serviceKey_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - serviceKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string service_key = 2; - * @param value The serviceKey to set. - * @return This builder for chaining. - */ - public Builder setServiceKey( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - serviceKey_ = value; - onChanged(); - return this; - } - /** - * string service_key = 2; - * @return This builder for chaining. - */ - public Builder clearServiceKey() { - - serviceKey_ = getDefaultInstance().getServiceKey(); - onChanged(); - return this; - } - /** - * string service_key = 2; - * @param value The bytes for serviceKey to set. - * @return This builder for chaining. - */ - public Builder setServiceKeyBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - serviceKey_ = value; - onChanged(); - return this; - } - - private java.lang.Object characteristicKey_ = ""; - /** - * string characteristic_key = 3; - * @return The characteristicKey. - */ - public java.lang.String getCharacteristicKey() { - java.lang.Object ref = characteristicKey_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - characteristicKey_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string characteristic_key = 3; - * @return The bytes for characteristicKey. - */ - public com.google.protobuf.ByteString - getCharacteristicKeyBytes() { - java.lang.Object ref = characteristicKey_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - characteristicKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string characteristic_key = 3; - * @param value The characteristicKey to set. - * @return This builder for chaining. - */ - public Builder setCharacteristicKey( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - characteristicKey_ = value; - onChanged(); - return this; - } - /** - * string characteristic_key = 3; - * @return This builder for chaining. - */ - public Builder clearCharacteristicKey() { - - characteristicKey_ = getDefaultInstance().getCharacteristicKey(); - onChanged(); - return this; - } - /** - * string characteristic_key = 3; - * @param value The bytes for characteristicKey to set. - * @return This builder for chaining. - */ - public Builder setCharacteristicKeyBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - characteristicKey_ = value; - onChanged(); - return this; - } - - private java.lang.Object key_ = ""; - /** - * string key = 4; - * @return The key. - */ - public java.lang.String getKey() { - java.lang.Object ref = key_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - key_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string key = 4; - * @return The bytes for key. - */ - public com.google.protobuf.ByteString - getKeyBytes() { - java.lang.Object ref = key_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - key_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string key = 4; - * @param value The key to set. - * @return This builder for chaining. - */ - public Builder setKey( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - key_ = value; - onChanged(); - return this; - } - /** - * string key = 4; - * @return This builder for chaining. - */ - public Builder clearKey() { - - key_ = getDefaultInstance().getKey(); - onChanged(); - return this; - } - /** - * string key = 4; - * @param value The bytes for key to set. - * @return This builder for chaining. - */ - public Builder setKeyBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - key_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:dev.yanshouwang.bluetooth_low_energy.GattDescriptorReadArguments) - } - - // @@protoc_insertion_point(class_scope:dev.yanshouwang.bluetooth_low_energy.GattDescriptorReadArguments) - private static final dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments(); - } - - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GattDescriptorReadArguments parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GattDescriptorReadArguments(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface GattDescriptorWriteArgumentsOrBuilder extends - // @@protoc_insertion_point(interface_extends:dev.yanshouwang.bluetooth_low_energy.GattDescriptorWriteArguments) - com.google.protobuf.MessageOrBuilder { - - /** - * string gatt_key = 1; - * @return The gattKey. - */ - java.lang.String getGattKey(); - /** - * string gatt_key = 1; - * @return The bytes for gattKey. - */ - com.google.protobuf.ByteString - getGattKeyBytes(); - - /** - * string service_key = 2; - * @return The serviceKey. - */ - java.lang.String getServiceKey(); - /** - * string service_key = 2; - * @return The bytes for serviceKey. - */ - com.google.protobuf.ByteString - getServiceKeyBytes(); - - /** - * string characteristic_key = 3; - * @return The characteristicKey. - */ - java.lang.String getCharacteristicKey(); - /** - * string characteristic_key = 3; - * @return The bytes for characteristicKey. - */ - com.google.protobuf.ByteString - getCharacteristicKeyBytes(); - - /** - * string key = 4; - * @return The key. - */ - java.lang.String getKey(); - /** - * string key = 4; - * @return The bytes for key. - */ - com.google.protobuf.ByteString - getKeyBytes(); - - /** - * bytes value = 5; - * @return The value. - */ - com.google.protobuf.ByteString getValue(); - } - /** - * Protobuf type {@code dev.yanshouwang.bluetooth_low_energy.GattDescriptorWriteArguments} - */ - public static final class GattDescriptorWriteArguments extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:dev.yanshouwang.bluetooth_low_energy.GattDescriptorWriteArguments) - GattDescriptorWriteArgumentsOrBuilder { - private static final long serialVersionUID = 0L; - // Use GattDescriptorWriteArguments.newBuilder() to construct. - private GattDescriptorWriteArguments(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private GattDescriptorWriteArguments() { - gattKey_ = ""; - serviceKey_ = ""; - characteristicKey_ = ""; - key_ = ""; - value_ = com.google.protobuf.ByteString.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new GattDescriptorWriteArguments(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private GattDescriptorWriteArguments( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - gattKey_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - serviceKey_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - characteristicKey_ = s; - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - key_ = s; - break; - } - case 42: { - - value_ = input.readBytes(); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattDescriptorWriteArguments_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattDescriptorWriteArguments_fieldAccessorTable - .ensureFieldAccessorsInitialized( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments.class, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments.Builder.class); - } - - public static final int GATT_KEY_FIELD_NUMBER = 1; - private volatile java.lang.Object gattKey_; - /** - * string gatt_key = 1; - * @return The gattKey. - */ - @java.lang.Override - public java.lang.String getGattKey() { - java.lang.Object ref = gattKey_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - gattKey_ = s; - return s; - } - } - /** - * string gatt_key = 1; - * @return The bytes for gattKey. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getGattKeyBytes() { - java.lang.Object ref = gattKey_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - gattKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SERVICE_KEY_FIELD_NUMBER = 2; - private volatile java.lang.Object serviceKey_; - /** - * string service_key = 2; - * @return The serviceKey. - */ - @java.lang.Override - public java.lang.String getServiceKey() { - java.lang.Object ref = serviceKey_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - serviceKey_ = s; - return s; - } - } - /** - * string service_key = 2; - * @return The bytes for serviceKey. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getServiceKeyBytes() { - java.lang.Object ref = serviceKey_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - serviceKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CHARACTERISTIC_KEY_FIELD_NUMBER = 3; - private volatile java.lang.Object characteristicKey_; - /** - * string characteristic_key = 3; - * @return The characteristicKey. - */ - @java.lang.Override - public java.lang.String getCharacteristicKey() { - java.lang.Object ref = characteristicKey_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - characteristicKey_ = s; - return s; - } - } - /** - * string characteristic_key = 3; - * @return The bytes for characteristicKey. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getCharacteristicKeyBytes() { - java.lang.Object ref = characteristicKey_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - characteristicKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int KEY_FIELD_NUMBER = 4; - private volatile java.lang.Object key_; - /** - * string key = 4; - * @return The key. - */ - @java.lang.Override - public java.lang.String getKey() { - java.lang.Object ref = key_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - key_ = s; - return s; - } - } - /** - * string key = 4; - * @return The bytes for key. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getKeyBytes() { - java.lang.Object ref = key_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - key_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int VALUE_FIELD_NUMBER = 5; - private com.google.protobuf.ByteString value_; - /** - * bytes value = 5; - * @return The value. - */ - @java.lang.Override - public com.google.protobuf.ByteString getValue() { - return value_; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getGattKeyBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, gattKey_); - } - if (!getServiceKeyBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, serviceKey_); - } - if (!getCharacteristicKeyBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, characteristicKey_); - } - if (!getKeyBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, key_); - } - if (!value_.isEmpty()) { - output.writeBytes(5, value_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getGattKeyBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, gattKey_); - } - if (!getServiceKeyBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, serviceKey_); - } - if (!getCharacteristicKeyBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, characteristicKey_); - } - if (!getKeyBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, key_); - } - if (!value_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(5, value_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments)) { - return super.equals(obj); - } - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments other = (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments) obj; - - if (!getGattKey() - .equals(other.getGattKey())) return false; - if (!getServiceKey() - .equals(other.getServiceKey())) return false; - if (!getCharacteristicKey() - .equals(other.getCharacteristicKey())) return false; - if (!getKey() - .equals(other.getKey())) return false; - if (!getValue() - .equals(other.getValue())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + GATT_KEY_FIELD_NUMBER; - hash = (53 * hash) + getGattKey().hashCode(); - hash = (37 * hash) + SERVICE_KEY_FIELD_NUMBER; - hash = (53 * hash) + getServiceKey().hashCode(); - hash = (37 * hash) + CHARACTERISTIC_KEY_FIELD_NUMBER; - hash = (53 * hash) + getCharacteristicKey().hashCode(); - hash = (37 * hash) + KEY_FIELD_NUMBER; - hash = (53 * hash) + getKey().hashCode(); - hash = (37 * hash) + VALUE_FIELD_NUMBER; - hash = (53 * hash) + getValue().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code dev.yanshouwang.bluetooth_low_energy.GattDescriptorWriteArguments} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:dev.yanshouwang.bluetooth_low_energy.GattDescriptorWriteArguments) - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArgumentsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattDescriptorWriteArguments_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattDescriptorWriteArguments_fieldAccessorTable - .ensureFieldAccessorsInitialized( - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments.class, dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments.Builder.class); - } - - // Construct using dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - gattKey_ = ""; - - serviceKey_ = ""; - - characteristicKey_ = ""; - - key_ = ""; - - value_ = com.google.protobuf.ByteString.EMPTY; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.internal_static_dev_yanshouwang_bluetooth_low_energy_GattDescriptorWriteArguments_descriptor; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments getDefaultInstanceForType() { - return dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments.getDefaultInstance(); - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments build() { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments buildPartial() { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments result = new dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments(this); - result.gattKey_ = gattKey_; - result.serviceKey_ = serviceKey_; - result.characteristicKey_ = characteristicKey_; - result.key_ = key_; - result.value_ = value_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments) { - return mergeFrom((dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments other) { - if (other == dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments.getDefaultInstance()) return this; - if (!other.getGattKey().isEmpty()) { - gattKey_ = other.gattKey_; - onChanged(); - } - if (!other.getServiceKey().isEmpty()) { - serviceKey_ = other.serviceKey_; - onChanged(); - } - if (!other.getCharacteristicKey().isEmpty()) { - characteristicKey_ = other.characteristicKey_; - onChanged(); - } - if (!other.getKey().isEmpty()) { - key_ = other.key_; - onChanged(); - } - if (other.getValue() != com.google.protobuf.ByteString.EMPTY) { - setValue(other.getValue()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object gattKey_ = ""; - /** - * string gatt_key = 1; - * @return The gattKey. - */ - public java.lang.String getGattKey() { - java.lang.Object ref = gattKey_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - gattKey_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string gatt_key = 1; - * @return The bytes for gattKey. - */ - public com.google.protobuf.ByteString - getGattKeyBytes() { - java.lang.Object ref = gattKey_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - gattKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string gatt_key = 1; - * @param value The gattKey to set. - * @return This builder for chaining. - */ - public Builder setGattKey( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - gattKey_ = value; - onChanged(); - return this; - } - /** - * string gatt_key = 1; - * @return This builder for chaining. - */ - public Builder clearGattKey() { - - gattKey_ = getDefaultInstance().getGattKey(); - onChanged(); - return this; - } - /** - * string gatt_key = 1; - * @param value The bytes for gattKey to set. - * @return This builder for chaining. - */ - public Builder setGattKeyBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - gattKey_ = value; - onChanged(); - return this; - } - - private java.lang.Object serviceKey_ = ""; - /** - * string service_key = 2; - * @return The serviceKey. - */ - public java.lang.String getServiceKey() { - java.lang.Object ref = serviceKey_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - serviceKey_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string service_key = 2; - * @return The bytes for serviceKey. - */ - public com.google.protobuf.ByteString - getServiceKeyBytes() { - java.lang.Object ref = serviceKey_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - serviceKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string service_key = 2; - * @param value The serviceKey to set. - * @return This builder for chaining. - */ - public Builder setServiceKey( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - serviceKey_ = value; - onChanged(); - return this; - } - /** - * string service_key = 2; - * @return This builder for chaining. - */ - public Builder clearServiceKey() { - - serviceKey_ = getDefaultInstance().getServiceKey(); - onChanged(); - return this; - } - /** - * string service_key = 2; - * @param value The bytes for serviceKey to set. - * @return This builder for chaining. - */ - public Builder setServiceKeyBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - serviceKey_ = value; - onChanged(); - return this; - } - - private java.lang.Object characteristicKey_ = ""; - /** - * string characteristic_key = 3; - * @return The characteristicKey. - */ - public java.lang.String getCharacteristicKey() { - java.lang.Object ref = characteristicKey_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - characteristicKey_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string characteristic_key = 3; - * @return The bytes for characteristicKey. - */ - public com.google.protobuf.ByteString - getCharacteristicKeyBytes() { - java.lang.Object ref = characteristicKey_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - characteristicKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string characteristic_key = 3; - * @param value The characteristicKey to set. - * @return This builder for chaining. - */ - public Builder setCharacteristicKey( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - characteristicKey_ = value; - onChanged(); - return this; - } - /** - * string characteristic_key = 3; - * @return This builder for chaining. - */ - public Builder clearCharacteristicKey() { - - characteristicKey_ = getDefaultInstance().getCharacteristicKey(); - onChanged(); - return this; - } - /** - * string characteristic_key = 3; - * @param value The bytes for characteristicKey to set. - * @return This builder for chaining. - */ - public Builder setCharacteristicKeyBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - characteristicKey_ = value; - onChanged(); - return this; - } - - private java.lang.Object key_ = ""; - /** - * string key = 4; - * @return The key. - */ - public java.lang.String getKey() { - java.lang.Object ref = key_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - key_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string key = 4; - * @return The bytes for key. - */ - public com.google.protobuf.ByteString - getKeyBytes() { - java.lang.Object ref = key_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - key_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string key = 4; - * @param value The key to set. - * @return This builder for chaining. - */ - public Builder setKey( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - key_ = value; - onChanged(); - return this; - } - /** - * string key = 4; - * @return This builder for chaining. - */ - public Builder clearKey() { - - key_ = getDefaultInstance().getKey(); - onChanged(); - return this; - } - /** - * string key = 4; - * @param value The bytes for key to set. - * @return This builder for chaining. - */ - public Builder setKeyBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - key_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.ByteString value_ = com.google.protobuf.ByteString.EMPTY; - /** - * bytes value = 5; - * @return The value. - */ - @java.lang.Override - public com.google.protobuf.ByteString getValue() { - return value_; - } - /** - * bytes value = 5; - * @param value The value to set. - * @return This builder for chaining. - */ - public Builder setValue(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - value_ = value; - onChanged(); - return this; - } - /** - * bytes value = 5; - * @return This builder for chaining. - */ - public Builder clearValue() { - - value_ = getDefaultInstance().getValue(); - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:dev.yanshouwang.bluetooth_low_energy.GattDescriptorWriteArguments) - } - - // @@protoc_insertion_point(class_scope:dev.yanshouwang.bluetooth_low_energy.GattDescriptorWriteArguments) - private static final dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments(); - } - - public static dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GattDescriptorWriteArguments parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GattDescriptorWriteArguments(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_dev_yanshouwang_bluetooth_low_energy_Message_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_dev_yanshouwang_bluetooth_low_energy_Message_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_dev_yanshouwang_bluetooth_low_energy_StartDiscoveryArguments_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_dev_yanshouwang_bluetooth_low_energy_StartDiscoveryArguments_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_dev_yanshouwang_bluetooth_low_energy_Discovery_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_dev_yanshouwang_bluetooth_low_energy_Discovery_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_dev_yanshouwang_bluetooth_low_energy_ConnectArguments_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_dev_yanshouwang_bluetooth_low_energy_ConnectArguments_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_dev_yanshouwang_bluetooth_low_energy_GATT_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_dev_yanshouwang_bluetooth_low_energy_GATT_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_dev_yanshouwang_bluetooth_low_energy_GattService_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_dev_yanshouwang_bluetooth_low_energy_GattService_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristic_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristic_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_dev_yanshouwang_bluetooth_low_energy_GattDescriptor_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_dev_yanshouwang_bluetooth_low_energy_GattDescriptor_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_dev_yanshouwang_bluetooth_low_energy_GattDisconnectArguments_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_dev_yanshouwang_bluetooth_low_energy_GattDisconnectArguments_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_dev_yanshouwang_bluetooth_low_energy_GattConnectionLost_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_dev_yanshouwang_bluetooth_low_energy_GattConnectionLost_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicReadArguments_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicReadArguments_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicWriteArguments_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicWriteArguments_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicNotifyArguments_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicNotifyArguments_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicValue_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicValue_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_dev_yanshouwang_bluetooth_low_energy_GattDescriptorReadArguments_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_dev_yanshouwang_bluetooth_low_energy_GattDescriptorReadArguments_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_dev_yanshouwang_bluetooth_low_energy_GattDescriptorWriteArguments_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_dev_yanshouwang_bluetooth_low_energy_GattDescriptorWriteArguments_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n\rmessage.proto\022$dev.yanshouwang.bluetoo" + - "th_low_energy\"\314\t\n\007Message\022G\n\010category\030\001 " + - "\001(\01625.dev.yanshouwang.bluetooth_low_ener" + - "gy.MessageCategory\022E\n\005state\030\002 \001(\01624.dev." + - "yanshouwang.bluetooth_low_energy.Bluetoo" + - "thStateH\000\022`\n\027startDiscoveryArguments\030\003 \001" + - "(\0132=.dev.yanshouwang.bluetooth_low_energ" + - "y.StartDiscoveryArgumentsH\000\022D\n\tdiscovery" + - "\030\004 \001(\0132/.dev.yanshouwang.bluetooth_low_e" + - "nergy.DiscoveryH\000\022R\n\020connectArguments\030\005 " + - "\001(\01326.dev.yanshouwang.bluetooth_low_ener" + - "gy.ConnectArgumentsH\000\022\\\n\023disconnectArgum" + - "ents\030\006 \001(\0132=.dev.yanshouwang.bluetooth_l" + - "ow_energy.GattDisconnectArgumentsH\000\022R\n\016c" + - "onnectionLost\030\007 \001(\01328.dev.yanshouwang.bl" + - "uetooth_low_energy.GattConnectionLostH\000\022" + - "l\n\033characteristicReadArguments\030\010 \001(\0132E.d" + - "ev.yanshouwang.bluetooth_low_energy.Gatt" + - "CharacteristicReadArgumentsH\000\022n\n\034charact" + - "eristicWriteArguments\030\t \001(\0132F.dev.yansho" + - "uwang.bluetooth_low_energy.GattCharacter" + - "isticWriteArgumentsH\000\022p\n\035characteristicN" + - "otifyArguments\030\n \001(\0132G.dev.yanshouwang.b" + - "luetooth_low_energy.GattCharacteristicNo" + - "tifyArgumentsH\000\022\\\n\023characteristicValue\030\013" + - " \001(\0132=.dev.yanshouwang.bluetooth_low_ene" + - "rgy.GattCharacteristicValueH\000\022d\n\027descrip" + - "torReadArguments\030\014 \001(\0132A.dev.yanshouwang" + - ".bluetooth_low_energy.GattDescriptorRead" + - "ArgumentsH\000\022f\n\030descriptorWriteArguments\030" + - "\r \001(\0132B.dev.yanshouwang.bluetooth_low_en" + - "ergy.GattDescriptorWriteArgumentsH\000B\007\n\005v" + - "alue\"+\n\027StartDiscoveryArguments\022\020\n\010servi" + - "ces\030\001 \003(\t\"T\n\tDiscovery\022\014\n\004uuid\030\001 \001(\t\022\014\n\004" + - "rssi\030\002 \001(\021\022\026\n\016advertisements\030\003 \001(\014\022\023\n\013co" + - "nnectable\030\004 \001(\010\" \n\020ConnectArguments\022\014\n\004u" + - "uid\030\001 \001(\t\"t\n\004GATT\022\013\n\003key\030\001 \001(\t\022\032\n\022maximu" + - "mWriteLength\030\002 \001(\005\022C\n\010services\030\003 \003(\01321.d" + - "ev.yanshouwang.bluetooth_low_energy.Gatt" + - "Service\"{\n\013GattService\022\013\n\003key\030\001 \001(\t\022\014\n\004u" + - "uid\030\002 \001(\t\022Q\n\017characteristics\030\003 \003(\01328.dev" + - ".yanshouwang.bluetooth_low_energy.GattCh" + - "aracteristic\"\321\001\n\022GattCharacteristic\022\013\n\003k" + - "ey\030\001 \001(\t\022\014\n\004uuid\030\002 \001(\t\022\017\n\007canRead\030\003 \001(\010\022" + - "\020\n\010canWrite\030\004 \001(\010\022\037\n\027canWriteWithoutResp" + - "onse\030\005 \001(\010\022\021\n\tcanNotify\030\006 \001(\010\022I\n\013descrip" + - "tors\030\007 \003(\01324.dev.yanshouwang.bluetooth_l" + - "ow_energy.GattDescriptor\"+\n\016GattDescript" + - "or\022\013\n\003key\030\001 \001(\t\022\014\n\004uuid\030\002 \001(\t\"&\n\027GattDis" + - "connectArguments\022\013\n\003key\030\001 \001(\t\"0\n\022GattCon" + - "nectionLost\022\013\n\003key\030\001 \001(\t\022\r\n\005error\030\002 \001(\t\"" + - "U\n\037GattCharacteristicReadArguments\022\020\n\010ga" + - "tt_key\030\001 \001(\t\022\023\n\013service_key\030\002 \001(\t\022\013\n\003key" + - "\030\003 \001(\t\"~\n GattCharacteristicWriteArgumen" + - "ts\022\020\n\010gatt_key\030\001 \001(\t\022\023\n\013service_key\030\002 \001(" + - "\t\022\013\n\003key\030\003 \001(\t\022\r\n\005value\030\004 \001(\014\022\027\n\017without" + - "Response\030\005 \001(\010\"f\n!GattCharacteristicNoti" + - "fyArguments\022\020\n\010gatt_key\030\001 \001(\t\022\023\n\013service" + - "_key\030\002 \001(\t\022\013\n\003key\030\003 \001(\t\022\r\n\005state\030\004 \001(\010\"\\" + - "\n\027GattCharacteristicValue\022\020\n\010gatt_key\030\001 " + - "\001(\t\022\023\n\013service_key\030\002 \001(\t\022\013\n\003key\030\003 \001(\t\022\r\n" + - "\005value\030\004 \001(\014\"m\n\033GattDescriptorReadArgume" + - "nts\022\020\n\010gatt_key\030\001 \001(\t\022\023\n\013service_key\030\002 \001" + - "(\t\022\032\n\022characteristic_key\030\003 \001(\t\022\013\n\003key\030\004 " + - "\001(\t\"}\n\034GattDescriptorWriteArguments\022\020\n\010g" + - "att_key\030\001 \001(\t\022\023\n\013service_key\030\002 \001(\t\022\032\n\022ch" + - "aracteristic_key\030\003 \001(\t\022\013\n\003key\030\004 \001(\t\022\r\n\005v" + - "alue\030\005 \001(\014*\315\002\n\017MessageCategory\022\023\n\017BLUETO" + - "OTH_STATE\020\000\022\033\n\027CENTRAL_START_DISCOVERY\020\001" + - "\022\032\n\026CENTRAL_STOP_DISCOVERY\020\002\022\026\n\022CENTRAL_" + - "DISCOVERED\020\003\022\023\n\017CENTRAL_CONNECT\020\004\022\023\n\017GAT" + - "T_DISCONNECT\020\005\022\030\n\024GATT_CONNECTION_LOST\020\006" + - "\022\034\n\030GATT_CHARACTERISTIC_READ\020\007\022\035\n\031GATT_C" + - "HARACTERISTIC_WRITE\020\010\022\036\n\032GATT_CHARACTERI" + - "STIC_NOTIFY\020\t\022\030\n\024GATT_DESCRIPTOR_READ\020\n\022" + - "\031\n\025GATT_DESCRIPTOR_WRITE\020\013*B\n\016BluetoothS" + - "tate\022\017\n\013UNSUPPORTED\020\000\022\017\n\013POWERED_OFF\020\001\022\016" + - "\n\nPOWERED_ON\020\002b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_dev_yanshouwang_bluetooth_low_energy_Message_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_dev_yanshouwang_bluetooth_low_energy_Message_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_dev_yanshouwang_bluetooth_low_energy_Message_descriptor, - new java.lang.String[] { "Category", "State", "StartDiscoveryArguments", "Discovery", "ConnectArguments", "DisconnectArguments", "ConnectionLost", "CharacteristicReadArguments", "CharacteristicWriteArguments", "CharacteristicNotifyArguments", "CharacteristicValue", "DescriptorReadArguments", "DescriptorWriteArguments", "Value", }); - internal_static_dev_yanshouwang_bluetooth_low_energy_StartDiscoveryArguments_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_dev_yanshouwang_bluetooth_low_energy_StartDiscoveryArguments_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_dev_yanshouwang_bluetooth_low_energy_StartDiscoveryArguments_descriptor, - new java.lang.String[] { "Services", }); - internal_static_dev_yanshouwang_bluetooth_low_energy_Discovery_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_dev_yanshouwang_bluetooth_low_energy_Discovery_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_dev_yanshouwang_bluetooth_low_energy_Discovery_descriptor, - new java.lang.String[] { "Uuid", "Rssi", "Advertisements", "Connectable", }); - internal_static_dev_yanshouwang_bluetooth_low_energy_ConnectArguments_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_dev_yanshouwang_bluetooth_low_energy_ConnectArguments_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_dev_yanshouwang_bluetooth_low_energy_ConnectArguments_descriptor, - new java.lang.String[] { "Uuid", }); - internal_static_dev_yanshouwang_bluetooth_low_energy_GATT_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_dev_yanshouwang_bluetooth_low_energy_GATT_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_dev_yanshouwang_bluetooth_low_energy_GATT_descriptor, - new java.lang.String[] { "Key", "MaximumWriteLength", "Services", }); - internal_static_dev_yanshouwang_bluetooth_low_energy_GattService_descriptor = - getDescriptor().getMessageTypes().get(5); - internal_static_dev_yanshouwang_bluetooth_low_energy_GattService_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_dev_yanshouwang_bluetooth_low_energy_GattService_descriptor, - new java.lang.String[] { "Key", "Uuid", "Characteristics", }); - internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristic_descriptor = - getDescriptor().getMessageTypes().get(6); - internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristic_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristic_descriptor, - new java.lang.String[] { "Key", "Uuid", "CanRead", "CanWrite", "CanWriteWithoutResponse", "CanNotify", "Descriptors", }); - internal_static_dev_yanshouwang_bluetooth_low_energy_GattDescriptor_descriptor = - getDescriptor().getMessageTypes().get(7); - internal_static_dev_yanshouwang_bluetooth_low_energy_GattDescriptor_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_dev_yanshouwang_bluetooth_low_energy_GattDescriptor_descriptor, - new java.lang.String[] { "Key", "Uuid", }); - internal_static_dev_yanshouwang_bluetooth_low_energy_GattDisconnectArguments_descriptor = - getDescriptor().getMessageTypes().get(8); - internal_static_dev_yanshouwang_bluetooth_low_energy_GattDisconnectArguments_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_dev_yanshouwang_bluetooth_low_energy_GattDisconnectArguments_descriptor, - new java.lang.String[] { "Key", }); - internal_static_dev_yanshouwang_bluetooth_low_energy_GattConnectionLost_descriptor = - getDescriptor().getMessageTypes().get(9); - internal_static_dev_yanshouwang_bluetooth_low_energy_GattConnectionLost_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_dev_yanshouwang_bluetooth_low_energy_GattConnectionLost_descriptor, - new java.lang.String[] { "Key", "Error", }); - internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicReadArguments_descriptor = - getDescriptor().getMessageTypes().get(10); - internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicReadArguments_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicReadArguments_descriptor, - new java.lang.String[] { "GattKey", "ServiceKey", "Key", }); - internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicWriteArguments_descriptor = - getDescriptor().getMessageTypes().get(11); - internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicWriteArguments_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicWriteArguments_descriptor, - new java.lang.String[] { "GattKey", "ServiceKey", "Key", "Value", "WithoutResponse", }); - internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicNotifyArguments_descriptor = - getDescriptor().getMessageTypes().get(12); - internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicNotifyArguments_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicNotifyArguments_descriptor, - new java.lang.String[] { "GattKey", "ServiceKey", "Key", "State", }); - internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicValue_descriptor = - getDescriptor().getMessageTypes().get(13); - internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicValue_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_dev_yanshouwang_bluetooth_low_energy_GattCharacteristicValue_descriptor, - new java.lang.String[] { "GattKey", "ServiceKey", "Key", "Value", }); - internal_static_dev_yanshouwang_bluetooth_low_energy_GattDescriptorReadArguments_descriptor = - getDescriptor().getMessageTypes().get(14); - internal_static_dev_yanshouwang_bluetooth_low_energy_GattDescriptorReadArguments_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_dev_yanshouwang_bluetooth_low_energy_GattDescriptorReadArguments_descriptor, - new java.lang.String[] { "GattKey", "ServiceKey", "CharacteristicKey", "Key", }); - internal_static_dev_yanshouwang_bluetooth_low_energy_GattDescriptorWriteArguments_descriptor = - getDescriptor().getMessageTypes().get(15); - internal_static_dev_yanshouwang_bluetooth_low_energy_GattDescriptorWriteArguments_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_dev_yanshouwang_bluetooth_low_energy_GattDescriptorWriteArguments_descriptor, - new java.lang.String[] { "GattKey", "ServiceKey", "CharacteristicKey", "Key", "Value", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/pigeon/Api.java b/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/pigeon/Api.java new file mode 100644 index 0000000..3c66fb1 --- /dev/null +++ b/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/pigeon/Api.java @@ -0,0 +1,930 @@ +// Autogenerated from Pigeon (v4.0.2), do not edit directly. +// See also: https://pub.dev/packages/pigeon + +package dev.yanshouwang.bluetooth_low_energy.pigeon; + +import android.util.Log; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import io.flutter.plugin.common.BasicMessageChannel; +import io.flutter.plugin.common.BinaryMessenger; +import io.flutter.plugin.common.MessageCodec; +import io.flutter.plugin.common.StandardMessageCodec; +import java.io.ByteArrayOutputStream; +import java.nio.ByteBuffer; +import java.util.Arrays; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.HashMap; + +/** Generated class from Pigeon. */ +@SuppressWarnings({"unused", "unchecked", "CodeBlock2Expr", "RedundantSuppression"}) +public class Api { + + public interface Result { + void success(T result); + void error(Throwable error); + } + private static class CentralManagerHostApiCodec extends StandardMessageCodec { + public static final CentralManagerHostApiCodec INSTANCE = new CentralManagerHostApiCodec(); + private CentralManagerHostApiCodec() {} + } + + /** Generated interface from Pigeon that represents a handler of messages from Flutter.*/ + public interface CentralManagerHostApi { + void authorize(Result result); + @NonNull Long getState(); + void addStateObserver(); + void removeStateObserver(); + void startScan(@Nullable List uuidBuffers, Result result); + void stopScan(); + void connect(@NonNull byte[] uuidBuffer, Result result); + + /** The codec used by CentralManagerHostApi. */ + static MessageCodec getCodec() { + return CentralManagerHostApiCodec.INSTANCE; + } + + /** Sets up an instance of `CentralManagerHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(BinaryMessenger binaryMessenger, CentralManagerHostApi api) { + { + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.CentralManagerHostApi.authorize", getCodec()); + if (api != null) { + channel.setMessageHandler((message, reply) -> { + Map wrapped = new HashMap<>(); + try { + Result resultCallback = new Result() { + public void success(Boolean result) { + wrapped.put("result", result); + reply.reply(wrapped); + } + public void error(Throwable error) { + wrapped.put("error", wrapError(error)); + reply.reply(wrapped); + } + }; + + api.authorize(resultCallback); + } + catch (Error | RuntimeException exception) { + wrapped.put("error", wrapError(exception)); + reply.reply(wrapped); + } + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.CentralManagerHostApi.getState", getCodec()); + if (api != null) { + channel.setMessageHandler((message, reply) -> { + Map wrapped = new HashMap<>(); + try { + Long output = api.getState(); + wrapped.put("result", output); + } + catch (Error | RuntimeException exception) { + wrapped.put("error", wrapError(exception)); + } + reply.reply(wrapped); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.CentralManagerHostApi.addStateObserver", getCodec()); + if (api != null) { + channel.setMessageHandler((message, reply) -> { + Map wrapped = new HashMap<>(); + try { + api.addStateObserver(); + wrapped.put("result", null); + } + catch (Error | RuntimeException exception) { + wrapped.put("error", wrapError(exception)); + } + reply.reply(wrapped); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.CentralManagerHostApi.removeStateObserver", getCodec()); + if (api != null) { + channel.setMessageHandler((message, reply) -> { + Map wrapped = new HashMap<>(); + try { + api.removeStateObserver(); + wrapped.put("result", null); + } + catch (Error | RuntimeException exception) { + wrapped.put("error", wrapError(exception)); + } + reply.reply(wrapped); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.CentralManagerHostApi.startScan", getCodec()); + if (api != null) { + channel.setMessageHandler((message, reply) -> { + Map wrapped = new HashMap<>(); + try { + ArrayList args = (ArrayList)message; + List uuidBuffersArg = (List)args.get(0); + Result resultCallback = new Result() { + public void success(Void result) { + wrapped.put("result", null); + reply.reply(wrapped); + } + public void error(Throwable error) { + wrapped.put("error", wrapError(error)); + reply.reply(wrapped); + } + }; + + api.startScan(uuidBuffersArg, resultCallback); + } + catch (Error | RuntimeException exception) { + wrapped.put("error", wrapError(exception)); + reply.reply(wrapped); + } + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.CentralManagerHostApi.stopScan", getCodec()); + if (api != null) { + channel.setMessageHandler((message, reply) -> { + Map wrapped = new HashMap<>(); + try { + api.stopScan(); + wrapped.put("result", null); + } + catch (Error | RuntimeException exception) { + wrapped.put("error", wrapError(exception)); + } + reply.reply(wrapped); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.CentralManagerHostApi.connect", getCodec()); + if (api != null) { + channel.setMessageHandler((message, reply) -> { + Map wrapped = new HashMap<>(); + try { + ArrayList args = (ArrayList)message; + byte[] uuidBufferArg = (byte[])args.get(0); + if (uuidBufferArg == null) { + throw new NullPointerException("uuidBufferArg unexpectedly null."); + } + Result resultCallback = new Result() { + public void success(byte[] result) { + wrapped.put("result", result); + reply.reply(wrapped); + } + public void error(Throwable error) { + wrapped.put("error", wrapError(error)); + reply.reply(wrapped); + } + }; + + api.connect(uuidBufferArg, resultCallback); + } + catch (Error | RuntimeException exception) { + wrapped.put("error", wrapError(exception)); + reply.reply(wrapped); + } + }); + } else { + channel.setMessageHandler(null); + } + } + } + } + private static class CentralManagerFlutterApiCodec extends StandardMessageCodec { + public static final CentralManagerFlutterApiCodec INSTANCE = new CentralManagerFlutterApiCodec(); + private CentralManagerFlutterApiCodec() {} + } + + /** Generated class from Pigeon that represents Flutter messages that can be called from Java.*/ + public static class CentralManagerFlutterApi { + private final BinaryMessenger binaryMessenger; + public CentralManagerFlutterApi(BinaryMessenger argBinaryMessenger){ + this.binaryMessenger = argBinaryMessenger; + } + public interface Reply { + void reply(T reply); + } + static MessageCodec getCodec() { + return CentralManagerFlutterApiCodec.INSTANCE; + } + + public void notifyState(@NonNull Long stateNumberArg, Reply callback) { + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.CentralManagerFlutterApi.notifyState", getCodec()); + channel.send(new ArrayList(Arrays.asList(stateNumberArg)), channelReply -> { + callback.reply(null); + }); + } + public void notifyAdvertisement(@NonNull byte[] advertisementBufferArg, Reply callback) { + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.CentralManagerFlutterApi.notifyAdvertisement", getCodec()); + channel.send(new ArrayList(Arrays.asList(advertisementBufferArg)), channelReply -> { + callback.reply(null); + }); + } + } + private static class PeripheralHostApiCodec extends StandardMessageCodec { + public static final PeripheralHostApiCodec INSTANCE = new PeripheralHostApiCodec(); + private PeripheralHostApiCodec() {} + } + + /** Generated interface from Pigeon that represents a handler of messages from Flutter.*/ + public interface PeripheralHostApi { + void allocate(@NonNull Long id, @NonNull Long instanceId); + void free(@NonNull Long id); + void disconnect(@NonNull Long id, Result result); + void discoverServices(@NonNull Long id, Result> result); + + /** The codec used by PeripheralHostApi. */ + static MessageCodec getCodec() { + return PeripheralHostApiCodec.INSTANCE; + } + + /** Sets up an instance of `PeripheralHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(BinaryMessenger binaryMessenger, PeripheralHostApi api) { + { + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.PeripheralHostApi.allocate", getCodec()); + if (api != null) { + channel.setMessageHandler((message, reply) -> { + Map wrapped = new HashMap<>(); + try { + ArrayList args = (ArrayList)message; + Number idArg = (Number)args.get(0); + if (idArg == null) { + throw new NullPointerException("idArg unexpectedly null."); + } + Number instanceIdArg = (Number)args.get(1); + if (instanceIdArg == null) { + throw new NullPointerException("instanceIdArg unexpectedly null."); + } + api.allocate((idArg == null) ? null : idArg.longValue(), (instanceIdArg == null) ? null : instanceIdArg.longValue()); + wrapped.put("result", null); + } + catch (Error | RuntimeException exception) { + wrapped.put("error", wrapError(exception)); + } + reply.reply(wrapped); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.PeripheralHostApi.free", getCodec()); + if (api != null) { + channel.setMessageHandler((message, reply) -> { + Map wrapped = new HashMap<>(); + try { + ArrayList args = (ArrayList)message; + Number idArg = (Number)args.get(0); + if (idArg == null) { + throw new NullPointerException("idArg unexpectedly null."); + } + api.free((idArg == null) ? null : idArg.longValue()); + wrapped.put("result", null); + } + catch (Error | RuntimeException exception) { + wrapped.put("error", wrapError(exception)); + } + reply.reply(wrapped); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.PeripheralHostApi.disconnect", getCodec()); + if (api != null) { + channel.setMessageHandler((message, reply) -> { + Map wrapped = new HashMap<>(); + try { + ArrayList args = (ArrayList)message; + Number idArg = (Number)args.get(0); + if (idArg == null) { + throw new NullPointerException("idArg unexpectedly null."); + } + Result resultCallback = new Result() { + public void success(Void result) { + wrapped.put("result", null); + reply.reply(wrapped); + } + public void error(Throwable error) { + wrapped.put("error", wrapError(error)); + reply.reply(wrapped); + } + }; + + api.disconnect((idArg == null) ? null : idArg.longValue(), resultCallback); + } + catch (Error | RuntimeException exception) { + wrapped.put("error", wrapError(exception)); + reply.reply(wrapped); + } + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.PeripheralHostApi.discoverServices", getCodec()); + if (api != null) { + channel.setMessageHandler((message, reply) -> { + Map wrapped = new HashMap<>(); + try { + ArrayList args = (ArrayList)message; + Number idArg = (Number)args.get(0); + if (idArg == null) { + throw new NullPointerException("idArg unexpectedly null."); + } + Result> resultCallback = new Result>() { + public void success(List result) { + wrapped.put("result", result); + reply.reply(wrapped); + } + public void error(Throwable error) { + wrapped.put("error", wrapError(error)); + reply.reply(wrapped); + } + }; + + api.discoverServices((idArg == null) ? null : idArg.longValue(), resultCallback); + } + catch (Error | RuntimeException exception) { + wrapped.put("error", wrapError(exception)); + reply.reply(wrapped); + } + }); + } else { + channel.setMessageHandler(null); + } + } + } + } + private static class PeripheralFlutterApiCodec extends StandardMessageCodec { + public static final PeripheralFlutterApiCodec INSTANCE = new PeripheralFlutterApiCodec(); + private PeripheralFlutterApiCodec() {} + } + + /** Generated class from Pigeon that represents Flutter messages that can be called from Java.*/ + public static class PeripheralFlutterApi { + private final BinaryMessenger binaryMessenger; + public PeripheralFlutterApi(BinaryMessenger argBinaryMessenger){ + this.binaryMessenger = argBinaryMessenger; + } + public interface Reply { + void reply(T reply); + } + static MessageCodec getCodec() { + return PeripheralFlutterApiCodec.INSTANCE; + } + + public void notifyConnectionLost(@NonNull Long idArg, @NonNull byte[] errorBufferArg, Reply callback) { + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.PeripheralFlutterApi.notifyConnectionLost", getCodec()); + channel.send(new ArrayList(Arrays.asList(idArg, errorBufferArg)), channelReply -> { + callback.reply(null); + }); + } + } + private static class GattServiceHostApiCodec extends StandardMessageCodec { + public static final GattServiceHostApiCodec INSTANCE = new GattServiceHostApiCodec(); + private GattServiceHostApiCodec() {} + } + + /** Generated interface from Pigeon that represents a handler of messages from Flutter.*/ + public interface GattServiceHostApi { + void allocate(@NonNull Long id, @NonNull Long instanceId); + void free(@NonNull Long id); + void discoverCharacteristics(@NonNull Long id, Result> result); + + /** The codec used by GattServiceHostApi. */ + static MessageCodec getCodec() { + return GattServiceHostApiCodec.INSTANCE; + } + + /** Sets up an instance of `GattServiceHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(BinaryMessenger binaryMessenger, GattServiceHostApi api) { + { + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.GattServiceHostApi.allocate", getCodec()); + if (api != null) { + channel.setMessageHandler((message, reply) -> { + Map wrapped = new HashMap<>(); + try { + ArrayList args = (ArrayList)message; + Number idArg = (Number)args.get(0); + if (idArg == null) { + throw new NullPointerException("idArg unexpectedly null."); + } + Number instanceIdArg = (Number)args.get(1); + if (instanceIdArg == null) { + throw new NullPointerException("instanceIdArg unexpectedly null."); + } + api.allocate((idArg == null) ? null : idArg.longValue(), (instanceIdArg == null) ? null : instanceIdArg.longValue()); + wrapped.put("result", null); + } + catch (Error | RuntimeException exception) { + wrapped.put("error", wrapError(exception)); + } + reply.reply(wrapped); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.GattServiceHostApi.free", getCodec()); + if (api != null) { + channel.setMessageHandler((message, reply) -> { + Map wrapped = new HashMap<>(); + try { + ArrayList args = (ArrayList)message; + Number idArg = (Number)args.get(0); + if (idArg == null) { + throw new NullPointerException("idArg unexpectedly null."); + } + api.free((idArg == null) ? null : idArg.longValue()); + wrapped.put("result", null); + } + catch (Error | RuntimeException exception) { + wrapped.put("error", wrapError(exception)); + } + reply.reply(wrapped); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.GattServiceHostApi.discoverCharacteristics", getCodec()); + if (api != null) { + channel.setMessageHandler((message, reply) -> { + Map wrapped = new HashMap<>(); + try { + ArrayList args = (ArrayList)message; + Number idArg = (Number)args.get(0); + if (idArg == null) { + throw new NullPointerException("idArg unexpectedly null."); + } + Result> resultCallback = new Result>() { + public void success(List result) { + wrapped.put("result", result); + reply.reply(wrapped); + } + public void error(Throwable error) { + wrapped.put("error", wrapError(error)); + reply.reply(wrapped); + } + }; + + api.discoverCharacteristics((idArg == null) ? null : idArg.longValue(), resultCallback); + } + catch (Error | RuntimeException exception) { + wrapped.put("error", wrapError(exception)); + reply.reply(wrapped); + } + }); + } else { + channel.setMessageHandler(null); + } + } + } + } + private static class GattCharacteristicHostApiCodec extends StandardMessageCodec { + public static final GattCharacteristicHostApiCodec INSTANCE = new GattCharacteristicHostApiCodec(); + private GattCharacteristicHostApiCodec() {} + } + + /** Generated interface from Pigeon that represents a handler of messages from Flutter.*/ + public interface GattCharacteristicHostApi { + void allocate(@NonNull Long id, @NonNull Long instanceId); + void free(@NonNull Long id); + void discoverDescriptors(@NonNull Long id, Result> result); + void read(@NonNull Long id, Result result); + void write(@NonNull Long id, @NonNull byte[] value, @NonNull Boolean withoutResponse, Result result); + void setNotify(@NonNull Long id, @NonNull Boolean value, Result result); + + /** The codec used by GattCharacteristicHostApi. */ + static MessageCodec getCodec() { + return GattCharacteristicHostApiCodec.INSTANCE; + } + + /** Sets up an instance of `GattCharacteristicHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(BinaryMessenger binaryMessenger, GattCharacteristicHostApi api) { + { + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.GattCharacteristicHostApi.allocate", getCodec()); + if (api != null) { + channel.setMessageHandler((message, reply) -> { + Map wrapped = new HashMap<>(); + try { + ArrayList args = (ArrayList)message; + Number idArg = (Number)args.get(0); + if (idArg == null) { + throw new NullPointerException("idArg unexpectedly null."); + } + Number instanceIdArg = (Number)args.get(1); + if (instanceIdArg == null) { + throw new NullPointerException("instanceIdArg unexpectedly null."); + } + api.allocate((idArg == null) ? null : idArg.longValue(), (instanceIdArg == null) ? null : instanceIdArg.longValue()); + wrapped.put("result", null); + } + catch (Error | RuntimeException exception) { + wrapped.put("error", wrapError(exception)); + } + reply.reply(wrapped); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.GattCharacteristicHostApi.free", getCodec()); + if (api != null) { + channel.setMessageHandler((message, reply) -> { + Map wrapped = new HashMap<>(); + try { + ArrayList args = (ArrayList)message; + Number idArg = (Number)args.get(0); + if (idArg == null) { + throw new NullPointerException("idArg unexpectedly null."); + } + api.free((idArg == null) ? null : idArg.longValue()); + wrapped.put("result", null); + } + catch (Error | RuntimeException exception) { + wrapped.put("error", wrapError(exception)); + } + reply.reply(wrapped); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.GattCharacteristicHostApi.discoverDescriptors", getCodec()); + if (api != null) { + channel.setMessageHandler((message, reply) -> { + Map wrapped = new HashMap<>(); + try { + ArrayList args = (ArrayList)message; + Number idArg = (Number)args.get(0); + if (idArg == null) { + throw new NullPointerException("idArg unexpectedly null."); + } + Result> resultCallback = new Result>() { + public void success(List result) { + wrapped.put("result", result); + reply.reply(wrapped); + } + public void error(Throwable error) { + wrapped.put("error", wrapError(error)); + reply.reply(wrapped); + } + }; + + api.discoverDescriptors((idArg == null) ? null : idArg.longValue(), resultCallback); + } + catch (Error | RuntimeException exception) { + wrapped.put("error", wrapError(exception)); + reply.reply(wrapped); + } + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.GattCharacteristicHostApi.read", getCodec()); + if (api != null) { + channel.setMessageHandler((message, reply) -> { + Map wrapped = new HashMap<>(); + try { + ArrayList args = (ArrayList)message; + Number idArg = (Number)args.get(0); + if (idArg == null) { + throw new NullPointerException("idArg unexpectedly null."); + } + Result resultCallback = new Result() { + public void success(byte[] result) { + wrapped.put("result", result); + reply.reply(wrapped); + } + public void error(Throwable error) { + wrapped.put("error", wrapError(error)); + reply.reply(wrapped); + } + }; + + api.read((idArg == null) ? null : idArg.longValue(), resultCallback); + } + catch (Error | RuntimeException exception) { + wrapped.put("error", wrapError(exception)); + reply.reply(wrapped); + } + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.GattCharacteristicHostApi.write", getCodec()); + if (api != null) { + channel.setMessageHandler((message, reply) -> { + Map wrapped = new HashMap<>(); + try { + ArrayList args = (ArrayList)message; + Number idArg = (Number)args.get(0); + if (idArg == null) { + throw new NullPointerException("idArg unexpectedly null."); + } + byte[] valueArg = (byte[])args.get(1); + if (valueArg == null) { + throw new NullPointerException("valueArg unexpectedly null."); + } + Boolean withoutResponseArg = (Boolean)args.get(2); + if (withoutResponseArg == null) { + throw new NullPointerException("withoutResponseArg unexpectedly null."); + } + Result resultCallback = new Result() { + public void success(Void result) { + wrapped.put("result", null); + reply.reply(wrapped); + } + public void error(Throwable error) { + wrapped.put("error", wrapError(error)); + reply.reply(wrapped); + } + }; + + api.write((idArg == null) ? null : idArg.longValue(), valueArg, withoutResponseArg, resultCallback); + } + catch (Error | RuntimeException exception) { + wrapped.put("error", wrapError(exception)); + reply.reply(wrapped); + } + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.GattCharacteristicHostApi.setNotify", getCodec()); + if (api != null) { + channel.setMessageHandler((message, reply) -> { + Map wrapped = new HashMap<>(); + try { + ArrayList args = (ArrayList)message; + Number idArg = (Number)args.get(0); + if (idArg == null) { + throw new NullPointerException("idArg unexpectedly null."); + } + Boolean valueArg = (Boolean)args.get(1); + if (valueArg == null) { + throw new NullPointerException("valueArg unexpectedly null."); + } + Result resultCallback = new Result() { + public void success(Void result) { + wrapped.put("result", null); + reply.reply(wrapped); + } + public void error(Throwable error) { + wrapped.put("error", wrapError(error)); + reply.reply(wrapped); + } + }; + + api.setNotify((idArg == null) ? null : idArg.longValue(), valueArg, resultCallback); + } + catch (Error | RuntimeException exception) { + wrapped.put("error", wrapError(exception)); + reply.reply(wrapped); + } + }); + } else { + channel.setMessageHandler(null); + } + } + } + } + private static class GattCharacteristicFlutterApiCodec extends StandardMessageCodec { + public static final GattCharacteristicFlutterApiCodec INSTANCE = new GattCharacteristicFlutterApiCodec(); + private GattCharacteristicFlutterApiCodec() {} + } + + /** Generated class from Pigeon that represents Flutter messages that can be called from Java.*/ + public static class GattCharacteristicFlutterApi { + private final BinaryMessenger binaryMessenger; + public GattCharacteristicFlutterApi(BinaryMessenger argBinaryMessenger){ + this.binaryMessenger = argBinaryMessenger; + } + public interface Reply { + void reply(T reply); + } + static MessageCodec getCodec() { + return GattCharacteristicFlutterApiCodec.INSTANCE; + } + + public void notifyValue(@NonNull Long idArg, @NonNull byte[] valueArg, Reply callback) { + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.GattCharacteristicFlutterApi.notifyValue", getCodec()); + channel.send(new ArrayList(Arrays.asList(idArg, valueArg)), channelReply -> { + callback.reply(null); + }); + } + } + private static class GattDescriptorHostApiCodec extends StandardMessageCodec { + public static final GattDescriptorHostApiCodec INSTANCE = new GattDescriptorHostApiCodec(); + private GattDescriptorHostApiCodec() {} + } + + /** Generated interface from Pigeon that represents a handler of messages from Flutter.*/ + public interface GattDescriptorHostApi { + void allocate(@NonNull Long id, @NonNull Long instanceId); + void free(@NonNull Long id); + void read(@NonNull Long id, Result result); + void write(@NonNull Long id, @NonNull byte[] value, Result result); + + /** The codec used by GattDescriptorHostApi. */ + static MessageCodec getCodec() { + return GattDescriptorHostApiCodec.INSTANCE; + } + + /** Sets up an instance of `GattDescriptorHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(BinaryMessenger binaryMessenger, GattDescriptorHostApi api) { + { + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.GattDescriptorHostApi.allocate", getCodec()); + if (api != null) { + channel.setMessageHandler((message, reply) -> { + Map wrapped = new HashMap<>(); + try { + ArrayList args = (ArrayList)message; + Number idArg = (Number)args.get(0); + if (idArg == null) { + throw new NullPointerException("idArg unexpectedly null."); + } + Number instanceIdArg = (Number)args.get(1); + if (instanceIdArg == null) { + throw new NullPointerException("instanceIdArg unexpectedly null."); + } + api.allocate((idArg == null) ? null : idArg.longValue(), (instanceIdArg == null) ? null : instanceIdArg.longValue()); + wrapped.put("result", null); + } + catch (Error | RuntimeException exception) { + wrapped.put("error", wrapError(exception)); + } + reply.reply(wrapped); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.GattDescriptorHostApi.free", getCodec()); + if (api != null) { + channel.setMessageHandler((message, reply) -> { + Map wrapped = new HashMap<>(); + try { + ArrayList args = (ArrayList)message; + Number idArg = (Number)args.get(0); + if (idArg == null) { + throw new NullPointerException("idArg unexpectedly null."); + } + api.free((idArg == null) ? null : idArg.longValue()); + wrapped.put("result", null); + } + catch (Error | RuntimeException exception) { + wrapped.put("error", wrapError(exception)); + } + reply.reply(wrapped); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.GattDescriptorHostApi.read", getCodec()); + if (api != null) { + channel.setMessageHandler((message, reply) -> { + Map wrapped = new HashMap<>(); + try { + ArrayList args = (ArrayList)message; + Number idArg = (Number)args.get(0); + if (idArg == null) { + throw new NullPointerException("idArg unexpectedly null."); + } + Result resultCallback = new Result() { + public void success(byte[] result) { + wrapped.put("result", result); + reply.reply(wrapped); + } + public void error(Throwable error) { + wrapped.put("error", wrapError(error)); + reply.reply(wrapped); + } + }; + + api.read((idArg == null) ? null : idArg.longValue(), resultCallback); + } + catch (Error | RuntimeException exception) { + wrapped.put("error", wrapError(exception)); + reply.reply(wrapped); + } + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.GattDescriptorHostApi.write", getCodec()); + if (api != null) { + channel.setMessageHandler((message, reply) -> { + Map wrapped = new HashMap<>(); + try { + ArrayList args = (ArrayList)message; + Number idArg = (Number)args.get(0); + if (idArg == null) { + throw new NullPointerException("idArg unexpectedly null."); + } + byte[] valueArg = (byte[])args.get(1); + if (valueArg == null) { + throw new NullPointerException("valueArg unexpectedly null."); + } + Result resultCallback = new Result() { + public void success(Void result) { + wrapped.put("result", null); + reply.reply(wrapped); + } + public void error(Throwable error) { + wrapped.put("error", wrapError(error)); + reply.reply(wrapped); + } + }; + + api.write((idArg == null) ? null : idArg.longValue(), valueArg, resultCallback); + } + catch (Error | RuntimeException exception) { + wrapped.put("error", wrapError(exception)); + reply.reply(wrapped); + } + }); + } else { + channel.setMessageHandler(null); + } + } + } + } + private static Map wrapError(Throwable exception) { + Map errorMap = new HashMap<>(); + errorMap.put("message", exception.toString()); + errorMap.put("code", exception.getClass().getSimpleName()); + errorMap.put("details", "Cause: " + exception.getCause() + ", Stacktrace: " + Log.getStackTraceString(exception)); + return errorMap; + } +} diff --git a/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/Advertisement.java b/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/Advertisement.java new file mode 100644 index 0000000..ff590a0 --- /dev/null +++ b/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/Advertisement.java @@ -0,0 +1,2198 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: proto/messages.proto + +package dev.yanshouwang.bluetooth_low_energy.proto; + +/** + * Protobuf type {@code proto.Advertisement} + */ +public final class Advertisement extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:proto.Advertisement) + AdvertisementOrBuilder { +private static final long serialVersionUID = 0L; + // Use Advertisement.newBuilder() to construct. + private Advertisement(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Advertisement() { + data_ = com.google.protobuf.ByteString.EMPTY; + localName_ = ""; + manufacturerSpecificData_ = com.google.protobuf.ByteString.EMPTY; + serviceDatas_ = java.util.Collections.emptyList(); + serviceUuids_ = java.util.Collections.emptyList(); + solicitedServiceUuids_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Advertisement(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Advertisement( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder subBuilder = null; + if (uuid_ != null) { + subBuilder = uuid_.toBuilder(); + } + uuid_ = input.readMessage(dev.yanshouwang.bluetooth_low_energy.proto.UUID.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(uuid_); + uuid_ = subBuilder.buildPartial(); + } + + break; + } + case 16: { + + rssi_ = input.readInt32(); + break; + } + case 24: { + bitField0_ |= 0x00000001; + connectable_ = input.readBool(); + break; + } + case 34: { + + data_ = input.readBytes(); + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + localName_ = s; + break; + } + case 50: { + + manufacturerSpecificData_ = input.readBytes(); + break; + } + case 58: { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + serviceDatas_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + serviceDatas_.add( + input.readMessage(dev.yanshouwang.bluetooth_low_energy.proto.ServiceData.parser(), extensionRegistry)); + break; + } + case 66: { + if (!((mutable_bitField0_ & 0x00000008) != 0)) { + serviceUuids_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000008; + } + serviceUuids_.add( + input.readMessage(dev.yanshouwang.bluetooth_low_energy.proto.UUID.parser(), extensionRegistry)); + break; + } + case 74: { + if (!((mutable_bitField0_ & 0x00000010) != 0)) { + solicitedServiceUuids_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000010; + } + solicitedServiceUuids_.add( + input.readMessage(dev.yanshouwang.bluetooth_low_energy.proto.UUID.parser(), extensionRegistry)); + break; + } + case 80: { + bitField0_ |= 0x00000004; + txPowerLevel_ = input.readInt32(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000004) != 0)) { + serviceDatas_ = java.util.Collections.unmodifiableList(serviceDatas_); + } + if (((mutable_bitField0_ & 0x00000008) != 0)) { + serviceUuids_ = java.util.Collections.unmodifiableList(serviceUuids_); + } + if (((mutable_bitField0_ & 0x00000010) != 0)) { + solicitedServiceUuids_ = java.util.Collections.unmodifiableList(solicitedServiceUuids_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_Advertisement_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_Advertisement_fieldAccessorTable + .ensureFieldAccessorsInitialized( + dev.yanshouwang.bluetooth_low_energy.proto.Advertisement.class, dev.yanshouwang.bluetooth_low_energy.proto.Advertisement.Builder.class); + } + + private int bitField0_; + public static final int UUID_FIELD_NUMBER = 1; + private dev.yanshouwang.bluetooth_low_energy.proto.UUID uuid_; + /** + * .proto.UUID uuid = 1; + * @return Whether the uuid field is set. + */ + @java.lang.Override + public boolean hasUuid() { + return uuid_ != null; + } + /** + * .proto.UUID uuid = 1; + * @return The uuid. + */ + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.UUID getUuid() { + return uuid_ == null ? dev.yanshouwang.bluetooth_low_energy.proto.UUID.getDefaultInstance() : uuid_; + } + /** + * .proto.UUID uuid = 1; + */ + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder getUuidOrBuilder() { + return getUuid(); + } + + public static final int RSSI_FIELD_NUMBER = 2; + private int rssi_; + /** + * int32 rssi = 2; + * @return The rssi. + */ + @java.lang.Override + public int getRssi() { + return rssi_; + } + + public static final int CONNECTABLE_FIELD_NUMBER = 3; + private boolean connectable_; + /** + * optional bool connectable = 3; + * @return Whether the connectable field is set. + */ + @java.lang.Override + public boolean hasConnectable() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional bool connectable = 3; + * @return The connectable. + */ + @java.lang.Override + public boolean getConnectable() { + return connectable_; + } + + public static final int DATA_FIELD_NUMBER = 4; + private com.google.protobuf.ByteString data_; + /** + * bytes data = 4; + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.ByteString getData() { + return data_; + } + + public static final int LOCAL_NAME_FIELD_NUMBER = 5; + private volatile java.lang.Object localName_; + /** + * optional string local_name = 5; + * @return Whether the localName field is set. + */ + @java.lang.Override + public boolean hasLocalName() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional string local_name = 5; + * @return The localName. + */ + @java.lang.Override + public java.lang.String getLocalName() { + java.lang.Object ref = localName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + localName_ = s; + return s; + } + } + /** + * optional string local_name = 5; + * @return The bytes for localName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getLocalNameBytes() { + java.lang.Object ref = localName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + localName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MANUFACTURER_SPECIFIC_DATA_FIELD_NUMBER = 6; + private com.google.protobuf.ByteString manufacturerSpecificData_; + /** + * bytes manufacturer_specific_data = 6; + * @return The manufacturerSpecificData. + */ + @java.lang.Override + public com.google.protobuf.ByteString getManufacturerSpecificData() { + return manufacturerSpecificData_; + } + + public static final int SERVICE_DATAS_FIELD_NUMBER = 7; + private java.util.List serviceDatas_; + /** + * repeated .proto.ServiceData service_datas = 7; + */ + @java.lang.Override + public java.util.List getServiceDatasList() { + return serviceDatas_; + } + /** + * repeated .proto.ServiceData service_datas = 7; + */ + @java.lang.Override + public java.util.List + getServiceDatasOrBuilderList() { + return serviceDatas_; + } + /** + * repeated .proto.ServiceData service_datas = 7; + */ + @java.lang.Override + public int getServiceDatasCount() { + return serviceDatas_.size(); + } + /** + * repeated .proto.ServiceData service_datas = 7; + */ + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.ServiceData getServiceDatas(int index) { + return serviceDatas_.get(index); + } + /** + * repeated .proto.ServiceData service_datas = 7; + */ + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.ServiceDataOrBuilder getServiceDatasOrBuilder( + int index) { + return serviceDatas_.get(index); + } + + public static final int SERVICE_UUIDS_FIELD_NUMBER = 8; + private java.util.List serviceUuids_; + /** + * repeated .proto.UUID service_uuids = 8; + */ + @java.lang.Override + public java.util.List getServiceUuidsList() { + return serviceUuids_; + } + /** + * repeated .proto.UUID service_uuids = 8; + */ + @java.lang.Override + public java.util.List + getServiceUuidsOrBuilderList() { + return serviceUuids_; + } + /** + * repeated .proto.UUID service_uuids = 8; + */ + @java.lang.Override + public int getServiceUuidsCount() { + return serviceUuids_.size(); + } + /** + * repeated .proto.UUID service_uuids = 8; + */ + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.UUID getServiceUuids(int index) { + return serviceUuids_.get(index); + } + /** + * repeated .proto.UUID service_uuids = 8; + */ + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder getServiceUuidsOrBuilder( + int index) { + return serviceUuids_.get(index); + } + + public static final int SOLICITED_SERVICE_UUIDS_FIELD_NUMBER = 9; + private java.util.List solicitedServiceUuids_; + /** + * repeated .proto.UUID solicited_service_uuids = 9; + */ + @java.lang.Override + public java.util.List getSolicitedServiceUuidsList() { + return solicitedServiceUuids_; + } + /** + * repeated .proto.UUID solicited_service_uuids = 9; + */ + @java.lang.Override + public java.util.List + getSolicitedServiceUuidsOrBuilderList() { + return solicitedServiceUuids_; + } + /** + * repeated .proto.UUID solicited_service_uuids = 9; + */ + @java.lang.Override + public int getSolicitedServiceUuidsCount() { + return solicitedServiceUuids_.size(); + } + /** + * repeated .proto.UUID solicited_service_uuids = 9; + */ + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.UUID getSolicitedServiceUuids(int index) { + return solicitedServiceUuids_.get(index); + } + /** + * repeated .proto.UUID solicited_service_uuids = 9; + */ + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder getSolicitedServiceUuidsOrBuilder( + int index) { + return solicitedServiceUuids_.get(index); + } + + public static final int TX_POWER_LEVEL_FIELD_NUMBER = 10; + private int txPowerLevel_; + /** + * optional int32 tx_power_level = 10; + * @return Whether the txPowerLevel field is set. + */ + @java.lang.Override + public boolean hasTxPowerLevel() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * optional int32 tx_power_level = 10; + * @return The txPowerLevel. + */ + @java.lang.Override + public int getTxPowerLevel() { + return txPowerLevel_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (uuid_ != null) { + output.writeMessage(1, getUuid()); + } + if (rssi_ != 0) { + output.writeInt32(2, rssi_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeBool(3, connectable_); + } + if (!data_.isEmpty()) { + output.writeBytes(4, data_); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, localName_); + } + if (!manufacturerSpecificData_.isEmpty()) { + output.writeBytes(6, manufacturerSpecificData_); + } + for (int i = 0; i < serviceDatas_.size(); i++) { + output.writeMessage(7, serviceDatas_.get(i)); + } + for (int i = 0; i < serviceUuids_.size(); i++) { + output.writeMessage(8, serviceUuids_.get(i)); + } + for (int i = 0; i < solicitedServiceUuids_.size(); i++) { + output.writeMessage(9, solicitedServiceUuids_.get(i)); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeInt32(10, txPowerLevel_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (uuid_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getUuid()); + } + if (rssi_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, rssi_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, connectable_); + } + if (!data_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(4, data_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, localName_); + } + if (!manufacturerSpecificData_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(6, manufacturerSpecificData_); + } + for (int i = 0; i < serviceDatas_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, serviceDatas_.get(i)); + } + for (int i = 0; i < serviceUuids_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, serviceUuids_.get(i)); + } + for (int i = 0; i < solicitedServiceUuids_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(9, solicitedServiceUuids_.get(i)); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(10, txPowerLevel_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof dev.yanshouwang.bluetooth_low_energy.proto.Advertisement)) { + return super.equals(obj); + } + dev.yanshouwang.bluetooth_low_energy.proto.Advertisement other = (dev.yanshouwang.bluetooth_low_energy.proto.Advertisement) obj; + + if (hasUuid() != other.hasUuid()) return false; + if (hasUuid()) { + if (!getUuid() + .equals(other.getUuid())) return false; + } + if (getRssi() + != other.getRssi()) return false; + if (hasConnectable() != other.hasConnectable()) return false; + if (hasConnectable()) { + if (getConnectable() + != other.getConnectable()) return false; + } + if (!getData() + .equals(other.getData())) return false; + if (hasLocalName() != other.hasLocalName()) return false; + if (hasLocalName()) { + if (!getLocalName() + .equals(other.getLocalName())) return false; + } + if (!getManufacturerSpecificData() + .equals(other.getManufacturerSpecificData())) return false; + if (!getServiceDatasList() + .equals(other.getServiceDatasList())) return false; + if (!getServiceUuidsList() + .equals(other.getServiceUuidsList())) return false; + if (!getSolicitedServiceUuidsList() + .equals(other.getSolicitedServiceUuidsList())) return false; + if (hasTxPowerLevel() != other.hasTxPowerLevel()) return false; + if (hasTxPowerLevel()) { + if (getTxPowerLevel() + != other.getTxPowerLevel()) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasUuid()) { + hash = (37 * hash) + UUID_FIELD_NUMBER; + hash = (53 * hash) + getUuid().hashCode(); + } + hash = (37 * hash) + RSSI_FIELD_NUMBER; + hash = (53 * hash) + getRssi(); + if (hasConnectable()) { + hash = (37 * hash) + CONNECTABLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getConnectable()); + } + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + getData().hashCode(); + if (hasLocalName()) { + hash = (37 * hash) + LOCAL_NAME_FIELD_NUMBER; + hash = (53 * hash) + getLocalName().hashCode(); + } + hash = (37 * hash) + MANUFACTURER_SPECIFIC_DATA_FIELD_NUMBER; + hash = (53 * hash) + getManufacturerSpecificData().hashCode(); + if (getServiceDatasCount() > 0) { + hash = (37 * hash) + SERVICE_DATAS_FIELD_NUMBER; + hash = (53 * hash) + getServiceDatasList().hashCode(); + } + if (getServiceUuidsCount() > 0) { + hash = (37 * hash) + SERVICE_UUIDS_FIELD_NUMBER; + hash = (53 * hash) + getServiceUuidsList().hashCode(); + } + if (getSolicitedServiceUuidsCount() > 0) { + hash = (37 * hash) + SOLICITED_SERVICE_UUIDS_FIELD_NUMBER; + hash = (53 * hash) + getSolicitedServiceUuidsList().hashCode(); + } + if (hasTxPowerLevel()) { + hash = (37 * hash) + TX_POWER_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + getTxPowerLevel(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static dev.yanshouwang.bluetooth_low_energy.proto.Advertisement parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.Advertisement parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.Advertisement parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.Advertisement parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.Advertisement parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.Advertisement parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.Advertisement parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.Advertisement parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.Advertisement parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.Advertisement parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.Advertisement parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.Advertisement parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(dev.yanshouwang.bluetooth_low_energy.proto.Advertisement prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code proto.Advertisement} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:proto.Advertisement) + dev.yanshouwang.bluetooth_low_energy.proto.AdvertisementOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_Advertisement_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_Advertisement_fieldAccessorTable + .ensureFieldAccessorsInitialized( + dev.yanshouwang.bluetooth_low_energy.proto.Advertisement.class, dev.yanshouwang.bluetooth_low_energy.proto.Advertisement.Builder.class); + } + + // Construct using dev.yanshouwang.bluetooth_low_energy.proto.Advertisement.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getServiceDatasFieldBuilder(); + getServiceUuidsFieldBuilder(); + getSolicitedServiceUuidsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (uuidBuilder_ == null) { + uuid_ = null; + } else { + uuid_ = null; + uuidBuilder_ = null; + } + rssi_ = 0; + + connectable_ = false; + bitField0_ = (bitField0_ & ~0x00000001); + data_ = com.google.protobuf.ByteString.EMPTY; + + localName_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + manufacturerSpecificData_ = com.google.protobuf.ByteString.EMPTY; + + if (serviceDatasBuilder_ == null) { + serviceDatas_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + serviceDatasBuilder_.clear(); + } + if (serviceUuidsBuilder_ == null) { + serviceUuids_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + } else { + serviceUuidsBuilder_.clear(); + } + if (solicitedServiceUuidsBuilder_ == null) { + solicitedServiceUuids_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + } else { + solicitedServiceUuidsBuilder_.clear(); + } + txPowerLevel_ = 0; + bitField0_ = (bitField0_ & ~0x00000020); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_Advertisement_descriptor; + } + + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.Advertisement getDefaultInstanceForType() { + return dev.yanshouwang.bluetooth_low_energy.proto.Advertisement.getDefaultInstance(); + } + + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.Advertisement build() { + dev.yanshouwang.bluetooth_low_energy.proto.Advertisement result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.Advertisement buildPartial() { + dev.yanshouwang.bluetooth_low_energy.proto.Advertisement result = new dev.yanshouwang.bluetooth_low_energy.proto.Advertisement(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (uuidBuilder_ == null) { + result.uuid_ = uuid_; + } else { + result.uuid_ = uuidBuilder_.build(); + } + result.rssi_ = rssi_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.connectable_ = connectable_; + to_bitField0_ |= 0x00000001; + } + result.data_ = data_; + if (((from_bitField0_ & 0x00000002) != 0)) { + to_bitField0_ |= 0x00000002; + } + result.localName_ = localName_; + result.manufacturerSpecificData_ = manufacturerSpecificData_; + if (serviceDatasBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + serviceDatas_ = java.util.Collections.unmodifiableList(serviceDatas_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.serviceDatas_ = serviceDatas_; + } else { + result.serviceDatas_ = serviceDatasBuilder_.build(); + } + if (serviceUuidsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + serviceUuids_ = java.util.Collections.unmodifiableList(serviceUuids_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.serviceUuids_ = serviceUuids_; + } else { + result.serviceUuids_ = serviceUuidsBuilder_.build(); + } + if (solicitedServiceUuidsBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0)) { + solicitedServiceUuids_ = java.util.Collections.unmodifiableList(solicitedServiceUuids_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.solicitedServiceUuids_ = solicitedServiceUuids_; + } else { + result.solicitedServiceUuids_ = solicitedServiceUuidsBuilder_.build(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.txPowerLevel_ = txPowerLevel_; + to_bitField0_ |= 0x00000004; + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof dev.yanshouwang.bluetooth_low_energy.proto.Advertisement) { + return mergeFrom((dev.yanshouwang.bluetooth_low_energy.proto.Advertisement)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(dev.yanshouwang.bluetooth_low_energy.proto.Advertisement other) { + if (other == dev.yanshouwang.bluetooth_low_energy.proto.Advertisement.getDefaultInstance()) return this; + if (other.hasUuid()) { + mergeUuid(other.getUuid()); + } + if (other.getRssi() != 0) { + setRssi(other.getRssi()); + } + if (other.hasConnectable()) { + setConnectable(other.getConnectable()); + } + if (other.getData() != com.google.protobuf.ByteString.EMPTY) { + setData(other.getData()); + } + if (other.hasLocalName()) { + bitField0_ |= 0x00000002; + localName_ = other.localName_; + onChanged(); + } + if (other.getManufacturerSpecificData() != com.google.protobuf.ByteString.EMPTY) { + setManufacturerSpecificData(other.getManufacturerSpecificData()); + } + if (serviceDatasBuilder_ == null) { + if (!other.serviceDatas_.isEmpty()) { + if (serviceDatas_.isEmpty()) { + serviceDatas_ = other.serviceDatas_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureServiceDatasIsMutable(); + serviceDatas_.addAll(other.serviceDatas_); + } + onChanged(); + } + } else { + if (!other.serviceDatas_.isEmpty()) { + if (serviceDatasBuilder_.isEmpty()) { + serviceDatasBuilder_.dispose(); + serviceDatasBuilder_ = null; + serviceDatas_ = other.serviceDatas_; + bitField0_ = (bitField0_ & ~0x00000004); + serviceDatasBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getServiceDatasFieldBuilder() : null; + } else { + serviceDatasBuilder_.addAllMessages(other.serviceDatas_); + } + } + } + if (serviceUuidsBuilder_ == null) { + if (!other.serviceUuids_.isEmpty()) { + if (serviceUuids_.isEmpty()) { + serviceUuids_ = other.serviceUuids_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureServiceUuidsIsMutable(); + serviceUuids_.addAll(other.serviceUuids_); + } + onChanged(); + } + } else { + if (!other.serviceUuids_.isEmpty()) { + if (serviceUuidsBuilder_.isEmpty()) { + serviceUuidsBuilder_.dispose(); + serviceUuidsBuilder_ = null; + serviceUuids_ = other.serviceUuids_; + bitField0_ = (bitField0_ & ~0x00000008); + serviceUuidsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getServiceUuidsFieldBuilder() : null; + } else { + serviceUuidsBuilder_.addAllMessages(other.serviceUuids_); + } + } + } + if (solicitedServiceUuidsBuilder_ == null) { + if (!other.solicitedServiceUuids_.isEmpty()) { + if (solicitedServiceUuids_.isEmpty()) { + solicitedServiceUuids_ = other.solicitedServiceUuids_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureSolicitedServiceUuidsIsMutable(); + solicitedServiceUuids_.addAll(other.solicitedServiceUuids_); + } + onChanged(); + } + } else { + if (!other.solicitedServiceUuids_.isEmpty()) { + if (solicitedServiceUuidsBuilder_.isEmpty()) { + solicitedServiceUuidsBuilder_.dispose(); + solicitedServiceUuidsBuilder_ = null; + solicitedServiceUuids_ = other.solicitedServiceUuids_; + bitField0_ = (bitField0_ & ~0x00000010); + solicitedServiceUuidsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSolicitedServiceUuidsFieldBuilder() : null; + } else { + solicitedServiceUuidsBuilder_.addAllMessages(other.solicitedServiceUuids_); + } + } + } + if (other.hasTxPowerLevel()) { + setTxPowerLevel(other.getTxPowerLevel()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + dev.yanshouwang.bluetooth_low_energy.proto.Advertisement parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (dev.yanshouwang.bluetooth_low_energy.proto.Advertisement) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private dev.yanshouwang.bluetooth_low_energy.proto.UUID uuid_; + private com.google.protobuf.SingleFieldBuilderV3< + dev.yanshouwang.bluetooth_low_energy.proto.UUID, dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder, dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder> uuidBuilder_; + /** + * .proto.UUID uuid = 1; + * @return Whether the uuid field is set. + */ + public boolean hasUuid() { + return uuidBuilder_ != null || uuid_ != null; + } + /** + * .proto.UUID uuid = 1; + * @return The uuid. + */ + public dev.yanshouwang.bluetooth_low_energy.proto.UUID getUuid() { + if (uuidBuilder_ == null) { + return uuid_ == null ? dev.yanshouwang.bluetooth_low_energy.proto.UUID.getDefaultInstance() : uuid_; + } else { + return uuidBuilder_.getMessage(); + } + } + /** + * .proto.UUID uuid = 1; + */ + public Builder setUuid(dev.yanshouwang.bluetooth_low_energy.proto.UUID value) { + if (uuidBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + uuid_ = value; + onChanged(); + } else { + uuidBuilder_.setMessage(value); + } + + return this; + } + /** + * .proto.UUID uuid = 1; + */ + public Builder setUuid( + dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder builderForValue) { + if (uuidBuilder_ == null) { + uuid_ = builderForValue.build(); + onChanged(); + } else { + uuidBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .proto.UUID uuid = 1; + */ + public Builder mergeUuid(dev.yanshouwang.bluetooth_low_energy.proto.UUID value) { + if (uuidBuilder_ == null) { + if (uuid_ != null) { + uuid_ = + dev.yanshouwang.bluetooth_low_energy.proto.UUID.newBuilder(uuid_).mergeFrom(value).buildPartial(); + } else { + uuid_ = value; + } + onChanged(); + } else { + uuidBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .proto.UUID uuid = 1; + */ + public Builder clearUuid() { + if (uuidBuilder_ == null) { + uuid_ = null; + onChanged(); + } else { + uuid_ = null; + uuidBuilder_ = null; + } + + return this; + } + /** + * .proto.UUID uuid = 1; + */ + public dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder getUuidBuilder() { + + onChanged(); + return getUuidFieldBuilder().getBuilder(); + } + /** + * .proto.UUID uuid = 1; + */ + public dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder getUuidOrBuilder() { + if (uuidBuilder_ != null) { + return uuidBuilder_.getMessageOrBuilder(); + } else { + return uuid_ == null ? + dev.yanshouwang.bluetooth_low_energy.proto.UUID.getDefaultInstance() : uuid_; + } + } + /** + * .proto.UUID uuid = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + dev.yanshouwang.bluetooth_low_energy.proto.UUID, dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder, dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder> + getUuidFieldBuilder() { + if (uuidBuilder_ == null) { + uuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + dev.yanshouwang.bluetooth_low_energy.proto.UUID, dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder, dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder>( + getUuid(), + getParentForChildren(), + isClean()); + uuid_ = null; + } + return uuidBuilder_; + } + + private int rssi_ ; + /** + * int32 rssi = 2; + * @return The rssi. + */ + @java.lang.Override + public int getRssi() { + return rssi_; + } + /** + * int32 rssi = 2; + * @param value The rssi to set. + * @return This builder for chaining. + */ + public Builder setRssi(int value) { + + rssi_ = value; + onChanged(); + return this; + } + /** + * int32 rssi = 2; + * @return This builder for chaining. + */ + public Builder clearRssi() { + + rssi_ = 0; + onChanged(); + return this; + } + + private boolean connectable_ ; + /** + * optional bool connectable = 3; + * @return Whether the connectable field is set. + */ + @java.lang.Override + public boolean hasConnectable() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional bool connectable = 3; + * @return The connectable. + */ + @java.lang.Override + public boolean getConnectable() { + return connectable_; + } + /** + * optional bool connectable = 3; + * @param value The connectable to set. + * @return This builder for chaining. + */ + public Builder setConnectable(boolean value) { + bitField0_ |= 0x00000001; + connectable_ = value; + onChanged(); + return this; + } + /** + * optional bool connectable = 3; + * @return This builder for chaining. + */ + public Builder clearConnectable() { + bitField0_ = (bitField0_ & ~0x00000001); + connectable_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes data = 4; + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.ByteString getData() { + return data_; + } + /** + * bytes data = 4; + * @param value The data to set. + * @return This builder for chaining. + */ + public Builder setData(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + data_ = value; + onChanged(); + return this; + } + /** + * bytes data = 4; + * @return This builder for chaining. + */ + public Builder clearData() { + + data_ = getDefaultInstance().getData(); + onChanged(); + return this; + } + + private java.lang.Object localName_ = ""; + /** + * optional string local_name = 5; + * @return Whether the localName field is set. + */ + public boolean hasLocalName() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional string local_name = 5; + * @return The localName. + */ + public java.lang.String getLocalName() { + java.lang.Object ref = localName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + localName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string local_name = 5; + * @return The bytes for localName. + */ + public com.google.protobuf.ByteString + getLocalNameBytes() { + java.lang.Object ref = localName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + localName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string local_name = 5; + * @param value The localName to set. + * @return This builder for chaining. + */ + public Builder setLocalName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + localName_ = value; + onChanged(); + return this; + } + /** + * optional string local_name = 5; + * @return This builder for chaining. + */ + public Builder clearLocalName() { + bitField0_ = (bitField0_ & ~0x00000002); + localName_ = getDefaultInstance().getLocalName(); + onChanged(); + return this; + } + /** + * optional string local_name = 5; + * @param value The bytes for localName to set. + * @return This builder for chaining. + */ + public Builder setLocalNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + bitField0_ |= 0x00000002; + localName_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString manufacturerSpecificData_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes manufacturer_specific_data = 6; + * @return The manufacturerSpecificData. + */ + @java.lang.Override + public com.google.protobuf.ByteString getManufacturerSpecificData() { + return manufacturerSpecificData_; + } + /** + * bytes manufacturer_specific_data = 6; + * @param value The manufacturerSpecificData to set. + * @return This builder for chaining. + */ + public Builder setManufacturerSpecificData(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + manufacturerSpecificData_ = value; + onChanged(); + return this; + } + /** + * bytes manufacturer_specific_data = 6; + * @return This builder for chaining. + */ + public Builder clearManufacturerSpecificData() { + + manufacturerSpecificData_ = getDefaultInstance().getManufacturerSpecificData(); + onChanged(); + return this; + } + + private java.util.List serviceDatas_ = + java.util.Collections.emptyList(); + private void ensureServiceDatasIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + serviceDatas_ = new java.util.ArrayList(serviceDatas_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + dev.yanshouwang.bluetooth_low_energy.proto.ServiceData, dev.yanshouwang.bluetooth_low_energy.proto.ServiceData.Builder, dev.yanshouwang.bluetooth_low_energy.proto.ServiceDataOrBuilder> serviceDatasBuilder_; + + /** + * repeated .proto.ServiceData service_datas = 7; + */ + public java.util.List getServiceDatasList() { + if (serviceDatasBuilder_ == null) { + return java.util.Collections.unmodifiableList(serviceDatas_); + } else { + return serviceDatasBuilder_.getMessageList(); + } + } + /** + * repeated .proto.ServiceData service_datas = 7; + */ + public int getServiceDatasCount() { + if (serviceDatasBuilder_ == null) { + return serviceDatas_.size(); + } else { + return serviceDatasBuilder_.getCount(); + } + } + /** + * repeated .proto.ServiceData service_datas = 7; + */ + public dev.yanshouwang.bluetooth_low_energy.proto.ServiceData getServiceDatas(int index) { + if (serviceDatasBuilder_ == null) { + return serviceDatas_.get(index); + } else { + return serviceDatasBuilder_.getMessage(index); + } + } + /** + * repeated .proto.ServiceData service_datas = 7; + */ + public Builder setServiceDatas( + int index, dev.yanshouwang.bluetooth_low_energy.proto.ServiceData value) { + if (serviceDatasBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServiceDatasIsMutable(); + serviceDatas_.set(index, value); + onChanged(); + } else { + serviceDatasBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .proto.ServiceData service_datas = 7; + */ + public Builder setServiceDatas( + int index, dev.yanshouwang.bluetooth_low_energy.proto.ServiceData.Builder builderForValue) { + if (serviceDatasBuilder_ == null) { + ensureServiceDatasIsMutable(); + serviceDatas_.set(index, builderForValue.build()); + onChanged(); + } else { + serviceDatasBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .proto.ServiceData service_datas = 7; + */ + public Builder addServiceDatas(dev.yanshouwang.bluetooth_low_energy.proto.ServiceData value) { + if (serviceDatasBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServiceDatasIsMutable(); + serviceDatas_.add(value); + onChanged(); + } else { + serviceDatasBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .proto.ServiceData service_datas = 7; + */ + public Builder addServiceDatas( + int index, dev.yanshouwang.bluetooth_low_energy.proto.ServiceData value) { + if (serviceDatasBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServiceDatasIsMutable(); + serviceDatas_.add(index, value); + onChanged(); + } else { + serviceDatasBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .proto.ServiceData service_datas = 7; + */ + public Builder addServiceDatas( + dev.yanshouwang.bluetooth_low_energy.proto.ServiceData.Builder builderForValue) { + if (serviceDatasBuilder_ == null) { + ensureServiceDatasIsMutable(); + serviceDatas_.add(builderForValue.build()); + onChanged(); + } else { + serviceDatasBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .proto.ServiceData service_datas = 7; + */ + public Builder addServiceDatas( + int index, dev.yanshouwang.bluetooth_low_energy.proto.ServiceData.Builder builderForValue) { + if (serviceDatasBuilder_ == null) { + ensureServiceDatasIsMutable(); + serviceDatas_.add(index, builderForValue.build()); + onChanged(); + } else { + serviceDatasBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .proto.ServiceData service_datas = 7; + */ + public Builder addAllServiceDatas( + java.lang.Iterable values) { + if (serviceDatasBuilder_ == null) { + ensureServiceDatasIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, serviceDatas_); + onChanged(); + } else { + serviceDatasBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .proto.ServiceData service_datas = 7; + */ + public Builder clearServiceDatas() { + if (serviceDatasBuilder_ == null) { + serviceDatas_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + serviceDatasBuilder_.clear(); + } + return this; + } + /** + * repeated .proto.ServiceData service_datas = 7; + */ + public Builder removeServiceDatas(int index) { + if (serviceDatasBuilder_ == null) { + ensureServiceDatasIsMutable(); + serviceDatas_.remove(index); + onChanged(); + } else { + serviceDatasBuilder_.remove(index); + } + return this; + } + /** + * repeated .proto.ServiceData service_datas = 7; + */ + public dev.yanshouwang.bluetooth_low_energy.proto.ServiceData.Builder getServiceDatasBuilder( + int index) { + return getServiceDatasFieldBuilder().getBuilder(index); + } + /** + * repeated .proto.ServiceData service_datas = 7; + */ + public dev.yanshouwang.bluetooth_low_energy.proto.ServiceDataOrBuilder getServiceDatasOrBuilder( + int index) { + if (serviceDatasBuilder_ == null) { + return serviceDatas_.get(index); } else { + return serviceDatasBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .proto.ServiceData service_datas = 7; + */ + public java.util.List + getServiceDatasOrBuilderList() { + if (serviceDatasBuilder_ != null) { + return serviceDatasBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(serviceDatas_); + } + } + /** + * repeated .proto.ServiceData service_datas = 7; + */ + public dev.yanshouwang.bluetooth_low_energy.proto.ServiceData.Builder addServiceDatasBuilder() { + return getServiceDatasFieldBuilder().addBuilder( + dev.yanshouwang.bluetooth_low_energy.proto.ServiceData.getDefaultInstance()); + } + /** + * repeated .proto.ServiceData service_datas = 7; + */ + public dev.yanshouwang.bluetooth_low_energy.proto.ServiceData.Builder addServiceDatasBuilder( + int index) { + return getServiceDatasFieldBuilder().addBuilder( + index, dev.yanshouwang.bluetooth_low_energy.proto.ServiceData.getDefaultInstance()); + } + /** + * repeated .proto.ServiceData service_datas = 7; + */ + public java.util.List + getServiceDatasBuilderList() { + return getServiceDatasFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + dev.yanshouwang.bluetooth_low_energy.proto.ServiceData, dev.yanshouwang.bluetooth_low_energy.proto.ServiceData.Builder, dev.yanshouwang.bluetooth_low_energy.proto.ServiceDataOrBuilder> + getServiceDatasFieldBuilder() { + if (serviceDatasBuilder_ == null) { + serviceDatasBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + dev.yanshouwang.bluetooth_low_energy.proto.ServiceData, dev.yanshouwang.bluetooth_low_energy.proto.ServiceData.Builder, dev.yanshouwang.bluetooth_low_energy.proto.ServiceDataOrBuilder>( + serviceDatas_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + serviceDatas_ = null; + } + return serviceDatasBuilder_; + } + + private java.util.List serviceUuids_ = + java.util.Collections.emptyList(); + private void ensureServiceUuidsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + serviceUuids_ = new java.util.ArrayList(serviceUuids_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + dev.yanshouwang.bluetooth_low_energy.proto.UUID, dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder, dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder> serviceUuidsBuilder_; + + /** + * repeated .proto.UUID service_uuids = 8; + */ + public java.util.List getServiceUuidsList() { + if (serviceUuidsBuilder_ == null) { + return java.util.Collections.unmodifiableList(serviceUuids_); + } else { + return serviceUuidsBuilder_.getMessageList(); + } + } + /** + * repeated .proto.UUID service_uuids = 8; + */ + public int getServiceUuidsCount() { + if (serviceUuidsBuilder_ == null) { + return serviceUuids_.size(); + } else { + return serviceUuidsBuilder_.getCount(); + } + } + /** + * repeated .proto.UUID service_uuids = 8; + */ + public dev.yanshouwang.bluetooth_low_energy.proto.UUID getServiceUuids(int index) { + if (serviceUuidsBuilder_ == null) { + return serviceUuids_.get(index); + } else { + return serviceUuidsBuilder_.getMessage(index); + } + } + /** + * repeated .proto.UUID service_uuids = 8; + */ + public Builder setServiceUuids( + int index, dev.yanshouwang.bluetooth_low_energy.proto.UUID value) { + if (serviceUuidsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServiceUuidsIsMutable(); + serviceUuids_.set(index, value); + onChanged(); + } else { + serviceUuidsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .proto.UUID service_uuids = 8; + */ + public Builder setServiceUuids( + int index, dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder builderForValue) { + if (serviceUuidsBuilder_ == null) { + ensureServiceUuidsIsMutable(); + serviceUuids_.set(index, builderForValue.build()); + onChanged(); + } else { + serviceUuidsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .proto.UUID service_uuids = 8; + */ + public Builder addServiceUuids(dev.yanshouwang.bluetooth_low_energy.proto.UUID value) { + if (serviceUuidsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServiceUuidsIsMutable(); + serviceUuids_.add(value); + onChanged(); + } else { + serviceUuidsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .proto.UUID service_uuids = 8; + */ + public Builder addServiceUuids( + int index, dev.yanshouwang.bluetooth_low_energy.proto.UUID value) { + if (serviceUuidsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServiceUuidsIsMutable(); + serviceUuids_.add(index, value); + onChanged(); + } else { + serviceUuidsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .proto.UUID service_uuids = 8; + */ + public Builder addServiceUuids( + dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder builderForValue) { + if (serviceUuidsBuilder_ == null) { + ensureServiceUuidsIsMutable(); + serviceUuids_.add(builderForValue.build()); + onChanged(); + } else { + serviceUuidsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .proto.UUID service_uuids = 8; + */ + public Builder addServiceUuids( + int index, dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder builderForValue) { + if (serviceUuidsBuilder_ == null) { + ensureServiceUuidsIsMutable(); + serviceUuids_.add(index, builderForValue.build()); + onChanged(); + } else { + serviceUuidsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .proto.UUID service_uuids = 8; + */ + public Builder addAllServiceUuids( + java.lang.Iterable values) { + if (serviceUuidsBuilder_ == null) { + ensureServiceUuidsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, serviceUuids_); + onChanged(); + } else { + serviceUuidsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .proto.UUID service_uuids = 8; + */ + public Builder clearServiceUuids() { + if (serviceUuidsBuilder_ == null) { + serviceUuids_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + serviceUuidsBuilder_.clear(); + } + return this; + } + /** + * repeated .proto.UUID service_uuids = 8; + */ + public Builder removeServiceUuids(int index) { + if (serviceUuidsBuilder_ == null) { + ensureServiceUuidsIsMutable(); + serviceUuids_.remove(index); + onChanged(); + } else { + serviceUuidsBuilder_.remove(index); + } + return this; + } + /** + * repeated .proto.UUID service_uuids = 8; + */ + public dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder getServiceUuidsBuilder( + int index) { + return getServiceUuidsFieldBuilder().getBuilder(index); + } + /** + * repeated .proto.UUID service_uuids = 8; + */ + public dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder getServiceUuidsOrBuilder( + int index) { + if (serviceUuidsBuilder_ == null) { + return serviceUuids_.get(index); } else { + return serviceUuidsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .proto.UUID service_uuids = 8; + */ + public java.util.List + getServiceUuidsOrBuilderList() { + if (serviceUuidsBuilder_ != null) { + return serviceUuidsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(serviceUuids_); + } + } + /** + * repeated .proto.UUID service_uuids = 8; + */ + public dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder addServiceUuidsBuilder() { + return getServiceUuidsFieldBuilder().addBuilder( + dev.yanshouwang.bluetooth_low_energy.proto.UUID.getDefaultInstance()); + } + /** + * repeated .proto.UUID service_uuids = 8; + */ + public dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder addServiceUuidsBuilder( + int index) { + return getServiceUuidsFieldBuilder().addBuilder( + index, dev.yanshouwang.bluetooth_low_energy.proto.UUID.getDefaultInstance()); + } + /** + * repeated .proto.UUID service_uuids = 8; + */ + public java.util.List + getServiceUuidsBuilderList() { + return getServiceUuidsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + dev.yanshouwang.bluetooth_low_energy.proto.UUID, dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder, dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder> + getServiceUuidsFieldBuilder() { + if (serviceUuidsBuilder_ == null) { + serviceUuidsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + dev.yanshouwang.bluetooth_low_energy.proto.UUID, dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder, dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder>( + serviceUuids_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + serviceUuids_ = null; + } + return serviceUuidsBuilder_; + } + + private java.util.List solicitedServiceUuids_ = + java.util.Collections.emptyList(); + private void ensureSolicitedServiceUuidsIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + solicitedServiceUuids_ = new java.util.ArrayList(solicitedServiceUuids_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + dev.yanshouwang.bluetooth_low_energy.proto.UUID, dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder, dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder> solicitedServiceUuidsBuilder_; + + /** + * repeated .proto.UUID solicited_service_uuids = 9; + */ + public java.util.List getSolicitedServiceUuidsList() { + if (solicitedServiceUuidsBuilder_ == null) { + return java.util.Collections.unmodifiableList(solicitedServiceUuids_); + } else { + return solicitedServiceUuidsBuilder_.getMessageList(); + } + } + /** + * repeated .proto.UUID solicited_service_uuids = 9; + */ + public int getSolicitedServiceUuidsCount() { + if (solicitedServiceUuidsBuilder_ == null) { + return solicitedServiceUuids_.size(); + } else { + return solicitedServiceUuidsBuilder_.getCount(); + } + } + /** + * repeated .proto.UUID solicited_service_uuids = 9; + */ + public dev.yanshouwang.bluetooth_low_energy.proto.UUID getSolicitedServiceUuids(int index) { + if (solicitedServiceUuidsBuilder_ == null) { + return solicitedServiceUuids_.get(index); + } else { + return solicitedServiceUuidsBuilder_.getMessage(index); + } + } + /** + * repeated .proto.UUID solicited_service_uuids = 9; + */ + public Builder setSolicitedServiceUuids( + int index, dev.yanshouwang.bluetooth_low_energy.proto.UUID value) { + if (solicitedServiceUuidsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSolicitedServiceUuidsIsMutable(); + solicitedServiceUuids_.set(index, value); + onChanged(); + } else { + solicitedServiceUuidsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .proto.UUID solicited_service_uuids = 9; + */ + public Builder setSolicitedServiceUuids( + int index, dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder builderForValue) { + if (solicitedServiceUuidsBuilder_ == null) { + ensureSolicitedServiceUuidsIsMutable(); + solicitedServiceUuids_.set(index, builderForValue.build()); + onChanged(); + } else { + solicitedServiceUuidsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .proto.UUID solicited_service_uuids = 9; + */ + public Builder addSolicitedServiceUuids(dev.yanshouwang.bluetooth_low_energy.proto.UUID value) { + if (solicitedServiceUuidsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSolicitedServiceUuidsIsMutable(); + solicitedServiceUuids_.add(value); + onChanged(); + } else { + solicitedServiceUuidsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .proto.UUID solicited_service_uuids = 9; + */ + public Builder addSolicitedServiceUuids( + int index, dev.yanshouwang.bluetooth_low_energy.proto.UUID value) { + if (solicitedServiceUuidsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSolicitedServiceUuidsIsMutable(); + solicitedServiceUuids_.add(index, value); + onChanged(); + } else { + solicitedServiceUuidsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .proto.UUID solicited_service_uuids = 9; + */ + public Builder addSolicitedServiceUuids( + dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder builderForValue) { + if (solicitedServiceUuidsBuilder_ == null) { + ensureSolicitedServiceUuidsIsMutable(); + solicitedServiceUuids_.add(builderForValue.build()); + onChanged(); + } else { + solicitedServiceUuidsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .proto.UUID solicited_service_uuids = 9; + */ + public Builder addSolicitedServiceUuids( + int index, dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder builderForValue) { + if (solicitedServiceUuidsBuilder_ == null) { + ensureSolicitedServiceUuidsIsMutable(); + solicitedServiceUuids_.add(index, builderForValue.build()); + onChanged(); + } else { + solicitedServiceUuidsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .proto.UUID solicited_service_uuids = 9; + */ + public Builder addAllSolicitedServiceUuids( + java.lang.Iterable values) { + if (solicitedServiceUuidsBuilder_ == null) { + ensureSolicitedServiceUuidsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, solicitedServiceUuids_); + onChanged(); + } else { + solicitedServiceUuidsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .proto.UUID solicited_service_uuids = 9; + */ + public Builder clearSolicitedServiceUuids() { + if (solicitedServiceUuidsBuilder_ == null) { + solicitedServiceUuids_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + solicitedServiceUuidsBuilder_.clear(); + } + return this; + } + /** + * repeated .proto.UUID solicited_service_uuids = 9; + */ + public Builder removeSolicitedServiceUuids(int index) { + if (solicitedServiceUuidsBuilder_ == null) { + ensureSolicitedServiceUuidsIsMutable(); + solicitedServiceUuids_.remove(index); + onChanged(); + } else { + solicitedServiceUuidsBuilder_.remove(index); + } + return this; + } + /** + * repeated .proto.UUID solicited_service_uuids = 9; + */ + public dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder getSolicitedServiceUuidsBuilder( + int index) { + return getSolicitedServiceUuidsFieldBuilder().getBuilder(index); + } + /** + * repeated .proto.UUID solicited_service_uuids = 9; + */ + public dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder getSolicitedServiceUuidsOrBuilder( + int index) { + if (solicitedServiceUuidsBuilder_ == null) { + return solicitedServiceUuids_.get(index); } else { + return solicitedServiceUuidsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .proto.UUID solicited_service_uuids = 9; + */ + public java.util.List + getSolicitedServiceUuidsOrBuilderList() { + if (solicitedServiceUuidsBuilder_ != null) { + return solicitedServiceUuidsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(solicitedServiceUuids_); + } + } + /** + * repeated .proto.UUID solicited_service_uuids = 9; + */ + public dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder addSolicitedServiceUuidsBuilder() { + return getSolicitedServiceUuidsFieldBuilder().addBuilder( + dev.yanshouwang.bluetooth_low_energy.proto.UUID.getDefaultInstance()); + } + /** + * repeated .proto.UUID solicited_service_uuids = 9; + */ + public dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder addSolicitedServiceUuidsBuilder( + int index) { + return getSolicitedServiceUuidsFieldBuilder().addBuilder( + index, dev.yanshouwang.bluetooth_low_energy.proto.UUID.getDefaultInstance()); + } + /** + * repeated .proto.UUID solicited_service_uuids = 9; + */ + public java.util.List + getSolicitedServiceUuidsBuilderList() { + return getSolicitedServiceUuidsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + dev.yanshouwang.bluetooth_low_energy.proto.UUID, dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder, dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder> + getSolicitedServiceUuidsFieldBuilder() { + if (solicitedServiceUuidsBuilder_ == null) { + solicitedServiceUuidsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + dev.yanshouwang.bluetooth_low_energy.proto.UUID, dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder, dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder>( + solicitedServiceUuids_, + ((bitField0_ & 0x00000010) != 0), + getParentForChildren(), + isClean()); + solicitedServiceUuids_ = null; + } + return solicitedServiceUuidsBuilder_; + } + + private int txPowerLevel_ ; + /** + * optional int32 tx_power_level = 10; + * @return Whether the txPowerLevel field is set. + */ + @java.lang.Override + public boolean hasTxPowerLevel() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * optional int32 tx_power_level = 10; + * @return The txPowerLevel. + */ + @java.lang.Override + public int getTxPowerLevel() { + return txPowerLevel_; + } + /** + * optional int32 tx_power_level = 10; + * @param value The txPowerLevel to set. + * @return This builder for chaining. + */ + public Builder setTxPowerLevel(int value) { + bitField0_ |= 0x00000020; + txPowerLevel_ = value; + onChanged(); + return this; + } + /** + * optional int32 tx_power_level = 10; + * @return This builder for chaining. + */ + public Builder clearTxPowerLevel() { + bitField0_ = (bitField0_ & ~0x00000020); + txPowerLevel_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:proto.Advertisement) + } + + // @@protoc_insertion_point(class_scope:proto.Advertisement) + private static final dev.yanshouwang.bluetooth_low_energy.proto.Advertisement DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new dev.yanshouwang.bluetooth_low_energy.proto.Advertisement(); + } + + public static dev.yanshouwang.bluetooth_low_energy.proto.Advertisement getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Advertisement parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Advertisement(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.Advertisement getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/AdvertisementOrBuilder.java b/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/AdvertisementOrBuilder.java new file mode 100644 index 0000000..1cd545e --- /dev/null +++ b/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/AdvertisementOrBuilder.java @@ -0,0 +1,153 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: proto/messages.proto + +package dev.yanshouwang.bluetooth_low_energy.proto; + +public interface AdvertisementOrBuilder extends + // @@protoc_insertion_point(interface_extends:proto.Advertisement) + com.google.protobuf.MessageOrBuilder { + + /** + * .proto.UUID uuid = 1; + * @return Whether the uuid field is set. + */ + boolean hasUuid(); + /** + * .proto.UUID uuid = 1; + * @return The uuid. + */ + dev.yanshouwang.bluetooth_low_energy.proto.UUID getUuid(); + /** + * .proto.UUID uuid = 1; + */ + dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder getUuidOrBuilder(); + + /** + * int32 rssi = 2; + * @return The rssi. + */ + int getRssi(); + + /** + * optional bool connectable = 3; + * @return Whether the connectable field is set. + */ + boolean hasConnectable(); + /** + * optional bool connectable = 3; + * @return The connectable. + */ + boolean getConnectable(); + + /** + * bytes data = 4; + * @return The data. + */ + com.google.protobuf.ByteString getData(); + + /** + * optional string local_name = 5; + * @return Whether the localName field is set. + */ + boolean hasLocalName(); + /** + * optional string local_name = 5; + * @return The localName. + */ + java.lang.String getLocalName(); + /** + * optional string local_name = 5; + * @return The bytes for localName. + */ + com.google.protobuf.ByteString + getLocalNameBytes(); + + /** + * bytes manufacturer_specific_data = 6; + * @return The manufacturerSpecificData. + */ + com.google.protobuf.ByteString getManufacturerSpecificData(); + + /** + * repeated .proto.ServiceData service_datas = 7; + */ + java.util.List + getServiceDatasList(); + /** + * repeated .proto.ServiceData service_datas = 7; + */ + dev.yanshouwang.bluetooth_low_energy.proto.ServiceData getServiceDatas(int index); + /** + * repeated .proto.ServiceData service_datas = 7; + */ + int getServiceDatasCount(); + /** + * repeated .proto.ServiceData service_datas = 7; + */ + java.util.List + getServiceDatasOrBuilderList(); + /** + * repeated .proto.ServiceData service_datas = 7; + */ + dev.yanshouwang.bluetooth_low_energy.proto.ServiceDataOrBuilder getServiceDatasOrBuilder( + int index); + + /** + * repeated .proto.UUID service_uuids = 8; + */ + java.util.List + getServiceUuidsList(); + /** + * repeated .proto.UUID service_uuids = 8; + */ + dev.yanshouwang.bluetooth_low_energy.proto.UUID getServiceUuids(int index); + /** + * repeated .proto.UUID service_uuids = 8; + */ + int getServiceUuidsCount(); + /** + * repeated .proto.UUID service_uuids = 8; + */ + java.util.List + getServiceUuidsOrBuilderList(); + /** + * repeated .proto.UUID service_uuids = 8; + */ + dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder getServiceUuidsOrBuilder( + int index); + + /** + * repeated .proto.UUID solicited_service_uuids = 9; + */ + java.util.List + getSolicitedServiceUuidsList(); + /** + * repeated .proto.UUID solicited_service_uuids = 9; + */ + dev.yanshouwang.bluetooth_low_energy.proto.UUID getSolicitedServiceUuids(int index); + /** + * repeated .proto.UUID solicited_service_uuids = 9; + */ + int getSolicitedServiceUuidsCount(); + /** + * repeated .proto.UUID solicited_service_uuids = 9; + */ + java.util.List + getSolicitedServiceUuidsOrBuilderList(); + /** + * repeated .proto.UUID solicited_service_uuids = 9; + */ + dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder getSolicitedServiceUuidsOrBuilder( + int index); + + /** + * optional int32 tx_power_level = 10; + * @return Whether the txPowerLevel field is set. + */ + boolean hasTxPowerLevel(); + /** + * optional int32 tx_power_level = 10; + * @return The txPowerLevel. + */ + int getTxPowerLevel(); +} diff --git a/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/BluetoothLowEnergyException.java b/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/BluetoothLowEnergyException.java new file mode 100644 index 0000000..bd9253e --- /dev/null +++ b/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/BluetoothLowEnergyException.java @@ -0,0 +1,559 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: proto/messages.proto + +package dev.yanshouwang.bluetooth_low_energy.proto; + +/** + * Protobuf type {@code proto.BluetoothLowEnergyException} + */ +public final class BluetoothLowEnergyException extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:proto.BluetoothLowEnergyException) + BluetoothLowEnergyExceptionOrBuilder { +private static final long serialVersionUID = 0L; + // Use BluetoothLowEnergyException.newBuilder() to construct. + private BluetoothLowEnergyException(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private BluetoothLowEnergyException() { + message_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new BluetoothLowEnergyException(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private BluetoothLowEnergyException( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + message_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_BluetoothLowEnergyException_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_BluetoothLowEnergyException_fieldAccessorTable + .ensureFieldAccessorsInitialized( + dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException.class, dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException.Builder.class); + } + + public static final int MESSAGE_FIELD_NUMBER = 1; + private volatile java.lang.Object message_; + /** + * string message = 1; + * @return The message. + */ + @java.lang.Override + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } + } + /** + * string message = 1; + * @return The bytes for message. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, message_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, message_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException)) { + return super.equals(obj); + } + dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException other = (dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException) obj; + + if (!getMessage() + .equals(other.getMessage())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code proto.BluetoothLowEnergyException} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:proto.BluetoothLowEnergyException) + dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyExceptionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_BluetoothLowEnergyException_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_BluetoothLowEnergyException_fieldAccessorTable + .ensureFieldAccessorsInitialized( + dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException.class, dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException.Builder.class); + } + + // Construct using dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + message_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_BluetoothLowEnergyException_descriptor; + } + + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException getDefaultInstanceForType() { + return dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException.getDefaultInstance(); + } + + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException build() { + dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException buildPartial() { + dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException result = new dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException(this); + result.message_ = message_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException) { + return mergeFrom((dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException other) { + if (other == dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException.getDefaultInstance()) return this; + if (!other.getMessage().isEmpty()) { + message_ = other.message_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object message_ = ""; + /** + * string message = 1; + * @return The message. + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string message = 1; + * @return The bytes for message. + */ + public com.google.protobuf.ByteString + getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string message = 1; + * @param value The message to set. + * @return This builder for chaining. + */ + public Builder setMessage( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + message_ = value; + onChanged(); + return this; + } + /** + * string message = 1; + * @return This builder for chaining. + */ + public Builder clearMessage() { + + message_ = getDefaultInstance().getMessage(); + onChanged(); + return this; + } + /** + * string message = 1; + * @param value The bytes for message to set. + * @return This builder for chaining. + */ + public Builder setMessageBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + message_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:proto.BluetoothLowEnergyException) + } + + // @@protoc_insertion_point(class_scope:proto.BluetoothLowEnergyException) + private static final dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException(); + } + + public static dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BluetoothLowEnergyException parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BluetoothLowEnergyException(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/BluetoothLowEnergyExceptionOrBuilder.java b/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/BluetoothLowEnergyExceptionOrBuilder.java new file mode 100644 index 0000000..afdbadb --- /dev/null +++ b/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/BluetoothLowEnergyExceptionOrBuilder.java @@ -0,0 +1,21 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: proto/messages.proto + +package dev.yanshouwang.bluetooth_low_energy.proto; + +public interface BluetoothLowEnergyExceptionOrBuilder extends + // @@protoc_insertion_point(interface_extends:proto.BluetoothLowEnergyException) + com.google.protobuf.MessageOrBuilder { + + /** + * string message = 1; + * @return The message. + */ + java.lang.String getMessage(); + /** + * string message = 1; + * @return The bytes for message. + */ + com.google.protobuf.ByteString + getMessageBytes(); +} diff --git a/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/BluetoothState.java b/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/BluetoothState.java new file mode 100644 index 0000000..171ec39 --- /dev/null +++ b/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/BluetoothState.java @@ -0,0 +1,122 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: proto/messages.proto + +package dev.yanshouwang.bluetooth_low_energy.proto; + +/** + * Protobuf enum {@code proto.BluetoothState} + */ +public enum BluetoothState + implements com.google.protobuf.ProtocolMessageEnum { + /** + * BLUETOOTH_STATE_UNSUPPORTED = 0; + */ + BLUETOOTH_STATE_UNSUPPORTED(0), + /** + * BLUETOOTH_STATE_POWERED_OFF = 1; + */ + BLUETOOTH_STATE_POWERED_OFF(1), + /** + * BLUETOOTH_STATE_POWERED_ON = 2; + */ + BLUETOOTH_STATE_POWERED_ON(2), + UNRECOGNIZED(-1), + ; + + /** + * BLUETOOTH_STATE_UNSUPPORTED = 0; + */ + public static final int BLUETOOTH_STATE_UNSUPPORTED_VALUE = 0; + /** + * BLUETOOTH_STATE_POWERED_OFF = 1; + */ + public static final int BLUETOOTH_STATE_POWERED_OFF_VALUE = 1; + /** + * BLUETOOTH_STATE_POWERED_ON = 2; + */ + public static final int BLUETOOTH_STATE_POWERED_ON_VALUE = 2; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static BluetoothState valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static BluetoothState forNumber(int value) { + switch (value) { + case 0: return BLUETOOTH_STATE_UNSUPPORTED; + case 1: return BLUETOOTH_STATE_POWERED_OFF; + case 2: return BLUETOOTH_STATE_POWERED_ON; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + BluetoothState> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public BluetoothState findValueByNumber(int number) { + return BluetoothState.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.getDescriptor().getEnumTypes().get(0); + } + + private static final BluetoothState[] VALUES = values(); + + public static BluetoothState valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private BluetoothState(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:proto.BluetoothState) +} + diff --git a/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/GattCharacteristic.java b/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/GattCharacteristic.java new file mode 100644 index 0000000..de5c148 --- /dev/null +++ b/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/GattCharacteristic.java @@ -0,0 +1,934 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: proto/messages.proto + +package dev.yanshouwang.bluetooth_low_energy.proto; + +/** + * Protobuf type {@code proto.GattCharacteristic} + */ +public final class GattCharacteristic extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:proto.GattCharacteristic) + GattCharacteristicOrBuilder { +private static final long serialVersionUID = 0L; + // Use GattCharacteristic.newBuilder() to construct. + private GattCharacteristic(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GattCharacteristic() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new GattCharacteristic(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GattCharacteristic( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + id_ = input.readInt64(); + break; + } + case 18: { + dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder subBuilder = null; + if (uuid_ != null) { + subBuilder = uuid_.toBuilder(); + } + uuid_ = input.readMessage(dev.yanshouwang.bluetooth_low_energy.proto.UUID.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(uuid_); + uuid_ = subBuilder.buildPartial(); + } + + break; + } + case 24: { + + canRead_ = input.readBool(); + break; + } + case 32: { + + canWrite_ = input.readBool(); + break; + } + case 40: { + + canWriteWithoutResponse_ = input.readBool(); + break; + } + case 48: { + + canNotify_ = input.readBool(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_GattCharacteristic_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_GattCharacteristic_fieldAccessorTable + .ensureFieldAccessorsInitialized( + dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic.class, dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + private long id_; + /** + * int64 id = 1; + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + + public static final int UUID_FIELD_NUMBER = 2; + private dev.yanshouwang.bluetooth_low_energy.proto.UUID uuid_; + /** + * .proto.UUID uuid = 2; + * @return Whether the uuid field is set. + */ + @java.lang.Override + public boolean hasUuid() { + return uuid_ != null; + } + /** + * .proto.UUID uuid = 2; + * @return The uuid. + */ + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.UUID getUuid() { + return uuid_ == null ? dev.yanshouwang.bluetooth_low_energy.proto.UUID.getDefaultInstance() : uuid_; + } + /** + * .proto.UUID uuid = 2; + */ + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder getUuidOrBuilder() { + return getUuid(); + } + + public static final int CAN_READ_FIELD_NUMBER = 3; + private boolean canRead_; + /** + * bool can_read = 3; + * @return The canRead. + */ + @java.lang.Override + public boolean getCanRead() { + return canRead_; + } + + public static final int CAN_WRITE_FIELD_NUMBER = 4; + private boolean canWrite_; + /** + * bool can_write = 4; + * @return The canWrite. + */ + @java.lang.Override + public boolean getCanWrite() { + return canWrite_; + } + + public static final int CAN_WRITE_WITHOUT_RESPONSE_FIELD_NUMBER = 5; + private boolean canWriteWithoutResponse_; + /** + * bool can_write_without_response = 5; + * @return The canWriteWithoutResponse. + */ + @java.lang.Override + public boolean getCanWriteWithoutResponse() { + return canWriteWithoutResponse_; + } + + public static final int CAN_NOTIFY_FIELD_NUMBER = 6; + private boolean canNotify_; + /** + * bool can_notify = 6; + * @return The canNotify. + */ + @java.lang.Override + public boolean getCanNotify() { + return canNotify_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (id_ != 0L) { + output.writeInt64(1, id_); + } + if (uuid_ != null) { + output.writeMessage(2, getUuid()); + } + if (canRead_ != false) { + output.writeBool(3, canRead_); + } + if (canWrite_ != false) { + output.writeBool(4, canWrite_); + } + if (canWriteWithoutResponse_ != false) { + output.writeBool(5, canWriteWithoutResponse_); + } + if (canNotify_ != false) { + output.writeBool(6, canNotify_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (id_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, id_); + } + if (uuid_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getUuid()); + } + if (canRead_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, canRead_); + } + if (canWrite_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(4, canWrite_); + } + if (canWriteWithoutResponse_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(5, canWriteWithoutResponse_); + } + if (canNotify_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(6, canNotify_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic)) { + return super.equals(obj); + } + dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic other = (dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic) obj; + + if (getId() + != other.getId()) return false; + if (hasUuid() != other.hasUuid()) return false; + if (hasUuid()) { + if (!getUuid() + .equals(other.getUuid())) return false; + } + if (getCanRead() + != other.getCanRead()) return false; + if (getCanWrite() + != other.getCanWrite()) return false; + if (getCanWriteWithoutResponse() + != other.getCanWriteWithoutResponse()) return false; + if (getCanNotify() + != other.getCanNotify()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getId()); + if (hasUuid()) { + hash = (37 * hash) + UUID_FIELD_NUMBER; + hash = (53 * hash) + getUuid().hashCode(); + } + hash = (37 * hash) + CAN_READ_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getCanRead()); + hash = (37 * hash) + CAN_WRITE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getCanWrite()); + hash = (37 * hash) + CAN_WRITE_WITHOUT_RESPONSE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getCanWriteWithoutResponse()); + hash = (37 * hash) + CAN_NOTIFY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getCanNotify()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code proto.GattCharacteristic} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:proto.GattCharacteristic) + dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristicOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_GattCharacteristic_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_GattCharacteristic_fieldAccessorTable + .ensureFieldAccessorsInitialized( + dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic.class, dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic.Builder.class); + } + + // Construct using dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + id_ = 0L; + + if (uuidBuilder_ == null) { + uuid_ = null; + } else { + uuid_ = null; + uuidBuilder_ = null; + } + canRead_ = false; + + canWrite_ = false; + + canWriteWithoutResponse_ = false; + + canNotify_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_GattCharacteristic_descriptor; + } + + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic getDefaultInstanceForType() { + return dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic.getDefaultInstance(); + } + + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic build() { + dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic buildPartial() { + dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic result = new dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic(this); + result.id_ = id_; + if (uuidBuilder_ == null) { + result.uuid_ = uuid_; + } else { + result.uuid_ = uuidBuilder_.build(); + } + result.canRead_ = canRead_; + result.canWrite_ = canWrite_; + result.canWriteWithoutResponse_ = canWriteWithoutResponse_; + result.canNotify_ = canNotify_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic) { + return mergeFrom((dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic other) { + if (other == dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic.getDefaultInstance()) return this; + if (other.getId() != 0L) { + setId(other.getId()); + } + if (other.hasUuid()) { + mergeUuid(other.getUuid()); + } + if (other.getCanRead() != false) { + setCanRead(other.getCanRead()); + } + if (other.getCanWrite() != false) { + setCanWrite(other.getCanWrite()); + } + if (other.getCanWriteWithoutResponse() != false) { + setCanWriteWithoutResponse(other.getCanWriteWithoutResponse()); + } + if (other.getCanNotify() != false) { + setCanNotify(other.getCanNotify()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long id_ ; + /** + * int64 id = 1; + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + /** + * int64 id = 1; + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(long value) { + + id_ = value; + onChanged(); + return this; + } + /** + * int64 id = 1; + * @return This builder for chaining. + */ + public Builder clearId() { + + id_ = 0L; + onChanged(); + return this; + } + + private dev.yanshouwang.bluetooth_low_energy.proto.UUID uuid_; + private com.google.protobuf.SingleFieldBuilderV3< + dev.yanshouwang.bluetooth_low_energy.proto.UUID, dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder, dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder> uuidBuilder_; + /** + * .proto.UUID uuid = 2; + * @return Whether the uuid field is set. + */ + public boolean hasUuid() { + return uuidBuilder_ != null || uuid_ != null; + } + /** + * .proto.UUID uuid = 2; + * @return The uuid. + */ + public dev.yanshouwang.bluetooth_low_energy.proto.UUID getUuid() { + if (uuidBuilder_ == null) { + return uuid_ == null ? dev.yanshouwang.bluetooth_low_energy.proto.UUID.getDefaultInstance() : uuid_; + } else { + return uuidBuilder_.getMessage(); + } + } + /** + * .proto.UUID uuid = 2; + */ + public Builder setUuid(dev.yanshouwang.bluetooth_low_energy.proto.UUID value) { + if (uuidBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + uuid_ = value; + onChanged(); + } else { + uuidBuilder_.setMessage(value); + } + + return this; + } + /** + * .proto.UUID uuid = 2; + */ + public Builder setUuid( + dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder builderForValue) { + if (uuidBuilder_ == null) { + uuid_ = builderForValue.build(); + onChanged(); + } else { + uuidBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .proto.UUID uuid = 2; + */ + public Builder mergeUuid(dev.yanshouwang.bluetooth_low_energy.proto.UUID value) { + if (uuidBuilder_ == null) { + if (uuid_ != null) { + uuid_ = + dev.yanshouwang.bluetooth_low_energy.proto.UUID.newBuilder(uuid_).mergeFrom(value).buildPartial(); + } else { + uuid_ = value; + } + onChanged(); + } else { + uuidBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .proto.UUID uuid = 2; + */ + public Builder clearUuid() { + if (uuidBuilder_ == null) { + uuid_ = null; + onChanged(); + } else { + uuid_ = null; + uuidBuilder_ = null; + } + + return this; + } + /** + * .proto.UUID uuid = 2; + */ + public dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder getUuidBuilder() { + + onChanged(); + return getUuidFieldBuilder().getBuilder(); + } + /** + * .proto.UUID uuid = 2; + */ + public dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder getUuidOrBuilder() { + if (uuidBuilder_ != null) { + return uuidBuilder_.getMessageOrBuilder(); + } else { + return uuid_ == null ? + dev.yanshouwang.bluetooth_low_energy.proto.UUID.getDefaultInstance() : uuid_; + } + } + /** + * .proto.UUID uuid = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + dev.yanshouwang.bluetooth_low_energy.proto.UUID, dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder, dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder> + getUuidFieldBuilder() { + if (uuidBuilder_ == null) { + uuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + dev.yanshouwang.bluetooth_low_energy.proto.UUID, dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder, dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder>( + getUuid(), + getParentForChildren(), + isClean()); + uuid_ = null; + } + return uuidBuilder_; + } + + private boolean canRead_ ; + /** + * bool can_read = 3; + * @return The canRead. + */ + @java.lang.Override + public boolean getCanRead() { + return canRead_; + } + /** + * bool can_read = 3; + * @param value The canRead to set. + * @return This builder for chaining. + */ + public Builder setCanRead(boolean value) { + + canRead_ = value; + onChanged(); + return this; + } + /** + * bool can_read = 3; + * @return This builder for chaining. + */ + public Builder clearCanRead() { + + canRead_ = false; + onChanged(); + return this; + } + + private boolean canWrite_ ; + /** + * bool can_write = 4; + * @return The canWrite. + */ + @java.lang.Override + public boolean getCanWrite() { + return canWrite_; + } + /** + * bool can_write = 4; + * @param value The canWrite to set. + * @return This builder for chaining. + */ + public Builder setCanWrite(boolean value) { + + canWrite_ = value; + onChanged(); + return this; + } + /** + * bool can_write = 4; + * @return This builder for chaining. + */ + public Builder clearCanWrite() { + + canWrite_ = false; + onChanged(); + return this; + } + + private boolean canWriteWithoutResponse_ ; + /** + * bool can_write_without_response = 5; + * @return The canWriteWithoutResponse. + */ + @java.lang.Override + public boolean getCanWriteWithoutResponse() { + return canWriteWithoutResponse_; + } + /** + * bool can_write_without_response = 5; + * @param value The canWriteWithoutResponse to set. + * @return This builder for chaining. + */ + public Builder setCanWriteWithoutResponse(boolean value) { + + canWriteWithoutResponse_ = value; + onChanged(); + return this; + } + /** + * bool can_write_without_response = 5; + * @return This builder for chaining. + */ + public Builder clearCanWriteWithoutResponse() { + + canWriteWithoutResponse_ = false; + onChanged(); + return this; + } + + private boolean canNotify_ ; + /** + * bool can_notify = 6; + * @return The canNotify. + */ + @java.lang.Override + public boolean getCanNotify() { + return canNotify_; + } + /** + * bool can_notify = 6; + * @param value The canNotify to set. + * @return This builder for chaining. + */ + public Builder setCanNotify(boolean value) { + + canNotify_ = value; + onChanged(); + return this; + } + /** + * bool can_notify = 6; + * @return This builder for chaining. + */ + public Builder clearCanNotify() { + + canNotify_ = false; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:proto.GattCharacteristic) + } + + // @@protoc_insertion_point(class_scope:proto.GattCharacteristic) + private static final dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic(); + } + + public static dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GattCharacteristic parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GattCharacteristic(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/GattCharacteristicOrBuilder.java b/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/GattCharacteristicOrBuilder.java new file mode 100644 index 0000000..2b8eb59 --- /dev/null +++ b/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/GattCharacteristicOrBuilder.java @@ -0,0 +1,54 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: proto/messages.proto + +package dev.yanshouwang.bluetooth_low_energy.proto; + +public interface GattCharacteristicOrBuilder extends + // @@protoc_insertion_point(interface_extends:proto.GattCharacteristic) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 id = 1; + * @return The id. + */ + long getId(); + + /** + * .proto.UUID uuid = 2; + * @return Whether the uuid field is set. + */ + boolean hasUuid(); + /** + * .proto.UUID uuid = 2; + * @return The uuid. + */ + dev.yanshouwang.bluetooth_low_energy.proto.UUID getUuid(); + /** + * .proto.UUID uuid = 2; + */ + dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder getUuidOrBuilder(); + + /** + * bool can_read = 3; + * @return The canRead. + */ + boolean getCanRead(); + + /** + * bool can_write = 4; + * @return The canWrite. + */ + boolean getCanWrite(); + + /** + * bool can_write_without_response = 5; + * @return The canWriteWithoutResponse. + */ + boolean getCanWriteWithoutResponse(); + + /** + * bool can_notify = 6; + * @return The canNotify. + */ + boolean getCanNotify(); +} diff --git a/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/GattDescriptor.java b/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/GattDescriptor.java new file mode 100644 index 0000000..e913a4b --- /dev/null +++ b/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/GattDescriptor.java @@ -0,0 +1,674 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: proto/messages.proto + +package dev.yanshouwang.bluetooth_low_energy.proto; + +/** + * Protobuf type {@code proto.GattDescriptor} + */ +public final class GattDescriptor extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:proto.GattDescriptor) + GattDescriptorOrBuilder { +private static final long serialVersionUID = 0L; + // Use GattDescriptor.newBuilder() to construct. + private GattDescriptor(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GattDescriptor() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new GattDescriptor(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GattDescriptor( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + id_ = input.readInt64(); + break; + } + case 18: { + dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder subBuilder = null; + if (uuid_ != null) { + subBuilder = uuid_.toBuilder(); + } + uuid_ = input.readMessage(dev.yanshouwang.bluetooth_low_energy.proto.UUID.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(uuid_); + uuid_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_GattDescriptor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_GattDescriptor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor.class, dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + private long id_; + /** + * int64 id = 1; + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + + public static final int UUID_FIELD_NUMBER = 2; + private dev.yanshouwang.bluetooth_low_energy.proto.UUID uuid_; + /** + * .proto.UUID uuid = 2; + * @return Whether the uuid field is set. + */ + @java.lang.Override + public boolean hasUuid() { + return uuid_ != null; + } + /** + * .proto.UUID uuid = 2; + * @return The uuid. + */ + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.UUID getUuid() { + return uuid_ == null ? dev.yanshouwang.bluetooth_low_energy.proto.UUID.getDefaultInstance() : uuid_; + } + /** + * .proto.UUID uuid = 2; + */ + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder getUuidOrBuilder() { + return getUuid(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (id_ != 0L) { + output.writeInt64(1, id_); + } + if (uuid_ != null) { + output.writeMessage(2, getUuid()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (id_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, id_); + } + if (uuid_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getUuid()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor)) { + return super.equals(obj); + } + dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor other = (dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor) obj; + + if (getId() + != other.getId()) return false; + if (hasUuid() != other.hasUuid()) return false; + if (hasUuid()) { + if (!getUuid() + .equals(other.getUuid())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getId()); + if (hasUuid()) { + hash = (37 * hash) + UUID_FIELD_NUMBER; + hash = (53 * hash) + getUuid().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code proto.GattDescriptor} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:proto.GattDescriptor) + dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_GattDescriptor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_GattDescriptor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor.class, dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor.Builder.class); + } + + // Construct using dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + id_ = 0L; + + if (uuidBuilder_ == null) { + uuid_ = null; + } else { + uuid_ = null; + uuidBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_GattDescriptor_descriptor; + } + + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor getDefaultInstanceForType() { + return dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor.getDefaultInstance(); + } + + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor build() { + dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor buildPartial() { + dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor result = new dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor(this); + result.id_ = id_; + if (uuidBuilder_ == null) { + result.uuid_ = uuid_; + } else { + result.uuid_ = uuidBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor) { + return mergeFrom((dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor other) { + if (other == dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor.getDefaultInstance()) return this; + if (other.getId() != 0L) { + setId(other.getId()); + } + if (other.hasUuid()) { + mergeUuid(other.getUuid()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long id_ ; + /** + * int64 id = 1; + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + /** + * int64 id = 1; + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(long value) { + + id_ = value; + onChanged(); + return this; + } + /** + * int64 id = 1; + * @return This builder for chaining. + */ + public Builder clearId() { + + id_ = 0L; + onChanged(); + return this; + } + + private dev.yanshouwang.bluetooth_low_energy.proto.UUID uuid_; + private com.google.protobuf.SingleFieldBuilderV3< + dev.yanshouwang.bluetooth_low_energy.proto.UUID, dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder, dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder> uuidBuilder_; + /** + * .proto.UUID uuid = 2; + * @return Whether the uuid field is set. + */ + public boolean hasUuid() { + return uuidBuilder_ != null || uuid_ != null; + } + /** + * .proto.UUID uuid = 2; + * @return The uuid. + */ + public dev.yanshouwang.bluetooth_low_energy.proto.UUID getUuid() { + if (uuidBuilder_ == null) { + return uuid_ == null ? dev.yanshouwang.bluetooth_low_energy.proto.UUID.getDefaultInstance() : uuid_; + } else { + return uuidBuilder_.getMessage(); + } + } + /** + * .proto.UUID uuid = 2; + */ + public Builder setUuid(dev.yanshouwang.bluetooth_low_energy.proto.UUID value) { + if (uuidBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + uuid_ = value; + onChanged(); + } else { + uuidBuilder_.setMessage(value); + } + + return this; + } + /** + * .proto.UUID uuid = 2; + */ + public Builder setUuid( + dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder builderForValue) { + if (uuidBuilder_ == null) { + uuid_ = builderForValue.build(); + onChanged(); + } else { + uuidBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .proto.UUID uuid = 2; + */ + public Builder mergeUuid(dev.yanshouwang.bluetooth_low_energy.proto.UUID value) { + if (uuidBuilder_ == null) { + if (uuid_ != null) { + uuid_ = + dev.yanshouwang.bluetooth_low_energy.proto.UUID.newBuilder(uuid_).mergeFrom(value).buildPartial(); + } else { + uuid_ = value; + } + onChanged(); + } else { + uuidBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .proto.UUID uuid = 2; + */ + public Builder clearUuid() { + if (uuidBuilder_ == null) { + uuid_ = null; + onChanged(); + } else { + uuid_ = null; + uuidBuilder_ = null; + } + + return this; + } + /** + * .proto.UUID uuid = 2; + */ + public dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder getUuidBuilder() { + + onChanged(); + return getUuidFieldBuilder().getBuilder(); + } + /** + * .proto.UUID uuid = 2; + */ + public dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder getUuidOrBuilder() { + if (uuidBuilder_ != null) { + return uuidBuilder_.getMessageOrBuilder(); + } else { + return uuid_ == null ? + dev.yanshouwang.bluetooth_low_energy.proto.UUID.getDefaultInstance() : uuid_; + } + } + /** + * .proto.UUID uuid = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + dev.yanshouwang.bluetooth_low_energy.proto.UUID, dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder, dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder> + getUuidFieldBuilder() { + if (uuidBuilder_ == null) { + uuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + dev.yanshouwang.bluetooth_low_energy.proto.UUID, dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder, dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder>( + getUuid(), + getParentForChildren(), + isClean()); + uuid_ = null; + } + return uuidBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:proto.GattDescriptor) + } + + // @@protoc_insertion_point(class_scope:proto.GattDescriptor) + private static final dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor(); + } + + public static dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GattDescriptor parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GattDescriptor(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/GattDescriptorOrBuilder.java b/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/GattDescriptorOrBuilder.java new file mode 100644 index 0000000..560b8c2 --- /dev/null +++ b/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/GattDescriptorOrBuilder.java @@ -0,0 +1,30 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: proto/messages.proto + +package dev.yanshouwang.bluetooth_low_energy.proto; + +public interface GattDescriptorOrBuilder extends + // @@protoc_insertion_point(interface_extends:proto.GattDescriptor) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 id = 1; + * @return The id. + */ + long getId(); + + /** + * .proto.UUID uuid = 2; + * @return Whether the uuid field is set. + */ + boolean hasUuid(); + /** + * .proto.UUID uuid = 2; + * @return The uuid. + */ + dev.yanshouwang.bluetooth_low_energy.proto.UUID getUuid(); + /** + * .proto.UUID uuid = 2; + */ + dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder getUuidOrBuilder(); +} diff --git a/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/GattService.java b/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/GattService.java new file mode 100644 index 0000000..eafda67 --- /dev/null +++ b/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/GattService.java @@ -0,0 +1,674 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: proto/messages.proto + +package dev.yanshouwang.bluetooth_low_energy.proto; + +/** + * Protobuf type {@code proto.GattService} + */ +public final class GattService extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:proto.GattService) + GattServiceOrBuilder { +private static final long serialVersionUID = 0L; + // Use GattService.newBuilder() to construct. + private GattService(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GattService() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new GattService(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GattService( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + id_ = input.readInt64(); + break; + } + case 18: { + dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder subBuilder = null; + if (uuid_ != null) { + subBuilder = uuid_.toBuilder(); + } + uuid_ = input.readMessage(dev.yanshouwang.bluetooth_low_energy.proto.UUID.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(uuid_); + uuid_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_GattService_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_GattService_fieldAccessorTable + .ensureFieldAccessorsInitialized( + dev.yanshouwang.bluetooth_low_energy.proto.GattService.class, dev.yanshouwang.bluetooth_low_energy.proto.GattService.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + private long id_; + /** + * int64 id = 1; + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + + public static final int UUID_FIELD_NUMBER = 2; + private dev.yanshouwang.bluetooth_low_energy.proto.UUID uuid_; + /** + * .proto.UUID uuid = 2; + * @return Whether the uuid field is set. + */ + @java.lang.Override + public boolean hasUuid() { + return uuid_ != null; + } + /** + * .proto.UUID uuid = 2; + * @return The uuid. + */ + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.UUID getUuid() { + return uuid_ == null ? dev.yanshouwang.bluetooth_low_energy.proto.UUID.getDefaultInstance() : uuid_; + } + /** + * .proto.UUID uuid = 2; + */ + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder getUuidOrBuilder() { + return getUuid(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (id_ != 0L) { + output.writeInt64(1, id_); + } + if (uuid_ != null) { + output.writeMessage(2, getUuid()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (id_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, id_); + } + if (uuid_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getUuid()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof dev.yanshouwang.bluetooth_low_energy.proto.GattService)) { + return super.equals(obj); + } + dev.yanshouwang.bluetooth_low_energy.proto.GattService other = (dev.yanshouwang.bluetooth_low_energy.proto.GattService) obj; + + if (getId() + != other.getId()) return false; + if (hasUuid() != other.hasUuid()) return false; + if (hasUuid()) { + if (!getUuid() + .equals(other.getUuid())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getId()); + if (hasUuid()) { + hash = (37 * hash) + UUID_FIELD_NUMBER; + hash = (53 * hash) + getUuid().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static dev.yanshouwang.bluetooth_low_energy.proto.GattService parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.GattService parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.GattService parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.GattService parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.GattService parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.GattService parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.GattService parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.GattService parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.GattService parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.GattService parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.GattService parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.GattService parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(dev.yanshouwang.bluetooth_low_energy.proto.GattService prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code proto.GattService} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:proto.GattService) + dev.yanshouwang.bluetooth_low_energy.proto.GattServiceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_GattService_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_GattService_fieldAccessorTable + .ensureFieldAccessorsInitialized( + dev.yanshouwang.bluetooth_low_energy.proto.GattService.class, dev.yanshouwang.bluetooth_low_energy.proto.GattService.Builder.class); + } + + // Construct using dev.yanshouwang.bluetooth_low_energy.proto.GattService.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + id_ = 0L; + + if (uuidBuilder_ == null) { + uuid_ = null; + } else { + uuid_ = null; + uuidBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_GattService_descriptor; + } + + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.GattService getDefaultInstanceForType() { + return dev.yanshouwang.bluetooth_low_energy.proto.GattService.getDefaultInstance(); + } + + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.GattService build() { + dev.yanshouwang.bluetooth_low_energy.proto.GattService result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.GattService buildPartial() { + dev.yanshouwang.bluetooth_low_energy.proto.GattService result = new dev.yanshouwang.bluetooth_low_energy.proto.GattService(this); + result.id_ = id_; + if (uuidBuilder_ == null) { + result.uuid_ = uuid_; + } else { + result.uuid_ = uuidBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof dev.yanshouwang.bluetooth_low_energy.proto.GattService) { + return mergeFrom((dev.yanshouwang.bluetooth_low_energy.proto.GattService)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(dev.yanshouwang.bluetooth_low_energy.proto.GattService other) { + if (other == dev.yanshouwang.bluetooth_low_energy.proto.GattService.getDefaultInstance()) return this; + if (other.getId() != 0L) { + setId(other.getId()); + } + if (other.hasUuid()) { + mergeUuid(other.getUuid()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + dev.yanshouwang.bluetooth_low_energy.proto.GattService parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (dev.yanshouwang.bluetooth_low_energy.proto.GattService) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long id_ ; + /** + * int64 id = 1; + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + /** + * int64 id = 1; + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(long value) { + + id_ = value; + onChanged(); + return this; + } + /** + * int64 id = 1; + * @return This builder for chaining. + */ + public Builder clearId() { + + id_ = 0L; + onChanged(); + return this; + } + + private dev.yanshouwang.bluetooth_low_energy.proto.UUID uuid_; + private com.google.protobuf.SingleFieldBuilderV3< + dev.yanshouwang.bluetooth_low_energy.proto.UUID, dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder, dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder> uuidBuilder_; + /** + * .proto.UUID uuid = 2; + * @return Whether the uuid field is set. + */ + public boolean hasUuid() { + return uuidBuilder_ != null || uuid_ != null; + } + /** + * .proto.UUID uuid = 2; + * @return The uuid. + */ + public dev.yanshouwang.bluetooth_low_energy.proto.UUID getUuid() { + if (uuidBuilder_ == null) { + return uuid_ == null ? dev.yanshouwang.bluetooth_low_energy.proto.UUID.getDefaultInstance() : uuid_; + } else { + return uuidBuilder_.getMessage(); + } + } + /** + * .proto.UUID uuid = 2; + */ + public Builder setUuid(dev.yanshouwang.bluetooth_low_energy.proto.UUID value) { + if (uuidBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + uuid_ = value; + onChanged(); + } else { + uuidBuilder_.setMessage(value); + } + + return this; + } + /** + * .proto.UUID uuid = 2; + */ + public Builder setUuid( + dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder builderForValue) { + if (uuidBuilder_ == null) { + uuid_ = builderForValue.build(); + onChanged(); + } else { + uuidBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .proto.UUID uuid = 2; + */ + public Builder mergeUuid(dev.yanshouwang.bluetooth_low_energy.proto.UUID value) { + if (uuidBuilder_ == null) { + if (uuid_ != null) { + uuid_ = + dev.yanshouwang.bluetooth_low_energy.proto.UUID.newBuilder(uuid_).mergeFrom(value).buildPartial(); + } else { + uuid_ = value; + } + onChanged(); + } else { + uuidBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .proto.UUID uuid = 2; + */ + public Builder clearUuid() { + if (uuidBuilder_ == null) { + uuid_ = null; + onChanged(); + } else { + uuid_ = null; + uuidBuilder_ = null; + } + + return this; + } + /** + * .proto.UUID uuid = 2; + */ + public dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder getUuidBuilder() { + + onChanged(); + return getUuidFieldBuilder().getBuilder(); + } + /** + * .proto.UUID uuid = 2; + */ + public dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder getUuidOrBuilder() { + if (uuidBuilder_ != null) { + return uuidBuilder_.getMessageOrBuilder(); + } else { + return uuid_ == null ? + dev.yanshouwang.bluetooth_low_energy.proto.UUID.getDefaultInstance() : uuid_; + } + } + /** + * .proto.UUID uuid = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + dev.yanshouwang.bluetooth_low_energy.proto.UUID, dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder, dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder> + getUuidFieldBuilder() { + if (uuidBuilder_ == null) { + uuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + dev.yanshouwang.bluetooth_low_energy.proto.UUID, dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder, dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder>( + getUuid(), + getParentForChildren(), + isClean()); + uuid_ = null; + } + return uuidBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:proto.GattService) + } + + // @@protoc_insertion_point(class_scope:proto.GattService) + private static final dev.yanshouwang.bluetooth_low_energy.proto.GattService DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new dev.yanshouwang.bluetooth_low_energy.proto.GattService(); + } + + public static dev.yanshouwang.bluetooth_low_energy.proto.GattService getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GattService parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GattService(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.GattService getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/GattServiceOrBuilder.java b/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/GattServiceOrBuilder.java new file mode 100644 index 0000000..2da8e6a --- /dev/null +++ b/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/GattServiceOrBuilder.java @@ -0,0 +1,30 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: proto/messages.proto + +package dev.yanshouwang.bluetooth_low_energy.proto; + +public interface GattServiceOrBuilder extends + // @@protoc_insertion_point(interface_extends:proto.GattService) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 id = 1; + * @return The id. + */ + long getId(); + + /** + * .proto.UUID uuid = 2; + * @return Whether the uuid field is set. + */ + boolean hasUuid(); + /** + * .proto.UUID uuid = 2; + * @return The uuid. + */ + dev.yanshouwang.bluetooth_low_energy.proto.UUID getUuid(); + /** + * .proto.UUID uuid = 2; + */ + dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder getUuidOrBuilder(); +} diff --git a/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/Messages.java b/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/Messages.java new file mode 100644 index 0000000..4f0a00f --- /dev/null +++ b/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/Messages.java @@ -0,0 +1,148 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: proto/messages.proto + +package dev.yanshouwang.bluetooth_low_energy.proto; + +public final class Messages { + private Messages() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_proto_Advertisement_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_proto_Advertisement_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_proto_Peripheral_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_proto_Peripheral_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_proto_GattService_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_proto_GattService_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_proto_GattCharacteristic_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_proto_GattCharacteristic_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_proto_GattDescriptor_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_proto_GattDescriptor_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_proto_UUID_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_proto_UUID_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_proto_ServiceData_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_proto_ServiceData_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_proto_BluetoothLowEnergyException_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_proto_BluetoothLowEnergyException_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\024proto/messages.proto\022\005proto\"\351\002\n\rAdvert" + + "isement\022\031\n\004uuid\030\001 \001(\0132\013.proto.UUID\022\014\n\004rs" + + "si\030\002 \001(\005\022\030\n\013connectable\030\003 \001(\010H\000\210\001\001\022\014\n\004da" + + "ta\030\004 \001(\014\022\027\n\nlocal_name\030\005 \001(\tH\001\210\001\001\022\"\n\032man" + + "ufacturer_specific_data\030\006 \001(\014\022)\n\rservice" + + "_datas\030\007 \003(\0132\022.proto.ServiceData\022\"\n\rserv" + + "ice_uuids\030\010 \003(\0132\013.proto.UUID\022,\n\027solicite" + + "d_service_uuids\030\t \003(\0132\013.proto.UUID\022\033\n\016tx" + + "_power_level\030\n \001(\005H\002\210\001\001B\016\n\014_connectableB" + + "\r\n\013_local_nameB\021\n\017_tx_power_level\"6\n\nPer" + + "ipheral\022\n\n\002id\030\001 \001(\003\022\034\n\024maximum_write_len" + + "gth\030\002 \001(\005\"4\n\013GattService\022\n\n\002id\030\001 \001(\003\022\031\n\004" + + "uuid\030\002 \001(\0132\013.proto.UUID\"\230\001\n\022GattCharacte" + + "ristic\022\n\n\002id\030\001 \001(\003\022\031\n\004uuid\030\002 \001(\0132\013.proto" + + ".UUID\022\020\n\010can_read\030\003 \001(\010\022\021\n\tcan_write\030\004 \001" + + "(\010\022\"\n\032can_write_without_response\030\005 \001(\010\022\022" + + "\n\ncan_notify\030\006 \001(\010\"7\n\016GattDescriptor\022\n\n\002" + + "id\030\001 \001(\003\022\031\n\004uuid\030\002 \001(\0132\013.proto.UUID\"\025\n\004U" + + "UID\022\r\n\005value\030\001 \001(\t\"6\n\013ServiceData\022\031\n\004uui" + + "d\030\001 \001(\0132\013.proto.UUID\022\014\n\004data\030\002 \001(\014\".\n\033Bl" + + "uetoothLowEnergyException\022\017\n\007message\030\001 \001" + + "(\t*r\n\016BluetoothState\022\037\n\033BLUETOOTH_STATE_" + + "UNSUPPORTED\020\000\022\037\n\033BLUETOOTH_STATE_POWERED" + + "_OFF\020\001\022\036\n\032BLUETOOTH_STATE_POWERED_ON\020\002B." + + "\n*dev.yanshouwang.bluetooth_low_energy.p" + + "rotoP\001b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_proto_Advertisement_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_proto_Advertisement_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_proto_Advertisement_descriptor, + new java.lang.String[] { "Uuid", "Rssi", "Connectable", "Data", "LocalName", "ManufacturerSpecificData", "ServiceDatas", "ServiceUuids", "SolicitedServiceUuids", "TxPowerLevel", "Connectable", "LocalName", "TxPowerLevel", }); + internal_static_proto_Peripheral_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_proto_Peripheral_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_proto_Peripheral_descriptor, + new java.lang.String[] { "Id", "MaximumWriteLength", }); + internal_static_proto_GattService_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_proto_GattService_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_proto_GattService_descriptor, + new java.lang.String[] { "Id", "Uuid", }); + internal_static_proto_GattCharacteristic_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_proto_GattCharacteristic_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_proto_GattCharacteristic_descriptor, + new java.lang.String[] { "Id", "Uuid", "CanRead", "CanWrite", "CanWriteWithoutResponse", "CanNotify", }); + internal_static_proto_GattDescriptor_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_proto_GattDescriptor_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_proto_GattDescriptor_descriptor, + new java.lang.String[] { "Id", "Uuid", }); + internal_static_proto_UUID_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_proto_UUID_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_proto_UUID_descriptor, + new java.lang.String[] { "Value", }); + internal_static_proto_ServiceData_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_proto_ServiceData_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_proto_ServiceData_descriptor, + new java.lang.String[] { "Uuid", "Data", }); + internal_static_proto_BluetoothLowEnergyException_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_proto_BluetoothLowEnergyException_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_proto_BluetoothLowEnergyException_descriptor, + new java.lang.String[] { "Message", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/Peripheral.java b/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/Peripheral.java new file mode 100644 index 0000000..75875cb --- /dev/null +++ b/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/Peripheral.java @@ -0,0 +1,550 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: proto/messages.proto + +package dev.yanshouwang.bluetooth_low_energy.proto; + +/** + * Protobuf type {@code proto.Peripheral} + */ +public final class Peripheral extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:proto.Peripheral) + PeripheralOrBuilder { +private static final long serialVersionUID = 0L; + // Use Peripheral.newBuilder() to construct. + private Peripheral(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Peripheral() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Peripheral(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Peripheral( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + id_ = input.readInt64(); + break; + } + case 16: { + + maximumWriteLength_ = input.readInt32(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_Peripheral_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_Peripheral_fieldAccessorTable + .ensureFieldAccessorsInitialized( + dev.yanshouwang.bluetooth_low_energy.proto.Peripheral.class, dev.yanshouwang.bluetooth_low_energy.proto.Peripheral.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + private long id_; + /** + * int64 id = 1; + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + + public static final int MAXIMUM_WRITE_LENGTH_FIELD_NUMBER = 2; + private int maximumWriteLength_; + /** + * int32 maximum_write_length = 2; + * @return The maximumWriteLength. + */ + @java.lang.Override + public int getMaximumWriteLength() { + return maximumWriteLength_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (id_ != 0L) { + output.writeInt64(1, id_); + } + if (maximumWriteLength_ != 0) { + output.writeInt32(2, maximumWriteLength_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (id_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, id_); + } + if (maximumWriteLength_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, maximumWriteLength_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof dev.yanshouwang.bluetooth_low_energy.proto.Peripheral)) { + return super.equals(obj); + } + dev.yanshouwang.bluetooth_low_energy.proto.Peripheral other = (dev.yanshouwang.bluetooth_low_energy.proto.Peripheral) obj; + + if (getId() + != other.getId()) return false; + if (getMaximumWriteLength() + != other.getMaximumWriteLength()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getId()); + hash = (37 * hash) + MAXIMUM_WRITE_LENGTH_FIELD_NUMBER; + hash = (53 * hash) + getMaximumWriteLength(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static dev.yanshouwang.bluetooth_low_energy.proto.Peripheral parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.Peripheral parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.Peripheral parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.Peripheral parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.Peripheral parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.Peripheral parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.Peripheral parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.Peripheral parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.Peripheral parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.Peripheral parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.Peripheral parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.Peripheral parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(dev.yanshouwang.bluetooth_low_energy.proto.Peripheral prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code proto.Peripheral} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:proto.Peripheral) + dev.yanshouwang.bluetooth_low_energy.proto.PeripheralOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_Peripheral_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_Peripheral_fieldAccessorTable + .ensureFieldAccessorsInitialized( + dev.yanshouwang.bluetooth_low_energy.proto.Peripheral.class, dev.yanshouwang.bluetooth_low_energy.proto.Peripheral.Builder.class); + } + + // Construct using dev.yanshouwang.bluetooth_low_energy.proto.Peripheral.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + id_ = 0L; + + maximumWriteLength_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_Peripheral_descriptor; + } + + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.Peripheral getDefaultInstanceForType() { + return dev.yanshouwang.bluetooth_low_energy.proto.Peripheral.getDefaultInstance(); + } + + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.Peripheral build() { + dev.yanshouwang.bluetooth_low_energy.proto.Peripheral result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.Peripheral buildPartial() { + dev.yanshouwang.bluetooth_low_energy.proto.Peripheral result = new dev.yanshouwang.bluetooth_low_energy.proto.Peripheral(this); + result.id_ = id_; + result.maximumWriteLength_ = maximumWriteLength_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof dev.yanshouwang.bluetooth_low_energy.proto.Peripheral) { + return mergeFrom((dev.yanshouwang.bluetooth_low_energy.proto.Peripheral)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(dev.yanshouwang.bluetooth_low_energy.proto.Peripheral other) { + if (other == dev.yanshouwang.bluetooth_low_energy.proto.Peripheral.getDefaultInstance()) return this; + if (other.getId() != 0L) { + setId(other.getId()); + } + if (other.getMaximumWriteLength() != 0) { + setMaximumWriteLength(other.getMaximumWriteLength()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + dev.yanshouwang.bluetooth_low_energy.proto.Peripheral parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (dev.yanshouwang.bluetooth_low_energy.proto.Peripheral) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long id_ ; + /** + * int64 id = 1; + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + /** + * int64 id = 1; + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(long value) { + + id_ = value; + onChanged(); + return this; + } + /** + * int64 id = 1; + * @return This builder for chaining. + */ + public Builder clearId() { + + id_ = 0L; + onChanged(); + return this; + } + + private int maximumWriteLength_ ; + /** + * int32 maximum_write_length = 2; + * @return The maximumWriteLength. + */ + @java.lang.Override + public int getMaximumWriteLength() { + return maximumWriteLength_; + } + /** + * int32 maximum_write_length = 2; + * @param value The maximumWriteLength to set. + * @return This builder for chaining. + */ + public Builder setMaximumWriteLength(int value) { + + maximumWriteLength_ = value; + onChanged(); + return this; + } + /** + * int32 maximum_write_length = 2; + * @return This builder for chaining. + */ + public Builder clearMaximumWriteLength() { + + maximumWriteLength_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:proto.Peripheral) + } + + // @@protoc_insertion_point(class_scope:proto.Peripheral) + private static final dev.yanshouwang.bluetooth_low_energy.proto.Peripheral DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new dev.yanshouwang.bluetooth_low_energy.proto.Peripheral(); + } + + public static dev.yanshouwang.bluetooth_low_energy.proto.Peripheral getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Peripheral parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Peripheral(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.Peripheral getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/PeripheralOrBuilder.java b/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/PeripheralOrBuilder.java new file mode 100644 index 0000000..763f7ba --- /dev/null +++ b/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/PeripheralOrBuilder.java @@ -0,0 +1,21 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: proto/messages.proto + +package dev.yanshouwang.bluetooth_low_energy.proto; + +public interface PeripheralOrBuilder extends + // @@protoc_insertion_point(interface_extends:proto.Peripheral) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 id = 1; + * @return The id. + */ + long getId(); + + /** + * int32 maximum_write_length = 2; + * @return The maximumWriteLength. + */ + int getMaximumWriteLength(); +} diff --git a/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/ServiceData.java b/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/ServiceData.java new file mode 100644 index 0000000..b73e088 --- /dev/null +++ b/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/ServiceData.java @@ -0,0 +1,677 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: proto/messages.proto + +package dev.yanshouwang.bluetooth_low_energy.proto; + +/** + * Protobuf type {@code proto.ServiceData} + */ +public final class ServiceData extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:proto.ServiceData) + ServiceDataOrBuilder { +private static final long serialVersionUID = 0L; + // Use ServiceData.newBuilder() to construct. + private ServiceData(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ServiceData() { + data_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ServiceData(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ServiceData( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder subBuilder = null; + if (uuid_ != null) { + subBuilder = uuid_.toBuilder(); + } + uuid_ = input.readMessage(dev.yanshouwang.bluetooth_low_energy.proto.UUID.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(uuid_); + uuid_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + + data_ = input.readBytes(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_ServiceData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_ServiceData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + dev.yanshouwang.bluetooth_low_energy.proto.ServiceData.class, dev.yanshouwang.bluetooth_low_energy.proto.ServiceData.Builder.class); + } + + public static final int UUID_FIELD_NUMBER = 1; + private dev.yanshouwang.bluetooth_low_energy.proto.UUID uuid_; + /** + * .proto.UUID uuid = 1; + * @return Whether the uuid field is set. + */ + @java.lang.Override + public boolean hasUuid() { + return uuid_ != null; + } + /** + * .proto.UUID uuid = 1; + * @return The uuid. + */ + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.UUID getUuid() { + return uuid_ == null ? dev.yanshouwang.bluetooth_low_energy.proto.UUID.getDefaultInstance() : uuid_; + } + /** + * .proto.UUID uuid = 1; + */ + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder getUuidOrBuilder() { + return getUuid(); + } + + public static final int DATA_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString data_; + /** + * bytes data = 2; + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.ByteString getData() { + return data_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (uuid_ != null) { + output.writeMessage(1, getUuid()); + } + if (!data_.isEmpty()) { + output.writeBytes(2, data_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (uuid_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getUuid()); + } + if (!data_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, data_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof dev.yanshouwang.bluetooth_low_energy.proto.ServiceData)) { + return super.equals(obj); + } + dev.yanshouwang.bluetooth_low_energy.proto.ServiceData other = (dev.yanshouwang.bluetooth_low_energy.proto.ServiceData) obj; + + if (hasUuid() != other.hasUuid()) return false; + if (hasUuid()) { + if (!getUuid() + .equals(other.getUuid())) return false; + } + if (!getData() + .equals(other.getData())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasUuid()) { + hash = (37 * hash) + UUID_FIELD_NUMBER; + hash = (53 * hash) + getUuid().hashCode(); + } + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + getData().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static dev.yanshouwang.bluetooth_low_energy.proto.ServiceData parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.ServiceData parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.ServiceData parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.ServiceData parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.ServiceData parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.ServiceData parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.ServiceData parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.ServiceData parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.ServiceData parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.ServiceData parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.ServiceData parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.ServiceData parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(dev.yanshouwang.bluetooth_low_energy.proto.ServiceData prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code proto.ServiceData} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:proto.ServiceData) + dev.yanshouwang.bluetooth_low_energy.proto.ServiceDataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_ServiceData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_ServiceData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + dev.yanshouwang.bluetooth_low_energy.proto.ServiceData.class, dev.yanshouwang.bluetooth_low_energy.proto.ServiceData.Builder.class); + } + + // Construct using dev.yanshouwang.bluetooth_low_energy.proto.ServiceData.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (uuidBuilder_ == null) { + uuid_ = null; + } else { + uuid_ = null; + uuidBuilder_ = null; + } + data_ = com.google.protobuf.ByteString.EMPTY; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_ServiceData_descriptor; + } + + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.ServiceData getDefaultInstanceForType() { + return dev.yanshouwang.bluetooth_low_energy.proto.ServiceData.getDefaultInstance(); + } + + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.ServiceData build() { + dev.yanshouwang.bluetooth_low_energy.proto.ServiceData result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.ServiceData buildPartial() { + dev.yanshouwang.bluetooth_low_energy.proto.ServiceData result = new dev.yanshouwang.bluetooth_low_energy.proto.ServiceData(this); + if (uuidBuilder_ == null) { + result.uuid_ = uuid_; + } else { + result.uuid_ = uuidBuilder_.build(); + } + result.data_ = data_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof dev.yanshouwang.bluetooth_low_energy.proto.ServiceData) { + return mergeFrom((dev.yanshouwang.bluetooth_low_energy.proto.ServiceData)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(dev.yanshouwang.bluetooth_low_energy.proto.ServiceData other) { + if (other == dev.yanshouwang.bluetooth_low_energy.proto.ServiceData.getDefaultInstance()) return this; + if (other.hasUuid()) { + mergeUuid(other.getUuid()); + } + if (other.getData() != com.google.protobuf.ByteString.EMPTY) { + setData(other.getData()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + dev.yanshouwang.bluetooth_low_energy.proto.ServiceData parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (dev.yanshouwang.bluetooth_low_energy.proto.ServiceData) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private dev.yanshouwang.bluetooth_low_energy.proto.UUID uuid_; + private com.google.protobuf.SingleFieldBuilderV3< + dev.yanshouwang.bluetooth_low_energy.proto.UUID, dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder, dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder> uuidBuilder_; + /** + * .proto.UUID uuid = 1; + * @return Whether the uuid field is set. + */ + public boolean hasUuid() { + return uuidBuilder_ != null || uuid_ != null; + } + /** + * .proto.UUID uuid = 1; + * @return The uuid. + */ + public dev.yanshouwang.bluetooth_low_energy.proto.UUID getUuid() { + if (uuidBuilder_ == null) { + return uuid_ == null ? dev.yanshouwang.bluetooth_low_energy.proto.UUID.getDefaultInstance() : uuid_; + } else { + return uuidBuilder_.getMessage(); + } + } + /** + * .proto.UUID uuid = 1; + */ + public Builder setUuid(dev.yanshouwang.bluetooth_low_energy.proto.UUID value) { + if (uuidBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + uuid_ = value; + onChanged(); + } else { + uuidBuilder_.setMessage(value); + } + + return this; + } + /** + * .proto.UUID uuid = 1; + */ + public Builder setUuid( + dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder builderForValue) { + if (uuidBuilder_ == null) { + uuid_ = builderForValue.build(); + onChanged(); + } else { + uuidBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .proto.UUID uuid = 1; + */ + public Builder mergeUuid(dev.yanshouwang.bluetooth_low_energy.proto.UUID value) { + if (uuidBuilder_ == null) { + if (uuid_ != null) { + uuid_ = + dev.yanshouwang.bluetooth_low_energy.proto.UUID.newBuilder(uuid_).mergeFrom(value).buildPartial(); + } else { + uuid_ = value; + } + onChanged(); + } else { + uuidBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .proto.UUID uuid = 1; + */ + public Builder clearUuid() { + if (uuidBuilder_ == null) { + uuid_ = null; + onChanged(); + } else { + uuid_ = null; + uuidBuilder_ = null; + } + + return this; + } + /** + * .proto.UUID uuid = 1; + */ + public dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder getUuidBuilder() { + + onChanged(); + return getUuidFieldBuilder().getBuilder(); + } + /** + * .proto.UUID uuid = 1; + */ + public dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder getUuidOrBuilder() { + if (uuidBuilder_ != null) { + return uuidBuilder_.getMessageOrBuilder(); + } else { + return uuid_ == null ? + dev.yanshouwang.bluetooth_low_energy.proto.UUID.getDefaultInstance() : uuid_; + } + } + /** + * .proto.UUID uuid = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + dev.yanshouwang.bluetooth_low_energy.proto.UUID, dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder, dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder> + getUuidFieldBuilder() { + if (uuidBuilder_ == null) { + uuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + dev.yanshouwang.bluetooth_low_energy.proto.UUID, dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder, dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder>( + getUuid(), + getParentForChildren(), + isClean()); + uuid_ = null; + } + return uuidBuilder_; + } + + private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes data = 2; + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.ByteString getData() { + return data_; + } + /** + * bytes data = 2; + * @param value The data to set. + * @return This builder for chaining. + */ + public Builder setData(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + data_ = value; + onChanged(); + return this; + } + /** + * bytes data = 2; + * @return This builder for chaining. + */ + public Builder clearData() { + + data_ = getDefaultInstance().getData(); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:proto.ServiceData) + } + + // @@protoc_insertion_point(class_scope:proto.ServiceData) + private static final dev.yanshouwang.bluetooth_low_energy.proto.ServiceData DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new dev.yanshouwang.bluetooth_low_energy.proto.ServiceData(); + } + + public static dev.yanshouwang.bluetooth_low_energy.proto.ServiceData getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ServiceData parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ServiceData(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.ServiceData getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/ServiceDataOrBuilder.java b/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/ServiceDataOrBuilder.java new file mode 100644 index 0000000..af6b7e4 --- /dev/null +++ b/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/ServiceDataOrBuilder.java @@ -0,0 +1,30 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: proto/messages.proto + +package dev.yanshouwang.bluetooth_low_energy.proto; + +public interface ServiceDataOrBuilder extends + // @@protoc_insertion_point(interface_extends:proto.ServiceData) + com.google.protobuf.MessageOrBuilder { + + /** + * .proto.UUID uuid = 1; + * @return Whether the uuid field is set. + */ + boolean hasUuid(); + /** + * .proto.UUID uuid = 1; + * @return The uuid. + */ + dev.yanshouwang.bluetooth_low_energy.proto.UUID getUuid(); + /** + * .proto.UUID uuid = 1; + */ + dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder getUuidOrBuilder(); + + /** + * bytes data = 2; + * @return The data. + */ + com.google.protobuf.ByteString getData(); +} diff --git a/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/UUID.java b/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/UUID.java new file mode 100644 index 0000000..07eb7e1 --- /dev/null +++ b/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/UUID.java @@ -0,0 +1,559 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: proto/messages.proto + +package dev.yanshouwang.bluetooth_low_energy.proto; + +/** + * Protobuf type {@code proto.UUID} + */ +public final class UUID extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:proto.UUID) + UUIDOrBuilder { +private static final long serialVersionUID = 0L; + // Use UUID.newBuilder() to construct. + private UUID(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private UUID() { + value_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new UUID(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private UUID( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + value_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_UUID_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_UUID_fieldAccessorTable + .ensureFieldAccessorsInitialized( + dev.yanshouwang.bluetooth_low_energy.proto.UUID.class, dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder.class); + } + + public static final int VALUE_FIELD_NUMBER = 1; + private volatile java.lang.Object value_; + /** + * string value = 1; + * @return The value. + */ + @java.lang.Override + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } + } + /** + * string value = 1; + * @return The bytes for value. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, value_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, value_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof dev.yanshouwang.bluetooth_low_energy.proto.UUID)) { + return super.equals(obj); + } + dev.yanshouwang.bluetooth_low_energy.proto.UUID other = (dev.yanshouwang.bluetooth_low_energy.proto.UUID) obj; + + if (!getValue() + .equals(other.getValue())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static dev.yanshouwang.bluetooth_low_energy.proto.UUID parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.UUID parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.UUID parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.UUID parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.UUID parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.UUID parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.UUID parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.UUID parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.UUID parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.UUID parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.UUID parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static dev.yanshouwang.bluetooth_low_energy.proto.UUID parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(dev.yanshouwang.bluetooth_low_energy.proto.UUID prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code proto.UUID} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:proto.UUID) + dev.yanshouwang.bluetooth_low_energy.proto.UUIDOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_UUID_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_UUID_fieldAccessorTable + .ensureFieldAccessorsInitialized( + dev.yanshouwang.bluetooth_low_energy.proto.UUID.class, dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder.class); + } + + // Construct using dev.yanshouwang.bluetooth_low_energy.proto.UUID.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + value_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return dev.yanshouwang.bluetooth_low_energy.proto.Messages.internal_static_proto_UUID_descriptor; + } + + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.UUID getDefaultInstanceForType() { + return dev.yanshouwang.bluetooth_low_energy.proto.UUID.getDefaultInstance(); + } + + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.UUID build() { + dev.yanshouwang.bluetooth_low_energy.proto.UUID result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.UUID buildPartial() { + dev.yanshouwang.bluetooth_low_energy.proto.UUID result = new dev.yanshouwang.bluetooth_low_energy.proto.UUID(this); + result.value_ = value_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof dev.yanshouwang.bluetooth_low_energy.proto.UUID) { + return mergeFrom((dev.yanshouwang.bluetooth_low_energy.proto.UUID)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(dev.yanshouwang.bluetooth_low_energy.proto.UUID other) { + if (other == dev.yanshouwang.bluetooth_low_energy.proto.UUID.getDefaultInstance()) return this; + if (!other.getValue().isEmpty()) { + value_ = other.value_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + dev.yanshouwang.bluetooth_low_energy.proto.UUID parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (dev.yanshouwang.bluetooth_low_energy.proto.UUID) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object value_ = ""; + /** + * string value = 1; + * @return The value. + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string value = 1; + * @return The bytes for value. + */ + public com.google.protobuf.ByteString + getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string value = 1; + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + value_ = value; + onChanged(); + return this; + } + /** + * string value = 1; + * @return This builder for chaining. + */ + public Builder clearValue() { + + value_ = getDefaultInstance().getValue(); + onChanged(); + return this; + } + /** + * string value = 1; + * @param value The bytes for value to set. + * @return This builder for chaining. + */ + public Builder setValueBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + value_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:proto.UUID) + } + + // @@protoc_insertion_point(class_scope:proto.UUID) + private static final dev.yanshouwang.bluetooth_low_energy.proto.UUID DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new dev.yanshouwang.bluetooth_low_energy.proto.UUID(); + } + + public static dev.yanshouwang.bluetooth_low_energy.proto.UUID getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UUID parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UUID(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public dev.yanshouwang.bluetooth_low_energy.proto.UUID getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/UUIDOrBuilder.java b/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/UUIDOrBuilder.java new file mode 100644 index 0000000..3fe873b --- /dev/null +++ b/android/src/main/java/dev/yanshouwang/bluetooth_low_energy/proto/UUIDOrBuilder.java @@ -0,0 +1,21 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: proto/messages.proto + +package dev.yanshouwang.bluetooth_low_energy.proto; + +public interface UUIDOrBuilder extends + // @@protoc_insertion_point(interface_extends:proto.UUID) + com.google.protobuf.MessageOrBuilder { + + /** + * string value = 1; + * @return The value. + */ + java.lang.String getValue(); + /** + * string value = 1; + * @return The bytes for value. + */ + com.google.protobuf.ByteString + getValueBytes(); +} diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/BluetoothLowEnergyException.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/BluetoothLowEnergyException.kt new file mode 100644 index 0000000..35e1a42 --- /dev/null +++ b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/BluetoothLowEnergyException.kt @@ -0,0 +1,3 @@ +package dev.yanshouwang.bluetooth_low_energy + +class BluetoothLowEnergyException(message: String) : Exception(message) \ No newline at end of file diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/BluetoothLowEnergyPlugin.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/BluetoothLowEnergyPlugin.kt index 5336529..cd72e6e 100644 --- a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/BluetoothLowEnergyPlugin.kt +++ b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/BluetoothLowEnergyPlugin.kt @@ -1,599 +1,132 @@ package dev.yanshouwang.bluetooth_low_energy -import android.Manifest -import android.bluetooth.* -import android.bluetooth.le.* -import android.content.BroadcastReceiver +import android.bluetooth.BluetoothAdapter +import android.bluetooth.BluetoothDevice +import android.bluetooth.BluetoothManager +import android.bluetooth.le.ScanRecord import android.content.Context -import android.content.Intent -import android.content.IntentFilter import android.content.pm.PackageManager -import android.os.Build import android.os.Handler -import android.os.ParcelUuid -import android.util.Log import androidx.annotation.NonNull -import androidx.core.app.ActivityCompat import androidx.core.content.ContextCompat -import com.google.protobuf.ByteString -import dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.* -import dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.MessageCategory.* +import dev.yanshouwang.bluetooth_low_energy.pigeon.Api +import dev.yanshouwang.bluetooth_low_energy.proto.BluetoothState import io.flutter.embedding.engine.plugins.FlutterPlugin import io.flutter.embedding.engine.plugins.activity.ActivityAware import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding -import io.flutter.plugin.common.EventChannel -import io.flutter.plugin.common.EventChannel.EventSink -import io.flutter.plugin.common.EventChannel.StreamHandler -import io.flutter.plugin.common.MethodCall -import io.flutter.plugin.common.MethodChannel -import io.flutter.plugin.common.MethodChannel.MethodCallHandler -import io.flutter.plugin.common.MethodChannel.Result -import io.flutter.plugin.common.PluginRegistry.RequestPermissionsResultListener -import java.util.* - -const val NAMESPACE = "yanshouwang.dev/bluetooth_low_energy" - -typealias StartScanHandler = (code: Int) -> Unit -typealias RequestPermissionsHandler = (granted: Boolean) -> Unit +import java.util.concurrent.Executor /** BluetoothLowEnergyPlugin */ -class BluetoothLowEnergyPlugin : FlutterPlugin, MethodCallHandler, StreamHandler, ActivityAware, RequestPermissionsResultListener { - companion object { - private const val CLIENT_CHARACTERISTIC_CONFIG = "00002902-0000-1000-8000-00805f9b34fb" - private const val BLUETOOTH_ADAPTER_STATE_UNKNOWN = -1 - private const val NO_ERROR = 0 - private const val REQUEST_CODE = 443 - } - - private lateinit var method: MethodChannel - private lateinit var event: EventChannel - private lateinit var context: Context - - private var binding: ActivityPluginBinding? = null - private var events: EventSink? = null - - private val bluetoothAvailable by lazy { context.packageManager.hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE) } - private val bluetoothManager by lazy { context.getSystemService(Context.BLUETOOTH_SERVICE) as BluetoothManager } - private val bluetoothAdapter by lazy { bluetoothManager.adapter } - private val handler by lazy { Handler(context.mainLooper) } - - private val bluetoothState: BluetoothState - get() { - return if (bluetoothAvailable) bluetoothAdapter.state.messageState - else BluetoothState.UNSUPPORTED - } - - private val bluetoothStateReceiver by lazy { - object : BroadcastReceiver() { - override fun onReceive(context: Context?, intent: Intent?) { - val oldState = intent!!.getIntExtra(BluetoothAdapter.EXTRA_PREVIOUS_STATE, BLUETOOTH_ADAPTER_STATE_UNKNOWN).messageState - val newState = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, BLUETOOTH_ADAPTER_STATE_UNKNOWN).messageState - if (newState == oldState) return - if (newState != BluetoothState.POWERED_ON && scanning) scanning = false - val event = Message.newBuilder() - .setCategory(BLUETOOTH_STATE) - .setState(newState) - .build() - .toByteArray() - events?.success(event) - } - } - } - - private val hasPermission - get() = ContextCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED - - private var requestPermissionsHandler: RequestPermissionsHandler? = null - - private var scanCode = NO_ERROR - private var scanning = false - - private val scanCallback by lazy { - object : ScanCallback() { - override fun onScanFailed(errorCode: Int) { - super.onScanFailed(errorCode) - scanCode = errorCode - } - - override fun onScanResult(callbackType: Int, result: ScanResult?) { - super.onScanResult(callbackType, result) - if (result == null) return - val record = result.scanRecord - val advertisements = - if (record == null) ByteString.EMPTY - else ByteString.copyFrom(record.bytes) - // TODO: We can't get connectable value before Android 8.0, here we just return true - // remove this useless code after the minSdkVersion set to 26 or later. - val connectable = - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) result.isConnectable - else true - val builder = Discovery.newBuilder() - .setUuid(result.device.uuid) - .setRssi(result.rssi) - .setAdvertisements(advertisements) - .setConnectable(connectable) - val discovery = builder.build() - val event = Message.newBuilder() - .setCategory(CENTRAL_DISCOVERED) - .setDiscovery(discovery) - .build() - .toByteArray() - events?.success(event) - } - - override fun onBatchScanResults(results: MutableList?) { - super.onBatchScanResults(results) - if (results == null) return - for (result in results) { - val record = result.scanRecord - val advertisements = - if (record == null) ByteString.EMPTY - else ByteString.copyFrom(record.bytes) - // TODO: We can't get connectable value before Android 8.0, here we just return true - // remove this useless code after the minSdkVersion set to 26 or later. - val connectable = - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) result.isConnectable - else true - val builder = Discovery.newBuilder() - .setUuid(result.device.uuid) - .setRssi(result.rssi) - .setAdvertisements(advertisements) - .setConnectable(connectable) - val discovery = builder.build() - val event = Message.newBuilder() - .setCategory(CENTRAL_DISCOVERED) - .setDiscovery(discovery) - .build() - .toByteArray() - events?.success(event) - } - } - } - } - - private val nativeGATTs by lazy { mutableMapOf() } - - private val connects by lazy { mutableMapOf() } - private val maximumWriteLengths by lazy { mutableMapOf() } - private val disconnects by lazy { mutableMapOf() } - private val characteristicReads by lazy { mutableMapOf() } - private val characteristicWrites by lazy { mutableMapOf() } - private val descriptorReads by lazy { mutableMapOf() } - private val descriptorWrites by lazy { mutableMapOf() } - - private val bluetoothGattCallback by lazy { - object : BluetoothGattCallback() { - override fun onConnectionStateChange(gatt: BluetoothGatt?, status: Int, newState: Int) { - super.onConnectionStateChange(gatt, status, newState) - when (status) { - BluetoothGatt.GATT_SUCCESS -> { - when (newState) { - BluetoothProfile.STATE_DISCONNECTED -> { - // Maybe disconnect succeed, connect failed, or connection lost when an adaptor closed event triggered. - gatt!!.close() - val connect = connects.remove(gatt) - if (connect != null) handler.post { connect.error("GATT error with status: $status.", null, null) } - else { - val nativeGATT = nativeGATTs.entries.first { entry -> entry.value.value === gatt } - nativeGATTs.remove(nativeGATT.key) - val disconnect = disconnects.remove(gatt) - if (disconnect != null) handler.post { disconnect.success() } - else { - val connectionLost = GattConnectionLost.newBuilder() - .setKey(nativeGATT.key) - .setError("GATT error with status: $status") - .build() - val event = Message.newBuilder() - .setCategory(GATT_CONNECTION_LOST) - .setConnectionLost(connectionLost) - .build() - .toByteArray() - handler.post { events?.success(event) } - } - } - } - BluetoothProfile.STATE_CONNECTED -> { - // Must be connect succeed. - val requested = gatt!!.requestMtu(512) - if (!requested) gatt.disconnect() - } - else -> throw NotImplementedError() // should never be called. - } - } - else -> { - // Maybe connect failed, disconnect failed or connection lost. - gatt!!.close() - val connect = connects.remove(gatt) - if (connect != null) handler.post { connect.error("GATT error with status: $status", null, null) } - else { - val nativeGATT = nativeGATTs.entries.first { entry -> entry.value.value === gatt } - nativeGATTs.remove(nativeGATT.key) - val disconnect = disconnects.remove(gatt) - if (disconnect != null) handler.post { disconnect.error("GATT error with status: $status", null, null) } - else { - val connectionLost = GattConnectionLost.newBuilder() - .setKey(nativeGATT.key) - .setError("GATT error with status: $status") - .build() - val event = Message.newBuilder() - .setCategory(GATT_CONNECTION_LOST) - .setConnectionLost(connectionLost) - .build() - .toByteArray() - handler.post { events?.success(event) } - } - } - } - } - } - - override fun onMtuChanged(gatt: BluetoothGatt?, mtu: Int, status: Int) { - super.onMtuChanged(gatt, mtu, status) - when (status) { - BluetoothGatt.GATT_SUCCESS -> { - val discovered = gatt!!.discoverServices() - if (discovered) maximumWriteLengths[gatt] = mtu - 3 - else gatt.disconnect() - } - else -> gatt!!.disconnect() - } - } - - override fun onServicesDiscovered(gatt: BluetoothGatt?, status: Int) { - super.onServicesDiscovered(gatt, status) - val maximumWriteLength = maximumWriteLengths.remove(gatt)!! - when (status) { - BluetoothGatt.GATT_SUCCESS -> { - val nativeServices = mutableMapOf() - val messageServices = mutableListOf() - for (service in gatt!!.services) { - val nativeCharacteristics = mutableMapOf() - val messageCharacteristics = mutableListOf() - for (characteristic in service.characteristics) { - val nativeDescriptors = mutableMapOf() - val messageDescriptors = mutableListOf() - for (descriptor in characteristic.descriptors) { - // Add native descriptor. - val nativeDescriptor = NativeGattDescriptor(descriptor) - nativeDescriptors[nativeDescriptor.key] = nativeDescriptor - // Add message descriptor. - val descriptorUUID = descriptor.uuid.toString() - val messageDescriptor = GattDescriptor.newBuilder() - .setKey(nativeDescriptor.key) - .setUuid(descriptorUUID) - .build() - messageDescriptors.add(messageDescriptor) - } - // Add native characteristic. - val nativeCharacteristic = NativeGattCharacteristic(characteristic, nativeDescriptors) - nativeCharacteristics[nativeCharacteristic.key] = nativeCharacteristic - // Add message characteristic. - val characteristicUUID = characteristic.uuid.toString() - val canRead = characteristic.properties and BluetoothGattCharacteristic.PROPERTY_READ != 0 - val canWrite = characteristic.properties and BluetoothGattCharacteristic.PROPERTY_WRITE != 0 - val canWriteWithoutResponse = characteristic.properties and BluetoothGattCharacteristic.PROPERTY_WRITE_NO_RESPONSE != 0 - val canNotify = characteristic.properties and BluetoothGattCharacteristic.PROPERTY_NOTIFY != 0 - val messageCharacteristic = GattCharacteristic.newBuilder() - .setKey(nativeCharacteristic.key) - .setUuid(characteristicUUID) - .setCanRead(canRead) - .setCanWrite(canWrite) - .setCanWriteWithoutResponse(canWriteWithoutResponse) - .setCanNotify(canNotify) - .addAllDescriptors(messageDescriptors) - .build() - messageCharacteristics.add(messageCharacteristic) - } - // Add native service. - val nativeService = NativeGattService(service, nativeCharacteristics) - nativeServices[nativeService.key] = nativeService - // Add message service. - val serviceUUID = service.uuid.toString() - val messageService = GattService.newBuilder() - .setKey(nativeService.key) - .setUuid(serviceUUID) - .addAllCharacteristics(messageCharacteristics) - .build() - messageServices.add(messageService) - } - // Add native gatt. - val nativeGATT = NativeGATT(gatt, nativeServices) - nativeGATTs[nativeGATT.key] = nativeGATT - // Add message gatt. - val reply = GATT.newBuilder() - .setKey(nativeGATT.key) - .setMaximumWriteLength(maximumWriteLength) - .addAllServices(messageServices) - .build() - .toByteArray() - val connect = connects.remove(gatt)!! - handler.post { connect.success(reply) } - } - else -> gatt!!.disconnect() - } - } - - override fun onCharacteristicRead(gatt: BluetoothGatt?, characteristic: BluetoothGattCharacteristic?, status: Int) { - super.onCharacteristicRead(gatt, characteristic, status) - val read = characteristicReads.remove(characteristic)!! - when (status) { - BluetoothGatt.GATT_SUCCESS -> handler.post { read.success(characteristic!!.value) } - else -> handler.post { read.error("GATT error with status: $status", null, null) } - } - } - - override fun onCharacteristicWrite(gatt: BluetoothGatt?, characteristic: BluetoothGattCharacteristic?, status: Int) { - super.onCharacteristicWrite(gatt, characteristic, status) - val write = characteristicWrites.remove(characteristic)!! - when (status) { - BluetoothGatt.GATT_SUCCESS -> handler.post { write.success() } - else -> handler.post { write.error("GATT error with status: $status", null, null) } - } - } - - override fun onCharacteristicChanged(gatt: BluetoothGatt?, characteristic: BluetoothGattCharacteristic?) { - super.onCharacteristicChanged(gatt, characteristic) - val nativeGATT = nativeGATTs.values.first { entry -> entry.value === gatt } - val nativeService = nativeGATT.services.values.first { entry -> entry.value === characteristic!!.service } - val nativeCharacteristic = nativeService.characteristics.values.first { entry -> entry.value === characteristic } - val value = ByteString.copyFrom(characteristic!!.value) - val characteristicValue = GattCharacteristicValue.newBuilder() - .setGattKey(nativeGATT.key) - .setServiceKey(nativeService.key) - .setKey(nativeCharacteristic.key) - .setValue(value) - .build() - val event = Message.newBuilder() - .setCategory(GATT_CHARACTERISTIC_NOTIFY) - .setCharacteristicValue(characteristicValue) - .build() - .toByteArray() - handler.post { events?.success(event) } - } - - override fun onDescriptorRead(gatt: BluetoothGatt?, descriptor: BluetoothGattDescriptor?, status: Int) { - super.onDescriptorRead(gatt, descriptor, status) - val read = descriptorReads.remove(descriptor)!! - when (status) { - BluetoothGatt.GATT_SUCCESS -> handler.post { read.success(descriptor!!.value) } - else -> handler.post { read.error("GATT error with status: $status", null, null) } - } - } - - override fun onDescriptorWrite(gatt: BluetoothGatt?, descriptor: BluetoothGattDescriptor?, status: Int) { - super.onDescriptorWrite(gatt, descriptor, status) - val write = descriptorWrites.remove(descriptor)!! - when (status) { - BluetoothGatt.GATT_SUCCESS -> handler.post { write.success() } - else -> handler.post { write.error("GATT error with status: $status", null, null) } - } - } - } - } - - private fun startScan(services: List, startScanHandler: StartScanHandler) { - val filters = services.map { service -> - val serviceUUID = ParcelUuid.fromString(service) - ScanFilter.Builder() - .setServiceUuid(serviceUUID) - .build() - } - val settings = ScanSettings.Builder() - .setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY) - .build() - bluetoothAdapter.bluetoothLeScanner.startScan(filters, settings, scanCallback) - // use handler.post to delay until #onScanFailed executed. - handler.post { - val code = scanCode - when (code) { - NO_ERROR -> scanning = true - else -> scanCode = NO_ERROR - } - startScanHandler.invoke(code) - } - } - - private fun stopScan() { - bluetoothAdapter.bluetoothLeScanner.stopScan(scanCallback) - scanning = false - } - +class BluetoothLowEnergyPlugin : FlutterPlugin, ActivityAware { override fun onAttachedToEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) { - method = MethodChannel(binding.binaryMessenger, "$NAMESPACE/method") - method.setMethodCallHandler(this) - event = EventChannel(binding.binaryMessenger, "$NAMESPACE/event") - event.setStreamHandler(this) - context = binding.applicationContext - // Register bluetooth adapter state receiver. - val adapterStateFilter = IntentFilter(BluetoothAdapter.ACTION_STATE_CHANGED) - context.registerReceiver(bluetoothStateReceiver, adapterStateFilter) + val binaryMessenger = binding.binaryMessenger + + items[KEY_CENTRAL_MANAGER_FLUTTER_API] = Api.CentralManagerFlutterApi(binaryMessenger) + items[KEY_PERIPHERAL_FLUTTER_API] = Api.PeripheralFlutterApi(binaryMessenger) + items[KEY_GATT_CHARACTERISTIC_FLUTTER_API] = Api.GattCharacteristicFlutterApi(binaryMessenger) + + Api.CentralManagerHostApi.setup(binaryMessenger, MyCentralManagerHostApi) + Api.PeripheralHostApi.setup(binaryMessenger, MyPeripheralHostApi) + Api.GattServiceHostApi.setup(binaryMessenger, MyGattServiceHostApi) + Api.GattCharacteristicHostApi.setup(binaryMessenger, MyGattCharacteristicHostApi) + Api.GattDescriptorHostApi.setup(binaryMessenger, MyGattDescriptorHostApi) } override fun onDetachedFromEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) { - // Clear connections. - for (nativeGATT in nativeGATTs.values) nativeGATT.value.disconnect() - // Stop scan. - if (scanning) stopScan() - // Unregister bluetooth adapter state receiver. - context.unregisterReceiver(bluetoothStateReceiver) - event.setStreamHandler(null) - method.setMethodCallHandler(null) - } + val binaryMessenger = binding.binaryMessenger - override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) { - val data = call.arguments() - val command = Message.parseFrom(data) - when (command.category!!) { - BLUETOOTH_STATE -> result.success(bluetoothState.number) - CENTRAL_START_DISCOVERY -> { - val startDiscovery = Runnable { - val services = command.startDiscoveryArguments.servicesList - val startScanHandler: StartScanHandler = { code -> - when (code) { - NO_ERROR -> result.success() - else -> result.error("Discovery start failed with code: $code", null, null) - } - } - startScan(services, startScanHandler) - } - when { - hasPermission -> startDiscovery.run() - else -> { - requestPermissionsHandler = { granted -> - if (granted) startDiscovery.run() - else result.error("Discovery start failed because `ACCESS_FINE_LOCATION` was denied by user.", null, null) - } - val permissions = arrayOf(Manifest.permission.ACCESS_FINE_LOCATION) - ActivityCompat.requestPermissions(binding!!.activity, permissions, REQUEST_CODE) - } - } - } - CENTRAL_STOP_DISCOVERY -> { - stopScan() - result.success() - } - CENTRAL_CONNECT -> { - val device = bluetoothAdapter.getRemoteDevice(command.connectArguments.uuid.address) - val gatt = when { - // Use TRANSPORT_LE to avoid none flag device on Android 23 or later. - Build.VERSION.SDK_INT >= Build.VERSION_CODES.M -> device.connectGatt(context, false, bluetoothGattCallback, BluetoothDevice.TRANSPORT_LE) - else -> device.connectGatt(context, false, bluetoothGattCallback) - } - connects[gatt] = result - } - GATT_DISCONNECT -> { - val nativeGATT = nativeGATTs[command.disconnectArguments.key]!! - disconnects[nativeGATT.value] = result - nativeGATT.value.disconnect() - } - GATT_CHARACTERISTIC_READ -> { - val nativeGATT = nativeGATTs[command.characteristicReadArguments.gattKey]!! - val nativeService = nativeGATT.services[command.characteristicReadArguments.serviceKey]!! - val nativeCharacteristic = nativeService.characteristics[command.characteristicReadArguments.key]!! - val read = nativeGATT.value.readCharacteristic(nativeCharacteristic.value) - if (read) characteristicReads[nativeCharacteristic.value] = result - else result.error("Characteristic read failed.", null, null) - } - GATT_CHARACTERISTIC_WRITE -> { - val nativeGATT = nativeGATTs[command.characteristicWriteArguments.gattKey]!! - val nativeService = nativeGATT.services[command.characteristicWriteArguments.serviceKey]!! - val nativeCharacteristic = nativeService.characteristics[command.characteristicWriteArguments.key]!! - nativeCharacteristic.value.writeType = - if (command.characteristicWriteArguments.withoutResponse) BluetoothGattCharacteristic.WRITE_TYPE_NO_RESPONSE - else BluetoothGattCharacteristic.WRITE_TYPE_DEFAULT - nativeCharacteristic.value.value = command.characteristicWriteArguments.value.toByteArray() - val written = nativeGATT.value.writeCharacteristic(nativeCharacteristic.value) - if (written) characteristicWrites[nativeCharacteristic.value] = result - else result.error("Characteristic write failed.", null, null) - } - GATT_CHARACTERISTIC_NOTIFY -> { - val nativeGATT = nativeGATTs[command.characteristicNotifyArguments.gattKey]!! - val nativeService = nativeGATT.services[command.characteristicNotifyArguments.serviceKey]!! - val nativeCharacteristic = nativeService.characteristics[command.characteristicNotifyArguments.key]!! - val descriptorUUID = UUID.fromString(CLIENT_CHARACTERISTIC_CONFIG) - val descriptor = nativeCharacteristic.value.getDescriptor(descriptorUUID) - val notified = nativeGATT.value.setCharacteristicNotification(nativeCharacteristic.value, command.characteristicNotifyArguments.state) - if (notified) { - descriptor.value = - if (command.characteristicNotifyArguments.state) BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE - else BluetoothGattDescriptor.DISABLE_NOTIFICATION_VALUE - val written = nativeGATT.value.writeDescriptor(descriptor) - if (written) descriptorWrites[descriptor] = result - else result.error("Client characteristic config descriptor write failed.", null, null) - } else result.error("Characteristic Notify failed.", null, null) - } - GATT_DESCRIPTOR_READ -> { - val nativeGATT = nativeGATTs[command.descriptorReadArguments.gattKey]!! - val nativeService = nativeGATT.services[command.descriptorReadArguments.serviceKey]!! - val nativeCharacteristic = nativeService.characteristics[command.descriptorReadArguments.characteristicKey]!! - val nativeDescriptor = nativeCharacteristic.descriptors[command.descriptorReadArguments.key]!! - val read = nativeGATT.value.readDescriptor(nativeDescriptor.value) - if (read) descriptorReads[nativeDescriptor.value] = result - else result.error("Descriptor read failed.", null, null) - } - GATT_DESCRIPTOR_WRITE -> { - val nativeGATT = nativeGATTs[command.descriptorWriteArguments.gattKey]!! - val nativeService = nativeGATT.services[command.descriptorWriteArguments.serviceKey]!! - val nativeCharacteristic = nativeService.characteristics[command.descriptorWriteArguments.characteristicKey]!! - val nativeDescriptor = nativeCharacteristic.descriptors[command.descriptorWriteArguments.key]!! - nativeDescriptor.value.value = command.descriptorWriteArguments.value.toByteArray() - val written = nativeGATT.value.writeDescriptor(nativeDescriptor.value) - if (written) descriptorWrites[nativeDescriptor.value] = result - else result.error("Descriptor write failed.", null, null) - } - else -> result.notImplemented() - } - } + items.remove(KEY_CENTRAL_MANAGER_FLUTTER_API) + items.remove(KEY_PERIPHERAL_FLUTTER_API) + items.remove(KEY_GATT_CHARACTERISTIC_FLUTTER_API) - override fun onListen(arguments: Any?, events: EventSink?) { - Log.d(TAG, "onListen") - this.events = events - } - - override fun onCancel(arguments: Any?) { - Log.d(TAG, "onCancel") - // This must be a hot reload for now, clear all status here. - // Clear connections. - for (nativeGATT in nativeGATTs.values) nativeGATT.value.disconnect() - // Stop scan. - if (scanning) stopScan() - events = null + Api.CentralManagerHostApi.setup(binaryMessenger, null) + Api.PeripheralHostApi.setup(binaryMessenger, null) + Api.GattServiceHostApi.setup(binaryMessenger, null) + Api.GattCharacteristicHostApi.setup(binaryMessenger, null) + Api.GattDescriptorHostApi.setup(binaryMessenger, null) } override fun onAttachedToActivity(binding: ActivityPluginBinding) { - this.binding = binding - this.binding!!.addRequestPermissionsResultListener(this) - } - - override fun onDetachedFromActivity() { - binding!!.removeRequestPermissionsResultListener(this) - binding = null - } - - override fun onReattachedToActivityForConfigChanges(binding: ActivityPluginBinding) { - onAttachedToActivity(binding) + items[KEY_ACTIVITY_PLUGIN_BINDING] = binding + binding.addRequestPermissionsResultListener(MyRequestPermissionsResultListener) } override fun onDetachedFromActivityForConfigChanges() { onDetachedFromActivity() } - override fun onRequestPermissionsResult(requestCode: Int, permissions: Array?, grantResults: IntArray?): Boolean { - return when { - requestCode != REQUEST_CODE || requestPermissionsHandler == null -> false - else -> { - val granted = - grantResults != null && grantResults.all { result -> result == PackageManager.PERMISSION_GRANTED } - requestPermissionsHandler!!.invoke(granted) - requestPermissionsHandler = null - true - } - } + override fun onReattachedToActivityForConfigChanges(binding: ActivityPluginBinding) { + onAttachedToActivity(binding) + } + + override fun onDetachedFromActivity() { + val binding = items.remove(KEY_ACTIVITY_PLUGIN_BINDING) as ActivityPluginBinding + binding.removeRequestPermissionsResultListener(MyRequestPermissionsResultListener) } } -val Any.TAG: String - get() = this::class.java.simpleName +const val KEY_CENTRAL_MANAGER_FLUTTER_API = "KEY_CENTRAL_MANAGER_FLUTTER_API" +const val KEY_PERIPHERAL_FLUTTER_API = "KEY_PERIPHERAL_FLUTTER_API" +const val KEY_GATT_CHARACTERISTIC_FLUTTER_API = "KEY_GATT_CHARACTERISTIC_FLUTTER_API" +const val KEY_ACTIVITY_PLUGIN_BINDING = "KEY_ACTIVITY_PLUGIN_BINDING" +const val REQUEST_CODE = 443 +const val KEY_AUTHORIZE_RESULT = "KEY_AUTHORIZE_RESULT" +const val KEY_START_SCAN_ERROR = "KEY_START_SCAN_ERROR" +const val KEY_CONNECT_RESULT = "KEY_CONNECT_RESULT" +const val KEY_DISCONNECT_RESULT = "KEY_DISCONNECT_RESULT" +const val KEY_DISCOVER_SERVICES_RESULT = "KEY_DISCOVER_SERVICES_RESULT" +const val KEY_READ_RESULT = "KEY_READ_RESULT" +const val KEY_WRITE_RESULT = "KEY_WRITE_RESULT" +const val DATA_TYPE_MANUFACTURER_SPECIFIC_DATA = 0xFF; -fun Result.success() { - success(null) -} +val items = mutableMapOf() +val instances = mutableMapOf() +val identifiers = mutableMapOf() -val Int.messageState: BluetoothState +val activity get() = (items[KEY_ACTIVITY_PLUGIN_BINDING] as ActivityPluginBinding).activity +val centralFlutterApi get() = items[KEY_CENTRAL_MANAGER_FLUTTER_API] as Api.CentralManagerFlutterApi +val peripheralFlutterApi get() = items[KEY_PERIPHERAL_FLUTTER_API] as Api.PeripheralFlutterApi +val characteristicFlutterApi get() = items[KEY_GATT_CHARACTERISTIC_FLUTTER_API] as Api.GattCharacteristicFlutterApi + +val bluetoothManager get() = activity.getSystemService(Context.BLUETOOTH_SERVICE) as BluetoothManager +val bluetoothAdapter get() = bluetoothManager.adapter as BluetoothAdapter +val bluetoothAvailable get() = activity.packageManager.hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE) +val mainHandler get() = Handler(activity.mainLooper) +val mainExecutor: Executor get() = ContextCompat.getMainExecutor(activity) + +val Int.bluetoothState get() = when (this) { - BluetoothAdapter.STATE_OFF -> BluetoothState.POWERED_OFF - BluetoothAdapter.STATE_TURNING_ON -> BluetoothState.POWERED_OFF - BluetoothAdapter.STATE_ON -> BluetoothState.POWERED_ON - BluetoothAdapter.STATE_TURNING_OFF -> BluetoothState.POWERED_ON - else -> BluetoothState.UNRECOGNIZED + BluetoothAdapter.STATE_OFF -> BluetoothState.BLUETOOTH_STATE_POWERED_OFF + BluetoothAdapter.STATE_TURNING_ON -> BluetoothState.BLUETOOTH_STATE_POWERED_OFF + BluetoothAdapter.STATE_ON -> BluetoothState.BLUETOOTH_STATE_POWERED_ON + BluetoothAdapter.STATE_TURNING_OFF -> BluetoothState.BLUETOOTH_STATE_POWERED_ON + else -> throw IllegalArgumentException() } -val BluetoothDevice.uuid: String +val BluetoothDevice.uuidString: String get() { val node = address.filter { char -> char != ':' }.lowercase() - // We don't known the timestamp of the bluetooth device, use nil UUID as prefix. - return "00000000-0000-0000-0000-$node" + // We don't know the timestamp of the bluetooth device, use nil UUID as prefix. + return "00000000-0000-0000-$node" } val String.address: String - get() = takeLast(12).chunked(2).joinToString(":").uppercase() \ No newline at end of file + get() = takeLast(12).chunked(2).joinToString(":").uppercase() + +val ScanRecord.rawManufacturerSpecificData: ByteArray? + get() { + var offset = 0; + while (offset < bytes.size) { + val length = bytes[offset++].toInt() and 0xff + if (length == 0) { + break + } + val end = offset + length + val type = bytes[offset++].toInt() and 0xff + if (type == DATA_TYPE_MANUFACTURER_SPECIFIC_DATA) { + return bytes.slice(offset until end).toByteArray() + } + offset = end + } + return null + } \ No newline at end of file diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/ConnectArgumentsKt.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/ConnectArgumentsKt.kt deleted file mode 100644 index 7df12e8..0000000 --- a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/ConnectArgumentsKt.kt +++ /dev/null @@ -1,45 +0,0 @@ -//Generated by the protocol buffer compiler. DO NOT EDIT! -// source: message.proto - -package dev.yanshouwang.bluetooth_low_energy; - -@kotlin.jvm.JvmSynthetic -inline fun connectArguments(block: dev.yanshouwang.bluetooth_low_energy.ConnectArgumentsKt.Dsl.() -> Unit): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments = - dev.yanshouwang.bluetooth_low_energy.ConnectArgumentsKt.Dsl._create(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments.newBuilder()).apply { block() }._build() -object ConnectArgumentsKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - class Dsl private constructor( - @kotlin.jvm.JvmField private val _builder: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments.Builder - ) { - companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments = _builder.build() - - /** - * string uuid = 1; - */ - var uuid: kotlin.String - @JvmName("getUuid") - get() = _builder.getUuid() - @JvmName("setUuid") - set(value) { - _builder.setUuid(value) - } - /** - * string uuid = 1; - */ - fun clearUuid() { - _builder.clearUuid() - } - } -} -@kotlin.jvm.JvmSynthetic -inline fun dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments.copy(block: dev.yanshouwang.bluetooth_low_energy.ConnectArgumentsKt.Dsl.() -> Unit): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments = - dev.yanshouwang.bluetooth_low_energy.ConnectArgumentsKt.Dsl._create(this.toBuilder()).apply { block() }._build() diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/DiscoveryKt.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/DiscoveryKt.kt deleted file mode 100644 index f9af228..0000000 --- a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/DiscoveryKt.kt +++ /dev/null @@ -1,96 +0,0 @@ -//Generated by the protocol buffer compiler. DO NOT EDIT! -// source: message.proto - -package dev.yanshouwang.bluetooth_low_energy; - -@kotlin.jvm.JvmSynthetic -inline fun discovery(block: dev.yanshouwang.bluetooth_low_energy.DiscoveryKt.Dsl.() -> Unit): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery = - dev.yanshouwang.bluetooth_low_energy.DiscoveryKt.Dsl._create(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery.newBuilder()).apply { block() }._build() -object DiscoveryKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - class Dsl private constructor( - @kotlin.jvm.JvmField private val _builder: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery.Builder - ) { - companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery = _builder.build() - - /** - * string uuid = 1; - */ - var uuid: kotlin.String - @JvmName("getUuid") - get() = _builder.getUuid() - @JvmName("setUuid") - set(value) { - _builder.setUuid(value) - } - /** - * string uuid = 1; - */ - fun clearUuid() { - _builder.clearUuid() - } - - /** - * sint32 rssi = 2; - */ - var rssi: kotlin.Int - @JvmName("getRssi") - get() = _builder.getRssi() - @JvmName("setRssi") - set(value) { - _builder.setRssi(value) - } - /** - * sint32 rssi = 2; - */ - fun clearRssi() { - _builder.clearRssi() - } - - /** - * bytes advertisements = 3; - */ - var advertisements: com.google.protobuf.ByteString - @JvmName("getAdvertisements") - get() = _builder.getAdvertisements() - @JvmName("setAdvertisements") - set(value) { - _builder.setAdvertisements(value) - } - /** - * bytes advertisements = 3; - */ - fun clearAdvertisements() { - _builder.clearAdvertisements() - } - - /** - * bool connectable = 4; - */ - var connectable: kotlin.Boolean - @JvmName("getConnectable") - get() = _builder.getConnectable() - @JvmName("setConnectable") - set(value) { - _builder.setConnectable(value) - } - /** - * bool connectable = 4; - */ - fun clearConnectable() { - _builder.clearConnectable() - } - } -} -@kotlin.jvm.JvmSynthetic -inline fun dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery.copy(block: dev.yanshouwang.bluetooth_low_energy.DiscoveryKt.Dsl.() -> Unit): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery = - dev.yanshouwang.bluetooth_low_energy.DiscoveryKt.Dsl._create(this.toBuilder()).apply { block() }._build() diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GATTKt.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GATTKt.kt deleted file mode 100644 index 841ec41..0000000 --- a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GATTKt.kt +++ /dev/null @@ -1,125 +0,0 @@ -//Generated by the protocol buffer compiler. DO NOT EDIT! -// source: message.proto - -package dev.yanshouwang.bluetooth_low_energy; - -@kotlin.jvm.JvmSynthetic -inline fun gATT(block: dev.yanshouwang.bluetooth_low_energy.GATTKt.Dsl.() -> Unit): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT = - dev.yanshouwang.bluetooth_low_energy.GATTKt.Dsl._create(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT.newBuilder()).apply { block() }._build() -object GATTKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - class Dsl private constructor( - @kotlin.jvm.JvmField private val _builder: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT.Builder - ) { - companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT = _builder.build() - - /** - * string key = 1; - */ - var key: kotlin.String - @JvmName("getKey") - get() = _builder.getKey() - @JvmName("setKey") - set(value) { - _builder.setKey(value) - } - /** - * string key = 1; - */ - fun clearKey() { - _builder.clearKey() - } - - /** - * int32 maximumWriteLength = 2; - */ - var maximumWriteLength: kotlin.Int - @JvmName("getMaximumWriteLength") - get() = _builder.getMaximumWriteLength() - @JvmName("setMaximumWriteLength") - set(value) { - _builder.setMaximumWriteLength(value) - } - /** - * int32 maximumWriteLength = 2; - */ - fun clearMaximumWriteLength() { - _builder.clearMaximumWriteLength() - } - - /** - * An uninstantiable, behaviorless type to represent the field in - * generics. - */ - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - class ServicesProxy private constructor() : com.google.protobuf.kotlin.DslProxy() - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattService services = 3; - */ - val services: com.google.protobuf.kotlin.DslList - @kotlin.jvm.JvmSynthetic - get() = com.google.protobuf.kotlin.DslList( - _builder.getServicesList() - ) - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattService services = 3; - * @param value The services to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("addServices") - fun com.google.protobuf.kotlin.DslList.add(value: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService) { - _builder.addServices(value) - }/** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattService services = 3; - * @param value The services to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("plusAssignServices") - inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(value: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService) { - add(value) - }/** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattService services = 3; - * @param values The services to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("addAllServices") - fun com.google.protobuf.kotlin.DslList.addAll(values: kotlin.collections.Iterable) { - _builder.addAllServices(values) - }/** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattService services = 3; - * @param values The services to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("plusAssignAllServices") - inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(values: kotlin.collections.Iterable) { - addAll(values) - }/** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattService services = 3; - * @param index The index to set the value at. - * @param value The services to set. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("setServices") - operator fun com.google.protobuf.kotlin.DslList.set(index: kotlin.Int, value: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService) { - _builder.setServices(index, value) - }/** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattService services = 3; - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("clearServices") - fun com.google.protobuf.kotlin.DslList.clear() { - _builder.clearServices() - }} -} -@kotlin.jvm.JvmSynthetic -inline fun dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT.copy(block: dev.yanshouwang.bluetooth_low_energy.GATTKt.Dsl.() -> Unit): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GATT = - dev.yanshouwang.bluetooth_low_energy.GATTKt.Dsl._create(this.toBuilder()).apply { block() }._build() diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattCharacteristicKt.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattCharacteristicKt.kt deleted file mode 100644 index eee62f4..0000000 --- a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattCharacteristicKt.kt +++ /dev/null @@ -1,193 +0,0 @@ -//Generated by the protocol buffer compiler. DO NOT EDIT! -// source: message.proto - -package dev.yanshouwang.bluetooth_low_energy; - -@kotlin.jvm.JvmSynthetic -inline fun gattCharacteristic(block: dev.yanshouwang.bluetooth_low_energy.GattCharacteristicKt.Dsl.() -> Unit): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic = - dev.yanshouwang.bluetooth_low_energy.GattCharacteristicKt.Dsl._create(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic.newBuilder()).apply { block() }._build() -object GattCharacteristicKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - class Dsl private constructor( - @kotlin.jvm.JvmField private val _builder: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic.Builder - ) { - companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic = _builder.build() - - /** - * string key = 1; - */ - var key: kotlin.String - @JvmName("getKey") - get() = _builder.getKey() - @JvmName("setKey") - set(value) { - _builder.setKey(value) - } - /** - * string key = 1; - */ - fun clearKey() { - _builder.clearKey() - } - - /** - * string uuid = 2; - */ - var uuid: kotlin.String - @JvmName("getUuid") - get() = _builder.getUuid() - @JvmName("setUuid") - set(value) { - _builder.setUuid(value) - } - /** - * string uuid = 2; - */ - fun clearUuid() { - _builder.clearUuid() - } - - /** - * bool canRead = 3; - */ - var canRead: kotlin.Boolean - @JvmName("getCanRead") - get() = _builder.getCanRead() - @JvmName("setCanRead") - set(value) { - _builder.setCanRead(value) - } - /** - * bool canRead = 3; - */ - fun clearCanRead() { - _builder.clearCanRead() - } - - /** - * bool canWrite = 4; - */ - var canWrite: kotlin.Boolean - @JvmName("getCanWrite") - get() = _builder.getCanWrite() - @JvmName("setCanWrite") - set(value) { - _builder.setCanWrite(value) - } - /** - * bool canWrite = 4; - */ - fun clearCanWrite() { - _builder.clearCanWrite() - } - - /** - * bool canWriteWithoutResponse = 5; - */ - var canWriteWithoutResponse: kotlin.Boolean - @JvmName("getCanWriteWithoutResponse") - get() = _builder.getCanWriteWithoutResponse() - @JvmName("setCanWriteWithoutResponse") - set(value) { - _builder.setCanWriteWithoutResponse(value) - } - /** - * bool canWriteWithoutResponse = 5; - */ - fun clearCanWriteWithoutResponse() { - _builder.clearCanWriteWithoutResponse() - } - - /** - * bool canNotify = 6; - */ - var canNotify: kotlin.Boolean - @JvmName("getCanNotify") - get() = _builder.getCanNotify() - @JvmName("setCanNotify") - set(value) { - _builder.setCanNotify(value) - } - /** - * bool canNotify = 6; - */ - fun clearCanNotify() { - _builder.clearCanNotify() - } - - /** - * An uninstantiable, behaviorless type to represent the field in - * generics. - */ - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - class DescriptorsProxy private constructor() : com.google.protobuf.kotlin.DslProxy() - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattDescriptor descriptors = 7; - */ - val descriptors: com.google.protobuf.kotlin.DslList - @kotlin.jvm.JvmSynthetic - get() = com.google.protobuf.kotlin.DslList( - _builder.getDescriptorsList() - ) - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattDescriptor descriptors = 7; - * @param value The descriptors to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("addDescriptors") - fun com.google.protobuf.kotlin.DslList.add(value: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor) { - _builder.addDescriptors(value) - }/** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattDescriptor descriptors = 7; - * @param value The descriptors to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("plusAssignDescriptors") - inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(value: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor) { - add(value) - }/** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattDescriptor descriptors = 7; - * @param values The descriptors to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("addAllDescriptors") - fun com.google.protobuf.kotlin.DslList.addAll(values: kotlin.collections.Iterable) { - _builder.addAllDescriptors(values) - }/** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattDescriptor descriptors = 7; - * @param values The descriptors to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("plusAssignAllDescriptors") - inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(values: kotlin.collections.Iterable) { - addAll(values) - }/** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattDescriptor descriptors = 7; - * @param index The index to set the value at. - * @param value The descriptors to set. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("setDescriptors") - operator fun com.google.protobuf.kotlin.DslList.set(index: kotlin.Int, value: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor) { - _builder.setDescriptors(index, value) - }/** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattDescriptor descriptors = 7; - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("clearDescriptors") - fun com.google.protobuf.kotlin.DslList.clear() { - _builder.clearDescriptors() - }} -} -@kotlin.jvm.JvmSynthetic -inline fun dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic.copy(block: dev.yanshouwang.bluetooth_low_energy.GattCharacteristicKt.Dsl.() -> Unit): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic = - dev.yanshouwang.bluetooth_low_energy.GattCharacteristicKt.Dsl._create(this.toBuilder()).apply { block() }._build() diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattCharacteristicNotifyArgumentsKt.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattCharacteristicNotifyArgumentsKt.kt deleted file mode 100644 index a62cbd7..0000000 --- a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattCharacteristicNotifyArgumentsKt.kt +++ /dev/null @@ -1,96 +0,0 @@ -//Generated by the protocol buffer compiler. DO NOT EDIT! -// source: message.proto - -package dev.yanshouwang.bluetooth_low_energy; - -@kotlin.jvm.JvmSynthetic -inline fun gattCharacteristicNotifyArguments(block: dev.yanshouwang.bluetooth_low_energy.GattCharacteristicNotifyArgumentsKt.Dsl.() -> Unit): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments = - dev.yanshouwang.bluetooth_low_energy.GattCharacteristicNotifyArgumentsKt.Dsl._create(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments.newBuilder()).apply { block() }._build() -object GattCharacteristicNotifyArgumentsKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - class Dsl private constructor( - @kotlin.jvm.JvmField private val _builder: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments.Builder - ) { - companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments = _builder.build() - - /** - * string gatt_key = 1; - */ - var gattKey: kotlin.String - @JvmName("getGattKey") - get() = _builder.getGattKey() - @JvmName("setGattKey") - set(value) { - _builder.setGattKey(value) - } - /** - * string gatt_key = 1; - */ - fun clearGattKey() { - _builder.clearGattKey() - } - - /** - * string service_key = 2; - */ - var serviceKey: kotlin.String - @JvmName("getServiceKey") - get() = _builder.getServiceKey() - @JvmName("setServiceKey") - set(value) { - _builder.setServiceKey(value) - } - /** - * string service_key = 2; - */ - fun clearServiceKey() { - _builder.clearServiceKey() - } - - /** - * string key = 3; - */ - var key: kotlin.String - @JvmName("getKey") - get() = _builder.getKey() - @JvmName("setKey") - set(value) { - _builder.setKey(value) - } - /** - * string key = 3; - */ - fun clearKey() { - _builder.clearKey() - } - - /** - * bool state = 4; - */ - var state: kotlin.Boolean - @JvmName("getState") - get() = _builder.getState() - @JvmName("setState") - set(value) { - _builder.setState(value) - } - /** - * bool state = 4; - */ - fun clearState() { - _builder.clearState() - } - } -} -@kotlin.jvm.JvmSynthetic -inline fun dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments.copy(block: dev.yanshouwang.bluetooth_low_energy.GattCharacteristicNotifyArgumentsKt.Dsl.() -> Unit): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments = - dev.yanshouwang.bluetooth_low_energy.GattCharacteristicNotifyArgumentsKt.Dsl._create(this.toBuilder()).apply { block() }._build() diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattCharacteristicReadArgumentsKt.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattCharacteristicReadArgumentsKt.kt deleted file mode 100644 index c0a8bd5..0000000 --- a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattCharacteristicReadArgumentsKt.kt +++ /dev/null @@ -1,79 +0,0 @@ -//Generated by the protocol buffer compiler. DO NOT EDIT! -// source: message.proto - -package dev.yanshouwang.bluetooth_low_energy; - -@kotlin.jvm.JvmSynthetic -inline fun gattCharacteristicReadArguments(block: dev.yanshouwang.bluetooth_low_energy.GattCharacteristicReadArgumentsKt.Dsl.() -> Unit): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments = - dev.yanshouwang.bluetooth_low_energy.GattCharacteristicReadArgumentsKt.Dsl._create(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments.newBuilder()).apply { block() }._build() -object GattCharacteristicReadArgumentsKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - class Dsl private constructor( - @kotlin.jvm.JvmField private val _builder: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments.Builder - ) { - companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments = _builder.build() - - /** - * string gatt_key = 1; - */ - var gattKey: kotlin.String - @JvmName("getGattKey") - get() = _builder.getGattKey() - @JvmName("setGattKey") - set(value) { - _builder.setGattKey(value) - } - /** - * string gatt_key = 1; - */ - fun clearGattKey() { - _builder.clearGattKey() - } - - /** - * string service_key = 2; - */ - var serviceKey: kotlin.String - @JvmName("getServiceKey") - get() = _builder.getServiceKey() - @JvmName("setServiceKey") - set(value) { - _builder.setServiceKey(value) - } - /** - * string service_key = 2; - */ - fun clearServiceKey() { - _builder.clearServiceKey() - } - - /** - * string key = 3; - */ - var key: kotlin.String - @JvmName("getKey") - get() = _builder.getKey() - @JvmName("setKey") - set(value) { - _builder.setKey(value) - } - /** - * string key = 3; - */ - fun clearKey() { - _builder.clearKey() - } - } -} -@kotlin.jvm.JvmSynthetic -inline fun dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments.copy(block: dev.yanshouwang.bluetooth_low_energy.GattCharacteristicReadArgumentsKt.Dsl.() -> Unit): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments = - dev.yanshouwang.bluetooth_low_energy.GattCharacteristicReadArgumentsKt.Dsl._create(this.toBuilder()).apply { block() }._build() diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattCharacteristicValueKt.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattCharacteristicValueKt.kt deleted file mode 100644 index 0ceb9d9..0000000 --- a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattCharacteristicValueKt.kt +++ /dev/null @@ -1,96 +0,0 @@ -//Generated by the protocol buffer compiler. DO NOT EDIT! -// source: message.proto - -package dev.yanshouwang.bluetooth_low_energy; - -@kotlin.jvm.JvmSynthetic -inline fun gattCharacteristicValue(block: dev.yanshouwang.bluetooth_low_energy.GattCharacteristicValueKt.Dsl.() -> Unit): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue = - dev.yanshouwang.bluetooth_low_energy.GattCharacteristicValueKt.Dsl._create(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue.newBuilder()).apply { block() }._build() -object GattCharacteristicValueKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - class Dsl private constructor( - @kotlin.jvm.JvmField private val _builder: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue.Builder - ) { - companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue = _builder.build() - - /** - * string gatt_key = 1; - */ - var gattKey: kotlin.String - @JvmName("getGattKey") - get() = _builder.getGattKey() - @JvmName("setGattKey") - set(value) { - _builder.setGattKey(value) - } - /** - * string gatt_key = 1; - */ - fun clearGattKey() { - _builder.clearGattKey() - } - - /** - * string service_key = 2; - */ - var serviceKey: kotlin.String - @JvmName("getServiceKey") - get() = _builder.getServiceKey() - @JvmName("setServiceKey") - set(value) { - _builder.setServiceKey(value) - } - /** - * string service_key = 2; - */ - fun clearServiceKey() { - _builder.clearServiceKey() - } - - /** - * string key = 3; - */ - var key: kotlin.String - @JvmName("getKey") - get() = _builder.getKey() - @JvmName("setKey") - set(value) { - _builder.setKey(value) - } - /** - * string key = 3; - */ - fun clearKey() { - _builder.clearKey() - } - - /** - * bytes value = 4; - */ - var value: com.google.protobuf.ByteString - @JvmName("getValue") - get() = _builder.getValue() - @JvmName("setValue") - set(value) { - _builder.setValue(value) - } - /** - * bytes value = 4; - */ - fun clearValue() { - _builder.clearValue() - } - } -} -@kotlin.jvm.JvmSynthetic -inline fun dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue.copy(block: dev.yanshouwang.bluetooth_low_energy.GattCharacteristicValueKt.Dsl.() -> Unit): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue = - dev.yanshouwang.bluetooth_low_energy.GattCharacteristicValueKt.Dsl._create(this.toBuilder()).apply { block() }._build() diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattCharacteristicWriteArgumentsKt.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattCharacteristicWriteArgumentsKt.kt deleted file mode 100644 index 75ce09a..0000000 --- a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattCharacteristicWriteArgumentsKt.kt +++ /dev/null @@ -1,113 +0,0 @@ -//Generated by the protocol buffer compiler. DO NOT EDIT! -// source: message.proto - -package dev.yanshouwang.bluetooth_low_energy; - -@kotlin.jvm.JvmSynthetic -inline fun gattCharacteristicWriteArguments(block: dev.yanshouwang.bluetooth_low_energy.GattCharacteristicWriteArgumentsKt.Dsl.() -> Unit): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments = - dev.yanshouwang.bluetooth_low_energy.GattCharacteristicWriteArgumentsKt.Dsl._create(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments.newBuilder()).apply { block() }._build() -object GattCharacteristicWriteArgumentsKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - class Dsl private constructor( - @kotlin.jvm.JvmField private val _builder: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments.Builder - ) { - companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments = _builder.build() - - /** - * string gatt_key = 1; - */ - var gattKey: kotlin.String - @JvmName("getGattKey") - get() = _builder.getGattKey() - @JvmName("setGattKey") - set(value) { - _builder.setGattKey(value) - } - /** - * string gatt_key = 1; - */ - fun clearGattKey() { - _builder.clearGattKey() - } - - /** - * string service_key = 2; - */ - var serviceKey: kotlin.String - @JvmName("getServiceKey") - get() = _builder.getServiceKey() - @JvmName("setServiceKey") - set(value) { - _builder.setServiceKey(value) - } - /** - * string service_key = 2; - */ - fun clearServiceKey() { - _builder.clearServiceKey() - } - - /** - * string key = 3; - */ - var key: kotlin.String - @JvmName("getKey") - get() = _builder.getKey() - @JvmName("setKey") - set(value) { - _builder.setKey(value) - } - /** - * string key = 3; - */ - fun clearKey() { - _builder.clearKey() - } - - /** - * bytes value = 4; - */ - var value: com.google.protobuf.ByteString - @JvmName("getValue") - get() = _builder.getValue() - @JvmName("setValue") - set(value) { - _builder.setValue(value) - } - /** - * bytes value = 4; - */ - fun clearValue() { - _builder.clearValue() - } - - /** - * bool withoutResponse = 5; - */ - var withoutResponse: kotlin.Boolean - @JvmName("getWithoutResponse") - get() = _builder.getWithoutResponse() - @JvmName("setWithoutResponse") - set(value) { - _builder.setWithoutResponse(value) - } - /** - * bool withoutResponse = 5; - */ - fun clearWithoutResponse() { - _builder.clearWithoutResponse() - } - } -} -@kotlin.jvm.JvmSynthetic -inline fun dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments.copy(block: dev.yanshouwang.bluetooth_low_energy.GattCharacteristicWriteArgumentsKt.Dsl.() -> Unit): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments = - dev.yanshouwang.bluetooth_low_energy.GattCharacteristicWriteArgumentsKt.Dsl._create(this.toBuilder()).apply { block() }._build() diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattConnectionLostKt.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattConnectionLostKt.kt deleted file mode 100644 index c111533..0000000 --- a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattConnectionLostKt.kt +++ /dev/null @@ -1,62 +0,0 @@ -//Generated by the protocol buffer compiler. DO NOT EDIT! -// source: message.proto - -package dev.yanshouwang.bluetooth_low_energy; - -@kotlin.jvm.JvmSynthetic -inline fun gattConnectionLost(block: dev.yanshouwang.bluetooth_low_energy.GattConnectionLostKt.Dsl.() -> Unit): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost = - dev.yanshouwang.bluetooth_low_energy.GattConnectionLostKt.Dsl._create(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost.newBuilder()).apply { block() }._build() -object GattConnectionLostKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - class Dsl private constructor( - @kotlin.jvm.JvmField private val _builder: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost.Builder - ) { - companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost = _builder.build() - - /** - * string key = 1; - */ - var key: kotlin.String - @JvmName("getKey") - get() = _builder.getKey() - @JvmName("setKey") - set(value) { - _builder.setKey(value) - } - /** - * string key = 1; - */ - fun clearKey() { - _builder.clearKey() - } - - /** - * string error = 2; - */ - var error: kotlin.String - @JvmName("getError") - get() = _builder.getError() - @JvmName("setError") - set(value) { - _builder.setError(value) - } - /** - * string error = 2; - */ - fun clearError() { - _builder.clearError() - } - } -} -@kotlin.jvm.JvmSynthetic -inline fun dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost.copy(block: dev.yanshouwang.bluetooth_low_energy.GattConnectionLostKt.Dsl.() -> Unit): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost = - dev.yanshouwang.bluetooth_low_energy.GattConnectionLostKt.Dsl._create(this.toBuilder()).apply { block() }._build() diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattDescriptorKt.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattDescriptorKt.kt deleted file mode 100644 index fae54b1..0000000 --- a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattDescriptorKt.kt +++ /dev/null @@ -1,62 +0,0 @@ -//Generated by the protocol buffer compiler. DO NOT EDIT! -// source: message.proto - -package dev.yanshouwang.bluetooth_low_energy; - -@kotlin.jvm.JvmSynthetic -inline fun gattDescriptor(block: dev.yanshouwang.bluetooth_low_energy.GattDescriptorKt.Dsl.() -> Unit): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor = - dev.yanshouwang.bluetooth_low_energy.GattDescriptorKt.Dsl._create(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor.newBuilder()).apply { block() }._build() -object GattDescriptorKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - class Dsl private constructor( - @kotlin.jvm.JvmField private val _builder: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor.Builder - ) { - companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor = _builder.build() - - /** - * string key = 1; - */ - var key: kotlin.String - @JvmName("getKey") - get() = _builder.getKey() - @JvmName("setKey") - set(value) { - _builder.setKey(value) - } - /** - * string key = 1; - */ - fun clearKey() { - _builder.clearKey() - } - - /** - * string uuid = 2; - */ - var uuid: kotlin.String - @JvmName("getUuid") - get() = _builder.getUuid() - @JvmName("setUuid") - set(value) { - _builder.setUuid(value) - } - /** - * string uuid = 2; - */ - fun clearUuid() { - _builder.clearUuid() - } - } -} -@kotlin.jvm.JvmSynthetic -inline fun dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor.copy(block: dev.yanshouwang.bluetooth_low_energy.GattDescriptorKt.Dsl.() -> Unit): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptor = - dev.yanshouwang.bluetooth_low_energy.GattDescriptorKt.Dsl._create(this.toBuilder()).apply { block() }._build() diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattDescriptorReadArgumentsKt.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattDescriptorReadArgumentsKt.kt deleted file mode 100644 index 26a97e0..0000000 --- a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattDescriptorReadArgumentsKt.kt +++ /dev/null @@ -1,96 +0,0 @@ -//Generated by the protocol buffer compiler. DO NOT EDIT! -// source: message.proto - -package dev.yanshouwang.bluetooth_low_energy; - -@kotlin.jvm.JvmSynthetic -inline fun gattDescriptorReadArguments(block: dev.yanshouwang.bluetooth_low_energy.GattDescriptorReadArgumentsKt.Dsl.() -> Unit): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments = - dev.yanshouwang.bluetooth_low_energy.GattDescriptorReadArgumentsKt.Dsl._create(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments.newBuilder()).apply { block() }._build() -object GattDescriptorReadArgumentsKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - class Dsl private constructor( - @kotlin.jvm.JvmField private val _builder: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments.Builder - ) { - companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments = _builder.build() - - /** - * string gatt_key = 1; - */ - var gattKey: kotlin.String - @JvmName("getGattKey") - get() = _builder.getGattKey() - @JvmName("setGattKey") - set(value) { - _builder.setGattKey(value) - } - /** - * string gatt_key = 1; - */ - fun clearGattKey() { - _builder.clearGattKey() - } - - /** - * string service_key = 2; - */ - var serviceKey: kotlin.String - @JvmName("getServiceKey") - get() = _builder.getServiceKey() - @JvmName("setServiceKey") - set(value) { - _builder.setServiceKey(value) - } - /** - * string service_key = 2; - */ - fun clearServiceKey() { - _builder.clearServiceKey() - } - - /** - * string characteristic_key = 3; - */ - var characteristicKey: kotlin.String - @JvmName("getCharacteristicKey") - get() = _builder.getCharacteristicKey() - @JvmName("setCharacteristicKey") - set(value) { - _builder.setCharacteristicKey(value) - } - /** - * string characteristic_key = 3; - */ - fun clearCharacteristicKey() { - _builder.clearCharacteristicKey() - } - - /** - * string key = 4; - */ - var key: kotlin.String - @JvmName("getKey") - get() = _builder.getKey() - @JvmName("setKey") - set(value) { - _builder.setKey(value) - } - /** - * string key = 4; - */ - fun clearKey() { - _builder.clearKey() - } - } -} -@kotlin.jvm.JvmSynthetic -inline fun dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments.copy(block: dev.yanshouwang.bluetooth_low_energy.GattDescriptorReadArgumentsKt.Dsl.() -> Unit): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments = - dev.yanshouwang.bluetooth_low_energy.GattDescriptorReadArgumentsKt.Dsl._create(this.toBuilder()).apply { block() }._build() diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattDescriptorWriteArgumentsKt.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattDescriptorWriteArgumentsKt.kt deleted file mode 100644 index c1a5ab3..0000000 --- a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattDescriptorWriteArgumentsKt.kt +++ /dev/null @@ -1,113 +0,0 @@ -//Generated by the protocol buffer compiler. DO NOT EDIT! -// source: message.proto - -package dev.yanshouwang.bluetooth_low_energy; - -@kotlin.jvm.JvmSynthetic -inline fun gattDescriptorWriteArguments(block: dev.yanshouwang.bluetooth_low_energy.GattDescriptorWriteArgumentsKt.Dsl.() -> Unit): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments = - dev.yanshouwang.bluetooth_low_energy.GattDescriptorWriteArgumentsKt.Dsl._create(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments.newBuilder()).apply { block() }._build() -object GattDescriptorWriteArgumentsKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - class Dsl private constructor( - @kotlin.jvm.JvmField private val _builder: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments.Builder - ) { - companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments = _builder.build() - - /** - * string gatt_key = 1; - */ - var gattKey: kotlin.String - @JvmName("getGattKey") - get() = _builder.getGattKey() - @JvmName("setGattKey") - set(value) { - _builder.setGattKey(value) - } - /** - * string gatt_key = 1; - */ - fun clearGattKey() { - _builder.clearGattKey() - } - - /** - * string service_key = 2; - */ - var serviceKey: kotlin.String - @JvmName("getServiceKey") - get() = _builder.getServiceKey() - @JvmName("setServiceKey") - set(value) { - _builder.setServiceKey(value) - } - /** - * string service_key = 2; - */ - fun clearServiceKey() { - _builder.clearServiceKey() - } - - /** - * string characteristic_key = 3; - */ - var characteristicKey: kotlin.String - @JvmName("getCharacteristicKey") - get() = _builder.getCharacteristicKey() - @JvmName("setCharacteristicKey") - set(value) { - _builder.setCharacteristicKey(value) - } - /** - * string characteristic_key = 3; - */ - fun clearCharacteristicKey() { - _builder.clearCharacteristicKey() - } - - /** - * string key = 4; - */ - var key: kotlin.String - @JvmName("getKey") - get() = _builder.getKey() - @JvmName("setKey") - set(value) { - _builder.setKey(value) - } - /** - * string key = 4; - */ - fun clearKey() { - _builder.clearKey() - } - - /** - * bytes value = 5; - */ - var value: com.google.protobuf.ByteString - @JvmName("getValue") - get() = _builder.getValue() - @JvmName("setValue") - set(value) { - _builder.setValue(value) - } - /** - * bytes value = 5; - */ - fun clearValue() { - _builder.clearValue() - } - } -} -@kotlin.jvm.JvmSynthetic -inline fun dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments.copy(block: dev.yanshouwang.bluetooth_low_energy.GattDescriptorWriteArgumentsKt.Dsl.() -> Unit): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments = - dev.yanshouwang.bluetooth_low_energy.GattDescriptorWriteArgumentsKt.Dsl._create(this.toBuilder()).apply { block() }._build() diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattDisconnectArgumentsKt.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattDisconnectArgumentsKt.kt deleted file mode 100644 index 43c104e..0000000 --- a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattDisconnectArgumentsKt.kt +++ /dev/null @@ -1,45 +0,0 @@ -//Generated by the protocol buffer compiler. DO NOT EDIT! -// source: message.proto - -package dev.yanshouwang.bluetooth_low_energy; - -@kotlin.jvm.JvmSynthetic -inline fun gattDisconnectArguments(block: dev.yanshouwang.bluetooth_low_energy.GattDisconnectArgumentsKt.Dsl.() -> Unit): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments = - dev.yanshouwang.bluetooth_low_energy.GattDisconnectArgumentsKt.Dsl._create(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments.newBuilder()).apply { block() }._build() -object GattDisconnectArgumentsKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - class Dsl private constructor( - @kotlin.jvm.JvmField private val _builder: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments.Builder - ) { - companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments = _builder.build() - - /** - * string key = 1; - */ - var key: kotlin.String - @JvmName("getKey") - get() = _builder.getKey() - @JvmName("setKey") - set(value) { - _builder.setKey(value) - } - /** - * string key = 1; - */ - fun clearKey() { - _builder.clearKey() - } - } -} -@kotlin.jvm.JvmSynthetic -inline fun dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments.copy(block: dev.yanshouwang.bluetooth_low_energy.GattDisconnectArgumentsKt.Dsl.() -> Unit): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments = - dev.yanshouwang.bluetooth_low_energy.GattDisconnectArgumentsKt.Dsl._create(this.toBuilder()).apply { block() }._build() diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattServiceKt.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattServiceKt.kt deleted file mode 100644 index 6509c37..0000000 --- a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/GattServiceKt.kt +++ /dev/null @@ -1,125 +0,0 @@ -//Generated by the protocol buffer compiler. DO NOT EDIT! -// source: message.proto - -package dev.yanshouwang.bluetooth_low_energy; - -@kotlin.jvm.JvmSynthetic -inline fun gattService(block: dev.yanshouwang.bluetooth_low_energy.GattServiceKt.Dsl.() -> Unit): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService = - dev.yanshouwang.bluetooth_low_energy.GattServiceKt.Dsl._create(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService.newBuilder()).apply { block() }._build() -object GattServiceKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - class Dsl private constructor( - @kotlin.jvm.JvmField private val _builder: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService.Builder - ) { - companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService = _builder.build() - - /** - * string key = 1; - */ - var key: kotlin.String - @JvmName("getKey") - get() = _builder.getKey() - @JvmName("setKey") - set(value) { - _builder.setKey(value) - } - /** - * string key = 1; - */ - fun clearKey() { - _builder.clearKey() - } - - /** - * string uuid = 2; - */ - var uuid: kotlin.String - @JvmName("getUuid") - get() = _builder.getUuid() - @JvmName("setUuid") - set(value) { - _builder.setUuid(value) - } - /** - * string uuid = 2; - */ - fun clearUuid() { - _builder.clearUuid() - } - - /** - * An uninstantiable, behaviorless type to represent the field in - * generics. - */ - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - class CharacteristicsProxy private constructor() : com.google.protobuf.kotlin.DslProxy() - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattCharacteristic characteristics = 3; - */ - val characteristics: com.google.protobuf.kotlin.DslList - @kotlin.jvm.JvmSynthetic - get() = com.google.protobuf.kotlin.DslList( - _builder.getCharacteristicsList() - ) - /** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattCharacteristic characteristics = 3; - * @param value The characteristics to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("addCharacteristics") - fun com.google.protobuf.kotlin.DslList.add(value: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic) { - _builder.addCharacteristics(value) - }/** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattCharacteristic characteristics = 3; - * @param value The characteristics to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("plusAssignCharacteristics") - inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(value: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic) { - add(value) - }/** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattCharacteristic characteristics = 3; - * @param values The characteristics to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("addAllCharacteristics") - fun com.google.protobuf.kotlin.DslList.addAll(values: kotlin.collections.Iterable) { - _builder.addAllCharacteristics(values) - }/** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattCharacteristic characteristics = 3; - * @param values The characteristics to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("plusAssignAllCharacteristics") - inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(values: kotlin.collections.Iterable) { - addAll(values) - }/** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattCharacteristic characteristics = 3; - * @param index The index to set the value at. - * @param value The characteristics to set. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("setCharacteristics") - operator fun com.google.protobuf.kotlin.DslList.set(index: kotlin.Int, value: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristic) { - _builder.setCharacteristics(index, value) - }/** - * repeated .dev.yanshouwang.bluetooth_low_energy.GattCharacteristic characteristics = 3; - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("clearCharacteristics") - fun com.google.protobuf.kotlin.DslList.clear() { - _builder.clearCharacteristics() - }} -} -@kotlin.jvm.JvmSynthetic -inline fun dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService.copy(block: dev.yanshouwang.bluetooth_low_energy.GattServiceKt.Dsl.() -> Unit): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattService = - dev.yanshouwang.bluetooth_low_energy.GattServiceKt.Dsl._create(this.toBuilder()).apply { block() }._build() diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MessageKt.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MessageKt.kt deleted file mode 100644 index 80c44d0..0000000 --- a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MessageKt.kt +++ /dev/null @@ -1,340 +0,0 @@ -//Generated by the protocol buffer compiler. DO NOT EDIT! -// source: message.proto - -package dev.yanshouwang.bluetooth_low_energy; - -@kotlin.jvm.JvmSynthetic -inline fun message(block: dev.yanshouwang.bluetooth_low_energy.MessageKt.Dsl.() -> Unit): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message = - dev.yanshouwang.bluetooth_low_energy.MessageKt.Dsl._create(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message.newBuilder()).apply { block() }._build() -object MessageKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - class Dsl private constructor( - @kotlin.jvm.JvmField private val _builder: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message.Builder - ) { - companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message = _builder.build() - - /** - * .dev.yanshouwang.bluetooth_low_energy.MessageCategory category = 1; - */ - var category: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.MessageCategory - @JvmName("getCategory") - get() = _builder.getCategory() - @JvmName("setCategory") - set(value) { - _builder.setCategory(value) - } - /** - * .dev.yanshouwang.bluetooth_low_energy.MessageCategory category = 1; - */ - fun clearCategory() { - _builder.clearCategory() - } - - /** - * .dev.yanshouwang.bluetooth_low_energy.BluetoothState state = 2; - */ - var state: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.BluetoothState - @JvmName("getState") - get() = _builder.getState() - @JvmName("setState") - set(value) { - _builder.setState(value) - } - /** - * .dev.yanshouwang.bluetooth_low_energy.BluetoothState state = 2; - */ - fun clearState() { - _builder.clearState() - } - /** - * .dev.yanshouwang.bluetooth_low_energy.BluetoothState state = 2; - * @return Whether the state field is set. - */ - fun hasState(): kotlin.Boolean { - return _builder.hasState() - } - - /** - * .dev.yanshouwang.bluetooth_low_energy.StartDiscoveryArguments startDiscoveryArguments = 3; - */ - var startDiscoveryArguments: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments - @JvmName("getStartDiscoveryArguments") - get() = _builder.getStartDiscoveryArguments() - @JvmName("setStartDiscoveryArguments") - set(value) { - _builder.setStartDiscoveryArguments(value) - } - /** - * .dev.yanshouwang.bluetooth_low_energy.StartDiscoveryArguments startDiscoveryArguments = 3; - */ - fun clearStartDiscoveryArguments() { - _builder.clearStartDiscoveryArguments() - } - /** - * .dev.yanshouwang.bluetooth_low_energy.StartDiscoveryArguments startDiscoveryArguments = 3; - * @return Whether the startDiscoveryArguments field is set. - */ - fun hasStartDiscoveryArguments(): kotlin.Boolean { - return _builder.hasStartDiscoveryArguments() - } - - /** - * .dev.yanshouwang.bluetooth_low_energy.Discovery discovery = 4; - */ - var discovery: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Discovery - @JvmName("getDiscovery") - get() = _builder.getDiscovery() - @JvmName("setDiscovery") - set(value) { - _builder.setDiscovery(value) - } - /** - * .dev.yanshouwang.bluetooth_low_energy.Discovery discovery = 4; - */ - fun clearDiscovery() { - _builder.clearDiscovery() - } - /** - * .dev.yanshouwang.bluetooth_low_energy.Discovery discovery = 4; - * @return Whether the discovery field is set. - */ - fun hasDiscovery(): kotlin.Boolean { - return _builder.hasDiscovery() - } - - /** - * .dev.yanshouwang.bluetooth_low_energy.ConnectArguments connectArguments = 5; - */ - var connectArguments: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.ConnectArguments - @JvmName("getConnectArguments") - get() = _builder.getConnectArguments() - @JvmName("setConnectArguments") - set(value) { - _builder.setConnectArguments(value) - } - /** - * .dev.yanshouwang.bluetooth_low_energy.ConnectArguments connectArguments = 5; - */ - fun clearConnectArguments() { - _builder.clearConnectArguments() - } - /** - * .dev.yanshouwang.bluetooth_low_energy.ConnectArguments connectArguments = 5; - * @return Whether the connectArguments field is set. - */ - fun hasConnectArguments(): kotlin.Boolean { - return _builder.hasConnectArguments() - } - - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDisconnectArguments disconnectArguments = 6; - */ - var disconnectArguments: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDisconnectArguments - @JvmName("getDisconnectArguments") - get() = _builder.getDisconnectArguments() - @JvmName("setDisconnectArguments") - set(value) { - _builder.setDisconnectArguments(value) - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDisconnectArguments disconnectArguments = 6; - */ - fun clearDisconnectArguments() { - _builder.clearDisconnectArguments() - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDisconnectArguments disconnectArguments = 6; - * @return Whether the disconnectArguments field is set. - */ - fun hasDisconnectArguments(): kotlin.Boolean { - return _builder.hasDisconnectArguments() - } - - /** - * .dev.yanshouwang.bluetooth_low_energy.GattConnectionLost connectionLost = 7; - */ - var connectionLost: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattConnectionLost - @JvmName("getConnectionLost") - get() = _builder.getConnectionLost() - @JvmName("setConnectionLost") - set(value) { - _builder.setConnectionLost(value) - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattConnectionLost connectionLost = 7; - */ - fun clearConnectionLost() { - _builder.clearConnectionLost() - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattConnectionLost connectionLost = 7; - * @return Whether the connectionLost field is set. - */ - fun hasConnectionLost(): kotlin.Boolean { - return _builder.hasConnectionLost() - } - - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicReadArguments characteristicReadArguments = 8; - */ - var characteristicReadArguments: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicReadArguments - @JvmName("getCharacteristicReadArguments") - get() = _builder.getCharacteristicReadArguments() - @JvmName("setCharacteristicReadArguments") - set(value) { - _builder.setCharacteristicReadArguments(value) - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicReadArguments characteristicReadArguments = 8; - */ - fun clearCharacteristicReadArguments() { - _builder.clearCharacteristicReadArguments() - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicReadArguments characteristicReadArguments = 8; - * @return Whether the characteristicReadArguments field is set. - */ - fun hasCharacteristicReadArguments(): kotlin.Boolean { - return _builder.hasCharacteristicReadArguments() - } - - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicWriteArguments characteristicWriteArguments = 9; - */ - var characteristicWriteArguments: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicWriteArguments - @JvmName("getCharacteristicWriteArguments") - get() = _builder.getCharacteristicWriteArguments() - @JvmName("setCharacteristicWriteArguments") - set(value) { - _builder.setCharacteristicWriteArguments(value) - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicWriteArguments characteristicWriteArguments = 9; - */ - fun clearCharacteristicWriteArguments() { - _builder.clearCharacteristicWriteArguments() - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicWriteArguments characteristicWriteArguments = 9; - * @return Whether the characteristicWriteArguments field is set. - */ - fun hasCharacteristicWriteArguments(): kotlin.Boolean { - return _builder.hasCharacteristicWriteArguments() - } - - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicNotifyArguments characteristicNotifyArguments = 10; - */ - var characteristicNotifyArguments: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicNotifyArguments - @JvmName("getCharacteristicNotifyArguments") - get() = _builder.getCharacteristicNotifyArguments() - @JvmName("setCharacteristicNotifyArguments") - set(value) { - _builder.setCharacteristicNotifyArguments(value) - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicNotifyArguments characteristicNotifyArguments = 10; - */ - fun clearCharacteristicNotifyArguments() { - _builder.clearCharacteristicNotifyArguments() - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicNotifyArguments characteristicNotifyArguments = 10; - * @return Whether the characteristicNotifyArguments field is set. - */ - fun hasCharacteristicNotifyArguments(): kotlin.Boolean { - return _builder.hasCharacteristicNotifyArguments() - } - - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicValue characteristicValue = 11; - */ - var characteristicValue: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattCharacteristicValue - @JvmName("getCharacteristicValue") - get() = _builder.getCharacteristicValue() - @JvmName("setCharacteristicValue") - set(value) { - _builder.setCharacteristicValue(value) - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicValue characteristicValue = 11; - */ - fun clearCharacteristicValue() { - _builder.clearCharacteristicValue() - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattCharacteristicValue characteristicValue = 11; - * @return Whether the characteristicValue field is set. - */ - fun hasCharacteristicValue(): kotlin.Boolean { - return _builder.hasCharacteristicValue() - } - - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDescriptorReadArguments descriptorReadArguments = 12; - */ - var descriptorReadArguments: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorReadArguments - @JvmName("getDescriptorReadArguments") - get() = _builder.getDescriptorReadArguments() - @JvmName("setDescriptorReadArguments") - set(value) { - _builder.setDescriptorReadArguments(value) - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDescriptorReadArguments descriptorReadArguments = 12; - */ - fun clearDescriptorReadArguments() { - _builder.clearDescriptorReadArguments() - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDescriptorReadArguments descriptorReadArguments = 12; - * @return Whether the descriptorReadArguments field is set. - */ - fun hasDescriptorReadArguments(): kotlin.Boolean { - return _builder.hasDescriptorReadArguments() - } - - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDescriptorWriteArguments descriptorWriteArguments = 13; - */ - var descriptorWriteArguments: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.GattDescriptorWriteArguments - @JvmName("getDescriptorWriteArguments") - get() = _builder.getDescriptorWriteArguments() - @JvmName("setDescriptorWriteArguments") - set(value) { - _builder.setDescriptorWriteArguments(value) - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDescriptorWriteArguments descriptorWriteArguments = 13; - */ - fun clearDescriptorWriteArguments() { - _builder.clearDescriptorWriteArguments() - } - /** - * .dev.yanshouwang.bluetooth_low_energy.GattDescriptorWriteArguments descriptorWriteArguments = 13; - * @return Whether the descriptorWriteArguments field is set. - */ - fun hasDescriptorWriteArguments(): kotlin.Boolean { - return _builder.hasDescriptorWriteArguments() - } - val valueCase: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message.ValueCase - @JvmName("getValueCase") - get() = _builder.getValueCase() - - fun clearValue() { - _builder.clearValue() - } - } -} -@kotlin.jvm.JvmSynthetic -inline fun dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message.copy(block: dev.yanshouwang.bluetooth_low_energy.MessageKt.Dsl.() -> Unit): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.Message = - dev.yanshouwang.bluetooth_low_energy.MessageKt.Dsl._create(this.toBuilder()).apply { block() }._build() diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MyBluetoothGattCallback.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MyBluetoothGattCallback.kt new file mode 100644 index 0000000..6e4ab7c --- /dev/null +++ b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MyBluetoothGattCallback.kt @@ -0,0 +1,163 @@ +package dev.yanshouwang.bluetooth_low_energy + +import android.bluetooth.* +import android.bluetooth.BluetoothGattCallback +import dev.yanshouwang.bluetooth_low_energy.pigeon.Api +import dev.yanshouwang.bluetooth_low_energy.proto.bluetoothLowEnergyException +import dev.yanshouwang.bluetooth_low_energy.proto.gattService +import dev.yanshouwang.bluetooth_low_energy.proto.peripheral +import dev.yanshouwang.bluetooth_low_energy.proto.uUID + +object MyBluetoothGattCallback : BluetoothGattCallback() { + override fun onConnectionStateChange(gatt: BluetoothGatt, status: Int, newState: Int) { + super.onConnectionStateChange(gatt, status, newState) + if (status == BluetoothGatt.GATT_SUCCESS) { + if (newState == BluetoothProfile.STATE_CONNECTED) { + // Connect succeed. + val requested = gatt.requestMtu(512) + if (!requested) { + gatt.disconnect() + } + } else { + // Maybe disconnect succeed, connection failed or connection lost. + gatt.close() + val connectResult = items.remove("${gatt.hashCode()}/${KEY_CONNECT_RESULT}") as Api.Result? + if (connectResult == null) { + val disconnectResult = items.remove("${gatt.hashCode()}/${KEY_DISCONNECT_RESULT}") as Api.Result? + if (disconnectResult == null) { + val id = identifiers[gatt] as Long + val errorBuffer = bluetoothLowEnergyException { + this.message = "GATT connection lost." + }.toByteArray() + mainExecutor.execute { + peripheralFlutterApi.notifyConnectionLost(id, errorBuffer) {} + } + } else { + disconnectResult.success(null) + } + } else { + val errorMessage = "GATT connection lost." + val error = BluetoothLowEnergyException(errorMessage) + connectResult.error(error) + } + } + } else { + // Maybe connect failed, disconnect failed or connection lost. + gatt.close() + val connectResult = items.remove("${gatt.hashCode()}/${KEY_CONNECT_RESULT}") as Api.Result? + if (connectResult == null) { + val disconnectResult = items.remove("${gatt.hashCode()}/${KEY_DISCONNECT_RESULT}") as Api.Result? + if (disconnectResult == null) { + val id = identifiers[gatt] as Long + val errorBuffer = bluetoothLowEnergyException { + this.message = "GATT error with status: $status" + }.toByteArray() + mainExecutor.execute { + peripheralFlutterApi.notifyConnectionLost(id, errorBuffer) {} + } + } else { + val error = BluetoothLowEnergyException("GATT error with status: $status") + disconnectResult.error(error) + } + } else { + val error = BluetoothLowEnergyException("GATT error with status: $status") + connectResult.error(error) + } + } + } + + override fun onMtuChanged(gatt: BluetoothGatt, mtu: Int, status: Int) { + super.onMtuChanged(gatt, mtu, status) + when (status) { + BluetoothGatt.GATT_SUCCESS -> { + val connectResult = items.remove("${gatt.hashCode()}/${KEY_CONNECT_RESULT}") as Api.Result + val gattId = gatt.hashCode().toLong() + instances[gattId] = gatt + val peripheralValue = peripheral { + this.id = gattId + this.maximumWriteLength = mtu - 3 + }.toByteArray() + connectResult.success(peripheralValue) + } + else -> { + gatt.disconnect() + } + } + } + + override fun onServicesDiscovered(gatt: BluetoothGatt, status: Int) { + super.onServicesDiscovered(gatt, status) + val result = items.remove("${gatt.hashCode()}/${KEY_DISCOVER_SERVICES_RESULT}") as Api.Result> + if (status == BluetoothGatt.GATT_SUCCESS) { + val serviceValues = mutableListOf() + for (service in gatt.services) { + val serviceId = service.hashCode().toLong() + instances[serviceId] = listOf(gatt, service) + val serviceValue = gattService { + this.id = serviceId + this.uuid = uUID { + this.value = service.uuid.toString() + } + }.toByteArray() + serviceValues.add(serviceValue) + } + result.success(serviceValues) + } else { + val error = BluetoothLowEnergyException("GATT discover services failed with status: $status") + result.error(error) + } + } + + override fun onCharacteristicRead(gatt: BluetoothGatt, characteristic: BluetoothGattCharacteristic, status: Int) { + super.onCharacteristicRead(gatt, characteristic, status) + val result = items.remove("${characteristic.hashCode()}/${KEY_READ_RESULT}") as Api.Result + if (status == BluetoothGatt.GATT_SUCCESS) { + result.success(characteristic.value) + } else { + val error = BluetoothLowEnergyException("GATT read characteristic failed with status: $status.") + result.error(error) + } + } + + override fun onCharacteristicWrite(gatt: BluetoothGatt, characteristic: BluetoothGattCharacteristic, status: Int) { + super.onCharacteristicWrite(gatt, characteristic, status) + val result = items.remove("${characteristic.hashCode()}/${KEY_WRITE_RESULT}") as Api.Result + if (status == BluetoothGatt.GATT_SUCCESS) { + result.success(null) + } else { + val error = BluetoothLowEnergyException("GATT write characteristic failed with status: $status.") + result.error(error) + } + } + + override fun onCharacteristicChanged(gatt: BluetoothGatt, characteristic: BluetoothGattCharacteristic) { + super.onCharacteristicChanged(gatt, characteristic) + val id = identifiers[characteristic] as Long + val value = characteristic.value + mainExecutor.execute { + characteristicFlutterApi.notifyValue(id, value) {} + } + } + + override fun onDescriptorRead(gatt: BluetoothGatt, descriptor: BluetoothGattDescriptor, status: Int) { + super.onDescriptorRead(gatt, descriptor, status) + val result = items.remove("${descriptor.hashCode()}/${KEY_READ_RESULT}") as Api.Result + if (status == BluetoothGatt.GATT_SUCCESS) { + result.success(descriptor.value) + } else { + val error = BluetoothLowEnergyException("GATT read descriptor failed with status: $status.") + result.error(error) + } + } + + override fun onDescriptorWrite(gatt: BluetoothGatt, descriptor: BluetoothGattDescriptor, status: Int) { + super.onDescriptorWrite(gatt, descriptor, status) + val result = items.remove("${descriptor.hashCode()}/${KEY_WRITE_RESULT}") as Api.Result + if (status == BluetoothGatt.GATT_SUCCESS) { + result.success(null) + } else { + val error = BluetoothLowEnergyException("GATT write descriptor failed with status: $status.") + result.error(error) + } + } +} diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MyBroadcastReceiver.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MyBroadcastReceiver.kt new file mode 100644 index 0000000..52b548e --- /dev/null +++ b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MyBroadcastReceiver.kt @@ -0,0 +1,19 @@ +package dev.yanshouwang.bluetooth_low_energy + +import android.bluetooth.BluetoothAdapter +import android.content.BroadcastReceiver +import android.content.Context +import android.content.Intent + +object MyBroadcastReceiver : BroadcastReceiver() { + private const val STATE_UNKNOWN = -1 + + override fun onReceive(context: Context, intent: Intent) { + val previousState = + intent.getIntExtra(BluetoothAdapter.EXTRA_PREVIOUS_STATE, STATE_UNKNOWN).bluetoothState + val state = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, STATE_UNKNOWN).bluetoothState + if (state == previousState) return + val stateNumber = state.number.toLong() + centralFlutterApi.notifyState(stateNumber) {} + } +} diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MyCentralManagerHostApi.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MyCentralManagerHostApi.kt new file mode 100644 index 0000000..6a966d5 --- /dev/null +++ b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MyCentralManagerHostApi.kt @@ -0,0 +1,87 @@ +package dev.yanshouwang.bluetooth_low_energy + +import android.bluetooth.BluetoothAdapter +import android.bluetooth.BluetoothDevice +import android.bluetooth.le.ScanFilter +import android.bluetooth.le.ScanSettings +import android.content.IntentFilter +import android.content.pm.PackageManager +import android.os.Build +import android.os.ParcelUuid +import androidx.core.app.ActivityCompat +import dev.yanshouwang.bluetooth_low_energy.pigeon.Api +import dev.yanshouwang.bluetooth_low_energy.proto.BluetoothState +import dev.yanshouwang.bluetooth_low_energy.proto.UUID + +object MyCentralManagerHostApi : Api.CentralManagerHostApi { + override fun authorize(result: Api.Result) { + val permissions = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { + arrayOf(android.Manifest.permission.ACCESS_FINE_LOCATION, android.Manifest.permission.BLUETOOTH_SCAN, android.Manifest.permission.BLUETOOTH_CONNECT) + } else { + arrayOf(android.Manifest.permission.ACCESS_FINE_LOCATION) + } + val authorized = permissions.all { permission -> + ActivityCompat.checkSelfPermission(activity, permission) == PackageManager.PERMISSION_GRANTED + } + if (authorized) { + result.success(true) + } else { + ActivityCompat.requestPermissions(activity, permissions, REQUEST_CODE) + items[KEY_AUTHORIZE_RESULT] = result + } + } + + override fun getState(): Long { + val state = if (bluetoothAvailable) { + bluetoothAdapter.state.bluetoothState + } else { + BluetoothState.BLUETOOTH_STATE_UNSUPPORTED + } + return state.number.toLong() + } + + override fun addStateObserver() { + val filter = IntentFilter(BluetoothAdapter.ACTION_STATE_CHANGED) + activity.registerReceiver(MyBroadcastReceiver, filter) + } + + override fun removeStateObserver() { + activity.unregisterReceiver(MyBroadcastReceiver) + } + + override fun startScan(uuidBuffers: MutableList?, result: Api.Result) { + val filters = uuidBuffers?.map { buffer -> + val uuid = UUID.parseFrom(buffer).value + val serviceUUID = ParcelUuid.fromString(uuid) + ScanFilter.Builder().setServiceUuid(serviceUUID).build() + } + val settings = ScanSettings.Builder().setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY).build() + bluetoothAdapter.bluetoothLeScanner.startScan(filters, settings, MyScanCallback) + // Use main handler.post to delay until ScanCallback.onScanFailed executed. + mainHandler.post { + val error = items.remove(KEY_START_SCAN_ERROR) as Throwable? + if (error == null) { + result.success(null) + } else { + result.error(error) + } + } + } + + override fun stopScan() { + bluetoothAdapter.bluetoothLeScanner.stopScan(MyScanCallback) + } + + override fun connect(uuidBuffer: ByteArray, result: Api.Result) { + val address = UUID.parseFrom(uuidBuffer).value.address + val device = bluetoothAdapter.getRemoteDevice(address) + val autoConnect = false + val gatt = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + val transport = BluetoothDevice.TRANSPORT_LE + device.connectGatt(activity, autoConnect, MyBluetoothGattCallback, transport) + } else { + device.connectGatt(activity, autoConnect, MyBluetoothGattCallback) + } + items["${gatt.hashCode()}/${KEY_CONNECT_RESULT}"] = result + } +} \ No newline at end of file diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MyGattCharacteristicHostApi.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MyGattCharacteristicHostApi.kt new file mode 100644 index 0000000..74a3b92 --- /dev/null +++ b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MyGattCharacteristicHostApi.kt @@ -0,0 +1,103 @@ +package dev.yanshouwang.bluetooth_low_energy + +import android.bluetooth.BluetoothGatt +import android.bluetooth.BluetoothGattCharacteristic +import android.bluetooth.BluetoothGattDescriptor +import dev.yanshouwang.bluetooth_low_energy.pigeon.Api +import dev.yanshouwang.bluetooth_low_energy.proto.gattDescriptor +import dev.yanshouwang.bluetooth_low_energy.proto.uUID +import java.util.UUID + +object MyGattCharacteristicHostApi : Api.GattCharacteristicHostApi { + private const val CLIENT_CHARACTERISTIC_CONFIG = "00002902-0000-1000-8000-00805f9b34fb" + + override fun allocate(id: Long, instanceId: Long) { + val list = instances.remove(instanceId) as List + val characteristic = list[1] + instances[id] = list + identifiers[characteristic] = id + } + + override fun free(id: Long) { + val list = instances.remove(id) as List + val characteristic = list[1] + identifiers.remove(characteristic) + } + + override fun discoverDescriptors(id: Long, result: Api.Result>) { + val list = instances[id] as List + val gatt = list[0] as BluetoothGatt + val characteristic = list[1] as BluetoothGattCharacteristic + val descriptorValues = mutableListOf() + for (descriptor in characteristic.descriptors) { + val descriptorId = descriptor.hashCode().toLong() + instances[descriptorId] = listOf(gatt, descriptor) + val descriptorValue = gattDescriptor { + this.id = descriptorId + this.uuid = uUID { + this.value = descriptor.uuid.toString() + } + }.toByteArray() + descriptorValues.add(descriptorValue) + } + result.success(descriptorValues) + } + + override fun read(id: Long, result: Api.Result) { + val list = instances[id] as List + val gatt = list[0] as BluetoothGatt + val characteristic = list[1] as BluetoothGattCharacteristic + val succeed = gatt.readCharacteristic(characteristic) + if (succeed) { + items["${characteristic.hashCode()}/$KEY_READ_RESULT"] = result + } else { + val error = BluetoothLowEnergyException("GATT read characteristic failed.") + result.error(error) + } + } + + override fun write(id: Long, value: ByteArray, withoutResponse: Boolean, result: Api.Result) { + val list = instances[id] as List + val gatt = list[0] as BluetoothGatt + val characteristic = list[1] as BluetoothGattCharacteristic + characteristic.writeType = if (withoutResponse) { + BluetoothGattCharacteristic.WRITE_TYPE_NO_RESPONSE + } else { + BluetoothGattCharacteristic.WRITE_TYPE_DEFAULT + } + characteristic.value = value + val succeed = gatt.writeCharacteristic(characteristic) + if (succeed) { + items["${characteristic.hashCode()}/$KEY_WRITE_RESULT"] = result + } else { + val error = BluetoothLowEnergyException("GATT write characteristic failed.") + result.error(error) + } + } + + override fun setNotify(id: Long, value: Boolean, result: Api.Result) { + val list = instances[id] as List + val gatt = list[0] as BluetoothGatt + val characteristic = list[1] as BluetoothGattCharacteristic + val setNotificationSucceed = gatt.setCharacteristicNotification(characteristic, value) + if (setNotificationSucceed) { + val uuid = UUID.fromString(CLIENT_CHARACTERISTIC_CONFIG) + val descriptor = characteristic.getDescriptor(uuid) + descriptor.value = if (value) { + BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE + } else { + BluetoothGattDescriptor.DISABLE_NOTIFICATION_VALUE + } + val writeSucceed = gatt.writeDescriptor(descriptor) + if (writeSucceed) { + items["${descriptor.hashCode()}/${KEY_WRITE_RESULT}"] = result + } else { + val error = BluetoothLowEnergyException("GATT write descriptor failed.") + result.error(error) + } + } else { + val error = BluetoothLowEnergyException("GATT set characteristic notification failed.") + result.error(error) + } + } +} diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MyGattDescriptorHostApi.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MyGattDescriptorHostApi.kt new file mode 100644 index 0000000..2ed9edb --- /dev/null +++ b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MyGattDescriptorHostApi.kt @@ -0,0 +1,47 @@ +package dev.yanshouwang.bluetooth_low_energy + +import android.bluetooth.BluetoothGatt +import android.bluetooth.BluetoothGattDescriptor +import dev.yanshouwang.bluetooth_low_energy.pigeon.Api + +object MyGattDescriptorHostApi : Api.GattDescriptorHostApi { + override fun allocate(id: Long, instanceId: Long) { + val list = instances.remove(instanceId) as List + val descriptor = list[1] + instances[id] = list + identifiers[descriptor] = id + } + + override fun free(id: Long) { + val list = instances.remove(id) as List + val descriptor = list[1] + identifiers.remove(descriptor) + } + + override fun read(id: Long, result: Api.Result) { + val list = instances[id] as List + val gatt = list[0] as BluetoothGatt + val descriptor = list[1] as BluetoothGattDescriptor + val succeed = gatt.readDescriptor(descriptor) + if (succeed) { + items["${descriptor.hashCode()}/$KEY_READ_RESULT"] = result + } else { + val error = BluetoothLowEnergyException("GATT read descriptor failed.") + result.error(error) + } + } + + override fun write(id: Long, value: ByteArray, result: Api.Result) { + val list = instances[id] as List + val gatt = list[0] as BluetoothGatt + val descriptor = list[1] as BluetoothGattDescriptor + descriptor.value = value + val succeed = gatt.writeDescriptor(descriptor) + if (succeed) { + items["${descriptor.hashCode()}/$KEY_WRITE_RESULT"] = result + } else { + val error = BluetoothLowEnergyException("GATT write descriptor failed.") + result.error(error) + } + } +} diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MyGattServiceHostApi.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MyGattServiceHostApi.kt new file mode 100644 index 0000000..e059032 --- /dev/null +++ b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MyGattServiceHostApi.kt @@ -0,0 +1,47 @@ +package dev.yanshouwang.bluetooth_low_energy + +import android.bluetooth.BluetoothGatt +import android.bluetooth.BluetoothGattCharacteristic +import android.bluetooth.BluetoothGattService +import dev.yanshouwang.bluetooth_low_energy.pigeon.Api +import dev.yanshouwang.bluetooth_low_energy.proto.gattCharacteristic +import dev.yanshouwang.bluetooth_low_energy.proto.uUID + +object MyGattServiceHostApi : Api.GattServiceHostApi { + override fun allocate(id: Long, instanceId: Long) { + val list = instances.remove(instanceId) as List + val service = list[1] + instances[id] = list + identifiers[service] = id + } + + override fun free(id: Long) { + val list = instances.remove(id) as List + val service = list[1] + identifiers.remove(service) + } + + override fun discoverCharacteristics(id: Long, result: Api.Result>) { + val list = instances[id] as List + val gatt = list[0] as BluetoothGatt + val service = list[1] as BluetoothGattService + val characteristicValues = mutableListOf() + for (characteristic in service.characteristics) { + val characteristicId = characteristic.hashCode().toLong() + instances[characteristicId] = listOf(gatt, characteristic) + val characteristicValue = gattCharacteristic { + this.id = characteristicId + this.uuid = uUID { + this.value = characteristic.uuid.toString() + } + this.canRead = characteristic.properties and BluetoothGattCharacteristic.PROPERTY_READ != 0 + this.canWrite = characteristic.properties and BluetoothGattCharacteristic.PROPERTY_WRITE != 0 + this.canWriteWithoutResponse = + characteristic.properties and BluetoothGattCharacteristic.PROPERTY_WRITE_NO_RESPONSE != 0 + this.canNotify = characteristic.properties and BluetoothGattCharacteristic.PROPERTY_NOTIFY != 0 + }.toByteArray() + characteristicValues.add(characteristicValue) + } + result.success(characteristicValues) + } +} diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MyPeripheralHostApi.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MyPeripheralHostApi.kt new file mode 100644 index 0000000..7dcd746 --- /dev/null +++ b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MyPeripheralHostApi.kt @@ -0,0 +1,34 @@ +package dev.yanshouwang.bluetooth_low_energy + +import android.bluetooth.BluetoothGatt +import dev.yanshouwang.bluetooth_low_energy.pigeon.Api + +object MyPeripheralHostApi : Api.PeripheralHostApi { + override fun allocate(id: Long, instanceId: Long) { + val gatt = instances.remove(instanceId) as BluetoothGatt + instances[id] = gatt + identifiers[gatt] = id + } + + override fun free(id: Long) { + val gatt = instances.remove(id) as BluetoothGatt + identifiers.remove(gatt) + } + + override fun disconnect(id: Long, result: Api.Result) { + val gatt = instances[id] as BluetoothGatt + gatt.disconnect() + items["${gatt.hashCode()}/$KEY_DISCONNECT_RESULT"] = result + } + + override fun discoverServices(id: Long, result: Api.Result>) { + val gatt = instances[id] as BluetoothGatt + val started = gatt.discoverServices() + if (started) { + items["${gatt.hashCode()}/$KEY_DISCOVER_SERVICES_RESULT"] = result + } else { + val error = BluetoothLowEnergyException("Start discover services failed.") + result.error(error) + } + } +} diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MyRequestPermissionsResultListener.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MyRequestPermissionsResultListener.kt new file mode 100644 index 0000000..f59ab75 --- /dev/null +++ b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MyRequestPermissionsResultListener.kt @@ -0,0 +1,19 @@ +package dev.yanshouwang.bluetooth_low_energy + +import android.content.pm.PackageManager +import dev.yanshouwang.bluetooth_low_energy.pigeon.Api +import io.flutter.plugin.common.PluginRegistry.RequestPermissionsResultListener + +object MyRequestPermissionsResultListener : RequestPermissionsResultListener { + override fun onRequestPermissionsResult(requestCode: Int, permissions: Array, grantResults: IntArray): Boolean { + return when (requestCode) { + REQUEST_CODE -> { + val result = items.remove(KEY_AUTHORIZE_RESULT) as Api.Result + val authorized = grantResults.all { grantResult -> grantResult == PackageManager.PERMISSION_GRANTED } + result.success(authorized) + true + } + else -> false + } + } +} \ No newline at end of file diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MyScanCallback.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MyScanCallback.kt new file mode 100644 index 0000000..5968a12 --- /dev/null +++ b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MyScanCallback.kt @@ -0,0 +1,81 @@ +package dev.yanshouwang.bluetooth_low_energy + +import android.bluetooth.le.ScanCallback +import android.bluetooth.le.ScanResult +import android.bluetooth.le.ScanSettings +import android.os.Build +import com.google.protobuf.ByteString +import dev.yanshouwang.bluetooth_low_energy.proto.advertisement +import dev.yanshouwang.bluetooth_low_energy.proto.serviceData +import dev.yanshouwang.bluetooth_low_energy.proto.uUID + +object MyScanCallback : ScanCallback() { + override fun onScanFailed(errorCode: Int) { + super.onScanFailed(errorCode) + val error = BluetoothLowEnergyException("Start scan failed with code: $errorCode") + items[KEY_START_SCAN_ERROR] = error + } + + override fun onScanResult(callbackType: Int, result: ScanResult) { + super.onScanResult(callbackType, result) + val advertisementValue = advertisement { + this.uuid = uUID { + this.value = result.device.uuidString + } + this.rssi = result.rssi + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + this.connectable = result.isConnectable + } + val scanRecord = result.scanRecord + if (scanRecord == null) { + this.data = ByteString.EMPTY + } else { + this.data = ByteString.copyFrom(scanRecord.bytes) + val deviceName = scanRecord.deviceName + if (deviceName != null) { + this.localName = deviceName + } + val manufacturerSpecificData = scanRecord.rawManufacturerSpecificData + if (manufacturerSpecificData != null) { + this.manufacturerSpecificData = ByteString.copyFrom(manufacturerSpecificData) + } + val serviceDatas = scanRecord.serviceData.map { entry -> + serviceData { + this.uuid = uUID { + this.value = entry.key.toString() + } + this.data = ByteString.copyFrom(entry.value) + } + } + this.serviceDatas.addAll(serviceDatas) + val serviceUUIDs = scanRecord.serviceUuids + if (serviceUUIDs != null) { + val uuids = serviceUUIDs.map { uuid -> + uUID { + this.value = uuid.toString() + } + } + this.serviceUuids.addAll(uuids) + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { + val uuids = scanRecord.serviceSolicitationUuids.map { uuid -> + uUID { + this.value = uuid.toString() + } + } + this.solicitedServiceUuids.addAll(uuids) + } + this.txPowerLevel = scanRecord.txPowerLevel + } + }.toByteArray() + centralFlutterApi.notifyAdvertisement(advertisementValue) {} + } + + override fun onBatchScanResults(results: MutableList) { + super.onBatchScanResults(results) + + for (result in results) { + onScanResult(ScanSettings.CALLBACK_TYPE_ALL_MATCHES, result) + } + } +} diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/NativeGATT.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/NativeGATT.kt deleted file mode 100644 index 56c9f97..0000000 --- a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/NativeGATT.kt +++ /dev/null @@ -1,5 +0,0 @@ -package dev.yanshouwang.bluetooth_low_energy - -import android.bluetooth.BluetoothGatt - -class NativeGATT(value: BluetoothGatt, val services: Map) : NativeValue(value) \ No newline at end of file diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/NativeGattCharacteristic.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/NativeGattCharacteristic.kt deleted file mode 100644 index ab69048..0000000 --- a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/NativeGattCharacteristic.kt +++ /dev/null @@ -1,5 +0,0 @@ -package dev.yanshouwang.bluetooth_low_energy - -import android.bluetooth.BluetoothGattCharacteristic - -class NativeGattCharacteristic(value: BluetoothGattCharacteristic, val descriptors: Map) : NativeValue(value) \ No newline at end of file diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/NativeGattDescriptor.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/NativeGattDescriptor.kt deleted file mode 100644 index 1246c32..0000000 --- a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/NativeGattDescriptor.kt +++ /dev/null @@ -1,5 +0,0 @@ -package dev.yanshouwang.bluetooth_low_energy - -import android.bluetooth.BluetoothGattDescriptor - -class NativeGattDescriptor(value: BluetoothGattDescriptor) : NativeValue(value) \ No newline at end of file diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/NativeGattService.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/NativeGattService.kt deleted file mode 100644 index 1d53d2f..0000000 --- a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/NativeGattService.kt +++ /dev/null @@ -1,5 +0,0 @@ -package dev.yanshouwang.bluetooth_low_energy - -import android.bluetooth.BluetoothGattService - -class NativeGattService(value: BluetoothGattService, val characteristics: Map) : NativeValue(value) \ No newline at end of file diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/NativeValue.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/NativeValue.kt deleted file mode 100644 index 95242d3..0000000 --- a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/NativeValue.kt +++ /dev/null @@ -1,7 +0,0 @@ -package dev.yanshouwang.bluetooth_low_energy - -import java.util.* - -open class NativeValue(val value: T) { - public val key = UUID.randomUUID().toString() -} \ No newline at end of file diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/StartDiscoveryArgumentsKt.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/StartDiscoveryArgumentsKt.kt deleted file mode 100644 index 42e0429..0000000 --- a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/StartDiscoveryArgumentsKt.kt +++ /dev/null @@ -1,96 +0,0 @@ -//Generated by the protocol buffer compiler. DO NOT EDIT! -// source: message.proto - -package dev.yanshouwang.bluetooth_low_energy; - -@kotlin.jvm.JvmSynthetic -inline fun startDiscoveryArguments(block: dev.yanshouwang.bluetooth_low_energy.StartDiscoveryArgumentsKt.Dsl.() -> Unit): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments = - dev.yanshouwang.bluetooth_low_energy.StartDiscoveryArgumentsKt.Dsl._create(dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments.newBuilder()).apply { block() }._build() -object StartDiscoveryArgumentsKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - class Dsl private constructor( - @kotlin.jvm.JvmField private val _builder: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments.Builder - ) { - companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments = _builder.build() - - /** - * An uninstantiable, behaviorless type to represent the field in - * generics. - */ - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - class ServicesProxy private constructor() : com.google.protobuf.kotlin.DslProxy() - /** - * repeated string services = 1; - * @return A list containing the services. - */ - val services: com.google.protobuf.kotlin.DslList - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - get() = com.google.protobuf.kotlin.DslList( - _builder.getServicesList() - ) - /** - * repeated string services = 1; - * @param value The services to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("addServices") - fun com.google.protobuf.kotlin.DslList.add(value: kotlin.String) { - _builder.addServices(value) - } - /** - * repeated string services = 1; - * @param value The services to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("plusAssignServices") - operator fun com.google.protobuf.kotlin.DslList.plusAssign(value: kotlin.String) { - _builder.addServices(value) - } - /** - * repeated string services = 1; - * @param values The services to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("addAllServices") - fun com.google.protobuf.kotlin.DslList.addAll(values: kotlin.collections.Iterable) { - _builder.addAllServices(values) - } - /** - * repeated string services = 1; - * @param values The services to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("plusAssignAllServices") - operator fun com.google.protobuf.kotlin.DslList.plusAssign(values: kotlin.collections.Iterable) { - _builder.addAllServices(values) - } - /** - * repeated string services = 1; - * @param index The index to set the value at. - * @param value The services to set. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("setServices") - operator fun com.google.protobuf.kotlin.DslList.set(index: kotlin.Int, value: kotlin.String) { - _builder.setServices(index, value) - }/** - * repeated string services = 1; - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("clearServices") - fun com.google.protobuf.kotlin.DslList.clear() { - _builder.clearServices() - }} -} -@kotlin.jvm.JvmSynthetic -inline fun dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments.copy(block: dev.yanshouwang.bluetooth_low_energy.StartDiscoveryArgumentsKt.Dsl.() -> Unit): dev.yanshouwang.bluetooth_low_energy.MessageOuterClass.StartDiscoveryArguments = - dev.yanshouwang.bluetooth_low_energy.StartDiscoveryArgumentsKt.Dsl._create(this.toBuilder()).apply { block() }._build() diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/proto/AdvertisementKt.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/proto/AdvertisementKt.kt new file mode 100644 index 0000000..30c1bc8 --- /dev/null +++ b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/proto/AdvertisementKt.kt @@ -0,0 +1,395 @@ +//Generated by the protocol buffer compiler. DO NOT EDIT! +// source: proto/messages.proto + +package dev.yanshouwang.bluetooth_low_energy.proto; + +@kotlin.jvm.JvmName("-initializeadvertisement") +inline fun advertisement(block: dev.yanshouwang.bluetooth_low_energy.proto.AdvertisementKt.Dsl.() -> kotlin.Unit): dev.yanshouwang.bluetooth_low_energy.proto.Advertisement = + dev.yanshouwang.bluetooth_low_energy.proto.AdvertisementKt.Dsl._create(dev.yanshouwang.bluetooth_low_energy.proto.Advertisement.newBuilder()).apply { block() }._build() +object AdvertisementKt { + @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) + @com.google.protobuf.kotlin.ProtoDslMarker + class Dsl private constructor( + private val _builder: dev.yanshouwang.bluetooth_low_energy.proto.Advertisement.Builder + ) { + companion object { + @kotlin.jvm.JvmSynthetic + @kotlin.PublishedApi + internal fun _create(builder: dev.yanshouwang.bluetooth_low_energy.proto.Advertisement.Builder): Dsl = Dsl(builder) + } + + @kotlin.jvm.JvmSynthetic + @kotlin.PublishedApi + internal fun _build(): dev.yanshouwang.bluetooth_low_energy.proto.Advertisement = _builder.build() + + /** + * .proto.UUID uuid = 1; + */ + var uuid: dev.yanshouwang.bluetooth_low_energy.proto.UUID + @JvmName("getUuid") + get() = _builder.getUuid() + @JvmName("setUuid") + set(value) { + _builder.setUuid(value) + } + /** + * .proto.UUID uuid = 1; + */ + fun clearUuid() { + _builder.clearUuid() + } + /** + * .proto.UUID uuid = 1; + * @return Whether the uuid field is set. + */ + fun hasUuid(): kotlin.Boolean { + return _builder.hasUuid() + } + + /** + * int32 rssi = 2; + */ + var rssi: kotlin.Int + @JvmName("getRssi") + get() = _builder.getRssi() + @JvmName("setRssi") + set(value) { + _builder.setRssi(value) + } + /** + * int32 rssi = 2; + */ + fun clearRssi() { + _builder.clearRssi() + } + + /** + * optional bool connectable = 3; + */ + var connectable: kotlin.Boolean + @JvmName("getConnectable") + get() = _builder.getConnectable() + @JvmName("setConnectable") + set(value) { + _builder.setConnectable(value) + } + /** + * optional bool connectable = 3; + */ + fun clearConnectable() { + _builder.clearConnectable() + } + /** + * optional bool connectable = 3; + * @return Whether the connectable field is set. + */ + fun hasConnectable(): kotlin.Boolean { + return _builder.hasConnectable() + } + + /** + * bytes data = 4; + */ + var data: com.google.protobuf.ByteString + @JvmName("getData") + get() = _builder.getData() + @JvmName("setData") + set(value) { + _builder.setData(value) + } + /** + * bytes data = 4; + */ + fun clearData() { + _builder.clearData() + } + + /** + * optional string local_name = 5; + */ + var localName: kotlin.String + @JvmName("getLocalName") + get() = _builder.getLocalName() + @JvmName("setLocalName") + set(value) { + _builder.setLocalName(value) + } + /** + * optional string local_name = 5; + */ + fun clearLocalName() { + _builder.clearLocalName() + } + /** + * optional string local_name = 5; + * @return Whether the localName field is set. + */ + fun hasLocalName(): kotlin.Boolean { + return _builder.hasLocalName() + } + + /** + * bytes manufacturer_specific_data = 6; + */ + var manufacturerSpecificData: com.google.protobuf.ByteString + @JvmName("getManufacturerSpecificData") + get() = _builder.getManufacturerSpecificData() + @JvmName("setManufacturerSpecificData") + set(value) { + _builder.setManufacturerSpecificData(value) + } + /** + * bytes manufacturer_specific_data = 6; + */ + fun clearManufacturerSpecificData() { + _builder.clearManufacturerSpecificData() + } + + /** + * An uninstantiable, behaviorless type to represent the field in + * generics. + */ + @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) + class ServiceDatasProxy private constructor() : com.google.protobuf.kotlin.DslProxy() + /** + * repeated .proto.ServiceData service_datas = 7; + */ + val serviceDatas: com.google.protobuf.kotlin.DslList + @kotlin.jvm.JvmSynthetic + get() = com.google.protobuf.kotlin.DslList( + _builder.getServiceDatasList() + ) + /** + * repeated .proto.ServiceData service_datas = 7; + * @param value The serviceDatas to add. + */ + @kotlin.jvm.JvmSynthetic + @kotlin.jvm.JvmName("addServiceDatas") + fun com.google.protobuf.kotlin.DslList.add(value: dev.yanshouwang.bluetooth_low_energy.proto.ServiceData) { + _builder.addServiceDatas(value) + } + /** + * repeated .proto.ServiceData service_datas = 7; + * @param value The serviceDatas to add. + */ + @kotlin.jvm.JvmSynthetic + @kotlin.jvm.JvmName("plusAssignServiceDatas") + @Suppress("NOTHING_TO_INLINE") + inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(value: dev.yanshouwang.bluetooth_low_energy.proto.ServiceData) { + add(value) + } + /** + * repeated .proto.ServiceData service_datas = 7; + * @param values The serviceDatas to add. + */ + @kotlin.jvm.JvmSynthetic + @kotlin.jvm.JvmName("addAllServiceDatas") + fun com.google.protobuf.kotlin.DslList.addAll(values: kotlin.collections.Iterable) { + _builder.addAllServiceDatas(values) + } + /** + * repeated .proto.ServiceData service_datas = 7; + * @param values The serviceDatas to add. + */ + @kotlin.jvm.JvmSynthetic + @kotlin.jvm.JvmName("plusAssignAllServiceDatas") + @Suppress("NOTHING_TO_INLINE") + inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(values: kotlin.collections.Iterable) { + addAll(values) + } + /** + * repeated .proto.ServiceData service_datas = 7; + * @param index The index to set the value at. + * @param value The serviceDatas to set. + */ + @kotlin.jvm.JvmSynthetic + @kotlin.jvm.JvmName("setServiceDatas") + operator fun com.google.protobuf.kotlin.DslList.set(index: kotlin.Int, value: dev.yanshouwang.bluetooth_low_energy.proto.ServiceData) { + _builder.setServiceDatas(index, value) + } + /** + * repeated .proto.ServiceData service_datas = 7; + */ + @kotlin.jvm.JvmSynthetic + @kotlin.jvm.JvmName("clearServiceDatas") + fun com.google.protobuf.kotlin.DslList.clear() { + _builder.clearServiceDatas() + } + + + /** + * An uninstantiable, behaviorless type to represent the field in + * generics. + */ + @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) + class ServiceUuidsProxy private constructor() : com.google.protobuf.kotlin.DslProxy() + /** + * repeated .proto.UUID service_uuids = 8; + */ + val serviceUuids: com.google.protobuf.kotlin.DslList + @kotlin.jvm.JvmSynthetic + get() = com.google.protobuf.kotlin.DslList( + _builder.getServiceUuidsList() + ) + /** + * repeated .proto.UUID service_uuids = 8; + * @param value The serviceUuids to add. + */ + @kotlin.jvm.JvmSynthetic + @kotlin.jvm.JvmName("addServiceUuids") + fun com.google.protobuf.kotlin.DslList.add(value: dev.yanshouwang.bluetooth_low_energy.proto.UUID) { + _builder.addServiceUuids(value) + } + /** + * repeated .proto.UUID service_uuids = 8; + * @param value The serviceUuids to add. + */ + @kotlin.jvm.JvmSynthetic + @kotlin.jvm.JvmName("plusAssignServiceUuids") + @Suppress("NOTHING_TO_INLINE") + inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(value: dev.yanshouwang.bluetooth_low_energy.proto.UUID) { + add(value) + } + /** + * repeated .proto.UUID service_uuids = 8; + * @param values The serviceUuids to add. + */ + @kotlin.jvm.JvmSynthetic + @kotlin.jvm.JvmName("addAllServiceUuids") + fun com.google.protobuf.kotlin.DslList.addAll(values: kotlin.collections.Iterable) { + _builder.addAllServiceUuids(values) + } + /** + * repeated .proto.UUID service_uuids = 8; + * @param values The serviceUuids to add. + */ + @kotlin.jvm.JvmSynthetic + @kotlin.jvm.JvmName("plusAssignAllServiceUuids") + @Suppress("NOTHING_TO_INLINE") + inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(values: kotlin.collections.Iterable) { + addAll(values) + } + /** + * repeated .proto.UUID service_uuids = 8; + * @param index The index to set the value at. + * @param value The serviceUuids to set. + */ + @kotlin.jvm.JvmSynthetic + @kotlin.jvm.JvmName("setServiceUuids") + operator fun com.google.protobuf.kotlin.DslList.set(index: kotlin.Int, value: dev.yanshouwang.bluetooth_low_energy.proto.UUID) { + _builder.setServiceUuids(index, value) + } + /** + * repeated .proto.UUID service_uuids = 8; + */ + @kotlin.jvm.JvmSynthetic + @kotlin.jvm.JvmName("clearServiceUuids") + fun com.google.protobuf.kotlin.DslList.clear() { + _builder.clearServiceUuids() + } + + + /** + * An uninstantiable, behaviorless type to represent the field in + * generics. + */ + @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) + class SolicitedServiceUuidsProxy private constructor() : com.google.protobuf.kotlin.DslProxy() + /** + * repeated .proto.UUID solicited_service_uuids = 9; + */ + val solicitedServiceUuids: com.google.protobuf.kotlin.DslList + @kotlin.jvm.JvmSynthetic + get() = com.google.protobuf.kotlin.DslList( + _builder.getSolicitedServiceUuidsList() + ) + /** + * repeated .proto.UUID solicited_service_uuids = 9; + * @param value The solicitedServiceUuids to add. + */ + @kotlin.jvm.JvmSynthetic + @kotlin.jvm.JvmName("addSolicitedServiceUuids") + fun com.google.protobuf.kotlin.DslList.add(value: dev.yanshouwang.bluetooth_low_energy.proto.UUID) { + _builder.addSolicitedServiceUuids(value) + } + /** + * repeated .proto.UUID solicited_service_uuids = 9; + * @param value The solicitedServiceUuids to add. + */ + @kotlin.jvm.JvmSynthetic + @kotlin.jvm.JvmName("plusAssignSolicitedServiceUuids") + @Suppress("NOTHING_TO_INLINE") + inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(value: dev.yanshouwang.bluetooth_low_energy.proto.UUID) { + add(value) + } + /** + * repeated .proto.UUID solicited_service_uuids = 9; + * @param values The solicitedServiceUuids to add. + */ + @kotlin.jvm.JvmSynthetic + @kotlin.jvm.JvmName("addAllSolicitedServiceUuids") + fun com.google.protobuf.kotlin.DslList.addAll(values: kotlin.collections.Iterable) { + _builder.addAllSolicitedServiceUuids(values) + } + /** + * repeated .proto.UUID solicited_service_uuids = 9; + * @param values The solicitedServiceUuids to add. + */ + @kotlin.jvm.JvmSynthetic + @kotlin.jvm.JvmName("plusAssignAllSolicitedServiceUuids") + @Suppress("NOTHING_TO_INLINE") + inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(values: kotlin.collections.Iterable) { + addAll(values) + } + /** + * repeated .proto.UUID solicited_service_uuids = 9; + * @param index The index to set the value at. + * @param value The solicitedServiceUuids to set. + */ + @kotlin.jvm.JvmSynthetic + @kotlin.jvm.JvmName("setSolicitedServiceUuids") + operator fun com.google.protobuf.kotlin.DslList.set(index: kotlin.Int, value: dev.yanshouwang.bluetooth_low_energy.proto.UUID) { + _builder.setSolicitedServiceUuids(index, value) + } + /** + * repeated .proto.UUID solicited_service_uuids = 9; + */ + @kotlin.jvm.JvmSynthetic + @kotlin.jvm.JvmName("clearSolicitedServiceUuids") + fun com.google.protobuf.kotlin.DslList.clear() { + _builder.clearSolicitedServiceUuids() + } + + + /** + * optional int32 tx_power_level = 10; + */ + var txPowerLevel: kotlin.Int + @JvmName("getTxPowerLevel") + get() = _builder.getTxPowerLevel() + @JvmName("setTxPowerLevel") + set(value) { + _builder.setTxPowerLevel(value) + } + /** + * optional int32 tx_power_level = 10; + */ + fun clearTxPowerLevel() { + _builder.clearTxPowerLevel() + } + /** + * optional int32 tx_power_level = 10; + * @return Whether the txPowerLevel field is set. + */ + fun hasTxPowerLevel(): kotlin.Boolean { + return _builder.hasTxPowerLevel() + } + } +} +@kotlin.jvm.JvmSynthetic +inline fun dev.yanshouwang.bluetooth_low_energy.proto.Advertisement.copy(block: dev.yanshouwang.bluetooth_low_energy.proto.AdvertisementKt.Dsl.() -> kotlin.Unit): dev.yanshouwang.bluetooth_low_energy.proto.Advertisement = + dev.yanshouwang.bluetooth_low_energy.proto.AdvertisementKt.Dsl._create(this.toBuilder()).apply { block() }._build() + +val dev.yanshouwang.bluetooth_low_energy.proto.AdvertisementOrBuilder.uuidOrNull: dev.yanshouwang.bluetooth_low_energy.proto.UUID? + get() = if (hasUuid()) getUuid() else null + diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/proto/BluetoothLowEnergyExceptionKt.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/proto/BluetoothLowEnergyExceptionKt.kt new file mode 100644 index 0000000..d4efdea --- /dev/null +++ b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/proto/BluetoothLowEnergyExceptionKt.kt @@ -0,0 +1,46 @@ +//Generated by the protocol buffer compiler. DO NOT EDIT! +// source: proto/messages.proto + +package dev.yanshouwang.bluetooth_low_energy.proto; + +@kotlin.jvm.JvmName("-initializebluetoothLowEnergyException") +inline fun bluetoothLowEnergyException(block: dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyExceptionKt.Dsl.() -> kotlin.Unit): dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException = + dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyExceptionKt.Dsl._create(dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException.newBuilder()).apply { block() }._build() +object BluetoothLowEnergyExceptionKt { + @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) + @com.google.protobuf.kotlin.ProtoDslMarker + class Dsl private constructor( + private val _builder: dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException.Builder + ) { + companion object { + @kotlin.jvm.JvmSynthetic + @kotlin.PublishedApi + internal fun _create(builder: dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException.Builder): Dsl = Dsl(builder) + } + + @kotlin.jvm.JvmSynthetic + @kotlin.PublishedApi + internal fun _build(): dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException = _builder.build() + + /** + * string message = 1; + */ + var message: kotlin.String + @JvmName("getMessage") + get() = _builder.getMessage() + @JvmName("setMessage") + set(value) { + _builder.setMessage(value) + } + /** + * string message = 1; + */ + fun clearMessage() { + _builder.clearMessage() + } + } +} +@kotlin.jvm.JvmSynthetic +inline fun dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException.copy(block: dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyExceptionKt.Dsl.() -> kotlin.Unit): dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyException = + dev.yanshouwang.bluetooth_low_energy.proto.BluetoothLowEnergyExceptionKt.Dsl._create(this.toBuilder()).apply { block() }._build() + diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/proto/GattCharacteristicKt.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/proto/GattCharacteristicKt.kt new file mode 100644 index 0000000..29cf5bf --- /dev/null +++ b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/proto/GattCharacteristicKt.kt @@ -0,0 +1,141 @@ +//Generated by the protocol buffer compiler. DO NOT EDIT! +// source: proto/messages.proto + +package dev.yanshouwang.bluetooth_low_energy.proto; + +@kotlin.jvm.JvmName("-initializegattCharacteristic") +inline fun gattCharacteristic(block: dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristicKt.Dsl.() -> kotlin.Unit): dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic = + dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristicKt.Dsl._create(dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic.newBuilder()).apply { block() }._build() +object GattCharacteristicKt { + @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) + @com.google.protobuf.kotlin.ProtoDslMarker + class Dsl private constructor( + private val _builder: dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic.Builder + ) { + companion object { + @kotlin.jvm.JvmSynthetic + @kotlin.PublishedApi + internal fun _create(builder: dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic.Builder): Dsl = Dsl(builder) + } + + @kotlin.jvm.JvmSynthetic + @kotlin.PublishedApi + internal fun _build(): dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic = _builder.build() + + /** + * int64 id = 1; + */ + var id: kotlin.Long + @JvmName("getId") + get() = _builder.getId() + @JvmName("setId") + set(value) { + _builder.setId(value) + } + /** + * int64 id = 1; + */ + fun clearId() { + _builder.clearId() + } + + /** + * .proto.UUID uuid = 2; + */ + var uuid: dev.yanshouwang.bluetooth_low_energy.proto.UUID + @JvmName("getUuid") + get() = _builder.getUuid() + @JvmName("setUuid") + set(value) { + _builder.setUuid(value) + } + /** + * .proto.UUID uuid = 2; + */ + fun clearUuid() { + _builder.clearUuid() + } + /** + * .proto.UUID uuid = 2; + * @return Whether the uuid field is set. + */ + fun hasUuid(): kotlin.Boolean { + return _builder.hasUuid() + } + + /** + * bool can_read = 3; + */ + var canRead: kotlin.Boolean + @JvmName("getCanRead") + get() = _builder.getCanRead() + @JvmName("setCanRead") + set(value) { + _builder.setCanRead(value) + } + /** + * bool can_read = 3; + */ + fun clearCanRead() { + _builder.clearCanRead() + } + + /** + * bool can_write = 4; + */ + var canWrite: kotlin.Boolean + @JvmName("getCanWrite") + get() = _builder.getCanWrite() + @JvmName("setCanWrite") + set(value) { + _builder.setCanWrite(value) + } + /** + * bool can_write = 4; + */ + fun clearCanWrite() { + _builder.clearCanWrite() + } + + /** + * bool can_write_without_response = 5; + */ + var canWriteWithoutResponse: kotlin.Boolean + @JvmName("getCanWriteWithoutResponse") + get() = _builder.getCanWriteWithoutResponse() + @JvmName("setCanWriteWithoutResponse") + set(value) { + _builder.setCanWriteWithoutResponse(value) + } + /** + * bool can_write_without_response = 5; + */ + fun clearCanWriteWithoutResponse() { + _builder.clearCanWriteWithoutResponse() + } + + /** + * bool can_notify = 6; + */ + var canNotify: kotlin.Boolean + @JvmName("getCanNotify") + get() = _builder.getCanNotify() + @JvmName("setCanNotify") + set(value) { + _builder.setCanNotify(value) + } + /** + * bool can_notify = 6; + */ + fun clearCanNotify() { + _builder.clearCanNotify() + } + } +} +@kotlin.jvm.JvmSynthetic +inline fun dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic.copy(block: dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristicKt.Dsl.() -> kotlin.Unit): dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristic = + dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristicKt.Dsl._create(this.toBuilder()).apply { block() }._build() + +val dev.yanshouwang.bluetooth_low_energy.proto.GattCharacteristicOrBuilder.uuidOrNull: dev.yanshouwang.bluetooth_low_energy.proto.UUID? + get() = if (hasUuid()) getUuid() else null + diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/proto/GattDescriptorKt.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/proto/GattDescriptorKt.kt new file mode 100644 index 0000000..0c6ce9c --- /dev/null +++ b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/proto/GattDescriptorKt.kt @@ -0,0 +1,73 @@ +//Generated by the protocol buffer compiler. DO NOT EDIT! +// source: proto/messages.proto + +package dev.yanshouwang.bluetooth_low_energy.proto; + +@kotlin.jvm.JvmName("-initializegattDescriptor") +inline fun gattDescriptor(block: dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptorKt.Dsl.() -> kotlin.Unit): dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor = + dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptorKt.Dsl._create(dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor.newBuilder()).apply { block() }._build() +object GattDescriptorKt { + @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) + @com.google.protobuf.kotlin.ProtoDslMarker + class Dsl private constructor( + private val _builder: dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor.Builder + ) { + companion object { + @kotlin.jvm.JvmSynthetic + @kotlin.PublishedApi + internal fun _create(builder: dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor.Builder): Dsl = Dsl(builder) + } + + @kotlin.jvm.JvmSynthetic + @kotlin.PublishedApi + internal fun _build(): dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor = _builder.build() + + /** + * int64 id = 1; + */ + var id: kotlin.Long + @JvmName("getId") + get() = _builder.getId() + @JvmName("setId") + set(value) { + _builder.setId(value) + } + /** + * int64 id = 1; + */ + fun clearId() { + _builder.clearId() + } + + /** + * .proto.UUID uuid = 2; + */ + var uuid: dev.yanshouwang.bluetooth_low_energy.proto.UUID + @JvmName("getUuid") + get() = _builder.getUuid() + @JvmName("setUuid") + set(value) { + _builder.setUuid(value) + } + /** + * .proto.UUID uuid = 2; + */ + fun clearUuid() { + _builder.clearUuid() + } + /** + * .proto.UUID uuid = 2; + * @return Whether the uuid field is set. + */ + fun hasUuid(): kotlin.Boolean { + return _builder.hasUuid() + } + } +} +@kotlin.jvm.JvmSynthetic +inline fun dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor.copy(block: dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptorKt.Dsl.() -> kotlin.Unit): dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptor = + dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptorKt.Dsl._create(this.toBuilder()).apply { block() }._build() + +val dev.yanshouwang.bluetooth_low_energy.proto.GattDescriptorOrBuilder.uuidOrNull: dev.yanshouwang.bluetooth_low_energy.proto.UUID? + get() = if (hasUuid()) getUuid() else null + diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/proto/GattServiceKt.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/proto/GattServiceKt.kt new file mode 100644 index 0000000..d0b10e1 --- /dev/null +++ b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/proto/GattServiceKt.kt @@ -0,0 +1,73 @@ +//Generated by the protocol buffer compiler. DO NOT EDIT! +// source: proto/messages.proto + +package dev.yanshouwang.bluetooth_low_energy.proto; + +@kotlin.jvm.JvmName("-initializegattService") +inline fun gattService(block: dev.yanshouwang.bluetooth_low_energy.proto.GattServiceKt.Dsl.() -> kotlin.Unit): dev.yanshouwang.bluetooth_low_energy.proto.GattService = + dev.yanshouwang.bluetooth_low_energy.proto.GattServiceKt.Dsl._create(dev.yanshouwang.bluetooth_low_energy.proto.GattService.newBuilder()).apply { block() }._build() +object GattServiceKt { + @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) + @com.google.protobuf.kotlin.ProtoDslMarker + class Dsl private constructor( + private val _builder: dev.yanshouwang.bluetooth_low_energy.proto.GattService.Builder + ) { + companion object { + @kotlin.jvm.JvmSynthetic + @kotlin.PublishedApi + internal fun _create(builder: dev.yanshouwang.bluetooth_low_energy.proto.GattService.Builder): Dsl = Dsl(builder) + } + + @kotlin.jvm.JvmSynthetic + @kotlin.PublishedApi + internal fun _build(): dev.yanshouwang.bluetooth_low_energy.proto.GattService = _builder.build() + + /** + * int64 id = 1; + */ + var id: kotlin.Long + @JvmName("getId") + get() = _builder.getId() + @JvmName("setId") + set(value) { + _builder.setId(value) + } + /** + * int64 id = 1; + */ + fun clearId() { + _builder.clearId() + } + + /** + * .proto.UUID uuid = 2; + */ + var uuid: dev.yanshouwang.bluetooth_low_energy.proto.UUID + @JvmName("getUuid") + get() = _builder.getUuid() + @JvmName("setUuid") + set(value) { + _builder.setUuid(value) + } + /** + * .proto.UUID uuid = 2; + */ + fun clearUuid() { + _builder.clearUuid() + } + /** + * .proto.UUID uuid = 2; + * @return Whether the uuid field is set. + */ + fun hasUuid(): kotlin.Boolean { + return _builder.hasUuid() + } + } +} +@kotlin.jvm.JvmSynthetic +inline fun dev.yanshouwang.bluetooth_low_energy.proto.GattService.copy(block: dev.yanshouwang.bluetooth_low_energy.proto.GattServiceKt.Dsl.() -> kotlin.Unit): dev.yanshouwang.bluetooth_low_energy.proto.GattService = + dev.yanshouwang.bluetooth_low_energy.proto.GattServiceKt.Dsl._create(this.toBuilder()).apply { block() }._build() + +val dev.yanshouwang.bluetooth_low_energy.proto.GattServiceOrBuilder.uuidOrNull: dev.yanshouwang.bluetooth_low_energy.proto.UUID? + get() = if (hasUuid()) getUuid() else null + diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MessageOuterClassKt.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/proto/MessagesKt.kt similarity index 100% rename from android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/MessageOuterClassKt.kt rename to android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/proto/MessagesKt.kt diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/proto/PeripheralKt.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/proto/PeripheralKt.kt new file mode 100644 index 0000000..840d5ac --- /dev/null +++ b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/proto/PeripheralKt.kt @@ -0,0 +1,63 @@ +//Generated by the protocol buffer compiler. DO NOT EDIT! +// source: proto/messages.proto + +package dev.yanshouwang.bluetooth_low_energy.proto; + +@kotlin.jvm.JvmName("-initializeperipheral") +inline fun peripheral(block: dev.yanshouwang.bluetooth_low_energy.proto.PeripheralKt.Dsl.() -> kotlin.Unit): dev.yanshouwang.bluetooth_low_energy.proto.Peripheral = + dev.yanshouwang.bluetooth_low_energy.proto.PeripheralKt.Dsl._create(dev.yanshouwang.bluetooth_low_energy.proto.Peripheral.newBuilder()).apply { block() }._build() +object PeripheralKt { + @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) + @com.google.protobuf.kotlin.ProtoDslMarker + class Dsl private constructor( + private val _builder: dev.yanshouwang.bluetooth_low_energy.proto.Peripheral.Builder + ) { + companion object { + @kotlin.jvm.JvmSynthetic + @kotlin.PublishedApi + internal fun _create(builder: dev.yanshouwang.bluetooth_low_energy.proto.Peripheral.Builder): Dsl = Dsl(builder) + } + + @kotlin.jvm.JvmSynthetic + @kotlin.PublishedApi + internal fun _build(): dev.yanshouwang.bluetooth_low_energy.proto.Peripheral = _builder.build() + + /** + * int64 id = 1; + */ + var id: kotlin.Long + @JvmName("getId") + get() = _builder.getId() + @JvmName("setId") + set(value) { + _builder.setId(value) + } + /** + * int64 id = 1; + */ + fun clearId() { + _builder.clearId() + } + + /** + * int32 maximum_write_length = 2; + */ + var maximumWriteLength: kotlin.Int + @JvmName("getMaximumWriteLength") + get() = _builder.getMaximumWriteLength() + @JvmName("setMaximumWriteLength") + set(value) { + _builder.setMaximumWriteLength(value) + } + /** + * int32 maximum_write_length = 2; + */ + fun clearMaximumWriteLength() { + _builder.clearMaximumWriteLength() + } + } +} +@kotlin.jvm.JvmSynthetic +inline fun dev.yanshouwang.bluetooth_low_energy.proto.Peripheral.copy(block: dev.yanshouwang.bluetooth_low_energy.proto.PeripheralKt.Dsl.() -> kotlin.Unit): dev.yanshouwang.bluetooth_low_energy.proto.Peripheral = + dev.yanshouwang.bluetooth_low_energy.proto.PeripheralKt.Dsl._create(this.toBuilder()).apply { block() }._build() + diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/proto/ServiceDataKt.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/proto/ServiceDataKt.kt new file mode 100644 index 0000000..9c2ec89 --- /dev/null +++ b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/proto/ServiceDataKt.kt @@ -0,0 +1,73 @@ +//Generated by the protocol buffer compiler. DO NOT EDIT! +// source: proto/messages.proto + +package dev.yanshouwang.bluetooth_low_energy.proto; + +@kotlin.jvm.JvmName("-initializeserviceData") +inline fun serviceData(block: dev.yanshouwang.bluetooth_low_energy.proto.ServiceDataKt.Dsl.() -> kotlin.Unit): dev.yanshouwang.bluetooth_low_energy.proto.ServiceData = + dev.yanshouwang.bluetooth_low_energy.proto.ServiceDataKt.Dsl._create(dev.yanshouwang.bluetooth_low_energy.proto.ServiceData.newBuilder()).apply { block() }._build() +object ServiceDataKt { + @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) + @com.google.protobuf.kotlin.ProtoDslMarker + class Dsl private constructor( + private val _builder: dev.yanshouwang.bluetooth_low_energy.proto.ServiceData.Builder + ) { + companion object { + @kotlin.jvm.JvmSynthetic + @kotlin.PublishedApi + internal fun _create(builder: dev.yanshouwang.bluetooth_low_energy.proto.ServiceData.Builder): Dsl = Dsl(builder) + } + + @kotlin.jvm.JvmSynthetic + @kotlin.PublishedApi + internal fun _build(): dev.yanshouwang.bluetooth_low_energy.proto.ServiceData = _builder.build() + + /** + * .proto.UUID uuid = 1; + */ + var uuid: dev.yanshouwang.bluetooth_low_energy.proto.UUID + @JvmName("getUuid") + get() = _builder.getUuid() + @JvmName("setUuid") + set(value) { + _builder.setUuid(value) + } + /** + * .proto.UUID uuid = 1; + */ + fun clearUuid() { + _builder.clearUuid() + } + /** + * .proto.UUID uuid = 1; + * @return Whether the uuid field is set. + */ + fun hasUuid(): kotlin.Boolean { + return _builder.hasUuid() + } + + /** + * bytes data = 2; + */ + var data: com.google.protobuf.ByteString + @JvmName("getData") + get() = _builder.getData() + @JvmName("setData") + set(value) { + _builder.setData(value) + } + /** + * bytes data = 2; + */ + fun clearData() { + _builder.clearData() + } + } +} +@kotlin.jvm.JvmSynthetic +inline fun dev.yanshouwang.bluetooth_low_energy.proto.ServiceData.copy(block: dev.yanshouwang.bluetooth_low_energy.proto.ServiceDataKt.Dsl.() -> kotlin.Unit): dev.yanshouwang.bluetooth_low_energy.proto.ServiceData = + dev.yanshouwang.bluetooth_low_energy.proto.ServiceDataKt.Dsl._create(this.toBuilder()).apply { block() }._build() + +val dev.yanshouwang.bluetooth_low_energy.proto.ServiceDataOrBuilder.uuidOrNull: dev.yanshouwang.bluetooth_low_energy.proto.UUID? + get() = if (hasUuid()) getUuid() else null + diff --git a/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/proto/UUIDKt.kt b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/proto/UUIDKt.kt new file mode 100644 index 0000000..cb9ed3d --- /dev/null +++ b/android/src/main/kotlin/dev/yanshouwang/bluetooth_low_energy/proto/UUIDKt.kt @@ -0,0 +1,46 @@ +//Generated by the protocol buffer compiler. DO NOT EDIT! +// source: proto/messages.proto + +package dev.yanshouwang.bluetooth_low_energy.proto; + +@kotlin.jvm.JvmName("-initializeuUID") +inline fun uUID(block: dev.yanshouwang.bluetooth_low_energy.proto.UUIDKt.Dsl.() -> kotlin.Unit): dev.yanshouwang.bluetooth_low_energy.proto.UUID = + dev.yanshouwang.bluetooth_low_energy.proto.UUIDKt.Dsl._create(dev.yanshouwang.bluetooth_low_energy.proto.UUID.newBuilder()).apply { block() }._build() +object UUIDKt { + @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) + @com.google.protobuf.kotlin.ProtoDslMarker + class Dsl private constructor( + private val _builder: dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder + ) { + companion object { + @kotlin.jvm.JvmSynthetic + @kotlin.PublishedApi + internal fun _create(builder: dev.yanshouwang.bluetooth_low_energy.proto.UUID.Builder): Dsl = Dsl(builder) + } + + @kotlin.jvm.JvmSynthetic + @kotlin.PublishedApi + internal fun _build(): dev.yanshouwang.bluetooth_low_energy.proto.UUID = _builder.build() + + /** + * string value = 1; + */ + var value: kotlin.String + @JvmName("getValue") + get() = _builder.getValue() + @JvmName("setValue") + set(value) { + _builder.setValue(value) + } + /** + * string value = 1; + */ + fun clearValue() { + _builder.clearValue() + } + } +} +@kotlin.jvm.JvmSynthetic +inline fun dev.yanshouwang.bluetooth_low_energy.proto.UUID.copy(block: dev.yanshouwang.bluetooth_low_energy.proto.UUIDKt.Dsl.() -> kotlin.Unit): dev.yanshouwang.bluetooth_low_energy.proto.UUID = + dev.yanshouwang.bluetooth_low_energy.proto.UUIDKt.Dsl._create(this.toBuilder()).apply { block() }._build() + diff --git a/bluetooth_low_energy.iml b/bluetooth_low_energy.iml deleted file mode 100644 index 429df7d..0000000 --- a/bluetooth_low_energy.iml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/example/.gitignore b/example/.gitignore index 0fa6b67..a8e938c 100644 --- a/example/.gitignore +++ b/example/.gitignore @@ -8,6 +8,7 @@ .buildlog/ .history .svn/ +migrate_working_dir/ # IntelliJ related *.iml diff --git a/example/.metadata b/example/.metadata deleted file mode 100644 index 3733535..0000000 --- a/example/.metadata +++ /dev/null @@ -1,10 +0,0 @@ -# This file tracks properties of this Flutter project. -# Used by Flutter tool to assess capabilities and perform upgrades etc. -# -# This file should be version controlled and should not be manually edited. - -version: - revision: 02c026b03cd31dd3f867e5faeb7e104cce174c5f - channel: stable - -project_type: app diff --git a/example/README.md b/example/README.md index 4056243..13063a6 100644 --- a/example/README.md +++ b/example/README.md @@ -8,9 +8,9 @@ This project is a starting point for a Flutter application. A few resources to get you started if this is your first Flutter project: -- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) -- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) +- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) +- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) -For help getting started with Flutter, view our -[online documentation](https://flutter.dev/docs), which offers tutorials, +For help getting started with Flutter development, view the +[online documentation](https://docs.flutter.dev/), which offers tutorials, samples, guidance on mobile development, and a full API reference. diff --git a/example/analysis_options.yaml b/example/analysis_options.yaml new file mode 100644 index 0000000..61b6c4d --- /dev/null +++ b/example/analysis_options.yaml @@ -0,0 +1,29 @@ +# This file configures the analyzer, which statically analyzes Dart code to +# check for errors, warnings, and lints. +# +# The issues identified by the analyzer are surfaced in the UI of Dart-enabled +# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be +# invoked from the command line by running `flutter analyze`. + +# The following line activates a set of recommended lints for Flutter apps, +# packages, and plugins designed to encourage good coding practices. +include: package:flutter_lints/flutter.yaml + +linter: + # The lint rules applied to this project can be customized in the + # section below to disable rules from the `package:flutter_lints/flutter.yaml` + # included above or to enable additional rules. A list of all available lints + # and their documentation is published at + # https://dart-lang.github.io/linter/lints/index.html. + # + # Instead of disabling a lint rule for the entire project in the + # section below, it can also be suppressed for a single line of code + # or a specific dart file by using the `// ignore: name_of_lint` and + # `// ignore_for_file: name_of_lint` syntax on the line or in the file + # producing the lint. + rules: + # avoid_print: false # Uncomment to disable the `avoid_print` rule + # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/example/android/.gitignore b/example/android/.gitignore index 0a741cb..6f56801 100644 --- a/example/android/.gitignore +++ b/example/android/.gitignore @@ -9,3 +9,5 @@ GeneratedPluginRegistrant.java # Remember to never publicly share your keystore. # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app key.properties +**/*.keystore +**/*.jks diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 5d60e9d..7deef07 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -1,8 +1,7 @@ def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) + localPropertiesFile.withReader('UTF-8') { reader -> localProperties.load(reader) } } @@ -26,16 +25,29 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 30 + compileSdkVersion flutter.compileSdkVersion + ndkVersion flutter.ndkVersion + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = '1.8' + } sourceSets { main.java.srcDirs += 'src/main/kotlin' } defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "dev.yanshouwang.bluetooth_low_energy_example" + // You can update the following values to match your application needs. + // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. minSdkVersion 21 - targetSdkVersion 30 + targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName } diff --git a/example/android/app/src/debug/AndroidManifest.xml b/example/android/app/src/debug/AndroidManifest.xml index 08edaac..f695679 100644 --- a/example/android/app/src/debug/AndroidManifest.xml +++ b/example/android/app/src/debug/AndroidManifest.xml @@ -1,6 +1,7 @@ - diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml index 193a9f1..ae09f72 100644 --- a/example/android/app/src/main/AndroidManifest.xml +++ b/example/android/app/src/main/AndroidManifest.xml @@ -2,9 +2,11 @@ package="dev.yanshouwang.bluetooth_low_energy_example"> - - diff --git a/example/android/app/src/main/res/values-night/styles.xml b/example/android/app/src/main/res/values-night/styles.xml index 449a9f9..06952be 100644 --- a/example/android/app/src/main/res/values-night/styles.xml +++ b/example/android/app/src/main/res/values-night/styles.xml @@ -3,14 +3,14 @@