Skip to content

Commit

Permalink
[nxp][k32w0][k32w0] add restyle and wording fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Doru Gucea <[email protected]>
  • Loading branch information
doru91 committed Feb 22, 2024
1 parent aab2ab5 commit 9d19f8e
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 46 deletions.
1 change: 1 addition & 0 deletions .github/.wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,7 @@ libwebkitgtk
lifecycle
lightbulb
lightin
lit-icd
LightingApp
LightingColor
LightingState
Expand Down
14 changes: 4 additions & 10 deletions examples/contact-sensor-app/nxp/k32w/k32w0/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import("//build_overrides/openthread.gni")
import("${k32w0_sdk_build_root}/k32w0_executable.gni")
import("${k32w0_sdk_build_root}/k32w0_sdk.gni")

import("${chip_root}/src/app/icd/icd.gni")
import("${chip_root}/src/crypto/crypto.gni")
import("${chip_root}/src/lib/core/core.gni")
import("${chip_root}/src/platform/device.gni")
import("${chip_root}/src/app/icd/icd.gni")

declare_args() {
chip_software_version = 0
Expand Down Expand Up @@ -123,17 +123,11 @@ k32w0_executable("contact_sensor_app") {

#lit and sit are using different zap files
if (chip_enable_icd_lit) {
deps += [
"${chip_root}/examples/contact-sensor-app/nxp/zap-lit/",
]
deps += [ "${chip_root}/examples/contact-sensor-app/nxp/zap-lit/" ]

defines += [
"CHIP_ENABLE_LIT=1",
]
defines += [ "CHIP_ENABLE_LIT=1" ]
} else {
deps += [
"${chip_root}/examples/contact-sensor-app/nxp/zap-sit/",
]
deps += [ "${chip_root}/examples/contact-sensor-app/nxp/zap-sit/" ]
}

cflags = [ "-Wconversion" ]
Expand Down
10 changes: 7 additions & 3 deletions examples/contact-sensor-app/nxp/k32w/k32w0/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,9 @@ pycryptodome 3.9.8
The resulting output file can be found in out/debug/chip-k32w0x-contact-example.
## Long Idle Time ICD Support
By default, contact-sensor is compiled as SIT ICD (Short Idle Time Intermittently Connected Device) - see rules from k32w0_sdk.gni:
By default, contact-sensor is compiled as SIT ICD (Short Idle Time
Intermittently Connected Device) - see rules from k32w0_sdk.gni:
```
chip_ot_idle_interval_ms = 2000 # 2s Idle Intervals
Expand All @@ -277,8 +279,10 @@ nxp_active_mode_threshold_ms = 1000 # 1s Active Mode Threshold
nxp_icd_supported_clients_per_fabric = 2 # 2 registration slots per fabric
```
If LIT ICD support is needed then `chip_enable_icd_lit=true` must be specified as gn argument and the above parameters can be modified to
comply with LIT requirements (e.g.: LIT devices must configure `chip_ot_idle_interval_ms > 15000`). Example LIT configuration:
If LIT ICD support is needed then `chip_enable_icd_lit=true` must be specified
as gn argument and the above parameters can be modified to comply with LIT
requirements (e.g.: LIT devices must configure
`chip_ot_idle_interval_ms > 15000`). Example LIT configuration:
```
chip_ot_idle_interval_ms = 15000 # 15s Idle Intervals
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ void AppTask::HandleKeyboard(void)
else
#endif

ButtonEventHandler(BLE_BUTTON, BLE_BUTTON_PUSH);
ButtonEventHandler(BLE_BUTTON, BLE_BUTTON_PUSH);
break;
#if !(defined OM15082)
case gKBD_EventLongPB1_c:
Expand Down
14 changes: 4 additions & 10 deletions examples/contact-sensor-app/nxp/k32w/k32w1/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ import("${nxp_sdk_build_root}/${nxp_sdk_name}/nxp_executable.gni")

import("${nxp_sdk_build_root}/${nxp_sdk_name}/${nxp_sdk_name}.gni")

import("${chip_root}/src/app/icd/icd.gni")
import("${chip_root}/src/crypto/crypto.gni")
import("${chip_root}/src/lib/core/core.gni")
import("${chip_root}/src/platform/device.gni")
import("${chip_root}/src/platform/nxp/${nxp_platform}/args.gni")
import("${chip_root}/src/app/icd/icd.gni")

declare_args() {
chip_software_version = 0
Expand Down Expand Up @@ -113,17 +113,11 @@ k32w1_executable("contact_sensor_app") {

#lit and sit are using different zap files
if (chip_enable_icd_lit) {
deps += [
"${chip_root}/examples/contact-sensor-app/nxp/zap-lit/",
]
deps += [ "${chip_root}/examples/contact-sensor-app/nxp/zap-lit/" ]

defines += [
"CHIP_ENABLE_LIT=1",
]
defines += [ "CHIP_ENABLE_LIT=1" ]
} else {
deps += [
"${chip_root}/examples/contact-sensor-app/nxp/zap-sit/",
]
deps += [ "${chip_root}/examples/contact-sensor-app/nxp/zap-sit/" ]
}

cflags = [ "-Wconversion" ]
Expand Down
28 changes: 16 additions & 12 deletions examples/contact-sensor-app/nxp/k32w/k32w1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ will not work.
**RGB LED** shows the state of the simulated contact sensor. when the LED is
lit, the sensor is contacted, when not lit, the sensor is non-contacted.

**Button SW2**. SHORT press function is overloaded depending on the device type and
commissioning state. If the device is not commissioned, a SHORT press of the buttton
will enable Bluetooth LE advertising for a predefined period of time. If the device
is commissioned and is acting as a LIT ICD then a SHORT press of the button will enable
Active Mode.
A LONG Press of Button SW2 initiates a factory reset. After an initial period of 3
seconds, LED 2 and RGB LED will flash in unison to signal the pending reset.
After 6 seconds will cause the device to reset its persistent configuration and initiate
a reboot. The reset action can be cancelled by press SW2 button at any point before the 6 second limit.
**Button SW2**. SHORT press function is overloaded depending on the device type
and commissioning state. If the device is not commissioned, a SHORT press of the
button will enable Bluetooth LE advertising for a predefined period of time. If
the device is commissioned and is acting as a LIT ICD then a SHORT press of the
button will enable Active Mode. A LONG Press of Button SW2 initiates a factory
reset. After an initial period of 3 seconds, LED 2 and RGB LED will flash in
unison to signal the pending reset. After 6 seconds will cause the device to
reset its persistent configuration and initiate a reboot. The reset action can
be cancelled by press SW2 button at any point before the 6 second limit.

**Button SW3** can be used to change the state of the simulated contact sensor.
The button behaves as a toggle, swapping the state every time it is short
Expand Down Expand Up @@ -145,7 +145,9 @@ build, the `elf` and `srec` files are found in `out/debug/` -
`see the files prefixed with chip-k32w1-contact-example`.

## Long Idle Time ICD Support
By default, contact-sensor is compiled as SIT ICD (Short Idle Time Intermittently Connected Device) - see rules from k32w1_sdk.gni:

By default, contact-sensor is compiled as SIT ICD (Short Idle Time
Intermittently Connected Device) - see rules from k32w1_sdk.gni:

```
chip_ot_idle_interval_ms = 2000 # 2s Idle Intervals
Expand All @@ -157,8 +159,10 @@ nxp_active_mode_threshold_ms = 1000 # 1s Active Mode Threshold
nxp_icd_supported_clients_per_fabric = 2 # 2 registration slots per fabric
```

If LIT ICD support is needed then `chip_enable_icd_lit=true` must be specified as gn argument and the above parameters can be modified to
comply with LIT requirements (e.g.: LIT devices must configure `chip_ot_idle_interval_ms > 15000`). Example LIT configuration:
If LIT ICD support is needed then `chip_enable_icd_lit=true` must be specified
as gn argument and the above parameters can be modified to comply with LIT
requirements (e.g.: LIT devices must configure
`chip_ot_idle_interval_ms > 15000`). Example LIT configuration:

```
chip_ot_idle_interval_ms = 15000 # 15s Idle Intervals
Expand Down
10 changes: 5 additions & 5 deletions third_party/nxp/k32w0_sdk/k32w0_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ declare_args() {
chip_with_sdk_package = 1

# ICD Matter Configuration flags
nxp_ot_idle_interval_ms = 2000 # 2s Idle Intervals
nxp_ot_active_interval_ms = 500 # 500ms Active Intervals
nxp_ot_idle_interval_ms = 2000 # 2s Idle Intervals
nxp_ot_active_interval_ms = 500 # 500ms Active Intervals

nxp_idle_mode_duration_s = 600 # 10min Idle Mode Interval
nxp_active_mode_duration_ms = 10000 # 10s Active Mode Interval
nxp_active_mode_threshold_ms = 1000 # 1s Active Mode Threshold
nxp_idle_mode_duration_s = 600 # 10min Idle Mode Interval
nxp_active_mode_duration_ms = 10000 # 10s Active Mode Interval
nxp_active_mode_threshold_ms = 1000 # 1s Active Mode Threshold
nxp_icd_supported_clients_per_fabric = 2 # 2 registration slots per fabric
}

Expand Down
10 changes: 5 additions & 5 deletions third_party/nxp/nxp_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ declare_args() {
nxp_software_version_string = "1.3"

# ICD Matter Configuration flags
nxp_ot_idle_interval_ms = 2000 # 2s Idle Intervals
nxp_ot_active_interval_ms = 500 # 500ms Active Intervals
nxp_ot_idle_interval_ms = 2000 # 2s Idle Intervals
nxp_ot_active_interval_ms = 500 # 500ms Active Intervals

nxp_idle_mode_duration_s = 600 # 10min Idle Mode Interval
nxp_active_mode_duration_ms = 10000 # 10s Active Mode Interval
nxp_active_mode_threshold_ms = 1000 # 1s Active Mode Threshold
nxp_idle_mode_duration_s = 600 # 10min Idle Mode Interval
nxp_active_mode_duration_ms = 10000 # 10s Active Mode Interval
nxp_active_mode_threshold_ms = 1000 # 1s Active Mode Threshold
nxp_icd_supported_clients_per_fabric = 2 # 2 registration slots per fabric
}

Expand Down

0 comments on commit 9d19f8e

Please sign in to comment.