Skip to content

Commit

Permalink
[Java] Add the TLVReader/TLVWriter lib for generic IM write/invoke AP…
Browse files Browse the repository at this point in the history
…Is (#25411)

* [java] Add tlv writer and reader lib

* Address review comments
  • Loading branch information
yufengwangca authored and pull[bot] committed Oct 24, 2023
1 parent b45adb4 commit 1027722
Show file tree
Hide file tree
Showing 12 changed files with 1,313 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/smoketest-android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: connectedhomeip/chip-build-android:0.6.44
image: connectedhomeip/chip-build-android:0.6.46
volumes:
- "/tmp/log_output:/tmp/test_logs"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ jobs:
runs-on: ubuntu-latest

container:
image: connectedhomeip/chip-build:0.6.44
image: connectedhomeip/chip-build-java:0.6.46
options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0
net.ipv4.conf.all.forwarding=0 net.ipv6.conf.all.forwarding=0"

Expand Down
23 changes: 22 additions & 1 deletion src/controller/java/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,31 @@ if (chip_link_tests) {
}
}

kotlin_library("tlv") {
output_name = "libCHIPTlv.jar"

deps = [ "${chip_root}/third_party/java_deps:protobuf-java" ]

sources = [
"src/chip/tlv/Element.kt",
"src/chip/tlv/TlvReader.kt",
"src/chip/tlv/TlvWriter.kt",
"src/chip/tlv/tags.kt",
"src/chip/tlv/types.kt",
"src/chip/tlv/utils.kt",
"src/chip/tlv/values.kt",
]

kotlinc_flags = [ "-Xlint:deprecation" ]
}

android_library("java") {
output_name = "CHIPController.jar"

deps = [ "${chip_root}/third_party/java_deps:annotation" ]
deps = [
":tlv",
"${chip_root}/third_party/java_deps:annotation",
]

data_deps = [ ":jni" ]

Expand Down
27 changes: 27 additions & 0 deletions src/controller/java/src/chip/tlv/Element.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
*
* Copyright (c) 2023 Project CHIP Authors
* Copyright (c) 2019-2023 Google LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package chip.tlv

/**
* Represents a single TLV element.
*
* @property tag the tag of the element and its associated data
* @property value the value of the element
*/
data class Element(val tag: Tag, val value: Value)
Loading

0 comments on commit 1027722

Please sign in to comment.