diff --git a/ORLib/build.gradle b/ORLib/build.gradle index 567bb8f..58b5616 100644 --- a/ORLib/build.gradle +++ b/ORLib/build.gradle @@ -64,6 +64,18 @@ dependencies { implementation platform('com.google.firebase:firebase-bom:33.12.0') implementation 'com.google.firebase:firebase-messaging-ktx' implementation 'androidx.constraintlayout:constraintlayout:2.2.1' + implementation 'com.github.espressif:esp-idf-provisioning-android:lib-2.2.3' + implementation 'org.greenrobot:eventbus:3.3.1' + + implementation 'com.google.protobuf:protobuf-javalite:4.30.2' + implementation('com.google.protobuf:protobuf-kotlin:4.30.2') { + exclude group: 'com.google.protobuf', module: 'protobuf-java' + } + + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3' + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3' + + implementation 'com.github.iammohdzaki:Password-Generator:0.6' } diff --git a/ORLib/src/main/java/io/openremote/orlib/service/ESPProvisionProvider.kt b/ORLib/src/main/java/io/openremote/orlib/service/ESPProvisionProvider.kt new file mode 100644 index 0000000..9a33440 --- /dev/null +++ b/ORLib/src/main/java/io/openremote/orlib/service/ESPProvisionProvider.kt @@ -0,0 +1,330 @@ +package io.openremote.orlib.service + +import android.Manifest +import android.annotation.SuppressLint +import android.app.Activity +import android.bluetooth.BluetoothAdapter +import android.bluetooth.BluetoothManager +import android.content.Context +import android.content.Intent +import android.content.pm.PackageManager +import android.os.Build +import android.util.Log +import androidx.annotation.VisibleForTesting +import androidx.core.app.ActivityCompat +import io.openremote.orlib.R +import io.openremote.orlib.service.BleProvider.BleCallback +import io.openremote.orlib.service.BleProvider.Companion.BLUETOOTH_PERMISSION_REQUEST_CODE +import io.openremote.orlib.service.BleProvider.Companion.ENABLE_BLUETOOTH_REQUEST_CODE +import io.openremote.orlib.service.espprovision.BatteryProvision +import io.openremote.orlib.service.espprovision.CallbackChannel +import io.openremote.orlib.service.espprovision.DeviceConnection +import io.openremote.orlib.service.espprovision.DeviceRegistry +import io.openremote.orlib.service.espprovision.WifiProvisioner +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.launch +import java.net.URL + +object ESPProvisionProviderActions { + const val PROVIDER_INIT = "PROVIDER_INIT" + const val PROVIDER_ENABLE = "PROVIDER_ENABLE" + const val PROVIDER_DISABLE = "PROVIDER_DISABLE" + const val START_BLE_SCAN = "START_BLE_SCAN" + const val STOP_BLE_SCAN = "STOP_BLE_SCAN" + const val CONNECT_TO_DEVICE = "CONNECT_TO_DEVICE" + const val DISCONNECT_FROM_DEVICE = "DISCONNECT_FROM_DEVICE" + const val START_WIFI_SCAN = "START_WIFI_SCAN" + const val STOP_WIFI_SCAN = "STOP_WIFI_SCAN" + const val SEND_WIFI_CONFIGURATION = "SEND_WIFI_CONFIGURATION" + const val PROVISION_DEVICE = "PROVISION_DEVICE" + const val EXIT_PROVISIONING = "EXIT_PROVISIONING" +} + +class ESPProvisionProvider(val context: Context, val apiURL: URL = URL("http://localhost:8080/api/master")) { + @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) + val deviceRegistry: DeviceRegistry + var deviceConnection: DeviceConnection? = null + + private var searchDeviceTimeout: Long = 120 + private var searchDeviceMaxIterations = 25 + + var wifiProvisioner: WifiProvisioner? = null + private var searchWifiTimeout: Long = 120 + private var searchWifiMaxIterations = 25 + + init { + deviceRegistry = DeviceRegistry(context, searchDeviceTimeout, searchDeviceMaxIterations) + } + + interface ESPProvisionCallback { + fun accept(responseData: Map) + } + + companion object { + private const val espProvisionDisabledKey = "espProvisionDisabled" + private const val version = "beta" + + const val TAG = "ESPProvisionProvider" + + const val ENABLE_BLUETOOTH_ESPPROVISION_REQUEST_CODE = 655 + const val BLUETOOTH_PERMISSION_ESPPROVISION_REQUEST_CODE = 656 + } + + private val bluetoothAdapter: BluetoothAdapter by lazy { + val bluetoothManager = + context.getSystemService(Context.BLUETOOTH_SERVICE) as BluetoothManager + bluetoothManager.adapter + } + + fun initialize(): Map { + val sharedPreferences = + context.getSharedPreferences(context.getString(R.string.app_name), Context.MODE_PRIVATE) + + return hashMapOf( + "action" to ESPProvisionProviderActions.PROVIDER_INIT, + "provider" to "espprovision", + "version" to version, + "requiresPermission" to true, + "hasPermission" to hasPermission(), + "success" to true, + "enabled" to false, + "disabled" to sharedPreferences.contains(espProvisionDisabledKey) + ) + } + + @SuppressLint("MissingPermission") + fun enable(callback: ESPProvisionCallback, activity: Activity) { + deviceRegistry.callbackChannel = CallbackChannel(callback, "espprovision") + deviceRegistry.enable() + + if (!bluetoothAdapter.isEnabled) { + Log.d("ESP", "BLE not enabled") + val enableBtIntent = Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE) + activity.startActivityForResult(enableBtIntent, + ESPProvisionProvider.Companion.ENABLE_BLUETOOTH_ESPPROVISION_REQUEST_CODE + ) + } else if (!hasPermission()) { + Log.d("ESP", "Does not have permissions") + requestPermissions(activity) + } + + + if (bluetoothAdapter.isEnabled && hasPermission()) { + providerEnabled(deviceRegistry.callbackChannel) + } + } + + fun providerEnabled(callbackChannel: CallbackChannel?) { + val sharedPreferences = + context.getSharedPreferences( + context.getString(R.string.app_name), + Context.MODE_PRIVATE + ) + + sharedPreferences.edit() + .remove(espProvisionDisabledKey) + .apply() + + callbackChannel?.sendMessage(ESPProvisionProviderActions.PROVIDER_ENABLE, + hashMapOf( + "hasPermission" to hasPermission(), + "success" to true, + "enabled" to true, + "disabled" to sharedPreferences.contains(espProvisionDisabledKey) + ) + ) + } + + @SuppressLint("MissingPermission") + fun disable(): Map { + deviceRegistry.disable() + +// disconnectFromDevice() + + val sharedPreferences = + context.getSharedPreferences(context.getString(R.string.app_name), Context.MODE_PRIVATE) + sharedPreferences.edit() + .putBoolean(espProvisionDisabledKey, true) + .apply() + + return hashMapOf( + "action" to ESPProvisionProviderActions.PROVIDER_DISABLE, + "provider" to "espprovision" + ) + } + + @SuppressLint("MissingPermission") + fun onRequestPermissionsResult( + activity: Activity, + requestCode: Int, + prefix: String? + ) { + Log.d("espprovision", "onRequestPermissionsResult called with prefix >" + prefix + "<") + if (requestCode == BLUETOOTH_PERMISSION_ESPPROVISION_REQUEST_CODE) { + val hasPermission = hasPermission() + if (hasPermission) { + if (!bluetoothAdapter.isEnabled) { + val enableBtIntent = Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE) + activity.startActivityForResult(enableBtIntent, ENABLE_BLUETOOTH_ESPPROVISION_REQUEST_CODE) + } else { + providerEnabled(deviceRegistry.callbackChannel) + if (prefix != null) { + deviceRegistry.startDevicesScan(prefix) + } + } + } + } else if (requestCode == ENABLE_BLUETOOTH_ESPPROVISION_REQUEST_CODE) { + if (bluetoothAdapter.isEnabled) { + providerEnabled(deviceRegistry.callbackChannel) + if (prefix != null) { + deviceRegistry.startDevicesScan(prefix) + } + } + } + } + + // Device scan + + @SuppressLint("MissingPermission") + fun startDevicesScan(prefix: String?, activity: Activity, callback: ESPProvisionCallback) { + deviceRegistry.callbackChannel = CallbackChannel(callback, "espprovision") + if (!bluetoothAdapter.isEnabled) { + Log.d("ESP", "BLE not enabled") + val enableBtIntent = Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE) + activity.startActivityForResult(enableBtIntent, + ESPProvisionProvider.Companion.ENABLE_BLUETOOTH_ESPPROVISION_REQUEST_CODE + ) + } else if (!hasPermission()) { + Log.d("ESP", "Does not have permissions") + requestPermissions(activity) + } else { + deviceRegistry.startDevicesScan(prefix) + } + } + + @SuppressLint("MissingPermission") + fun stopDevicesScan() { + deviceRegistry.stopDevicesScan() + } + + // MARK: Device connect/disconnect + + @SuppressLint("MissingPermission") + fun connectTo(deviceId: String, pop: String? = null, username: String? = null) { + if (deviceConnection == null) { + deviceConnection = DeviceConnection(deviceRegistry, deviceRegistry.callbackChannel) + } + deviceConnection?.connectTo(deviceId, pop, username) + } + + fun disconnectFromDevice() { + wifiProvisioner?.stopWifiScan() + deviceConnection?.disconnectFromDevice() + } + + fun exitProvisioning() { + if (deviceConnection == null) { + return + } + if (!deviceConnection!!.isConnected) { + sendExitProvisioningError(ESPProviderErrorCode.NOT_CONNECTED, "No connection established to device") + return + } + deviceConnection!!.exitProvisioning() + deviceRegistry?.callbackChannel?.sendMessage( + ESPProvisionProviderActions.EXIT_PROVISIONING, + mapOf("exit" to true) + ) + } + + private fun sendExitProvisioningError(error: ESPProviderErrorCode, errorMessage: String?) { + val data = mutableMapOf() + + data["exit"] = false + data["errorCode"] = error.code + errorMessage?.let { + data["errorMessage"] = it + } + + deviceRegistry?.callbackChannel?.sendMessage(ESPProvisionProviderActions.EXIT_PROVISIONING, data) + } + + // Wifi scan + + fun startWifiScan() { + if (wifiProvisioner == null) { + wifiProvisioner = WifiProvisioner(deviceConnection, deviceRegistry.callbackChannel, searchWifiTimeout, searchWifiMaxIterations) + } + wifiProvisioner!!.startWifiScan() + } + + fun stopWifiScan() { + wifiProvisioner?.stopWifiScan() + } + + fun sendWifiConfiguration(ssid: String, password: String) { + if (wifiProvisioner == null) { + wifiProvisioner = WifiProvisioner(deviceConnection, deviceRegistry.callbackChannel, searchWifiTimeout, searchWifiMaxIterations) + } + wifiProvisioner!!.sendWifiConfiguration(ssid, password) + } + + // OR Configuration + + fun provisionDevice(userToken: String) { + val batteryProvision = BatteryProvision(deviceConnection, deviceRegistry.callbackChannel, apiURL) + CoroutineScope(Dispatchers.IO).launch { + batteryProvision.provision(userToken) + } + } + + private fun requestPermissions(activity: Activity) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { + ActivityCompat.requestPermissions( + activity, + arrayOf( + Manifest.permission.BLUETOOTH_SCAN, + Manifest.permission.BLUETOOTH_CONNECT + ), + ESPProvisionProvider.Companion.BLUETOOTH_PERMISSION_ESPPROVISION_REQUEST_CODE + ) + } else { + ActivityCompat.requestPermissions( + activity, + arrayOf(Manifest.permission.ACCESS_FINE_LOCATION), + ESPProvisionProvider.Companion.BLUETOOTH_PERMISSION_ESPPROVISION_REQUEST_CODE + ) + } + } + + private fun hasPermission() = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { + context.checkSelfPermission(Manifest.permission.BLUETOOTH_SCAN) == PackageManager.PERMISSION_GRANTED && + context.checkSelfPermission(Manifest.permission.BLUETOOTH_CONNECT) == PackageManager.PERMISSION_GRANTED + } else { + context.checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED + } + +} + +data class ESPProviderException(val errorCode: ESPProviderErrorCode, val errorMessage: String) : Exception() + +enum class ESPProviderErrorCode(val code: Int) { + UNKNOWN_DEVICE(100), + + BLE_COMMUNICATION_ERROR(200), + + NOT_CONNECTED(300), + COMMUNICATION_ERROR(301), + + SECURITY_ERROR(400), + + WIFI_CONFIGURATION_ERROR(500), + WIFI_COMMUNICATION_ERROR(501), + WIFI_AUTHENTICATION_ERROR(502), + WIFI_NETWORK_NOT_FOUND(503), + + TIMEOUT_ERROR(600), + + GENERIC_ERROR(10000); +} \ No newline at end of file diff --git a/ORLib/src/main/java/io/openremote/orlib/service/espprovision/BatteryProvision.kt b/ORLib/src/main/java/io/openremote/orlib/service/espprovision/BatteryProvision.kt new file mode 100644 index 0000000..05eff9c --- /dev/null +++ b/ORLib/src/main/java/io/openremote/orlib/service/espprovision/BatteryProvision.kt @@ -0,0 +1,124 @@ +package io.openremote.orlib.service.espprovision + +import android.util.Log +import data.entity.Response +import io.openremote.orlib.service.ESPProviderErrorCode +import io.openremote.orlib.service.ESPProviderException +import io.openremote.orlib.service.ESPProvisionProvider +import io.openremote.orlib.service.ESPProvisionProviderActions +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.withContext +import utils.PasswordType +import java.net.URL +import java.util.Locale +import kotlin.coroutines.resume +import kotlin.coroutines.suspendCoroutine + +class BatteryProvision(var deviceConnection: DeviceConnection?, var callbackChannel: CallbackChannel?, var apiURL: URL) { + var batteryProvisionAPI: BatteryProvisionAPI + + var backendConnectionTimeoutMillis = 60_000 + + init { + batteryProvisionAPI = BatteryProvisionAPIREST(apiURL) + } + + suspend fun provision(userToken: String) { + if (deviceConnection == null || !deviceConnection!!.isConnected) { + sendProvisionDeviceStatus(false, ESPProviderErrorCode.NOT_CONNECTED, "No connection established to device") + } + + try { + val deviceInfo = deviceConnection!!.getDeviceInfo() + Log.d(ESPProvisionProvider.TAG, "Device id is ${deviceInfo.deviceId}") + + val password = generatePassword() + + val assetId = batteryProvisionAPI.provision(deviceInfo.deviceId, password, userToken) + val userName = deviceInfo.deviceId.lowercase(Locale("en")) + + deviceConnection?.sendOpenRemoteConfig( + mqttBrokerUrl = mqttURL, + mqttUser = userName, + mqttPassword = password, + assetId = assetId + ) + + var status = BackendConnectionStatus.CONNECTING + val startTime = System.currentTimeMillis() + + while (status != BackendConnectionStatus.CONNECTED) { + if (System.currentTimeMillis() - startTime > backendConnectionTimeoutMillis) { + sendProvisionDeviceStatus( + connected = false, + error = ESPProviderErrorCode.TIMEOUT_ERROR, + errorMessage = "Timeout waiting for backend to get connected" + ) + return + } + + status = deviceConnection?.getBackendConnectionStatus() + ?: BackendConnectionStatus.DISCONNECTED + } + sendProvisionDeviceStatus(true) + } catch (e: ESPProviderException) { + sendProvisionDeviceStatus(false, e.errorCode, e.errorMessage) + } catch (e: BatteryProvisionAPIError) { + val (errorCode, errorMessage) = mapBatteryProvisionAPIError(e) + sendProvisionDeviceStatus(false, errorCode, errorMessage) + } + } + + private suspend fun sendProvisionDeviceStatus(connected: Boolean, error: ESPProviderErrorCode? = null, errorMessage: String? = null) { + val data = mutableMapOf("connected" to connected) + + error?.let { + data["errorCode"] = it.code + } + errorMessage?.let { + data["errorMessage"] = it + } + + // We bring it back to main context as this eventually is a message to the Web view + withContext(Dispatchers.Main) { + callbackChannel?.sendMessage(ESPProvisionProviderActions.PROVISION_DEVICE, data) + } + } + + private fun mapBatteryProvisionAPIError(error: BatteryProvisionAPIError): Pair { + return when (error) { + is BatteryProvisionAPIError.BusinessError, + is BatteryProvisionAPIError.UnknownError -> ESPProviderErrorCode.GENERIC_ERROR to null + + is BatteryProvisionAPIError.GenericError -> ESPProviderErrorCode.GENERIC_ERROR to error.error.localizedMessage + + is BatteryProvisionAPIError.Unauthorized -> ESPProviderErrorCode.SECURITY_ERROR to null + + is BatteryProvisionAPIError.CommunicationError -> ESPProviderErrorCode.COMMUNICATION_ERROR to error.message + } + } + + // Using https://github.com/iammohdzaki/Password-Generator + private suspend fun generatePassword(): String = suspendCoroutine { continuation -> + PasswordGenerator.Builder(PasswordType.RANDOM) + .showLogs(false) + .includeUpperCaseChars(true) + .includeNumbers(true) + .includeLowerCaseChars(true) + .includeSpecialSymbols(false) + .passwordLength(16) + .callback(object : PasswordGenerator.Callback { + override fun onPasswordGenerated(response: Response) { + continuation.resume(response.password) + } + }) + .build() + .generate() + } + + private val mqttURL: String + get() { + // TODO: is this OK or do we want to get the mqtt url from the server? + return "mqtts://${apiURL.host ?: "localhost"}:8883" + } +} \ No newline at end of file diff --git a/ORLib/src/main/java/io/openremote/orlib/service/espprovision/BatteryProvisionAPI.kt b/ORLib/src/main/java/io/openremote/orlib/service/espprovision/BatteryProvisionAPI.kt new file mode 100644 index 0000000..0e42629 --- /dev/null +++ b/ORLib/src/main/java/io/openremote/orlib/service/espprovision/BatteryProvisionAPI.kt @@ -0,0 +1,84 @@ +package io.openremote.orlib.service.espprovision + +import android.net.Uri +import android.util.Log +import io.openremote.orlib.service.ESPProvisionProvider +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.withContext +import org.json.JSONObject +import java.io.BufferedReader +import java.io.InputStreamReader +import java.io.OutputStreamWriter +import java.net.HttpURLConnection +import java.net.URL + +interface BatteryProvisionAPI { + suspend fun provision(deviceId: String, password: String, token: String): String +} + +class BatteryProvisionAPIREST(private val apiURL: URL) : BatteryProvisionAPI { + + companion object { + private const val TAG = "BatteryProvisionAPIREST" + } + + override suspend fun provision(deviceId: String, password: String, token: String): String = withContext(Dispatchers.IO) { + Log.d(ESPProvisionProvider.TAG, "apiURL $apiURL") + val uri = Uri.parse(apiURL.toString()).buildUpon() + .appendPath("rest") + .appendPath("battery") + .build() + + val url = URL(uri.toString()) + Log.d(ESPProvisionProvider.TAG, "Calling URL $url") + val connection = url.openConnection() as HttpURLConnection + connection.requestMethod = "POST" + connection.setRequestProperty("Content-Type", "application/json") + connection.setRequestProperty("Authorization", "Bearer $token") + connection.doOutput = true + + val requestBody = JSONObject().apply { + put("deviceId", deviceId) + put("password", password) + } + + try { + OutputStreamWriter(connection.outputStream).use { writer -> + writer.write(requestBody.toString()) + writer.flush() + } + + val responseCode = connection.responseCode + val responseText = BufferedReader(InputStreamReader( + if (responseCode in 200..299) connection.inputStream else connection.errorStream + )).use { it.readText() } + + if (responseCode !in 200..299) { + Log.d(ESPProvisionProvider.TAG, "Response code $responseCode") + Log.d(ESPProvisionProvider.TAG, "Response text $responseText") + when (responseCode) { + 401 -> throw BatteryProvisionAPIError.Unauthorized + 409 -> throw BatteryProvisionAPIError.BusinessError + else -> throw BatteryProvisionAPIError.UnknownError + } + } + + val json = JSONObject(responseText) + return@withContext json.getString("assetId") + } catch (e: BatteryProvisionAPIError) { + throw e + } catch (e: Exception) { + throw BatteryProvisionAPIError.GenericError(e) + } finally { + connection.disconnect() + } + } +} + +sealed class BatteryProvisionAPIError(message: String? = null, cause: Throwable? = null) : Exception(message, cause) { + object Unauthorized : BatteryProvisionAPIError("Unauthorized") + data class CommunicationError(val reason: String) : BatteryProvisionAPIError(reason) + object BusinessError : BatteryProvisionAPIError("Business logic error") + data class GenericError(val error: Throwable) : BatteryProvisionAPIError(error.message, error) + object UnknownError : BatteryProvisionAPIError("Unknown error") +} \ No newline at end of file diff --git a/ORLib/src/main/java/io/openremote/orlib/service/espprovision/CallbackChannel.kt b/ORLib/src/main/java/io/openremote/orlib/service/espprovision/CallbackChannel.kt new file mode 100644 index 0000000..ad8eb76 --- /dev/null +++ b/ORLib/src/main/java/io/openremote/orlib/service/espprovision/CallbackChannel.kt @@ -0,0 +1,16 @@ +package io.openremote.orlib.service.espprovision + +import io.openremote.orlib.service.ESPProvisionProvider + +class CallbackChannel(private val espProvisionCallback: ESPProvisionProvider.ESPProvisionCallback, private val provider: String) { + + fun sendMessage(action: String, data: Map? = null) { + var payload: MutableMap = hashMapOf( + "action" to action, + "provider" to "espprovision") + + data?.let { payload.putAll(it) } + + espProvisionCallback.accept(payload) + } +} \ No newline at end of file diff --git a/ORLib/src/main/java/io/openremote/orlib/service/espprovision/DeviceConnection.kt b/ORLib/src/main/java/io/openremote/orlib/service/espprovision/DeviceConnection.kt new file mode 100644 index 0000000..d137a4f --- /dev/null +++ b/ORLib/src/main/java/io/openremote/orlib/service/espprovision/DeviceConnection.kt @@ -0,0 +1,251 @@ +package io.openremote.orlib.service.espprovision + +import android.Manifest +import android.text.TextUtils +import android.util.Log +import androidx.annotation.RequiresPermission +import com.espressif.provisioning.DeviceConnectionEvent +import com.espressif.provisioning.ESPConstants +import com.espressif.provisioning.ESPDevice +import io.openremote.orlib.service.ESPProviderErrorCode +import io.openremote.orlib.service.ESPProviderException +import io.openremote.orlib.service.ESPProvisionProvider +import io.openremote.orlib.service.ESPProvisionProviderActions +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.launch +import kotlinx.coroutines.runBlocking +import org.greenrobot.eventbus.EventBus +import org.greenrobot.eventbus.Subscribe +import org.greenrobot.eventbus.ThreadMode +import org.json.JSONException +import org.json.JSONObject +import java.util.UUID + +class DeviceConnection(val deviceRegistry: DeviceRegistry, var callbackChannel: CallbackChannel? = null) { + + companion object { + private const val SEC_TYPE_0: Int = 0 + private const val SEC_TYPE_1: Int = 1 + private const val SEC_TYPE_2: Int = 2 + } + + init { + EventBus.getDefault().register(this) + } +// TODO: must un-register -> need a clean-up routine + + private var bleStatus: BLEStatus = BLEStatus.DISCONNECTED + + var deviceId: UUID? = null + private set + + private var configChannel: ORConfigChannel? = null + + @RequiresPermission(allOf = [Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.BLUETOOTH_ADMIN, Manifest.permission.BLUETOOTH]) + fun connectTo(deviceId: String, pop: String? = null, username: String? = null) { + + if (deviceRegistry.bleScanning) { + deviceRegistry.stopDevicesScan() + } + + val devId = UUID.fromString(deviceId) + val dev = deviceRegistry.getDeviceWithId(devId) + + if (dev != null) { +// device = dev.device // TODO: should I set this ? to what ? + this.deviceId = devId + + espDevice?.proofOfPossession = pop ?: "abcd1234" + espDevice?.userName = username ?: "UNUSED" + espDevice?.connectBLEDevice(dev.device, dev.serviceUuid) + + } + } + + fun disconnectFromDevice() { + espDevice?.disconnectDevice() + } + + fun exitProvisioning() { + if (!isConnected) { + throw ESPProviderException( + errorCode = ESPProviderErrorCode.NOT_CONNECTED, + errorMessage = "No connection established to device" + ) + } + + CoroutineScope(Dispatchers.IO).launch { + try { + configChannel?.exitProvisioning() + } catch (e: ORConfigChannelError) { + throw ESPProviderException(ESPProviderErrorCode.COMMUNICATION_ERROR, e.message ?: e.toString()) + } catch (e: Exception) { + throw ESPProviderException(ESPProviderErrorCode.GENERIC_ERROR, e.toString()) + } + } + } + + suspend fun getDeviceInfo(): DeviceInfo { + if (!isConnected) { + throw ESPProviderException( + errorCode = ESPProviderErrorCode.NOT_CONNECTED, + errorMessage = "No connection established to device" + ) + } + + return configChannel!!.getDeviceInfo() + } + + suspend fun sendOpenRemoteConfig( + mqttBrokerUrl: String, + mqttUser: String, + mqttPassword: String, + assetId: String + ) { + if (!isConnected) { + throw ESPProviderException( + errorCode = ESPProviderErrorCode.NOT_CONNECTED, + errorMessage = "No connection established to device" + ) + } + try { + configChannel?.sendOpenRemoteConfig( + mqttBrokerUrl = mqttBrokerUrl, + mqttUser = mqttUser, + mqttPassword = mqttPassword, + assetId = assetId + ) + } catch (e: Exception) { + throw ESPProviderException( + errorCode = ESPProviderErrorCode.COMMUNICATION_ERROR, + errorMessage = e.localizedMessage ?: "Unknown error" + ) + } + } + + suspend fun getBackendConnectionStatus(): BackendConnectionStatus { + if (!isConnected) { + throw ESPProviderException( + errorCode = ESPProviderErrorCode.NOT_CONNECTED, + errorMessage = "No connection established to device" + ) + } + return try { + configChannel?.getBackendConnectionStatus() + ?: throw ESPProviderException( + errorCode = ESPProviderErrorCode.COMMUNICATION_ERROR, + errorMessage = "Channel returned null status" + ) + } catch (e: Exception) { + throw ESPProviderException( + errorCode = ESPProviderErrorCode.COMMUNICATION_ERROR, + errorMessage = e.localizedMessage ?: "Unknown error" + ) + } as BackendConnectionStatus + } + + @Subscribe(threadMode = ThreadMode.MAIN) + fun onDeviceConnectionEvent(event: DeviceConnectionEvent) { + + when (event.getEventType()) { + ESPConstants.EVENT_DEVICE_CONNECTED -> { + Log.d(ESPProvisionProvider.TAG, "Device Connected Event Received") + bleStatus = BLEStatus.CONNECTED + + espDevice?.let { device -> + setSecurityTypeFromVersionInfo(device) + configChannel = ORConfigChannel(device) + } + + sendConnectToDeviceStatus(ESPProviderConnectToDeviceStatus.CONNECTED.value) + } + + ESPConstants.EVENT_DEVICE_DISCONNECTED -> { + bleStatus = BLEStatus.DISCONNECTED + configChannel = null + sendConnectToDeviceStatus(ESPProviderConnectToDeviceStatus.DISCONNECTED.value) + } + + ESPConstants.EVENT_DEVICE_CONNECTION_FAILED -> { + bleStatus = BLEStatus.DISCONNECTED + + // TODO: can I get some error details ? + sendConnectToDeviceStatus(ESPProviderConnectToDeviceStatus.CONNECTION_ERROR.value) + } + } + } + + private fun sendConnectToDeviceStatus(status: String, error: ESPProviderErrorCode? = null, errorMessage: String? = null) { + val data = mutableMapOf("id" to (deviceId?.toString() ?: ""), "status" to status) + + error?.let { + data["errorCode"] = error.code + } + errorMessage?.let { + data["errorMessage"] = it + } + + callbackChannel?.sendMessage(ESPProvisionProviderActions.CONNECT_TO_DEVICE, data) + } + + fun setSecurityTypeFromVersionInfo(device: ESPDevice) { + val protoVerStr: String = device.getVersionInfo() + + try { + val jsonObject = JSONObject(protoVerStr) + val provInfo = jsonObject.getJSONObject("prov") + + if (provInfo != null) { + if (provInfo.has("sec_ver")) { + val serVer = provInfo.optInt("sec_ver") + Log.d(ESPProvisionProvider.TAG, "Security Version : " + serVer) + + when (serVer) { + SEC_TYPE_0 -> { + device.setSecurityType(ESPConstants.SecurityType.SECURITY_0) + } + + SEC_TYPE_1 -> { + device.setSecurityType(ESPConstants.SecurityType.SECURITY_1) + } + + SEC_TYPE_2 -> { + device.setSecurityType(ESPConstants.SecurityType.SECURITY_2) + } + + else -> { + device.setSecurityType(ESPConstants.SecurityType.SECURITY_2) + } + } + } else { + device.setSecurityType(ESPConstants.SecurityType.SECURITY_1) + } + } else { + Log.e(ESPProvisionProvider.TAG, "proto-ver info is not available.") + } + } catch (e: JSONException) { + e.printStackTrace() + Log.d(ESPProvisionProvider.TAG, "Capabilities JSON not available.") + } + } + + val espDevice: ESPDevice? + get() = deviceRegistry.provisionManager?.espDevice + + val isConnected: Boolean + get() = bleStatus == BLEStatus.CONNECTED && espDevice != null && configChannel != null + + enum class ESPProviderConnectToDeviceStatus(val value: String) { + CONNECTED("connected"), + DISCONNECTED("disconnected"), + CONNECTION_ERROR("connectionError"); + + override fun toString(): String = value + } + enum class BLEStatus { + CONNECTING, + CONNECTED, + DISCONNECTED + } +} \ No newline at end of file diff --git a/ORLib/src/main/java/io/openremote/orlib/service/espprovision/DeviceRegistry.kt b/ORLib/src/main/java/io/openremote/orlib/service/espprovision/DeviceRegistry.kt new file mode 100644 index 0000000..d66ac30 --- /dev/null +++ b/ORLib/src/main/java/io/openremote/orlib/service/espprovision/DeviceRegistry.kt @@ -0,0 +1,188 @@ +package io.openremote.orlib.service.espprovision + +import android.Manifest +import android.bluetooth.BluetoothDevice +import android.bluetooth.le.ScanResult +import android.content.Context +import android.util.Log +import androidx.annotation.RequiresPermission +import com.espressif.provisioning.ESPConstants +import com.espressif.provisioning.ESPDevice +import com.espressif.provisioning.ESPProvisionManager +import com.espressif.provisioning.listeners.BleScanListener +import io.openremote.orlib.service.ESPProviderErrorCode +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.launch +import kotlinx.coroutines.suspendCancellableCoroutine +import kotlinx.coroutines.withContext +import java.util.UUID + +class EspressifProvisionManager(private val provisionManager: ESPProvisionManager) { + init { + provisionManager.createESPDevice(ESPConstants.TransportType.TRANSPORT_BLE, ESPConstants.SecurityType.SECURITY_1) + } + + @RequiresPermission(allOf = [android.Manifest.permission.ACCESS_FINE_LOCATION, android.Manifest.permission.BLUETOOTH_ADMIN, android.Manifest.permission.BLUETOOTH]) + suspend fun searchESPDevices(devicePrefix: String): List { + return withContext(Dispatchers.Main) { + // If on IO: Error during device scan: Can't create handler inside thread Thread[DefaultDispatcher-worker-2,5,main] that has not called Looper.prepare() + // But I don't see any warnings that the main thread is getting blocked + suspendCancellableCoroutine { continuation -> + var devices: MutableList = mutableListOf() + + provisionManager.searchBleEspDevices(devicePrefix, object: BleScanListener { + override fun scanStartFailed() { + // Don't care about that information + } + + override fun onPeripheralFound(device: BluetoothDevice, scanResult: ScanResult) { + if (!scanResult.scanRecord?.deviceName.isNullOrEmpty()) { + var serviceUuid = "" + scanResult.scanRecord?.serviceUuids?.firstOrNull()?.toString()?.let { uuid -> + serviceUuid = uuid + } + scanResult.scanRecord!!.deviceName?.let { deviceName -> + if (devices.find { it.name == deviceName } == null) { + devices.add(DeviceRegistry.DiscoveredDevice(deviceName, serviceUuid, device)) + Log.d("espprovision", "Added device, list is now $devices") + } + } + } + } + + override fun scanCompleted() { + Log.d("espprovision", "Scan completed") + // TODO: I don't want that second param + continuation.resume(devices, onCancellation = null) + } + + override fun onFailure(e: Exception) { + continuation.cancel(e) + } + + }) + } + } + } + + @RequiresPermission(allOf = [Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.BLUETOOTH_ADMIN, Manifest.permission.BLUETOOTH]) + fun stopESPDevicesSearch() + { + provisionManager.stopBleScan() + } + + val espDevice: ESPDevice + get() = provisionManager.espDevice +} + +class DeviceRegistry(private val context: Context, searchDeviceTimeout: Long, searchDeviceMaxIterations: Int, var callbackChannel: CallbackChannel? = null) { + private var loopDetector = LoopDetector(searchDeviceTimeout, searchDeviceMaxIterations) + var provisionManager: EspressifProvisionManager? = null + + var bleScanning = false + + private var devices: MutableList = mutableListOf() + private var devicesIndex: MutableMap = mutableMapOf() + + fun enable() { + provisionManager = EspressifProvisionManager(ESPProvisionManager.getInstance(context)) + } + + @RequiresPermission(allOf = [Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.BLUETOOTH_ADMIN, Manifest.permission.BLUETOOTH]) + fun disable() { + if (bleScanning) stopDevicesScan() + provisionManager = null + } + + @RequiresPermission(allOf = [Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.BLUETOOTH_ADMIN, Manifest.permission.BLUETOOTH]) + fun startDevicesScan(prefix: String? = "") { + Log.d("espprovision", "startDevicesScan called with prefix >" + prefix + "<") + bleScanning = true + resetDevicesList() + loopDetector.reset() + devicesScan(prefix ?: "") + } + + @RequiresPermission(allOf = [Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.BLUETOOTH_ADMIN, Manifest.permission.BLUETOOTH]) + fun stopDevicesScan(sendMessage: Boolean = true) { + bleScanning = false + provisionManager?.stopESPDevicesSearch() + if (sendMessage) { + callbackChannel?.sendMessage("STOP_BLE_SCAN", null) + } + } + + @RequiresPermission(allOf = [android.Manifest.permission.ACCESS_FINE_LOCATION, android.Manifest.permission.BLUETOOTH_ADMIN, android.Manifest.permission.BLUETOOTH]) + private fun devicesScan(prefix: String) { + provisionManager?.let { manager -> + if (loopDetector.detectLoop()) { + stopDevicesScan(sendMessage = false) + sendDeviceScanError(ESPProviderErrorCode.TIMEOUT_ERROR) + return + } + + CoroutineScope(Dispatchers.IO).launch { + try { + val deviceList = manager.searchESPDevices(prefix) + Log.d("espprovision", "I got a list of devices $deviceList") + if (bleScanning) { + var devicesChanged = false + for (device in deviceList) { + if (getDeviceNamed(device.name) == null) { + devicesChanged = true + registerDevice(device) + } + } + Log.d("espprovision", "devicesChanges $devicesChanged") + Log.d("espprovision", "devices $devices") + if (devices.isNotEmpty() && devicesChanged) { + Log.d("espprovision", "callbackChannel $callbackChannel") + callbackChannel?.sendMessage( + "START_BLE_SCAN", + mapOf("devices" to devices.map { it.info }) + ) + } + devicesScan(prefix) + } + } catch (e: Exception) { + Log.w("DeviceRegistry", "Error during device scan: ${e.localizedMessage}") + sendDeviceScanError(ESPProviderErrorCode.GENERIC_ERROR) + } + } + } + } + + private fun sendDeviceScanError(error: ESPProviderErrorCode, errorMessage: String? = null) { + val data = mutableMapOf("errorCode" to error.code) + + errorMessage?.let { + data["errorMessage"] = it + } + + callbackChannel?.sendMessage(action = "STOP_BLE_SCAN", data = data) + } + + private fun resetDevicesList() { + devices = mutableListOf() + devicesIndex = mutableMapOf() + } + + private fun getDeviceNamed(name: String): DiscoveredDevice? { + return devices.firstOrNull { it.name == name } + } + + fun getDeviceWithId(id: UUID): DiscoveredDevice? { + return devicesIndex[id] + } + + private fun registerDevice(device: DiscoveredDevice) { + devices.add(device) + devicesIndex[device.id] = device + } + + data class DiscoveredDevice(val name: String, val serviceUuid: String, val device: BluetoothDevice, val id: UUID = UUID.randomUUID()) { + val info: Map + get() = mapOf("id" to id.toString(), "name" to name) + } +} \ No newline at end of file diff --git a/ORLib/src/main/java/io/openremote/orlib/service/espprovision/LoopDetector.kt b/ORLib/src/main/java/io/openremote/orlib/service/espprovision/LoopDetector.kt new file mode 100644 index 0000000..18d17e3 --- /dev/null +++ b/ORLib/src/main/java/io/openremote/orlib/service/espprovision/LoopDetector.kt @@ -0,0 +1,29 @@ +package io.openremote.orlib.service.espprovision + +import java.util.Date +import java.util.concurrent.TimeUnit + +class LoopDetector( + private val timeout: Long = TimeUnit.MINUTES.toSeconds(2), + private val maxIterations: Int = 25) { + + private var startTime: Date? = null + private var iterationCount = 0 + + fun reset() { + startTime = Date() + iterationCount = 0 + } + + fun detectLoop(): Boolean { + iterationCount++ + if (iterationCount > maxIterations) { + return true + } + val start = startTime ?: return true + if ((Date().time - start.time) / 1000 > timeout) { + return true + } + return false + } +} diff --git a/ORLib/src/main/java/io/openremote/orlib/service/espprovision/ORConfigChannel.kt b/ORLib/src/main/java/io/openremote/orlib/service/espprovision/ORConfigChannel.kt new file mode 100644 index 0000000..d83dacd --- /dev/null +++ b/ORLib/src/main/java/io/openremote/orlib/service/espprovision/ORConfigChannel.kt @@ -0,0 +1,123 @@ +package io.openremote.orlib.service.espprovision + +import com.espressif.provisioning.ESPDevice +import com.espressif.provisioning.listeners.ResponseListener +import io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request +import io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response +import kotlinx.coroutines.suspendCancellableCoroutine +import kotlin.coroutines.resumeWithException + +data class DeviceInfo( + val deviceId: String, + val modelName: String +) + +enum class BackendConnectionStatus { + DISCONNECTED, CONNECTING, CONNECTED, FAILED +} +sealed class ORConfigChannelError(message: String) : Exception(message) { + class InvalidRequest(message: String) : ORConfigChannelError(message) + object MessageOutOfOrder : ORConfigChannelError("Message out of order") + class InvalidResponse(message: String) : ORConfigChannelError(message) + object OperationFailure : ORConfigChannelError("Operation failed") + object GenericError : ORConfigChannelError("Generic error") +} + +class ORConfigChannel(private val device: ESPDevice) { + + private var messageId = 0 + + suspend fun getDeviceInfo(): DeviceInfo { + val request = Request.newBuilder() + .setDeviceInfo(Request.DeviceInfo.getDefaultInstance()) + .setId(messageId++.toString()) + .build() + + val response = sendRequest(request) + if (response.hasDeviceInfo()) { + val info = response.deviceInfo + return DeviceInfo(deviceId = info.deviceId, modelName = info.modelName) + } else { + throw ORConfigChannelError.InvalidResponse("Invalid response type") + } + } + + suspend fun sendOpenRemoteConfig( + mqttBrokerUrl: String, + mqttUser: String, + mqttPassword: String, + realm: String = "master", + assetId: String + ) { + val config = Request.OpenRemoteConfig.newBuilder() + .setMqttBrokerUrl(mqttBrokerUrl) + .setUser(mqttUser) + .setMqttPassword(mqttPassword) + .setAssetId(assetId) + .setRealm(realm) + .build() + + val request = Request.newBuilder() + .setOpenRemoteConfig(config) + .setId(messageId++.toString()) + .build() + + val response = sendRequest(request) + if (!response.hasOpenRemoteConfig() || response.openRemoteConfig.status != Response.OpenRemoteConfig.Status.SUCCESS) { + throw ORConfigChannelError.OperationFailure + } + } + + suspend fun getBackendConnectionStatus(): BackendConnectionStatus { + val request = Request.newBuilder() + .setBackendConnectionStatus(Request.BackendConnectionStatus.getDefaultInstance()) + .setId(messageId++.toString()) + .build() + + val response = sendRequest(request) + if (response.hasBackendConnectionStatus()) { + return when (response.backendConnectionStatus.status) { + Response.BackendConnectionStatus.Status.DISCONNECTED -> BackendConnectionStatus.DISCONNECTED + Response.BackendConnectionStatus.Status.CONNECTING -> BackendConnectionStatus.CONNECTING + Response.BackendConnectionStatus.Status.CONNECTED -> BackendConnectionStatus.CONNECTED + Response.BackendConnectionStatus.Status.FAILED -> BackendConnectionStatus.FAILED + else -> throw ORConfigChannelError.InvalidResponse("Unrecognized status") + } + } else { + throw ORConfigChannelError.InvalidResponse("Invalid response type") + } + } + + suspend fun exitProvisioning() { + val request = Request.newBuilder() + .setExitProvisioning(Request.ExitProvisioning.getDefaultInstance()) + .setId(messageId++.toString()) + .build() + sendRequest(request) + } + + private suspend fun sendRequest(request: Request): Response = suspendCancellableCoroutine { cont -> + val data = request.toByteArray() + device.sendDataToCustomEndPoint("or-cfg", data, object: ResponseListener { + override fun onSuccess(returnData: ByteArray?) { + val response = Response.parseFrom(returnData) + if (response.id != request.id) { + cont.resumeWithException(ORConfigChannelError.MessageOutOfOrder) + } else if (!response.hasResult() || response.result.result != Response.ResponseResult.Result.SUCCESS) { + cont.resumeWithException( + ORConfigChannelError.InvalidResponse("Response result was not success") + ) + } else { + // TODO: why the onCancellation ? + cont.resume(response, onCancellation = null) + } + } + + override fun onFailure(e: java.lang.Exception?) { + // TODO: pass some details ? + cont.resumeWithException(ORConfigChannelError.GenericError) + } + + }) + } +} \ No newline at end of file diff --git a/ORLib/src/main/java/io/openremote/orlib/service/espprovision/ORConfigChannelProtocol.java b/ORLib/src/main/java/io/openremote/orlib/service/espprovision/ORConfigChannelProtocol.java new file mode 100644 index 0000000..3effae7 --- /dev/null +++ b/ORLib/src/main/java/io/openremote/orlib/service/espprovision/ORConfigChannelProtocol.java @@ -0,0 +1,4770 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: src/main/proto/ORConfigChannelProtocol.proto +// Protobuf Java Version: 4.29.3 + +package io.openremote.orlib.service.espprovision; + +public final class ORConfigChannelProtocol { + private ORConfigChannelProtocol() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + public interface ResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:io.openremote.orlib.service.espprovision.Response) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * string id = 1; + * @return The id. + */ + java.lang.String getId(); + /** + * string id = 1; + * @return The bytes for id. + */ + com.google.protobuf.ByteString + getIdBytes(); + + /** + * .io.openremote.orlib.service.espprovision.Response.ResponseResult result = 2; + * @return Whether the result field is set. + */ + boolean hasResult(); + /** + * .io.openremote.orlib.service.espprovision.Response.ResponseResult result = 2; + * @return The result. + */ + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResult getResult(); + + /** + * .io.openremote.orlib.service.espprovision.Response.DeviceInfo device_info = 6; + * @return Whether the deviceInfo field is set. + */ + boolean hasDeviceInfo(); + /** + * .io.openremote.orlib.service.espprovision.Response.DeviceInfo device_info = 6; + * @return The deviceInfo. + */ + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.DeviceInfo getDeviceInfo(); + + /** + * .io.openremote.orlib.service.espprovision.Response.BackendConnectionStatus backend_connection_status = 7; + * @return Whether the backendConnectionStatus field is set. + */ + boolean hasBackendConnectionStatus(); + /** + * .io.openremote.orlib.service.espprovision.Response.BackendConnectionStatus backend_connection_status = 7; + * @return The backendConnectionStatus. + */ + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus getBackendConnectionStatus(); + + /** + * .io.openremote.orlib.service.espprovision.Response.OpenRemoteConfig open_remote_config = 8; + * @return Whether the openRemoteConfig field is set. + */ + boolean hasOpenRemoteConfig(); + /** + * .io.openremote.orlib.service.espprovision.Response.OpenRemoteConfig open_remote_config = 8; + * @return The openRemoteConfig. + */ + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig getOpenRemoteConfig(); + + /** + * .io.openremote.orlib.service.espprovision.Response.ExitProvisioning exit_provisioning = 9; + * @return Whether the exitProvisioning field is set. + */ + boolean hasExitProvisioning(); + /** + * .io.openremote.orlib.service.espprovision.Response.ExitProvisioning exit_provisioning = 9; + * @return The exitProvisioning. + */ + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ExitProvisioning getExitProvisioning(); + + public io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BodyCase getBodyCase(); + } + /** + * Protobuf type {@code io.openremote.orlib.service.espprovision.Response} + */ + public static final class Response extends + com.google.protobuf.GeneratedMessageLite< + Response, Response.Builder> implements + // @@protoc_insertion_point(message_implements:io.openremote.orlib.service.espprovision.Response) + ResponseOrBuilder { + private Response() { + id_ = ""; + } + public interface ResponseResultOrBuilder extends + // @@protoc_insertion_point(interface_extends:io.openremote.orlib.service.espprovision.Response.ResponseResult) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * .io.openremote.orlib.service.espprovision.Response.ResponseResult.Result result = 1; + * @return The enum numeric value on the wire for result. + */ + int getResultValue(); + /** + * .io.openremote.orlib.service.espprovision.Response.ResponseResult.Result result = 1; + * @return The result. + */ + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResult.Result getResult(); + } + /** + * Protobuf type {@code io.openremote.orlib.service.espprovision.Response.ResponseResult} + */ + public static final class ResponseResult extends + com.google.protobuf.GeneratedMessageLite< + ResponseResult, ResponseResult.Builder> implements + // @@protoc_insertion_point(message_implements:io.openremote.orlib.service.espprovision.Response.ResponseResult) + ResponseResultOrBuilder { + private ResponseResult() { + } + /** + * Protobuf enum {@code io.openremote.orlib.service.espprovision.Response.ResponseResult.Result} + */ + public enum Result + implements com.google.protobuf.Internal.EnumLite { + /** + * SUCCESS = 0; + */ + SUCCESS(0), + /** + * REQUEST_UNKNOWN = 1; + */ + REQUEST_UNKNOWN(1), + /** + * INTERNAL_ERROR = 2; + */ + INTERNAL_ERROR(2), + /** + * ARGUMENT_ERROR = 3; + */ + ARGUMENT_ERROR(3), + UNRECOGNIZED(-1), + ; + + /** + * SUCCESS = 0; + */ + public static final int SUCCESS_VALUE = 0; + /** + * REQUEST_UNKNOWN = 1; + */ + public static final int REQUEST_UNKNOWN_VALUE = 1; + /** + * INTERNAL_ERROR = 2; + */ + public static final int INTERNAL_ERROR_VALUE = 2; + /** + * ARGUMENT_ERROR = 3; + */ + public static final int ARGUMENT_ERROR_VALUE = 3; + + + @java.lang.Override + 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 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 Result valueOf(int value) { + return forNumber(value); + } + + public static Result forNumber(int value) { + switch (value) { + case 0: return SUCCESS; + case 1: return REQUEST_UNKNOWN; + case 2: return INTERNAL_ERROR; + case 3: return ARGUMENT_ERROR; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Result> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + @java.lang.Override + public Result findValueByNumber(int number) { + return Result.forNumber(number); + } + }; + + public static com.google.protobuf.Internal.EnumVerifier + internalGetVerifier() { + return ResultVerifier.INSTANCE; + } + + private static final class ResultVerifier implements + com.google.protobuf.Internal.EnumVerifier { + static final com.google.protobuf.Internal.EnumVerifier INSTANCE = new ResultVerifier(); + @java.lang.Override + public boolean isInRange(int number) { + return Result.forNumber(number) != null; + } + }; + + private final int value; + + private Result(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:io.openremote.orlib.service.espprovision.Response.ResponseResult.Result) + } + + public static final int RESULT_FIELD_NUMBER = 1; + private int result_; + /** + * .io.openremote.orlib.service.espprovision.Response.ResponseResult.Result result = 1; + * @return The enum numeric value on the wire for result. + */ + @java.lang.Override + public int getResultValue() { + return result_; + } + /** + * .io.openremote.orlib.service.espprovision.Response.ResponseResult.Result result = 1; + * @return The result. + */ + @java.lang.Override + public io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResult.Result getResult() { + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResult.Result result = io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResult.Result.forNumber(result_); + return result == null ? io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResult.Result.UNRECOGNIZED : result; + } + /** + * .io.openremote.orlib.service.espprovision.Response.ResponseResult.Result result = 1; + * @param value The enum numeric value on the wire for result to set. + */ + private void setResultValue(int value) { + result_ = value; + } + /** + * .io.openremote.orlib.service.espprovision.Response.ResponseResult.Result result = 1; + * @param value The result to set. + */ + private void setResult(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResult.Result value) { + result_ = value.getNumber(); + + } + /** + * .io.openremote.orlib.service.espprovision.Response.ResponseResult.Result result = 1; + */ + private void clearResult() { + + result_ = 0; + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResult parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResult parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResult parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResult parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResult parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResult parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResult parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResult parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResult parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResult parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResult parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResult parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResult prototype) { + return DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code io.openremote.orlib.service.espprovision.Response.ResponseResult} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResult, Builder> implements + // @@protoc_insertion_point(builder_implements:io.openremote.orlib.service.espprovision.Response.ResponseResult) + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResultOrBuilder { + // Construct using io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResult.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * .io.openremote.orlib.service.espprovision.Response.ResponseResult.Result result = 1; + * @return The enum numeric value on the wire for result. + */ + @java.lang.Override + public int getResultValue() { + return instance.getResultValue(); + } + /** + * .io.openremote.orlib.service.espprovision.Response.ResponseResult.Result result = 1; + * @param value The result to set. + * @return This builder for chaining. + */ + public Builder setResultValue(int value) { + copyOnWrite(); + instance.setResultValue(value); + return this; + } + /** + * .io.openremote.orlib.service.espprovision.Response.ResponseResult.Result result = 1; + * @return The result. + */ + @java.lang.Override + public io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResult.Result getResult() { + return instance.getResult(); + } + /** + * .io.openremote.orlib.service.espprovision.Response.ResponseResult.Result result = 1; + * @param value The enum numeric value on the wire for result to set. + * @return This builder for chaining. + */ + public Builder setResult(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResult.Result value) { + copyOnWrite(); + instance.setResult(value); + return this; + } + /** + * .io.openremote.orlib.service.espprovision.Response.ResponseResult.Result result = 1; + * @return This builder for chaining. + */ + public Builder clearResult() { + copyOnWrite(); + instance.clearResult(); + return this; + } + + // @@protoc_insertion_point(builder_scope:io.openremote.orlib.service.espprovision.Response.ResponseResult) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResult(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "result_", + }; + java.lang.String info = + "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\f"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResult.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:io.openremote.orlib.service.espprovision.Response.ResponseResult) + private static final io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResult DEFAULT_INSTANCE; + static { + ResponseResult defaultInstance = new ResponseResult(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + ResponseResult.class, defaultInstance); + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResult getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface OpenRemoteConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:io.openremote.orlib.service.espprovision.Response.OpenRemoteConfig) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * .io.openremote.orlib.service.espprovision.Response.OpenRemoteConfig.Status status = 1; + * @return The enum numeric value on the wire for status. + */ + int getStatusValue(); + /** + * .io.openremote.orlib.service.espprovision.Response.OpenRemoteConfig.Status status = 1; + * @return The status. + */ + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig.Status getStatus(); + } + /** + * Protobuf type {@code io.openremote.orlib.service.espprovision.Response.OpenRemoteConfig} + */ + public static final class OpenRemoteConfig extends + com.google.protobuf.GeneratedMessageLite< + OpenRemoteConfig, OpenRemoteConfig.Builder> implements + // @@protoc_insertion_point(message_implements:io.openremote.orlib.service.espprovision.Response.OpenRemoteConfig) + OpenRemoteConfigOrBuilder { + private OpenRemoteConfig() { + } + /** + * Protobuf enum {@code io.openremote.orlib.service.espprovision.Response.OpenRemoteConfig.Status} + */ + public enum Status + implements com.google.protobuf.Internal.EnumLite { + /** + * SUCCESS = 0; + */ + SUCCESS(0), + /** + * FAIL = 1; + */ + FAIL(1), + UNRECOGNIZED(-1), + ; + + /** + * SUCCESS = 0; + */ + public static final int SUCCESS_VALUE = 0; + /** + * FAIL = 1; + */ + public static final int FAIL_VALUE = 1; + + + @java.lang.Override + 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 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 Status valueOf(int value) { + return forNumber(value); + } + + public static Status forNumber(int value) { + switch (value) { + case 0: return SUCCESS; + case 1: return FAIL; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Status> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + @java.lang.Override + public Status findValueByNumber(int number) { + return Status.forNumber(number); + } + }; + + public static com.google.protobuf.Internal.EnumVerifier + internalGetVerifier() { + return StatusVerifier.INSTANCE; + } + + private static final class StatusVerifier implements + com.google.protobuf.Internal.EnumVerifier { + static final com.google.protobuf.Internal.EnumVerifier INSTANCE = new StatusVerifier(); + @java.lang.Override + public boolean isInRange(int number) { + return Status.forNumber(number) != null; + } + }; + + private final int value; + + private Status(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:io.openremote.orlib.service.espprovision.Response.OpenRemoteConfig.Status) + } + + public static final int STATUS_FIELD_NUMBER = 1; + private int status_; + /** + * .io.openremote.orlib.service.espprovision.Response.OpenRemoteConfig.Status status = 1; + * @return The enum numeric value on the wire for status. + */ + @java.lang.Override + public int getStatusValue() { + return status_; + } + /** + * .io.openremote.orlib.service.espprovision.Response.OpenRemoteConfig.Status status = 1; + * @return The status. + */ + @java.lang.Override + public io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig.Status getStatus() { + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig.Status result = io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig.Status.forNumber(status_); + return result == null ? io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig.Status.UNRECOGNIZED : result; + } + /** + * .io.openremote.orlib.service.espprovision.Response.OpenRemoteConfig.Status status = 1; + * @param value The enum numeric value on the wire for status to set. + */ + private void setStatusValue(int value) { + status_ = value; + } + /** + * .io.openremote.orlib.service.espprovision.Response.OpenRemoteConfig.Status status = 1; + * @param value The status to set. + */ + private void setStatus(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig.Status value) { + status_ = value.getNumber(); + + } + /** + * .io.openremote.orlib.service.espprovision.Response.OpenRemoteConfig.Status status = 1; + */ + private void clearStatus() { + + status_ = 0; + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig prototype) { + return DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code io.openremote.orlib.service.espprovision.Response.OpenRemoteConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig, Builder> implements + // @@protoc_insertion_point(builder_implements:io.openremote.orlib.service.espprovision.Response.OpenRemoteConfig) + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfigOrBuilder { + // Construct using io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * .io.openremote.orlib.service.espprovision.Response.OpenRemoteConfig.Status status = 1; + * @return The enum numeric value on the wire for status. + */ + @java.lang.Override + public int getStatusValue() { + return instance.getStatusValue(); + } + /** + * .io.openremote.orlib.service.espprovision.Response.OpenRemoteConfig.Status status = 1; + * @param value The status to set. + * @return This builder for chaining. + */ + public Builder setStatusValue(int value) { + copyOnWrite(); + instance.setStatusValue(value); + return this; + } + /** + * .io.openremote.orlib.service.espprovision.Response.OpenRemoteConfig.Status status = 1; + * @return The status. + */ + @java.lang.Override + public io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig.Status getStatus() { + return instance.getStatus(); + } + /** + * .io.openremote.orlib.service.espprovision.Response.OpenRemoteConfig.Status status = 1; + * @param value The enum numeric value on the wire for status to set. + * @return This builder for chaining. + */ + public Builder setStatus(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig.Status value) { + copyOnWrite(); + instance.setStatus(value); + return this; + } + /** + * .io.openremote.orlib.service.espprovision.Response.OpenRemoteConfig.Status status = 1; + * @return This builder for chaining. + */ + public Builder clearStatus() { + copyOnWrite(); + instance.clearStatus(); + return this; + } + + // @@protoc_insertion_point(builder_scope:io.openremote.orlib.service.espprovision.Response.OpenRemoteConfig) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "status_", + }; + java.lang.String info = + "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\f"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:io.openremote.orlib.service.espprovision.Response.OpenRemoteConfig) + private static final io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig DEFAULT_INSTANCE; + static { + OpenRemoteConfig defaultInstance = new OpenRemoteConfig(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + OpenRemoteConfig.class, defaultInstance); + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface BackendConnectionStatusOrBuilder extends + // @@protoc_insertion_point(interface_extends:io.openremote.orlib.service.espprovision.Response.BackendConnectionStatus) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * .io.openremote.orlib.service.espprovision.Response.BackendConnectionStatus.Status status = 1; + * @return The enum numeric value on the wire for status. + */ + int getStatusValue(); + /** + * .io.openremote.orlib.service.espprovision.Response.BackendConnectionStatus.Status status = 1; + * @return The status. + */ + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus.Status getStatus(); + } + /** + * Protobuf type {@code io.openremote.orlib.service.espprovision.Response.BackendConnectionStatus} + */ + public static final class BackendConnectionStatus extends + com.google.protobuf.GeneratedMessageLite< + BackendConnectionStatus, BackendConnectionStatus.Builder> implements + // @@protoc_insertion_point(message_implements:io.openremote.orlib.service.espprovision.Response.BackendConnectionStatus) + BackendConnectionStatusOrBuilder { + private BackendConnectionStatus() { + } + /** + * Protobuf enum {@code io.openremote.orlib.service.espprovision.Response.BackendConnectionStatus.Status} + */ + public enum Status + implements com.google.protobuf.Internal.EnumLite { + /** + * DISCONNECTED = 0; + */ + DISCONNECTED(0), + /** + * CONNECTING = 1; + */ + CONNECTING(1), + /** + * CONNECTED = 2; + */ + CONNECTED(2), + /** + * FAILED = 3; + */ + FAILED(3), + UNRECOGNIZED(-1), + ; + + /** + * DISCONNECTED = 0; + */ + public static final int DISCONNECTED_VALUE = 0; + /** + * CONNECTING = 1; + */ + public static final int CONNECTING_VALUE = 1; + /** + * CONNECTED = 2; + */ + public static final int CONNECTED_VALUE = 2; + /** + * FAILED = 3; + */ + public static final int FAILED_VALUE = 3; + + + @java.lang.Override + 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 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 Status valueOf(int value) { + return forNumber(value); + } + + public static Status forNumber(int value) { + switch (value) { + case 0: return DISCONNECTED; + case 1: return CONNECTING; + case 2: return CONNECTED; + case 3: return FAILED; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Status> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + @java.lang.Override + public Status findValueByNumber(int number) { + return Status.forNumber(number); + } + }; + + public static com.google.protobuf.Internal.EnumVerifier + internalGetVerifier() { + return StatusVerifier.INSTANCE; + } + + private static final class StatusVerifier implements + com.google.protobuf.Internal.EnumVerifier { + static final com.google.protobuf.Internal.EnumVerifier INSTANCE = new StatusVerifier(); + @java.lang.Override + public boolean isInRange(int number) { + return Status.forNumber(number) != null; + } + }; + + private final int value; + + private Status(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:io.openremote.orlib.service.espprovision.Response.BackendConnectionStatus.Status) + } + + public static final int STATUS_FIELD_NUMBER = 1; + private int status_; + /** + * .io.openremote.orlib.service.espprovision.Response.BackendConnectionStatus.Status status = 1; + * @return The enum numeric value on the wire for status. + */ + @java.lang.Override + public int getStatusValue() { + return status_; + } + /** + * .io.openremote.orlib.service.espprovision.Response.BackendConnectionStatus.Status status = 1; + * @return The status. + */ + @java.lang.Override + public io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus.Status getStatus() { + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus.Status result = io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus.Status.forNumber(status_); + return result == null ? io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus.Status.UNRECOGNIZED : result; + } + /** + * .io.openremote.orlib.service.espprovision.Response.BackendConnectionStatus.Status status = 1; + * @param value The enum numeric value on the wire for status to set. + */ + private void setStatusValue(int value) { + status_ = value; + } + /** + * .io.openremote.orlib.service.espprovision.Response.BackendConnectionStatus.Status status = 1; + * @param value The status to set. + */ + private void setStatus(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus.Status value) { + status_ = value.getNumber(); + + } + /** + * .io.openremote.orlib.service.espprovision.Response.BackendConnectionStatus.Status status = 1; + */ + private void clearStatus() { + + status_ = 0; + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus prototype) { + return DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code io.openremote.orlib.service.espprovision.Response.BackendConnectionStatus} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus, Builder> implements + // @@protoc_insertion_point(builder_implements:io.openremote.orlib.service.espprovision.Response.BackendConnectionStatus) + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatusOrBuilder { + // Construct using io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * .io.openremote.orlib.service.espprovision.Response.BackendConnectionStatus.Status status = 1; + * @return The enum numeric value on the wire for status. + */ + @java.lang.Override + public int getStatusValue() { + return instance.getStatusValue(); + } + /** + * .io.openremote.orlib.service.espprovision.Response.BackendConnectionStatus.Status status = 1; + * @param value The status to set. + * @return This builder for chaining. + */ + public Builder setStatusValue(int value) { + copyOnWrite(); + instance.setStatusValue(value); + return this; + } + /** + * .io.openremote.orlib.service.espprovision.Response.BackendConnectionStatus.Status status = 1; + * @return The status. + */ + @java.lang.Override + public io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus.Status getStatus() { + return instance.getStatus(); + } + /** + * .io.openremote.orlib.service.espprovision.Response.BackendConnectionStatus.Status status = 1; + * @param value The enum numeric value on the wire for status to set. + * @return This builder for chaining. + */ + public Builder setStatus(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus.Status value) { + copyOnWrite(); + instance.setStatus(value); + return this; + } + /** + * .io.openremote.orlib.service.espprovision.Response.BackendConnectionStatus.Status status = 1; + * @return This builder for chaining. + */ + public Builder clearStatus() { + copyOnWrite(); + instance.clearStatus(); + return this; + } + + // @@protoc_insertion_point(builder_scope:io.openremote.orlib.service.espprovision.Response.BackendConnectionStatus) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "status_", + }; + java.lang.String info = + "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\f"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:io.openremote.orlib.service.espprovision.Response.BackendConnectionStatus) + private static final io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus DEFAULT_INSTANCE; + static { + BackendConnectionStatus defaultInstance = new BackendConnectionStatus(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + BackendConnectionStatus.class, defaultInstance); + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface DeviceInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:io.openremote.orlib.service.espprovision.Response.DeviceInfo) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * string device_id = 1; + * @return The deviceId. + */ + java.lang.String getDeviceId(); + /** + * string device_id = 1; + * @return The bytes for deviceId. + */ + com.google.protobuf.ByteString + getDeviceIdBytes(); + + /** + * string model_name = 3; + * @return The modelName. + */ + java.lang.String getModelName(); + /** + * string model_name = 3; + * @return The bytes for modelName. + */ + com.google.protobuf.ByteString + getModelNameBytes(); + } + /** + * Protobuf type {@code io.openremote.orlib.service.espprovision.Response.DeviceInfo} + */ + public static final class DeviceInfo extends + com.google.protobuf.GeneratedMessageLite< + DeviceInfo, DeviceInfo.Builder> implements + // @@protoc_insertion_point(message_implements:io.openremote.orlib.service.espprovision.Response.DeviceInfo) + DeviceInfoOrBuilder { + private DeviceInfo() { + deviceId_ = ""; + modelName_ = ""; + } + public static final int DEVICE_ID_FIELD_NUMBER = 1; + private java.lang.String deviceId_; + /** + * string device_id = 1; + * @return The deviceId. + */ + @java.lang.Override + public java.lang.String getDeviceId() { + return deviceId_; + } + /** + * string device_id = 1; + * @return The bytes for deviceId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDeviceIdBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(deviceId_); + } + /** + * string device_id = 1; + * @param value The deviceId to set. + */ + @java.lang.SuppressWarnings("ReturnValueIgnored") + private void setDeviceId( + java.lang.String value) { + value.getClass(); // minimal bytecode null check + + deviceId_ = value; + } + /** + * string device_id = 1; + */ + private void clearDeviceId() { + + deviceId_ = getDefaultInstance().getDeviceId(); + } + /** + * string device_id = 1; + * @param value The bytes for deviceId to set. + */ + private void setDeviceIdBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + deviceId_ = value.toStringUtf8(); + + } + + public static final int MODEL_NAME_FIELD_NUMBER = 3; + private java.lang.String modelName_; + /** + * string model_name = 3; + * @return The modelName. + */ + @java.lang.Override + public java.lang.String getModelName() { + return modelName_; + } + /** + * string model_name = 3; + * @return The bytes for modelName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getModelNameBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(modelName_); + } + /** + * string model_name = 3; + * @param value The modelName to set. + */ + @java.lang.SuppressWarnings("ReturnValueIgnored") + private void setModelName( + java.lang.String value) { + value.getClass(); // minimal bytecode null check + + modelName_ = value; + } + /** + * string model_name = 3; + */ + private void clearModelName() { + + modelName_ = getDefaultInstance().getModelName(); + } + /** + * string model_name = 3; + * @param value The bytes for modelName to set. + */ + private void setModelNameBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + modelName_ = value.toStringUtf8(); + + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.DeviceInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.DeviceInfo parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.DeviceInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.DeviceInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.DeviceInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.DeviceInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.DeviceInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.DeviceInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.DeviceInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.DeviceInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.DeviceInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.DeviceInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.DeviceInfo prototype) { + return DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code io.openremote.orlib.service.espprovision.Response.DeviceInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.DeviceInfo, Builder> implements + // @@protoc_insertion_point(builder_implements:io.openremote.orlib.service.espprovision.Response.DeviceInfo) + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.DeviceInfoOrBuilder { + // Construct using io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.DeviceInfo.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * string device_id = 1; + * @return The deviceId. + */ + @java.lang.Override + public java.lang.String getDeviceId() { + return instance.getDeviceId(); + } + /** + * string device_id = 1; + * @return The bytes for deviceId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDeviceIdBytes() { + return instance.getDeviceIdBytes(); + } + /** + * string device_id = 1; + * @param value The deviceId to set. + * @return This builder for chaining. + */ + public Builder setDeviceId( + java.lang.String value) { + copyOnWrite(); + instance.setDeviceId(value); + return this; + } + /** + * string device_id = 1; + * @return This builder for chaining. + */ + public Builder clearDeviceId() { + copyOnWrite(); + instance.clearDeviceId(); + return this; + } + /** + * string device_id = 1; + * @param value The bytes for deviceId to set. + * @return This builder for chaining. + */ + public Builder setDeviceIdBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setDeviceIdBytes(value); + return this; + } + + /** + * string model_name = 3; + * @return The modelName. + */ + @java.lang.Override + public java.lang.String getModelName() { + return instance.getModelName(); + } + /** + * string model_name = 3; + * @return The bytes for modelName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getModelNameBytes() { + return instance.getModelNameBytes(); + } + /** + * string model_name = 3; + * @param value The modelName to set. + * @return This builder for chaining. + */ + public Builder setModelName( + java.lang.String value) { + copyOnWrite(); + instance.setModelName(value); + return this; + } + /** + * string model_name = 3; + * @return This builder for chaining. + */ + public Builder clearModelName() { + copyOnWrite(); + instance.clearModelName(); + return this; + } + /** + * string model_name = 3; + * @param value The bytes for modelName to set. + * @return This builder for chaining. + */ + public Builder setModelNameBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setModelNameBytes(value); + return this; + } + + // @@protoc_insertion_point(builder_scope:io.openremote.orlib.service.espprovision.Response.DeviceInfo) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.DeviceInfo(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "deviceId_", + "modelName_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0003\u0002\u0000\u0000\u0000\u0001\u0208\u0003\u0208" + + ""; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.DeviceInfo.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:io.openremote.orlib.service.espprovision.Response.DeviceInfo) + private static final io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.DeviceInfo DEFAULT_INSTANCE; + static { + DeviceInfo defaultInstance = new DeviceInfo(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + DeviceInfo.class, defaultInstance); + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.DeviceInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface ExitProvisioningOrBuilder extends + // @@protoc_insertion_point(interface_extends:io.openremote.orlib.service.espprovision.Response.ExitProvisioning) + com.google.protobuf.MessageLiteOrBuilder { + } + /** + * Protobuf type {@code io.openremote.orlib.service.espprovision.Response.ExitProvisioning} + */ + public static final class ExitProvisioning extends + com.google.protobuf.GeneratedMessageLite< + ExitProvisioning, ExitProvisioning.Builder> implements + // @@protoc_insertion_point(message_implements:io.openremote.orlib.service.espprovision.Response.ExitProvisioning) + ExitProvisioningOrBuilder { + private ExitProvisioning() { + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ExitProvisioning parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ExitProvisioning parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ExitProvisioning parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ExitProvisioning parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ExitProvisioning parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ExitProvisioning parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ExitProvisioning parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ExitProvisioning parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ExitProvisioning parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ExitProvisioning parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ExitProvisioning parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ExitProvisioning parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ExitProvisioning prototype) { + return DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code io.openremote.orlib.service.espprovision.Response.ExitProvisioning} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ExitProvisioning, Builder> implements + // @@protoc_insertion_point(builder_implements:io.openremote.orlib.service.espprovision.Response.ExitProvisioning) + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ExitProvisioningOrBuilder { + // Construct using io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ExitProvisioning.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + // @@protoc_insertion_point(builder_scope:io.openremote.orlib.service.espprovision.Response.ExitProvisioning) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ExitProvisioning(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = null;java.lang.String info = + "\u0000\u0000"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ExitProvisioning.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:io.openremote.orlib.service.espprovision.Response.ExitProvisioning) + private static final io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ExitProvisioning DEFAULT_INSTANCE; + static { + ExitProvisioning defaultInstance = new ExitProvisioning(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + ExitProvisioning.class, defaultInstance); + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ExitProvisioning getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + private int bitField0_; + private int bodyCase_ = 0; + private java.lang.Object body_; + public enum BodyCase { + DEVICE_INFO(6), + BACKEND_CONNECTION_STATUS(7), + OPEN_REMOTE_CONFIG(8), + EXIT_PROVISIONING(9), + BODY_NOT_SET(0); + private final int value; + private BodyCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static BodyCase valueOf(int value) { + return forNumber(value); + } + + public static BodyCase forNumber(int value) { + switch (value) { + case 6: return DEVICE_INFO; + case 7: return BACKEND_CONNECTION_STATUS; + case 8: return OPEN_REMOTE_CONFIG; + case 9: return EXIT_PROVISIONING; + case 0: return BODY_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + @java.lang.Override + public BodyCase + getBodyCase() { + return BodyCase.forNumber( + bodyCase_); + } + + private void clearBody() { + bodyCase_ = 0; + body_ = null; + } + + public static final int ID_FIELD_NUMBER = 1; + private java.lang.String id_; + /** + * string id = 1; + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + return id_; + } + /** + * string id = 1; + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getIdBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(id_); + } + /** + * string id = 1; + * @param value The id to set. + */ + @java.lang.SuppressWarnings("ReturnValueIgnored") + private void setId( + java.lang.String value) { + value.getClass(); // minimal bytecode null check + + id_ = value; + } + /** + * string id = 1; + */ + private void clearId() { + + id_ = getDefaultInstance().getId(); + } + /** + * string id = 1; + * @param value The bytes for id to set. + */ + private void setIdBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + id_ = value.toStringUtf8(); + + } + + public static final int RESULT_FIELD_NUMBER = 2; + private io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResult result_; + /** + * .io.openremote.orlib.service.espprovision.Response.ResponseResult result = 2; + */ + @java.lang.Override + public boolean hasResult() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .io.openremote.orlib.service.espprovision.Response.ResponseResult result = 2; + */ + @java.lang.Override + public io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResult getResult() { + return result_ == null ? io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResult.getDefaultInstance() : result_; + } + /** + * .io.openremote.orlib.service.espprovision.Response.ResponseResult result = 2; + */ + @java.lang.SuppressWarnings("ReturnValueIgnored") + private void setResult(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResult value) { + value.getClass(); // minimal bytecode null check + result_ = value; + bitField0_ |= 0x00000001; + } + /** + * .io.openremote.orlib.service.espprovision.Response.ResponseResult result = 2; + */ + @java.lang.SuppressWarnings({"ReferenceEquality", "ReturnValueIgnored"}) + private void mergeResult(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResult value) { + value.getClass(); // minimal bytecode null check + if (result_ != null && + result_ != io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResult.getDefaultInstance()) { + result_ = + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResult.newBuilder(result_).mergeFrom(value).buildPartial(); + } else { + result_ = value; + } + bitField0_ |= 0x00000001; + } + /** + * .io.openremote.orlib.service.espprovision.Response.ResponseResult result = 2; + */ + private void clearResult() { result_ = null; + bitField0_ = (bitField0_ & ~0x00000001); + } + + public static final int DEVICE_INFO_FIELD_NUMBER = 6; + /** + * .io.openremote.orlib.service.espprovision.Response.DeviceInfo device_info = 6; + */ + @java.lang.Override + public boolean hasDeviceInfo() { + return bodyCase_ == 6; + } + /** + * .io.openremote.orlib.service.espprovision.Response.DeviceInfo device_info = 6; + */ + @java.lang.Override + public io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.DeviceInfo getDeviceInfo() { + if (bodyCase_ == 6) { + return (io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.DeviceInfo) body_; + } + return io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.DeviceInfo.getDefaultInstance(); + } + /** + * .io.openremote.orlib.service.espprovision.Response.DeviceInfo device_info = 6; + */ + @java.lang.SuppressWarnings("ReturnValueIgnored") + private void setDeviceInfo(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.DeviceInfo value) { + value.getClass(); // minimal bytecode null check + body_ = value; + bodyCase_ = 6; + } + /** + * .io.openremote.orlib.service.espprovision.Response.DeviceInfo device_info = 6; + */ + @java.lang.SuppressWarnings("ReturnValueIgnored") + private void mergeDeviceInfo(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.DeviceInfo value) { + value.getClass(); // minimal bytecode null check + if (bodyCase_ == 6 && + body_ != io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.DeviceInfo.getDefaultInstance()) { + body_ = io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.DeviceInfo.newBuilder((io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.DeviceInfo) body_) + .mergeFrom(value).buildPartial(); + } else { + body_ = value; + } + bodyCase_ = 6; + } + /** + * .io.openremote.orlib.service.espprovision.Response.DeviceInfo device_info = 6; + */ + private void clearDeviceInfo() { + if (bodyCase_ == 6) { + bodyCase_ = 0; + body_ = null; + } + } + + public static final int BACKEND_CONNECTION_STATUS_FIELD_NUMBER = 7; + /** + * .io.openremote.orlib.service.espprovision.Response.BackendConnectionStatus backend_connection_status = 7; + */ + @java.lang.Override + public boolean hasBackendConnectionStatus() { + return bodyCase_ == 7; + } + /** + * .io.openremote.orlib.service.espprovision.Response.BackendConnectionStatus backend_connection_status = 7; + */ + @java.lang.Override + public io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus getBackendConnectionStatus() { + if (bodyCase_ == 7) { + return (io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus) body_; + } + return io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus.getDefaultInstance(); + } + /** + * .io.openremote.orlib.service.espprovision.Response.BackendConnectionStatus backend_connection_status = 7; + */ + @java.lang.SuppressWarnings("ReturnValueIgnored") + private void setBackendConnectionStatus(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus value) { + value.getClass(); // minimal bytecode null check + body_ = value; + bodyCase_ = 7; + } + /** + * .io.openremote.orlib.service.espprovision.Response.BackendConnectionStatus backend_connection_status = 7; + */ + @java.lang.SuppressWarnings("ReturnValueIgnored") + private void mergeBackendConnectionStatus(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus value) { + value.getClass(); // minimal bytecode null check + if (bodyCase_ == 7 && + body_ != io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus.getDefaultInstance()) { + body_ = io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus.newBuilder((io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus) body_) + .mergeFrom(value).buildPartial(); + } else { + body_ = value; + } + bodyCase_ = 7; + } + /** + * .io.openremote.orlib.service.espprovision.Response.BackendConnectionStatus backend_connection_status = 7; + */ + private void clearBackendConnectionStatus() { + if (bodyCase_ == 7) { + bodyCase_ = 0; + body_ = null; + } + } + + public static final int OPEN_REMOTE_CONFIG_FIELD_NUMBER = 8; + /** + * .io.openremote.orlib.service.espprovision.Response.OpenRemoteConfig open_remote_config = 8; + */ + @java.lang.Override + public boolean hasOpenRemoteConfig() { + return bodyCase_ == 8; + } + /** + * .io.openremote.orlib.service.espprovision.Response.OpenRemoteConfig open_remote_config = 8; + */ + @java.lang.Override + public io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig getOpenRemoteConfig() { + if (bodyCase_ == 8) { + return (io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig) body_; + } + return io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig.getDefaultInstance(); + } + /** + * .io.openremote.orlib.service.espprovision.Response.OpenRemoteConfig open_remote_config = 8; + */ + @java.lang.SuppressWarnings("ReturnValueIgnored") + private void setOpenRemoteConfig(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig value) { + value.getClass(); // minimal bytecode null check + body_ = value; + bodyCase_ = 8; + } + /** + * .io.openremote.orlib.service.espprovision.Response.OpenRemoteConfig open_remote_config = 8; + */ + @java.lang.SuppressWarnings("ReturnValueIgnored") + private void mergeOpenRemoteConfig(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig value) { + value.getClass(); // minimal bytecode null check + if (bodyCase_ == 8 && + body_ != io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig.getDefaultInstance()) { + body_ = io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig.newBuilder((io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig) body_) + .mergeFrom(value).buildPartial(); + } else { + body_ = value; + } + bodyCase_ = 8; + } + /** + * .io.openremote.orlib.service.espprovision.Response.OpenRemoteConfig open_remote_config = 8; + */ + private void clearOpenRemoteConfig() { + if (bodyCase_ == 8) { + bodyCase_ = 0; + body_ = null; + } + } + + public static final int EXIT_PROVISIONING_FIELD_NUMBER = 9; + /** + * .io.openremote.orlib.service.espprovision.Response.ExitProvisioning exit_provisioning = 9; + */ + @java.lang.Override + public boolean hasExitProvisioning() { + return bodyCase_ == 9; + } + /** + * .io.openremote.orlib.service.espprovision.Response.ExitProvisioning exit_provisioning = 9; + */ + @java.lang.Override + public io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ExitProvisioning getExitProvisioning() { + if (bodyCase_ == 9) { + return (io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ExitProvisioning) body_; + } + return io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ExitProvisioning.getDefaultInstance(); + } + /** + * .io.openremote.orlib.service.espprovision.Response.ExitProvisioning exit_provisioning = 9; + */ + @java.lang.SuppressWarnings("ReturnValueIgnored") + private void setExitProvisioning(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ExitProvisioning value) { + value.getClass(); // minimal bytecode null check + body_ = value; + bodyCase_ = 9; + } + /** + * .io.openremote.orlib.service.espprovision.Response.ExitProvisioning exit_provisioning = 9; + */ + @java.lang.SuppressWarnings("ReturnValueIgnored") + private void mergeExitProvisioning(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ExitProvisioning value) { + value.getClass(); // minimal bytecode null check + if (bodyCase_ == 9 && + body_ != io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ExitProvisioning.getDefaultInstance()) { + body_ = io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ExitProvisioning.newBuilder((io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ExitProvisioning) body_) + .mergeFrom(value).buildPartial(); + } else { + body_ = value; + } + bodyCase_ = 9; + } + /** + * .io.openremote.orlib.service.espprovision.Response.ExitProvisioning exit_provisioning = 9; + */ + private void clearExitProvisioning() { + if (bodyCase_ == 9) { + bodyCase_ = 0; + body_ = null; + } + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response prototype) { + return DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code io.openremote.orlib.service.espprovision.Response} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response, Builder> implements + // @@protoc_insertion_point(builder_implements:io.openremote.orlib.service.espprovision.Response) + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.ResponseOrBuilder { + // Construct using io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + @java.lang.Override + public BodyCase + getBodyCase() { + return instance.getBodyCase(); + } + + public Builder clearBody() { + copyOnWrite(); + instance.clearBody(); + return this; + } + + + /** + * string id = 1; + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + return instance.getId(); + } + /** + * string id = 1; + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getIdBytes() { + return instance.getIdBytes(); + } + /** + * string id = 1; + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId( + java.lang.String value) { + copyOnWrite(); + instance.setId(value); + return this; + } + /** + * string id = 1; + * @return This builder for chaining. + */ + public Builder clearId() { + copyOnWrite(); + instance.clearId(); + return this; + } + /** + * string id = 1; + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setIdBytes(value); + return this; + } + + /** + * .io.openremote.orlib.service.espprovision.Response.ResponseResult result = 2; + */ + @java.lang.Override + public boolean hasResult() { + return instance.hasResult(); + } + /** + * .io.openremote.orlib.service.espprovision.Response.ResponseResult result = 2; + */ + @java.lang.Override + public io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResult getResult() { + return instance.getResult(); + } + /** + * .io.openremote.orlib.service.espprovision.Response.ResponseResult result = 2; + */ + public Builder setResult(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResult value) { + copyOnWrite(); + instance.setResult(value); + return this; + } + /** + * .io.openremote.orlib.service.espprovision.Response.ResponseResult result = 2; + */ + public Builder setResult( + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResult.Builder builderForValue) { + copyOnWrite(); + instance.setResult(builderForValue.build()); + return this; + } + /** + * .io.openremote.orlib.service.espprovision.Response.ResponseResult result = 2; + */ + public Builder mergeResult(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ResponseResult value) { + copyOnWrite(); + instance.mergeResult(value); + return this; + } + /** + * .io.openremote.orlib.service.espprovision.Response.ResponseResult result = 2; + */ + public Builder clearResult() { copyOnWrite(); + instance.clearResult(); + return this; + } + + /** + * .io.openremote.orlib.service.espprovision.Response.DeviceInfo device_info = 6; + */ + @java.lang.Override + public boolean hasDeviceInfo() { + return instance.hasDeviceInfo(); + } + /** + * .io.openremote.orlib.service.espprovision.Response.DeviceInfo device_info = 6; + */ + @java.lang.Override + public io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.DeviceInfo getDeviceInfo() { + return instance.getDeviceInfo(); + } + /** + * .io.openremote.orlib.service.espprovision.Response.DeviceInfo device_info = 6; + */ + public Builder setDeviceInfo(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.DeviceInfo value) { + copyOnWrite(); + instance.setDeviceInfo(value); + return this; + } + /** + * .io.openremote.orlib.service.espprovision.Response.DeviceInfo device_info = 6; + */ + public Builder setDeviceInfo( + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.DeviceInfo.Builder builderForValue) { + copyOnWrite(); + instance.setDeviceInfo(builderForValue.build()); + return this; + } + /** + * .io.openremote.orlib.service.espprovision.Response.DeviceInfo device_info = 6; + */ + public Builder mergeDeviceInfo(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.DeviceInfo value) { + copyOnWrite(); + instance.mergeDeviceInfo(value); + return this; + } + /** + * .io.openremote.orlib.service.espprovision.Response.DeviceInfo device_info = 6; + */ + public Builder clearDeviceInfo() { + copyOnWrite(); + instance.clearDeviceInfo(); + return this; + } + + /** + * .io.openremote.orlib.service.espprovision.Response.BackendConnectionStatus backend_connection_status = 7; + */ + @java.lang.Override + public boolean hasBackendConnectionStatus() { + return instance.hasBackendConnectionStatus(); + } + /** + * .io.openremote.orlib.service.espprovision.Response.BackendConnectionStatus backend_connection_status = 7; + */ + @java.lang.Override + public io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus getBackendConnectionStatus() { + return instance.getBackendConnectionStatus(); + } + /** + * .io.openremote.orlib.service.espprovision.Response.BackendConnectionStatus backend_connection_status = 7; + */ + public Builder setBackendConnectionStatus(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus value) { + copyOnWrite(); + instance.setBackendConnectionStatus(value); + return this; + } + /** + * .io.openremote.orlib.service.espprovision.Response.BackendConnectionStatus backend_connection_status = 7; + */ + public Builder setBackendConnectionStatus( + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus.Builder builderForValue) { + copyOnWrite(); + instance.setBackendConnectionStatus(builderForValue.build()); + return this; + } + /** + * .io.openremote.orlib.service.espprovision.Response.BackendConnectionStatus backend_connection_status = 7; + */ + public Builder mergeBackendConnectionStatus(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus value) { + copyOnWrite(); + instance.mergeBackendConnectionStatus(value); + return this; + } + /** + * .io.openremote.orlib.service.espprovision.Response.BackendConnectionStatus backend_connection_status = 7; + */ + public Builder clearBackendConnectionStatus() { + copyOnWrite(); + instance.clearBackendConnectionStatus(); + return this; + } + + /** + * .io.openremote.orlib.service.espprovision.Response.OpenRemoteConfig open_remote_config = 8; + */ + @java.lang.Override + public boolean hasOpenRemoteConfig() { + return instance.hasOpenRemoteConfig(); + } + /** + * .io.openremote.orlib.service.espprovision.Response.OpenRemoteConfig open_remote_config = 8; + */ + @java.lang.Override + public io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig getOpenRemoteConfig() { + return instance.getOpenRemoteConfig(); + } + /** + * .io.openremote.orlib.service.espprovision.Response.OpenRemoteConfig open_remote_config = 8; + */ + public Builder setOpenRemoteConfig(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig value) { + copyOnWrite(); + instance.setOpenRemoteConfig(value); + return this; + } + /** + * .io.openremote.orlib.service.espprovision.Response.OpenRemoteConfig open_remote_config = 8; + */ + public Builder setOpenRemoteConfig( + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig.Builder builderForValue) { + copyOnWrite(); + instance.setOpenRemoteConfig(builderForValue.build()); + return this; + } + /** + * .io.openremote.orlib.service.espprovision.Response.OpenRemoteConfig open_remote_config = 8; + */ + public Builder mergeOpenRemoteConfig(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig value) { + copyOnWrite(); + instance.mergeOpenRemoteConfig(value); + return this; + } + /** + * .io.openremote.orlib.service.espprovision.Response.OpenRemoteConfig open_remote_config = 8; + */ + public Builder clearOpenRemoteConfig() { + copyOnWrite(); + instance.clearOpenRemoteConfig(); + return this; + } + + /** + * .io.openremote.orlib.service.espprovision.Response.ExitProvisioning exit_provisioning = 9; + */ + @java.lang.Override + public boolean hasExitProvisioning() { + return instance.hasExitProvisioning(); + } + /** + * .io.openremote.orlib.service.espprovision.Response.ExitProvisioning exit_provisioning = 9; + */ + @java.lang.Override + public io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ExitProvisioning getExitProvisioning() { + return instance.getExitProvisioning(); + } + /** + * .io.openremote.orlib.service.espprovision.Response.ExitProvisioning exit_provisioning = 9; + */ + public Builder setExitProvisioning(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ExitProvisioning value) { + copyOnWrite(); + instance.setExitProvisioning(value); + return this; + } + /** + * .io.openremote.orlib.service.espprovision.Response.ExitProvisioning exit_provisioning = 9; + */ + public Builder setExitProvisioning( + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ExitProvisioning.Builder builderForValue) { + copyOnWrite(); + instance.setExitProvisioning(builderForValue.build()); + return this; + } + /** + * .io.openremote.orlib.service.espprovision.Response.ExitProvisioning exit_provisioning = 9; + */ + public Builder mergeExitProvisioning(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ExitProvisioning value) { + copyOnWrite(); + instance.mergeExitProvisioning(value); + return this; + } + /** + * .io.openremote.orlib.service.espprovision.Response.ExitProvisioning exit_provisioning = 9; + */ + public Builder clearExitProvisioning() { + copyOnWrite(); + instance.clearExitProvisioning(); + return this; + } + + // @@protoc_insertion_point(builder_scope:io.openremote.orlib.service.espprovision.Response) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "body_", + "bodyCase_", + "bitField0_", + "id_", + "result_", + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.DeviceInfo.class, + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.BackendConnectionStatus.class, + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.OpenRemoteConfig.class, + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.ExitProvisioning.class, + }; + java.lang.String info = + "\u0000\u0006\u0001\u0001\u0001\t\u0006\u0000\u0000\u0000\u0001\u0208\u0002\u1009" + + "\u0000\u0006<\u0000\u0007<\u0000\b<\u0000\t<\u0000"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:io.openremote.orlib.service.espprovision.Response) + private static final io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response DEFAULT_INSTANCE; + static { + Response defaultInstance = new Response(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Response.class, defaultInstance); + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Response getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface RequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:io.openremote.orlib.service.espprovision.Request) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * string id = 1; + * @return The id. + */ + java.lang.String getId(); + /** + * string id = 1; + * @return The bytes for id. + */ + com.google.protobuf.ByteString + getIdBytes(); + + /** + * .io.openremote.orlib.service.espprovision.Request.DeviceInfo device_info = 6; + * @return Whether the deviceInfo field is set. + */ + boolean hasDeviceInfo(); + /** + * .io.openremote.orlib.service.espprovision.Request.DeviceInfo device_info = 6; + * @return The deviceInfo. + */ + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.DeviceInfo getDeviceInfo(); + + /** + * .io.openremote.orlib.service.espprovision.Request.BackendConnectionStatus backend_connection_status = 7; + * @return Whether the backendConnectionStatus field is set. + */ + boolean hasBackendConnectionStatus(); + /** + * .io.openremote.orlib.service.espprovision.Request.BackendConnectionStatus backend_connection_status = 7; + * @return The backendConnectionStatus. + */ + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.BackendConnectionStatus getBackendConnectionStatus(); + + /** + * .io.openremote.orlib.service.espprovision.Request.OpenRemoteConfig open_remote_config = 8; + * @return Whether the openRemoteConfig field is set. + */ + boolean hasOpenRemoteConfig(); + /** + * .io.openremote.orlib.service.espprovision.Request.OpenRemoteConfig open_remote_config = 8; + * @return The openRemoteConfig. + */ + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.OpenRemoteConfig getOpenRemoteConfig(); + + /** + * .io.openremote.orlib.service.espprovision.Request.ExitProvisioning exit_provisioning = 9; + * @return Whether the exitProvisioning field is set. + */ + boolean hasExitProvisioning(); + /** + * .io.openremote.orlib.service.espprovision.Request.ExitProvisioning exit_provisioning = 9; + * @return The exitProvisioning. + */ + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.ExitProvisioning getExitProvisioning(); + + public io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.BodyCase getBodyCase(); + } + /** + * Protobuf type {@code io.openremote.orlib.service.espprovision.Request} + */ + public static final class Request extends + com.google.protobuf.GeneratedMessageLite< + Request, Request.Builder> implements + // @@protoc_insertion_point(message_implements:io.openremote.orlib.service.espprovision.Request) + RequestOrBuilder { + private Request() { + id_ = ""; + } + public interface DeviceInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:io.openremote.orlib.service.espprovision.Request.DeviceInfo) + com.google.protobuf.MessageLiteOrBuilder { + } + /** + * Protobuf type {@code io.openremote.orlib.service.espprovision.Request.DeviceInfo} + */ + public static final class DeviceInfo extends + com.google.protobuf.GeneratedMessageLite< + DeviceInfo, DeviceInfo.Builder> implements + // @@protoc_insertion_point(message_implements:io.openremote.orlib.service.espprovision.Request.DeviceInfo) + DeviceInfoOrBuilder { + private DeviceInfo() { + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.DeviceInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.DeviceInfo parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.DeviceInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.DeviceInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.DeviceInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.DeviceInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.DeviceInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.DeviceInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.DeviceInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.DeviceInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.DeviceInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.DeviceInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.DeviceInfo prototype) { + return DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code io.openremote.orlib.service.espprovision.Request.DeviceInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.DeviceInfo, Builder> implements + // @@protoc_insertion_point(builder_implements:io.openremote.orlib.service.espprovision.Request.DeviceInfo) + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.DeviceInfoOrBuilder { + // Construct using io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.DeviceInfo.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + // @@protoc_insertion_point(builder_scope:io.openremote.orlib.service.espprovision.Request.DeviceInfo) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.DeviceInfo(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = null;java.lang.String info = + "\u0000\u0000"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.DeviceInfo.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:io.openremote.orlib.service.espprovision.Request.DeviceInfo) + private static final io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.DeviceInfo DEFAULT_INSTANCE; + static { + DeviceInfo defaultInstance = new DeviceInfo(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + DeviceInfo.class, defaultInstance); + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.DeviceInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface BackendConnectionStatusOrBuilder extends + // @@protoc_insertion_point(interface_extends:io.openremote.orlib.service.espprovision.Request.BackendConnectionStatus) + com.google.protobuf.MessageLiteOrBuilder { + } + /** + * Protobuf type {@code io.openremote.orlib.service.espprovision.Request.BackendConnectionStatus} + */ + public static final class BackendConnectionStatus extends + com.google.protobuf.GeneratedMessageLite< + BackendConnectionStatus, BackendConnectionStatus.Builder> implements + // @@protoc_insertion_point(message_implements:io.openremote.orlib.service.espprovision.Request.BackendConnectionStatus) + BackendConnectionStatusOrBuilder { + private BackendConnectionStatus() { + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.BackendConnectionStatus parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.BackendConnectionStatus parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.BackendConnectionStatus parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.BackendConnectionStatus parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.BackendConnectionStatus parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.BackendConnectionStatus parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.BackendConnectionStatus parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.BackendConnectionStatus parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.BackendConnectionStatus parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.BackendConnectionStatus parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.BackendConnectionStatus parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.BackendConnectionStatus parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.BackendConnectionStatus prototype) { + return DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code io.openremote.orlib.service.espprovision.Request.BackendConnectionStatus} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.BackendConnectionStatus, Builder> implements + // @@protoc_insertion_point(builder_implements:io.openremote.orlib.service.espprovision.Request.BackendConnectionStatus) + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.BackendConnectionStatusOrBuilder { + // Construct using io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.BackendConnectionStatus.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + // @@protoc_insertion_point(builder_scope:io.openremote.orlib.service.espprovision.Request.BackendConnectionStatus) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.BackendConnectionStatus(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = null;java.lang.String info = + "\u0000\u0000"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.BackendConnectionStatus.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:io.openremote.orlib.service.espprovision.Request.BackendConnectionStatus) + private static final io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.BackendConnectionStatus DEFAULT_INSTANCE; + static { + BackendConnectionStatus defaultInstance = new BackendConnectionStatus(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + BackendConnectionStatus.class, defaultInstance); + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.BackendConnectionStatus getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface OpenRemoteConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:io.openremote.orlib.service.espprovision.Request.OpenRemoteConfig) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * string mqtt_broker_url = 1; + * @return The mqttBrokerUrl. + */ + java.lang.String getMqttBrokerUrl(); + /** + * string mqtt_broker_url = 1; + * @return The bytes for mqttBrokerUrl. + */ + com.google.protobuf.ByteString + getMqttBrokerUrlBytes(); + + /** + * string user = 2; + * @return The user. + */ + java.lang.String getUser(); + /** + * string user = 2; + * @return The bytes for user. + */ + com.google.protobuf.ByteString + getUserBytes(); + + /** + * string mqtt_password = 3; + * @return The mqttPassword. + */ + java.lang.String getMqttPassword(); + /** + * string mqtt_password = 3; + * @return The bytes for mqttPassword. + */ + com.google.protobuf.ByteString + getMqttPasswordBytes(); + + /** + * string realm = 4; + * @return The realm. + */ + java.lang.String getRealm(); + /** + * string realm = 4; + * @return The bytes for realm. + */ + com.google.protobuf.ByteString + getRealmBytes(); + + /** + * string asset_id = 5; + * @return The assetId. + */ + java.lang.String getAssetId(); + /** + * string asset_id = 5; + * @return The bytes for assetId. + */ + com.google.protobuf.ByteString + getAssetIdBytes(); + } + /** + * Protobuf type {@code io.openremote.orlib.service.espprovision.Request.OpenRemoteConfig} + */ + public static final class OpenRemoteConfig extends + com.google.protobuf.GeneratedMessageLite< + OpenRemoteConfig, OpenRemoteConfig.Builder> implements + // @@protoc_insertion_point(message_implements:io.openremote.orlib.service.espprovision.Request.OpenRemoteConfig) + OpenRemoteConfigOrBuilder { + private OpenRemoteConfig() { + mqttBrokerUrl_ = ""; + user_ = ""; + mqttPassword_ = ""; + realm_ = ""; + assetId_ = ""; + } + public static final int MQTT_BROKER_URL_FIELD_NUMBER = 1; + private java.lang.String mqttBrokerUrl_; + /** + * string mqtt_broker_url = 1; + * @return The mqttBrokerUrl. + */ + @java.lang.Override + public java.lang.String getMqttBrokerUrl() { + return mqttBrokerUrl_; + } + /** + * string mqtt_broker_url = 1; + * @return The bytes for mqttBrokerUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMqttBrokerUrlBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(mqttBrokerUrl_); + } + /** + * string mqtt_broker_url = 1; + * @param value The mqttBrokerUrl to set. + */ + @java.lang.SuppressWarnings("ReturnValueIgnored") + private void setMqttBrokerUrl( + java.lang.String value) { + value.getClass(); // minimal bytecode null check + + mqttBrokerUrl_ = value; + } + /** + * string mqtt_broker_url = 1; + */ + private void clearMqttBrokerUrl() { + + mqttBrokerUrl_ = getDefaultInstance().getMqttBrokerUrl(); + } + /** + * string mqtt_broker_url = 1; + * @param value The bytes for mqttBrokerUrl to set. + */ + private void setMqttBrokerUrlBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + mqttBrokerUrl_ = value.toStringUtf8(); + + } + + public static final int USER_FIELD_NUMBER = 2; + private java.lang.String user_; + /** + * string user = 2; + * @return The user. + */ + @java.lang.Override + public java.lang.String getUser() { + return user_; + } + /** + * string user = 2; + * @return The bytes for user. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getUserBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(user_); + } + /** + * string user = 2; + * @param value The user to set. + */ + @java.lang.SuppressWarnings("ReturnValueIgnored") + private void setUser( + java.lang.String value) { + value.getClass(); // minimal bytecode null check + + user_ = value; + } + /** + * string user = 2; + */ + private void clearUser() { + + user_ = getDefaultInstance().getUser(); + } + /** + * string user = 2; + * @param value The bytes for user to set. + */ + private void setUserBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + user_ = value.toStringUtf8(); + + } + + public static final int MQTT_PASSWORD_FIELD_NUMBER = 3; + private java.lang.String mqttPassword_; + /** + * string mqtt_password = 3; + * @return The mqttPassword. + */ + @java.lang.Override + public java.lang.String getMqttPassword() { + return mqttPassword_; + } + /** + * string mqtt_password = 3; + * @return The bytes for mqttPassword. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMqttPasswordBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(mqttPassword_); + } + /** + * string mqtt_password = 3; + * @param value The mqttPassword to set. + */ + @java.lang.SuppressWarnings("ReturnValueIgnored") + private void setMqttPassword( + java.lang.String value) { + value.getClass(); // minimal bytecode null check + + mqttPassword_ = value; + } + /** + * string mqtt_password = 3; + */ + private void clearMqttPassword() { + + mqttPassword_ = getDefaultInstance().getMqttPassword(); + } + /** + * string mqtt_password = 3; + * @param value The bytes for mqttPassword to set. + */ + private void setMqttPasswordBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + mqttPassword_ = value.toStringUtf8(); + + } + + public static final int REALM_FIELD_NUMBER = 4; + private java.lang.String realm_; + /** + * string realm = 4; + * @return The realm. + */ + @java.lang.Override + public java.lang.String getRealm() { + return realm_; + } + /** + * string realm = 4; + * @return The bytes for realm. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getRealmBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(realm_); + } + /** + * string realm = 4; + * @param value The realm to set. + */ + @java.lang.SuppressWarnings("ReturnValueIgnored") + private void setRealm( + java.lang.String value) { + value.getClass(); // minimal bytecode null check + + realm_ = value; + } + /** + * string realm = 4; + */ + private void clearRealm() { + + realm_ = getDefaultInstance().getRealm(); + } + /** + * string realm = 4; + * @param value The bytes for realm to set. + */ + private void setRealmBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + realm_ = value.toStringUtf8(); + + } + + public static final int ASSET_ID_FIELD_NUMBER = 5; + private java.lang.String assetId_; + /** + * string asset_id = 5; + * @return The assetId. + */ + @java.lang.Override + public java.lang.String getAssetId() { + return assetId_; + } + /** + * string asset_id = 5; + * @return The bytes for assetId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getAssetIdBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(assetId_); + } + /** + * string asset_id = 5; + * @param value The assetId to set. + */ + @java.lang.SuppressWarnings("ReturnValueIgnored") + private void setAssetId( + java.lang.String value) { + value.getClass(); // minimal bytecode null check + + assetId_ = value; + } + /** + * string asset_id = 5; + */ + private void clearAssetId() { + + assetId_ = getDefaultInstance().getAssetId(); + } + /** + * string asset_id = 5; + * @param value The bytes for assetId to set. + */ + private void setAssetIdBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + assetId_ = value.toStringUtf8(); + + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.OpenRemoteConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.OpenRemoteConfig parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.OpenRemoteConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.OpenRemoteConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.OpenRemoteConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.OpenRemoteConfig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.OpenRemoteConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.OpenRemoteConfig parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.OpenRemoteConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.OpenRemoteConfig parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.OpenRemoteConfig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.OpenRemoteConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.OpenRemoteConfig prototype) { + return DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code io.openremote.orlib.service.espprovision.Request.OpenRemoteConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.OpenRemoteConfig, Builder> implements + // @@protoc_insertion_point(builder_implements:io.openremote.orlib.service.espprovision.Request.OpenRemoteConfig) + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.OpenRemoteConfigOrBuilder { + // Construct using io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.OpenRemoteConfig.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * string mqtt_broker_url = 1; + * @return The mqttBrokerUrl. + */ + @java.lang.Override + public java.lang.String getMqttBrokerUrl() { + return instance.getMqttBrokerUrl(); + } + /** + * string mqtt_broker_url = 1; + * @return The bytes for mqttBrokerUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMqttBrokerUrlBytes() { + return instance.getMqttBrokerUrlBytes(); + } + /** + * string mqtt_broker_url = 1; + * @param value The mqttBrokerUrl to set. + * @return This builder for chaining. + */ + public Builder setMqttBrokerUrl( + java.lang.String value) { + copyOnWrite(); + instance.setMqttBrokerUrl(value); + return this; + } + /** + * string mqtt_broker_url = 1; + * @return This builder for chaining. + */ + public Builder clearMqttBrokerUrl() { + copyOnWrite(); + instance.clearMqttBrokerUrl(); + return this; + } + /** + * string mqtt_broker_url = 1; + * @param value The bytes for mqttBrokerUrl to set. + * @return This builder for chaining. + */ + public Builder setMqttBrokerUrlBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setMqttBrokerUrlBytes(value); + return this; + } + + /** + * string user = 2; + * @return The user. + */ + @java.lang.Override + public java.lang.String getUser() { + return instance.getUser(); + } + /** + * string user = 2; + * @return The bytes for user. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getUserBytes() { + return instance.getUserBytes(); + } + /** + * string user = 2; + * @param value The user to set. + * @return This builder for chaining. + */ + public Builder setUser( + java.lang.String value) { + copyOnWrite(); + instance.setUser(value); + return this; + } + /** + * string user = 2; + * @return This builder for chaining. + */ + public Builder clearUser() { + copyOnWrite(); + instance.clearUser(); + return this; + } + /** + * string user = 2; + * @param value The bytes for user to set. + * @return This builder for chaining. + */ + public Builder setUserBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setUserBytes(value); + return this; + } + + /** + * string mqtt_password = 3; + * @return The mqttPassword. + */ + @java.lang.Override + public java.lang.String getMqttPassword() { + return instance.getMqttPassword(); + } + /** + * string mqtt_password = 3; + * @return The bytes for mqttPassword. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMqttPasswordBytes() { + return instance.getMqttPasswordBytes(); + } + /** + * string mqtt_password = 3; + * @param value The mqttPassword to set. + * @return This builder for chaining. + */ + public Builder setMqttPassword( + java.lang.String value) { + copyOnWrite(); + instance.setMqttPassword(value); + return this; + } + /** + * string mqtt_password = 3; + * @return This builder for chaining. + */ + public Builder clearMqttPassword() { + copyOnWrite(); + instance.clearMqttPassword(); + return this; + } + /** + * string mqtt_password = 3; + * @param value The bytes for mqttPassword to set. + * @return This builder for chaining. + */ + public Builder setMqttPasswordBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setMqttPasswordBytes(value); + return this; + } + + /** + * string realm = 4; + * @return The realm. + */ + @java.lang.Override + public java.lang.String getRealm() { + return instance.getRealm(); + } + /** + * string realm = 4; + * @return The bytes for realm. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getRealmBytes() { + return instance.getRealmBytes(); + } + /** + * string realm = 4; + * @param value The realm to set. + * @return This builder for chaining. + */ + public Builder setRealm( + java.lang.String value) { + copyOnWrite(); + instance.setRealm(value); + return this; + } + /** + * string realm = 4; + * @return This builder for chaining. + */ + public Builder clearRealm() { + copyOnWrite(); + instance.clearRealm(); + return this; + } + /** + * string realm = 4; + * @param value The bytes for realm to set. + * @return This builder for chaining. + */ + public Builder setRealmBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setRealmBytes(value); + return this; + } + + /** + * string asset_id = 5; + * @return The assetId. + */ + @java.lang.Override + public java.lang.String getAssetId() { + return instance.getAssetId(); + } + /** + * string asset_id = 5; + * @return The bytes for assetId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getAssetIdBytes() { + return instance.getAssetIdBytes(); + } + /** + * string asset_id = 5; + * @param value The assetId to set. + * @return This builder for chaining. + */ + public Builder setAssetId( + java.lang.String value) { + copyOnWrite(); + instance.setAssetId(value); + return this; + } + /** + * string asset_id = 5; + * @return This builder for chaining. + */ + public Builder clearAssetId() { + copyOnWrite(); + instance.clearAssetId(); + return this; + } + /** + * string asset_id = 5; + * @param value The bytes for assetId to set. + * @return This builder for chaining. + */ + public Builder setAssetIdBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setAssetIdBytes(value); + return this; + } + + // @@protoc_insertion_point(builder_scope:io.openremote.orlib.service.espprovision.Request.OpenRemoteConfig) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.OpenRemoteConfig(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "mqttBrokerUrl_", + "user_", + "mqttPassword_", + "realm_", + "assetId_", + }; + java.lang.String info = + "\u0000\u0005\u0000\u0000\u0001\u0005\u0005\u0000\u0000\u0000\u0001\u0208\u0002\u0208" + + "\u0003\u0208\u0004\u0208\u0005\u0208"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.OpenRemoteConfig.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:io.openremote.orlib.service.espprovision.Request.OpenRemoteConfig) + private static final io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.OpenRemoteConfig DEFAULT_INSTANCE; + static { + OpenRemoteConfig defaultInstance = new OpenRemoteConfig(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + OpenRemoteConfig.class, defaultInstance); + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.OpenRemoteConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface ExitProvisioningOrBuilder extends + // @@protoc_insertion_point(interface_extends:io.openremote.orlib.service.espprovision.Request.ExitProvisioning) + com.google.protobuf.MessageLiteOrBuilder { + } + /** + * Protobuf type {@code io.openremote.orlib.service.espprovision.Request.ExitProvisioning} + */ + public static final class ExitProvisioning extends + com.google.protobuf.GeneratedMessageLite< + ExitProvisioning, ExitProvisioning.Builder> implements + // @@protoc_insertion_point(message_implements:io.openremote.orlib.service.espprovision.Request.ExitProvisioning) + ExitProvisioningOrBuilder { + private ExitProvisioning() { + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.ExitProvisioning parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.ExitProvisioning parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.ExitProvisioning parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.ExitProvisioning parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.ExitProvisioning parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.ExitProvisioning parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.ExitProvisioning parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.ExitProvisioning parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.ExitProvisioning parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.ExitProvisioning parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.ExitProvisioning parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.ExitProvisioning parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.ExitProvisioning prototype) { + return DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code io.openremote.orlib.service.espprovision.Request.ExitProvisioning} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.ExitProvisioning, Builder> implements + // @@protoc_insertion_point(builder_implements:io.openremote.orlib.service.espprovision.Request.ExitProvisioning) + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.ExitProvisioningOrBuilder { + // Construct using io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.ExitProvisioning.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + // @@protoc_insertion_point(builder_scope:io.openremote.orlib.service.espprovision.Request.ExitProvisioning) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.ExitProvisioning(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = null;java.lang.String info = + "\u0000\u0000"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.ExitProvisioning.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:io.openremote.orlib.service.espprovision.Request.ExitProvisioning) + private static final io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.ExitProvisioning DEFAULT_INSTANCE; + static { + ExitProvisioning defaultInstance = new ExitProvisioning(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + ExitProvisioning.class, defaultInstance); + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.ExitProvisioning getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + private int bodyCase_ = 0; + private java.lang.Object body_; + public enum BodyCase { + DEVICE_INFO(6), + BACKEND_CONNECTION_STATUS(7), + OPEN_REMOTE_CONFIG(8), + EXIT_PROVISIONING(9), + BODY_NOT_SET(0); + private final int value; + private BodyCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static BodyCase valueOf(int value) { + return forNumber(value); + } + + public static BodyCase forNumber(int value) { + switch (value) { + case 6: return DEVICE_INFO; + case 7: return BACKEND_CONNECTION_STATUS; + case 8: return OPEN_REMOTE_CONFIG; + case 9: return EXIT_PROVISIONING; + case 0: return BODY_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + @java.lang.Override + public BodyCase + getBodyCase() { + return BodyCase.forNumber( + bodyCase_); + } + + private void clearBody() { + bodyCase_ = 0; + body_ = null; + } + + public static final int ID_FIELD_NUMBER = 1; + private java.lang.String id_; + /** + * string id = 1; + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + return id_; + } + /** + * string id = 1; + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getIdBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(id_); + } + /** + * string id = 1; + * @param value The id to set. + */ + @java.lang.SuppressWarnings("ReturnValueIgnored") + private void setId( + java.lang.String value) { + value.getClass(); // minimal bytecode null check + + id_ = value; + } + /** + * string id = 1; + */ + private void clearId() { + + id_ = getDefaultInstance().getId(); + } + /** + * string id = 1; + * @param value The bytes for id to set. + */ + private void setIdBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + id_ = value.toStringUtf8(); + + } + + public static final int DEVICE_INFO_FIELD_NUMBER = 6; + /** + * .io.openremote.orlib.service.espprovision.Request.DeviceInfo device_info = 6; + */ + @java.lang.Override + public boolean hasDeviceInfo() { + return bodyCase_ == 6; + } + /** + * .io.openremote.orlib.service.espprovision.Request.DeviceInfo device_info = 6; + */ + @java.lang.Override + public io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.DeviceInfo getDeviceInfo() { + if (bodyCase_ == 6) { + return (io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.DeviceInfo) body_; + } + return io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.DeviceInfo.getDefaultInstance(); + } + /** + * .io.openremote.orlib.service.espprovision.Request.DeviceInfo device_info = 6; + */ + @java.lang.SuppressWarnings("ReturnValueIgnored") + private void setDeviceInfo(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.DeviceInfo value) { + value.getClass(); // minimal bytecode null check + body_ = value; + bodyCase_ = 6; + } + /** + * .io.openremote.orlib.service.espprovision.Request.DeviceInfo device_info = 6; + */ + @java.lang.SuppressWarnings("ReturnValueIgnored") + private void mergeDeviceInfo(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.DeviceInfo value) { + value.getClass(); // minimal bytecode null check + if (bodyCase_ == 6 && + body_ != io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.DeviceInfo.getDefaultInstance()) { + body_ = io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.DeviceInfo.newBuilder((io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.DeviceInfo) body_) + .mergeFrom(value).buildPartial(); + } else { + body_ = value; + } + bodyCase_ = 6; + } + /** + * .io.openremote.orlib.service.espprovision.Request.DeviceInfo device_info = 6; + */ + private void clearDeviceInfo() { + if (bodyCase_ == 6) { + bodyCase_ = 0; + body_ = null; + } + } + + public static final int BACKEND_CONNECTION_STATUS_FIELD_NUMBER = 7; + /** + * .io.openremote.orlib.service.espprovision.Request.BackendConnectionStatus backend_connection_status = 7; + */ + @java.lang.Override + public boolean hasBackendConnectionStatus() { + return bodyCase_ == 7; + } + /** + * .io.openremote.orlib.service.espprovision.Request.BackendConnectionStatus backend_connection_status = 7; + */ + @java.lang.Override + public io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.BackendConnectionStatus getBackendConnectionStatus() { + if (bodyCase_ == 7) { + return (io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.BackendConnectionStatus) body_; + } + return io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.BackendConnectionStatus.getDefaultInstance(); + } + /** + * .io.openremote.orlib.service.espprovision.Request.BackendConnectionStatus backend_connection_status = 7; + */ + @java.lang.SuppressWarnings("ReturnValueIgnored") + private void setBackendConnectionStatus(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.BackendConnectionStatus value) { + value.getClass(); // minimal bytecode null check + body_ = value; + bodyCase_ = 7; + } + /** + * .io.openremote.orlib.service.espprovision.Request.BackendConnectionStatus backend_connection_status = 7; + */ + @java.lang.SuppressWarnings("ReturnValueIgnored") + private void mergeBackendConnectionStatus(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.BackendConnectionStatus value) { + value.getClass(); // minimal bytecode null check + if (bodyCase_ == 7 && + body_ != io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.BackendConnectionStatus.getDefaultInstance()) { + body_ = io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.BackendConnectionStatus.newBuilder((io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.BackendConnectionStatus) body_) + .mergeFrom(value).buildPartial(); + } else { + body_ = value; + } + bodyCase_ = 7; + } + /** + * .io.openremote.orlib.service.espprovision.Request.BackendConnectionStatus backend_connection_status = 7; + */ + private void clearBackendConnectionStatus() { + if (bodyCase_ == 7) { + bodyCase_ = 0; + body_ = null; + } + } + + public static final int OPEN_REMOTE_CONFIG_FIELD_NUMBER = 8; + /** + * .io.openremote.orlib.service.espprovision.Request.OpenRemoteConfig open_remote_config = 8; + */ + @java.lang.Override + public boolean hasOpenRemoteConfig() { + return bodyCase_ == 8; + } + /** + * .io.openremote.orlib.service.espprovision.Request.OpenRemoteConfig open_remote_config = 8; + */ + @java.lang.Override + public io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.OpenRemoteConfig getOpenRemoteConfig() { + if (bodyCase_ == 8) { + return (io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.OpenRemoteConfig) body_; + } + return io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.OpenRemoteConfig.getDefaultInstance(); + } + /** + * .io.openremote.orlib.service.espprovision.Request.OpenRemoteConfig open_remote_config = 8; + */ + @java.lang.SuppressWarnings("ReturnValueIgnored") + private void setOpenRemoteConfig(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.OpenRemoteConfig value) { + value.getClass(); // minimal bytecode null check + body_ = value; + bodyCase_ = 8; + } + /** + * .io.openremote.orlib.service.espprovision.Request.OpenRemoteConfig open_remote_config = 8; + */ + @java.lang.SuppressWarnings("ReturnValueIgnored") + private void mergeOpenRemoteConfig(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.OpenRemoteConfig value) { + value.getClass(); // minimal bytecode null check + if (bodyCase_ == 8 && + body_ != io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.OpenRemoteConfig.getDefaultInstance()) { + body_ = io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.OpenRemoteConfig.newBuilder((io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.OpenRemoteConfig) body_) + .mergeFrom(value).buildPartial(); + } else { + body_ = value; + } + bodyCase_ = 8; + } + /** + * .io.openremote.orlib.service.espprovision.Request.OpenRemoteConfig open_remote_config = 8; + */ + private void clearOpenRemoteConfig() { + if (bodyCase_ == 8) { + bodyCase_ = 0; + body_ = null; + } + } + + public static final int EXIT_PROVISIONING_FIELD_NUMBER = 9; + /** + * .io.openremote.orlib.service.espprovision.Request.ExitProvisioning exit_provisioning = 9; + */ + @java.lang.Override + public boolean hasExitProvisioning() { + return bodyCase_ == 9; + } + /** + * .io.openremote.orlib.service.espprovision.Request.ExitProvisioning exit_provisioning = 9; + */ + @java.lang.Override + public io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.ExitProvisioning getExitProvisioning() { + if (bodyCase_ == 9) { + return (io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.ExitProvisioning) body_; + } + return io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.ExitProvisioning.getDefaultInstance(); + } + /** + * .io.openremote.orlib.service.espprovision.Request.ExitProvisioning exit_provisioning = 9; + */ + @java.lang.SuppressWarnings("ReturnValueIgnored") + private void setExitProvisioning(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.ExitProvisioning value) { + value.getClass(); // minimal bytecode null check + body_ = value; + bodyCase_ = 9; + } + /** + * .io.openremote.orlib.service.espprovision.Request.ExitProvisioning exit_provisioning = 9; + */ + @java.lang.SuppressWarnings("ReturnValueIgnored") + private void mergeExitProvisioning(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.ExitProvisioning value) { + value.getClass(); // minimal bytecode null check + if (bodyCase_ == 9 && + body_ != io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.ExitProvisioning.getDefaultInstance()) { + body_ = io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.ExitProvisioning.newBuilder((io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.ExitProvisioning) body_) + .mergeFrom(value).buildPartial(); + } else { + body_ = value; + } + bodyCase_ = 9; + } + /** + * .io.openremote.orlib.service.espprovision.Request.ExitProvisioning exit_provisioning = 9; + */ + private void clearExitProvisioning() { + if (bodyCase_ == 9) { + bodyCase_ = 0; + body_ = null; + } + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request prototype) { + return DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + * Protobuf type {@code io.openremote.orlib.service.espprovision.Request} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request, Builder> implements + // @@protoc_insertion_point(builder_implements:io.openremote.orlib.service.espprovision.Request) + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.RequestOrBuilder { + // Construct using io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + @java.lang.Override + public BodyCase + getBodyCase() { + return instance.getBodyCase(); + } + + public Builder clearBody() { + copyOnWrite(); + instance.clearBody(); + return this; + } + + + /** + * string id = 1; + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + return instance.getId(); + } + /** + * string id = 1; + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getIdBytes() { + return instance.getIdBytes(); + } + /** + * string id = 1; + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId( + java.lang.String value) { + copyOnWrite(); + instance.setId(value); + return this; + } + /** + * string id = 1; + * @return This builder for chaining. + */ + public Builder clearId() { + copyOnWrite(); + instance.clearId(); + return this; + } + /** + * string id = 1; + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setIdBytes(value); + return this; + } + + /** + * .io.openremote.orlib.service.espprovision.Request.DeviceInfo device_info = 6; + */ + @java.lang.Override + public boolean hasDeviceInfo() { + return instance.hasDeviceInfo(); + } + /** + * .io.openremote.orlib.service.espprovision.Request.DeviceInfo device_info = 6; + */ + @java.lang.Override + public io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.DeviceInfo getDeviceInfo() { + return instance.getDeviceInfo(); + } + /** + * .io.openremote.orlib.service.espprovision.Request.DeviceInfo device_info = 6; + */ + public Builder setDeviceInfo(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.DeviceInfo value) { + copyOnWrite(); + instance.setDeviceInfo(value); + return this; + } + /** + * .io.openremote.orlib.service.espprovision.Request.DeviceInfo device_info = 6; + */ + public Builder setDeviceInfo( + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.DeviceInfo.Builder builderForValue) { + copyOnWrite(); + instance.setDeviceInfo(builderForValue.build()); + return this; + } + /** + * .io.openremote.orlib.service.espprovision.Request.DeviceInfo device_info = 6; + */ + public Builder mergeDeviceInfo(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.DeviceInfo value) { + copyOnWrite(); + instance.mergeDeviceInfo(value); + return this; + } + /** + * .io.openremote.orlib.service.espprovision.Request.DeviceInfo device_info = 6; + */ + public Builder clearDeviceInfo() { + copyOnWrite(); + instance.clearDeviceInfo(); + return this; + } + + /** + * .io.openremote.orlib.service.espprovision.Request.BackendConnectionStatus backend_connection_status = 7; + */ + @java.lang.Override + public boolean hasBackendConnectionStatus() { + return instance.hasBackendConnectionStatus(); + } + /** + * .io.openremote.orlib.service.espprovision.Request.BackendConnectionStatus backend_connection_status = 7; + */ + @java.lang.Override + public io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.BackendConnectionStatus getBackendConnectionStatus() { + return instance.getBackendConnectionStatus(); + } + /** + * .io.openremote.orlib.service.espprovision.Request.BackendConnectionStatus backend_connection_status = 7; + */ + public Builder setBackendConnectionStatus(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.BackendConnectionStatus value) { + copyOnWrite(); + instance.setBackendConnectionStatus(value); + return this; + } + /** + * .io.openremote.orlib.service.espprovision.Request.BackendConnectionStatus backend_connection_status = 7; + */ + public Builder setBackendConnectionStatus( + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.BackendConnectionStatus.Builder builderForValue) { + copyOnWrite(); + instance.setBackendConnectionStatus(builderForValue.build()); + return this; + } + /** + * .io.openremote.orlib.service.espprovision.Request.BackendConnectionStatus backend_connection_status = 7; + */ + public Builder mergeBackendConnectionStatus(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.BackendConnectionStatus value) { + copyOnWrite(); + instance.mergeBackendConnectionStatus(value); + return this; + } + /** + * .io.openremote.orlib.service.espprovision.Request.BackendConnectionStatus backend_connection_status = 7; + */ + public Builder clearBackendConnectionStatus() { + copyOnWrite(); + instance.clearBackendConnectionStatus(); + return this; + } + + /** + * .io.openremote.orlib.service.espprovision.Request.OpenRemoteConfig open_remote_config = 8; + */ + @java.lang.Override + public boolean hasOpenRemoteConfig() { + return instance.hasOpenRemoteConfig(); + } + /** + * .io.openremote.orlib.service.espprovision.Request.OpenRemoteConfig open_remote_config = 8; + */ + @java.lang.Override + public io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.OpenRemoteConfig getOpenRemoteConfig() { + return instance.getOpenRemoteConfig(); + } + /** + * .io.openremote.orlib.service.espprovision.Request.OpenRemoteConfig open_remote_config = 8; + */ + public Builder setOpenRemoteConfig(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.OpenRemoteConfig value) { + copyOnWrite(); + instance.setOpenRemoteConfig(value); + return this; + } + /** + * .io.openremote.orlib.service.espprovision.Request.OpenRemoteConfig open_remote_config = 8; + */ + public Builder setOpenRemoteConfig( + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.OpenRemoteConfig.Builder builderForValue) { + copyOnWrite(); + instance.setOpenRemoteConfig(builderForValue.build()); + return this; + } + /** + * .io.openremote.orlib.service.espprovision.Request.OpenRemoteConfig open_remote_config = 8; + */ + public Builder mergeOpenRemoteConfig(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.OpenRemoteConfig value) { + copyOnWrite(); + instance.mergeOpenRemoteConfig(value); + return this; + } + /** + * .io.openremote.orlib.service.espprovision.Request.OpenRemoteConfig open_remote_config = 8; + */ + public Builder clearOpenRemoteConfig() { + copyOnWrite(); + instance.clearOpenRemoteConfig(); + return this; + } + + /** + * .io.openremote.orlib.service.espprovision.Request.ExitProvisioning exit_provisioning = 9; + */ + @java.lang.Override + public boolean hasExitProvisioning() { + return instance.hasExitProvisioning(); + } + /** + * .io.openremote.orlib.service.espprovision.Request.ExitProvisioning exit_provisioning = 9; + */ + @java.lang.Override + public io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.ExitProvisioning getExitProvisioning() { + return instance.getExitProvisioning(); + } + /** + * .io.openremote.orlib.service.espprovision.Request.ExitProvisioning exit_provisioning = 9; + */ + public Builder setExitProvisioning(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.ExitProvisioning value) { + copyOnWrite(); + instance.setExitProvisioning(value); + return this; + } + /** + * .io.openremote.orlib.service.espprovision.Request.ExitProvisioning exit_provisioning = 9; + */ + public Builder setExitProvisioning( + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.ExitProvisioning.Builder builderForValue) { + copyOnWrite(); + instance.setExitProvisioning(builderForValue.build()); + return this; + } + /** + * .io.openremote.orlib.service.espprovision.Request.ExitProvisioning exit_provisioning = 9; + */ + public Builder mergeExitProvisioning(io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.ExitProvisioning value) { + copyOnWrite(); + instance.mergeExitProvisioning(value); + return this; + } + /** + * .io.openremote.orlib.service.espprovision.Request.ExitProvisioning exit_provisioning = 9; + */ + public Builder clearExitProvisioning() { + copyOnWrite(); + instance.clearExitProvisioning(); + return this; + } + + // @@protoc_insertion_point(builder_scope:io.openremote.orlib.service.espprovision.Request) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "body_", + "bodyCase_", + "id_", + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.DeviceInfo.class, + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.BackendConnectionStatus.class, + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.OpenRemoteConfig.class, + io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.ExitProvisioning.class, + }; + java.lang.String info = + "\u0000\u0005\u0001\u0000\u0001\t\u0005\u0000\u0000\u0000\u0001\u0208\u0006<\u0000" + + "\u0007<\u0000\b<\u0000\t<\u0000"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:io.openremote.orlib.service.espprovision.Request) + private static final io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request DEFAULT_INSTANCE; + static { + Request defaultInstance = new Request(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Request.class, defaultInstance); + } + + public static io.openremote.orlib.service.espprovision.ORConfigChannelProtocol.Request getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + + static { + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/ORLib/src/main/java/io/openremote/orlib/service/espprovision/WifiProvisioner.kt b/ORLib/src/main/java/io/openremote/orlib/service/espprovision/WifiProvisioner.kt new file mode 100644 index 0000000..24d077f --- /dev/null +++ b/ORLib/src/main/java/io/openremote/orlib/service/espprovision/WifiProvisioner.kt @@ -0,0 +1,150 @@ +package io.openremote.orlib.service.espprovision + +import com.espressif.provisioning.ESPConstants +import com.espressif.provisioning.ESPConstants.ProvisionFailureReason +import com.espressif.provisioning.WiFiAccessPoint +import com.espressif.provisioning.listeners.ProvisionListener +import com.espressif.provisioning.listeners.WiFiScanListener +import io.openremote.orlib.service.ESPProviderErrorCode +import io.openremote.orlib.service.ESPProvisionProviderActions + +class WifiProvisioner(private var deviceConnection: DeviceConnection? = null, var callbackChannel: CallbackChannel? = null, searchWifiTimeout: Long, searchWifiMaxIterations: Int) { + private var loopDetector = LoopDetector(searchWifiTimeout, searchWifiMaxIterations) + + var wifiScanning = false + private set + + private val wifiNetworks = mutableListOf() + + fun startWifiScan() { + if (deviceConnection?.isConnected != true) { + sendWifiScanError(ESPProviderErrorCode.NOT_CONNECTED) + return + } + wifiScanning = true + loopDetector.reset() + scanWifi() + } + + fun stopWifiScan(sendMessage: Boolean = true) { + wifiScanning = false + if (sendMessage) { + callbackChannel?.sendMessage(ESPProvisionProviderActions.STOP_WIFI_SCAN, null) + } + } + + private fun scanWifi() { + if (loopDetector.detectLoop()) { + stopWifiScan(false) + sendWifiScanError(ESPProviderErrorCode.TIMEOUT_ERROR) + return + } + + deviceConnection?.espDevice?.scanNetworks(object : WiFiScanListener { + override fun onWifiListReceived(wifiList: ArrayList?) { + wifiList?.let { + if (wifiScanning) { + var wifiNetworksChanged = false + it.forEach { wifiAP -> + wifiAP?.let { discoveredAP -> + val ap = wifiNetworks.firstOrNull() { ap -> discoveredAP.wifiName == ap.wifiName } + if (ap != null) { + if (ap.rssi != discoveredAP.rssi) { + wifiNetworksChanged = true + wifiNetworks.remove(ap) + wifiNetworks.add(discoveredAP) + } + } else { + wifiNetworksChanged = true + wifiNetworks.add(discoveredAP) + } + } + } + if (wifiNetworks.isNotEmpty() && wifiNetworksChanged) { + callbackChannel?.sendMessage(ESPProvisionProviderActions.START_WIFI_SCAN, hashMapOf( + "networks" to wifiNetworks.map { network -> + hashMapOf( + "ssid" to network.wifiName, + "signalStrength" to network.rssi) + } + )) + } + scanWifi() + } + } + } + + override fun onWiFiScanFailed(e: Exception) { + stopWifiScan(false) + sendWifiScanError(ESPProviderErrorCode.COMMUNICATION_ERROR, e.toString()) + } + }) + } + + private fun sendWifiScanError(error: ESPProviderErrorCode? = null, errorMessage: String? = null) { + val data = mutableMapOf( + "id" to (deviceConnection?.deviceId?.toString() ?: "N/A") + ) + error?.let { data["errorCode"] = it.code } + errorMessage?.let { data["errorMessage"] = it } + callbackChannel?.sendMessage(ESPProvisionProviderActions.STOP_WIFI_SCAN, data) + } + + fun sendWifiConfiguration(ssid: String, password: String) { + if (deviceConnection?.isConnected != true) { + sendWifiConfigurationStatus(false, ESPProviderErrorCode.NOT_CONNECTED) + return + } + stopWifiScan() + + deviceConnection?.espDevice?.provision(ssid, password, object: ProvisionListener { + override fun createSessionFailed(e: java.lang.Exception?) { + sendWifiConfigurationStatus(false, ESPProviderErrorCode.GENERIC_ERROR, e.toString()) + } + + override fun wifiConfigSent() { + /* ignore */ + } + + override fun wifiConfigFailed(e: java.lang.Exception?) { + sendWifiConfigurationStatus(false, ESPProviderErrorCode.WIFI_CONFIGURATION_ERROR, e.toString()) + } + + override fun wifiConfigApplied() { + /* ignore */ + } + + override fun wifiConfigApplyFailed(e: java.lang.Exception?) { + sendWifiConfigurationStatus(false, ESPProviderErrorCode.GENERIC_ERROR, e.toString()) + } + + override fun provisioningFailedFromDevice(failureReason: ESPConstants.ProvisionFailureReason?) { + sendWifiConfigurationStatus(false, mapProvisionFailureReason(failureReason ?: ProvisionFailureReason.UNKNOWN)) + } + + override fun deviceProvisioningSuccess() { + sendWifiConfigurationStatus(true) + } + + override fun onProvisioningFailed(e: java.lang.Exception?) { + sendWifiConfigurationStatus(false, ESPProviderErrorCode.GENERIC_ERROR, e.toString()) + } + }) + } + + private fun sendWifiConfigurationStatus(connected: Boolean, error: ESPProviderErrorCode? = null, errorMessage: String? = null) { + val data = mutableMapOf("connected" to connected) + error?.let { data["errorCode"] = it.code } + errorMessage?.let { data["errorMessage"] = it } + callbackChannel?.sendMessage(ESPProvisionProviderActions.SEND_WIFI_CONFIGURATION, data) + } + + private fun mapProvisionFailureReason(reason: ProvisionFailureReason): ESPProviderErrorCode { + return when (reason) { + ProvisionFailureReason.AUTH_FAILED -> ESPProviderErrorCode.WIFI_AUTHENTICATION_ERROR + ProvisionFailureReason.NETWORK_NOT_FOUND -> ESPProviderErrorCode.WIFI_NETWORK_NOT_FOUND + ProvisionFailureReason.DEVICE_DISCONNECTED -> ESPProviderErrorCode.NOT_CONNECTED + ProvisionFailureReason.UNKNOWN -> ESPProviderErrorCode.GENERIC_ERROR + } + } +} \ No newline at end of file diff --git a/ORLib/src/main/java/io/openremote/orlib/ui/OrMainActivity.kt b/ORLib/src/main/java/io/openremote/orlib/ui/OrMainActivity.kt index c26d941..f707a6e 100644 --- a/ORLib/src/main/java/io/openremote/orlib/ui/OrMainActivity.kt +++ b/ORLib/src/main/java/io/openremote/orlib/ui/OrMainActivity.kt @@ -35,12 +35,16 @@ import io.openremote.orlib.R import io.openremote.orlib.databinding.ActivityOrMainBinding import io.openremote.orlib.service.BleProvider import io.openremote.orlib.service.ConnectivityChangeReceiver +import io.openremote.orlib.service.ESPProviderErrorCode +import io.openremote.orlib.service.ESPProvisionProvider +import io.openremote.orlib.service.ESPProvisionProviderActions import io.openremote.orlib.service.GeofenceProvider import io.openremote.orlib.service.QrScannerProvider import io.openremote.orlib.service.SecureStorageProvider import io.openremote.orlib.shared.SharedData.offlineActivity import org.json.JSONException import org.json.JSONObject +import java.net.URL import java.util.logging.Level import java.util.logging.Logger @@ -73,6 +77,12 @@ open class OrMainActivity : Activity() { private var geofenceProvider: GeofenceProvider? = null private var qrScannerProvider: QrScannerProvider? = null private var bleProvider: BleProvider? = null + + private var espProvisionProvider: ESPProvisionProvider? = null + // We store the prefix here so it can be used to start a scan after permissions request + // A scan is only started if the prefix is NOT null + private var prefix: String? = null + private var secureStorageProvider: SecureStorageProvider? = null private var consoleId: String? = null private var connectFailCount: Int = 0 @@ -501,6 +511,10 @@ open class OrMainActivity : Activity() { notifyClient(responseData) } }) + + + } else if (requestCode == ESPProvisionProvider.BLUETOOTH_PERMISSION_ESPPROVISION_REQUEST_CODE || requestCode == ESPProvisionProvider.ENABLE_BLUETOOTH_ESPPROVISION_REQUEST_CODE) { + espProvisionProvider?.onRequestPermissionsResult(this, requestCode, prefix) } else if (requestCode == pushResponseCode) { if (grantResults.isNotEmpty() && grantResults[0] == PackageManager.PERMISSION_GRANTED) { notifyClient( @@ -588,6 +602,10 @@ open class OrMainActivity : Activity() { provider.equals("ble", ignoreCase = true) -> { handleBleProviderMessage(it) } + + provider.equals("espprovision", ignoreCase = true) -> { + handleESPProvisionProviderMessage(it) + } } } } @@ -942,6 +960,107 @@ open class OrMainActivity : Activity() { } } } + + + @Throws(JSONException::class) + private fun handleESPProvisionProviderMessage(data: JSONObject) { + val action = data.getString("action") + if (espProvisionProvider == null) { + if (baseUrl != null) { + espProvisionProvider = ESPProvisionProvider(activity, URL(URL(baseUrl), "/api/master")) + } else { + espProvisionProvider = ESPProvisionProvider(activity) + } + } + when { + action.equals(ESPProvisionProviderActions.PROVIDER_INIT, ignoreCase = true) -> { + val initData: Map = espProvisionProvider!!.initialize() + notifyClient(initData) + } + action.equals(ESPProvisionProviderActions.PROVIDER_ENABLE, ignoreCase = true) -> { + espProvisionProvider?.enable(object : ESPProvisionProvider.ESPProvisionCallback { + override fun accept(responseData: Map) { + notifyClient(responseData) + } + }, activity) + } + + action.equals(ESPProvisionProviderActions.PROVIDER_DISABLE, ignoreCase = true) -> { + val response = espProvisionProvider?.disable() + notifyClient(response) + } + + action.equals(ESPProvisionProviderActions.START_BLE_SCAN, ignoreCase = true) -> { + // Must define a value for prefix, to ensure scan is started in case we need to request BLE permissions (though it should not happen here) + prefix = data.optString("prefix", "") + espProvisionProvider?.startDevicesScan(prefix, + this@OrMainActivity, + object : ESPProvisionProvider.ESPProvisionCallback { + override fun accept(responseData: Map) { + notifyClient(responseData) + } + }) + } + action.equals(ESPProvisionProviderActions.STOP_BLE_SCAN, ignoreCase = true) -> { + espProvisionProvider?.stopDevicesScan() + } + + action.equals(ESPProvisionProviderActions.CONNECT_TO_DEVICE) -> { + val deviceId = data.optString("id") + val pop = data.optString("pop") + if (!deviceId.isNullOrEmpty()) { + espProvisionProvider?.connectTo(deviceId, pop) + } else { + val payload: Map = hashMapOf( + "action" to action, + "provider" to "espprovision", + "errorCode" to ESPProviderErrorCode.UNKNOWN_DEVICE.code, + "errorMessage" to "Missing id parameter" + ) + } + } + + action.equals(ESPProvisionProviderActions.DISCONNECT_FROM_DEVICE) -> { + espProvisionProvider?.disconnectFromDevice() + } + action.equals(ESPProvisionProviderActions.START_WIFI_SCAN) -> { + espProvisionProvider?.startWifiScan() + } + action.equals(ESPProvisionProviderActions.STOP_WIFI_SCAN) -> { + espProvisionProvider?.stopWifiScan() + } + action.equals(ESPProvisionProviderActions.SEND_WIFI_CONFIGURATION) -> { + val ssid = data.optString("ssid") + val password = data.optString("password") + if (!ssid.isNullOrEmpty() && !password.isNullOrEmpty()) { + espProvisionProvider?.sendWifiConfiguration(ssid, password) + } else { + val payload: Map = hashMapOf( + "action" to action, + "provider" to "espprovision", + "errorCode" to ESPProviderErrorCode.WIFI_AUTHENTICATION_ERROR.code, + "errorMessage" to "Missing ssid or password parameter" + ) + } + } + action.equals(ESPProvisionProviderActions.EXIT_PROVISIONING) -> { + espProvisionProvider?.exitProvisioning() + } + action.equals(ESPProvisionProviderActions.PROVISION_DEVICE) -> { + val userToken = data.optString("userToken") + if (!userToken.isNullOrEmpty()) { + espProvisionProvider?.provisionDevice(userToken) + } else { + val payload: Map = hashMapOf( + "action" to action, + "provider" to "espprovision", + "errorCode" to ESPProviderErrorCode.SECURITY_ERROR.code, + "errorMessage" to "Missing userToken parameter" + ) + } + } + } + } } private fun notifyClient(data: Map?) { diff --git a/ORLib/src/test/java/io/openremote/orlib/service/ESPProvisionProviderTest.kt b/ORLib/src/test/java/io/openremote/orlib/service/ESPProvisionProviderTest.kt new file mode 100644 index 0000000..41c1482 --- /dev/null +++ b/ORLib/src/test/java/io/openremote/orlib/service/ESPProvisionProviderTest.kt @@ -0,0 +1,4 @@ +package io.openremote.orlib.service + +class ESPProvisionProviderTest { +} \ No newline at end of file diff --git a/build.gradle b/build.gradle index 72ec4ec..e3a29d7 100644 --- a/build.gradle +++ b/build.gradle @@ -55,6 +55,7 @@ allprojects { repositories { google() mavenCentral() + maven { url 'https://jitpack.io' } } }