Trident IoT Zigbee SDK
Loading...
Searching...
No Matches
On/Off Switch SZED

Theory of Operation

The On/Off Switch SZED application is a dual endpoint, sleepy end device, light switch that uses 2 separate buttons to send On/Off Toggle commands for each endpoint.

When an identify start command is received, the blue LED will turn on for the duration specified in the command.

Upon first boot up, the device shall begin searching for a network if it is not already part of one. During the network search, 5 attempts will be made to find a network and the blue LED will blink 3 times at the start of each attempt. If a network is not found after 5 attempts, the red LED will turn on solid for 2 seconds. If the device boots up and is already part of a network then the green LED will turn on solid for 2 seconds.

If the device was previously part of a network, the Network Rejoin plugin will be used to attempt to rejoin the network.

By default, builds will be created for the Trident DKNCM11 board and for a custom PCB target when doing a project build. Both configurations are identical to start but this provides a way for users to build their applications for both targets as custom device development begins. This allows easier transition between different PCB targets which can be useful if a user ever wants Trident to help debug issues. Being able to run on the DKNCM11 board will allow Trident support to more quickly reproduce issues and support customers without needing the custom hardware target. To remove either hardware target from the build, simply delete or rename the hal_config_<board>T32CM11C directory. The build system looks for the hal_config directory and builds all of them for the specified chip target (T32CM11C).

ZCL Configuration

Endpoint 1
RoleSleepy ZED
Profile ID0x0104
Device TypeHA On/Off Switch (0x0000)
In Clusters (Client)Identify Cluster (0x0003)
OTA Upgrade Cluster (0x0019)
On/Off Cluster (0x0006)
Out Clusters (Server)Basic Cluster (0x0000)
Power Configuration Cluster (0x0001)
Identify Cluster (0x0003)
On/Off Switch Configuration Cluster (0x0007)
Poll Control Cluster (0x0020)
Diagnostics Cluster (0x0B05)
Remote CLI Cluster (0xFC54)


Endpoint 2
RoleSleepy ZED
Profile ID0x0104
Device TypeHA On/Off Switch (0x0000)
In Clusters (Client)Identify Cluster (0x0003)
On/Off Cluster (0x0006)
Out Clusters (Server)Basic Cluster (0x0000)
Power Configuration Cluster (0x0001)
Identify Cluster (0x0003)
On/Off Switch Configuration Cluster (0x0007)

Trident Plugins

Enabled PluginsImplemented Callbacks
Command Line Interface (CLI)
Debug Print
Network Rejointr_network_rejoin_attempt_cb
Sleep tr_pre_sleep_cb
tr_post_wake_cb
Primary/Secondary Channel Masks
End Device Keepalive
Basic Servertr_basic_server_reset_to_factory_defaults_cb
Power Configuration Server
Identify Client
Identify Servertr_identify_server_identify_start_cb
tr_identify_server_identify_stop_cb
On/Off Client
On/Off Switch Configuration Server
Over the Air Bootloading Client
Poll Control Server
Remote CLI Server
tr_app_init_cb
tr_connection_state_cb

User Interface on the DKNCM11C10

USB-C Interface

Plugging a USB-C cable from a computer into the DKNCM11C10 will enable a COM port to appear on the computer. This can be connected used to open a connection to the CLI that is running on the device.

COM Port Settings
Baud115200
Data Bits8
Stop Bits1
ParityNone
Flow ControlNone

Buttons

ButtonActionDescription
BTN0PressHardware reset
BTN1PressSends On/Off Toggle command for endpoint 1
(Also restarts network rejoin backoff algorithm if rejoin is active)
BTN2PressSends On/Off Toggle command for endpoint 2
(Also restarts network rejoin backoff algorithm if rejoin is active)

LEDs

LEDBehaviorDescription
GreenOn for 2 secondsDevice reboot and previously joined to a network
GreenBlink 100msWhen network rejoin attempt is made
RedOn for 2 secondsNetwork search attempts exhausted
BlueOn for identify durationIdentify command received
BlueBlink 3 times x 250msNetwork search attempt started

Custom APP Tokens

This project contains an example of how to create custom APP tokens that can be used from the application and can be interacted with externally via elcap. As long as the project_app_tokens.h exists in the project src directory, the application tokens will be added to the project and the APP token definition file needed for interacting with these tokens via elcap will be generated into the build directory. The APP token definition file looks like T32CM11C_app_token_def.json.