Skip to content

Commit

Permalink
Pierred/rel5 (#26)
Browse files Browse the repository at this point in the history
* Release 1.1.0.
Sync matterhorn with Matter SDK at commit d47c8f7a3ac84f2cc04e5411f064baeb9fe8c93f.
REL5 for EAP partners.

* Release 1.1.0.
Sync matterhorn with Matter SDK at commit d47c8f7a3ac84f2cc04e5411f064baeb9fe8c93f.
REL5 for EAP partners.

* Release 1.1.0.
Sync matterhorn with Matter SDK at commit d47c8f7a3ac84f2cc04e5411f064baeb9fe8c93f.
REL5 for EAP partners.
Fix issue #24.
  • Loading branch information
pierredelisle authored Oct 19, 2022
1 parent 727f902 commit 7104a03
Show file tree
Hide file tree
Showing 15 changed files with 48 additions and 24 deletions.
3 changes: 1 addition & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ android {
minSdk 27
targetSdk 31
versionCode 10
versionName "1.0.3"

versionName "1.1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,12 @@ abstract class BaseCompletionListener : ChipDeviceController.CompletionListener
override fun onOpCSRGenerationComplete(csr: ByteArray) {
Timber.d("onOpCSRGenerationComplete(): csr [${csr}]")
}

override fun onReadCommissioningInfo(vendorId: Int, productId: Int, wifiEndpointId: Int, threadEndpointId: Int) {
Timber.d("onReadCommissioningInfo: vendorId [${vendorId}] productId [${productId}] wifiEndpointId [${wifiEndpointId}] threadEndpointId [${threadEndpointId}]")
}

override fun onCommissioningStatusUpdate(nodeId: Long, stage: String?, errorCode: Int) {
Timber.d("onCommissioningStatusUpdate nodeId [${nodeId}] stage [${stage}] errorCode [${errorCode}]")
}
}
28 changes: 23 additions & 5 deletions app/src/main/java/com/google/homesampleapp/chip/ChipClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,19 @@ package com.google.homesampleapp.chip

import android.content.Context
import chip.devicecontroller.ChipDeviceController
import chip.devicecontroller.ControllerParams
import chip.devicecontroller.GetConnectedDeviceCallbackJni.GetConnectedDeviceCallback
import chip.devicecontroller.NetworkCredentials
import chip.devicecontroller.PaseVerifierParams
import chip.platform.AndroidBleManager
import chip.platform.AndroidChipPlatform
import chip.platform.ChipMdnsCallbackImpl
import chip.platform.DiagnosticDataProviderImpl
import chip.platform.NsdManagerServiceResolver
import chip.platform.PreferencesConfigurationManager
import chip.platform.PreferencesKeyValueStoreManager
import chip.platform.NsdManagerServiceResolver
import chip.platform.NsdManagerServiceBrowser
import chip.platform.ChipMdnsCallbackImpl
import chip.platform.DiagnosticDataProviderImpl

import com.google.homesampleapp.stripLinkLocalInIpAddress
import dagger.hilt.android.qualifiers.ApplicationContext
import javax.inject.Inject
Expand All @@ -41,6 +44,9 @@ import timber.log.Timber
@Singleton
class ChipClient @Inject constructor(@ApplicationContext context: Context) {

/* 0xFFF4 is a test vendor ID, replace with your assigned company ID */
private val VENDOR_ID = 0xFFF4

// Lazily instantiate [ChipDeviceController] and hold a reference to it.
private val chipDeviceController: ChipDeviceController by lazy {
ChipDeviceController.loadJni()
Expand All @@ -49,9 +55,11 @@ class ChipClient @Inject constructor(@ApplicationContext context: Context) {
PreferencesKeyValueStoreManager(context),
PreferencesConfigurationManager(context),
NsdManagerServiceResolver(context),
NsdManagerServiceBrowser(context),
ChipMdnsCallbackImpl(),
DiagnosticDataProviderImpl(context))
ChipDeviceController()
DiagnosticDataProviderImpl(context)
)
ChipDeviceController(ControllerParams.newBuilder().setUdpListenPort(0).setControllerVendorId(VENDOR_ID).build())
}

/**
Expand Down Expand Up @@ -110,6 +118,16 @@ class ChipClient @Inject constructor(@ApplicationContext context: Context) {
super.onError(error)
continuation.resumeWithException(error)
}

override fun onReadCommissioningInfo(vendorId: Int, productId: Int, wifiEndpointId: Int, threadEndpointId: Int) {
super.onReadCommissioningInfo(vendorId, productId, wifiEndpointId, threadEndpointId)
continuation.resume(Unit)
}

override fun onCommissioningStatusUpdate(nodeId: Long, stage: String?, errorCode: Int) {
super.onCommissioningStatusUpdate(nodeId, stage, errorCode)
continuation.resume(Unit)
}
})

// Temporary workaround to remove interface indexes from ipAddress
Expand Down
Binary file modified app/third_party/connectedhomeip/libs/AndroidPlatform.jar
Binary file not shown.
Binary file modified app/third_party/connectedhomeip/libs/CHIPController.jar
Binary file not shown.
Binary file modified app/third_party/connectedhomeip/libs/SetupPayloadParser.jar
Binary file not shown.
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:7.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10"
classpath "com.google.dagger:hilt-android-gradle-plugin:2.38.1"
classpath 'com.google.protobuf:protobuf-java:3.4.0'
classpath 'com.google.dagger:hilt-android-gradle-plugin:2.41'
classpath("androidx.navigation:navigation-safe-args-gradle-plugin:2.4.2")
Expand Down

0 comments on commit 7104a03

Please sign in to comment.