Skip to content

Commit

Permalink
add matter_ prefix to ota parameters
Browse files Browse the repository at this point in the history
fix location of oad hexfile
  • Loading branch information
srickardti committed Apr 29, 2022
1 parent a3155b9 commit da9cc70
Show file tree
Hide file tree
Showing 13 changed files with 55 additions and 98 deletions.
7 changes: 0 additions & 7 deletions examples/all-clusters-app/cc13x2x7_26x2x7/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@ import("${ti_simplelink_sdk_build_root}/ti_simplelink_sdk.gni")

assert(current_os == "freertos")

declare_args() {
device_vid = "0xFFF1"
device_pid = "0x8006"
software_ver = "0x0001"
software_ver_str = "1.0d1"
}

project_dir = "${chip_root}/examples/all-clusters-app/cc13x2x7_26x2x7"

ti_simplelink_sdk("sdk") {
Expand Down
5 changes: 5 additions & 0 deletions examples/all-clusters-app/cc13x2x7_26x2x7/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,8 @@ chip_config_network_layer_ble = true
# Disable lock tracking, since our FreeRTOS configuration does not set
# INCLUDE_xSemaphoreGetMutexHolder
chip_stack_lock_tracking = "none"

matter_device_vid = "0xFFF1"
matter_device_pid = "0x8006"
matter_software_ver = "0x0001"
matter_software_ver_str = "1.0d1"
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
#define CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION 1

/**
* Values set by BUILD.gn:
* Values set by args.gni:
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
* CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID
* CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING
Expand Down
12 changes: 0 additions & 12 deletions examples/lock-app/cc13x2x7_26x2x7/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@ import("${ti_simplelink_sdk_build_root}/ti_simplelink_sdk.gni")

assert(current_os == "freertos")

declare_args() {
device_vid = "0xFFF1"
device_pid = "0x8006"
software_ver = "0x0001"
software_ver_str = "1.0d1"
}

project_dir = "${chip_root}/examples/lock-app/cc13x2x7_26x2x7"

ti_simplelink_sdk("sdk") {
Expand Down Expand Up @@ -80,11 +73,6 @@ ti_sysconfig("sysconfig") {
ti_simplelink_executable("lock_app") {
output_name = "chip-${ti_simplelink_board}-lock-example.out"

device_vid = device_vid
device_pid = device_pid
software_ver = software_ver
software_ver_str = software_ver_str

sources = [
"${project_dir}/main/AppTask.cpp",
"${project_dir}/main/BoltLockManager.cpp",
Expand Down
5 changes: 5 additions & 0 deletions examples/lock-app/cc13x2x7_26x2x7/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,8 @@ chip_config_network_layer_ble = true
chip_stack_lock_tracking = "none"

chip_openthread_ftd = true

matter_device_vid = "0xFFF1"
matter_device_pid = "0x8006"
matter_software_ver = "0x0001"
matter_software_ver_str = "1.0d1"
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
#endif

/**
* Values set by BUILD.gn:
* Values set by args.gni:
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
* CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID
* CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING
Expand Down
7 changes: 0 additions & 7 deletions examples/pump-app/cc13x2x7_26x2x7/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ import("${ti_simplelink_sdk_build_root}/ti_simplelink_sdk.gni")

assert(current_os == "freertos")

declare_args() {
device_vid = "0xFFF1"
device_pid = "0x800A"
software_ver = "0x0001"
software_ver_str = "1.0d1"
}

project_dir = "${chip_root}/examples/pump-app/cc13x2x7_26x2x7"

ti_simplelink_sdk("sdk") {
Expand Down
5 changes: 5 additions & 0 deletions examples/pump-app/cc13x2x7_26x2x7/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,8 @@ chip_config_network_layer_ble = true
# Disable lock tracking, since our FreeRTOS configuration does not set
# INCLUDE_xSemaphoreGetMutexHolder
chip_stack_lock_tracking = "none"

matter_device_vid = "0xFFF1"
matter_device_pid = "0x800A"
matter_software_ver = "0x0001"
matter_software_ver_str = "1.0d1"
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
#define CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION 1

/**
* Values set by BUILD.gn:
* Values set by args.gni:
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
* CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID
* CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING
Expand Down
7 changes: 0 additions & 7 deletions examples/pump-controller-app/cc13x2x7_26x2x7/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@ import("${ti_simplelink_sdk_build_root}/ti_simplelink_sdk.gni")

assert(current_os == "freertos")

declare_args() {
device_vid = "0xFFF1"
device_pid = "0x8011"
software_ver = "0x0001"
software_ver_str = "1.0d1"
}

project_dir = "${chip_root}/examples/pump-controller-app/cc13x2x7_26x2x7"

ti_simplelink_sdk("sdk") {
Expand Down
5 changes: 5 additions & 0 deletions examples/pump-controller-app/cc13x2x7_26x2x7/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,8 @@ chip_config_network_layer_ble = true
# Disable lock tracking, since our FreeRTOS configuration does not set
# INCLUDE_xSemaphoreGetMutexHolder
chip_stack_lock_tracking = "none"

matter_device_vid = "0xFFF1"
matter_device_pid = "0x8011"
matter_software_ver = "0x0001"
matter_software_ver_str = "1.0d1"
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
#define CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION 1

/**
* Values set by BUILD.gn:
* Values set by args.gni:
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
* CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID
* CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING
Expand Down
92 changes: 31 additions & 61 deletions third_party/ti_simplelink_sdk/ti_simplelink_executable.gni
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@ import("${chip_root}/src/platform/device.gni")
import("ti_simplelink_board.gni")
import("ti_simplelink_sdk.gni")

declare_args() {
matter_device_vid = ""
matter_device_pid = ""
matter_software_ver = ""
matter_software_ver_str = ""
}

assert(matter_device_vid != "", "matter_device_vid must be specified")
assert(matter_device_pid != "", "matter_device_pid must be specified")
assert(matter_software_ver != "", "matter_software_ver must be specified")
assert(matter_software_ver_str != "",
"matter_software_ver_str must be specified")

template("ti_simplelink_executable") {
simplelink_target_name = target_name

Expand All @@ -45,21 +58,12 @@ template("ti_simplelink_executable") {
}

# add OTA options if available
if (defined(invoker.device_vid)) {
defines += [ "CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID=${invoker.device_vid}" ]
}
if (defined(invoker.device_pid)) {
defines +=
[ "CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID=${invoker.device_pid}" ]
}
if (defined(invoker.software_ver)) {
defines += [
"CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION=${invoker.software_ver}",
]
}
if (defined(invoker.software_ver_str)) {
defines += [ "CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING=\"${invoker.software_ver_str}\"" ]
}
defines += [
"CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID=${matter_device_vid}",
"CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID=${matter_device_pid}",
"CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION=${matter_software_ver}",
"CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING=\"${matter_software_ver_str}\"",
]
}

flashable_executable("${simplelink_target_name}.out") {
Expand Down Expand Up @@ -103,7 +107,7 @@ template("ti_simplelink_executable") {
rebase_path(root_out_dir, root_build_dir),
"7",
"-hex1",
rebase_path("${root_out_dir}/${output_base_name}.hex", root_build_dir),
rebase_path("${root_out_dir}/${output_base_name}.hex", root_out_dir),
"-o",
output_base_name,
]
Expand Down Expand Up @@ -156,54 +160,20 @@ template("ti_simplelink_executable") {
rebase_path("${root_out_dir}/${output_base_name}.ota", root_build_dir),
]

if (defined(invoker.device_vid)) {
args += [
"-v",
invoker.device_vid,
]
} else {
args += [
"-v",
"0xFFF1",
]
}
if (defined(invoker.device_pid)) {
args += [
"-p",
invoker.device_pid,
]
} else {
args += [
"-p",
"0x8006",
]
}
if (defined(invoker.software_ver)) {
args += [
"-vn",
invoker.software_ver,
]
} else {
args += [
"-vn",
"0x0001",
]
}
if (defined(invoker.software_ver_str)) {
args += [
"-vs",
invoker.software_ver_str,
]
} else {
args += [
"-vs",
"1.0d1",
]
}
args += [
"-v",
matter_device_vid,
"-p",
matter_device_pid,
"-vn",
matter_software_ver,
"-vs",
matter_software_ver_str,
]
if (defined(invoker.ota_digest)) {
args += [
"-da",
invoker.ota_digest,
matter_ota_digest,
]
} else {
args += [
Expand Down

0 comments on commit da9cc70

Please sign in to comment.