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 Neptune 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 develpment 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 Neptune 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
Role Sleepy ZED
Profile ID 0x0104
Device Type HA On/Off Switch (0x0000)
In Clusters (Client) Identify Cluster (0x0003)
On/Off Cluster (0x0006)
Out Clusters (Server) Basic Cluster (0x0000)
Identify Cluster (0x0003)
On/Off Switch Configuration Cluster (0x0007)
Poll Control Cluster (0x0020)
Diagnostics Cluster (0x0B05)
Remote CLI Cluster (0xFC54)


Endpoint 2
Role Sleepy ZED
Profile ID 0x0104
Device Type HA On/Off Switch (0x0000)
In Clusters (Client) Identify Cluster (0x0003)
On/Off Cluster (0x0006)
Out Clusters (Server) Basic Cluster (0x0000)
Identify Cluster (0x0003)
On/Off Switch Configuration Cluster (0x0007)

Trident Plugins

Enabled Plugins Implemented Callbacks
Command Line Interface (CLI)
Debug Print
Network Rejoin tr_network_rejoin_attempt_cb
Sleep tr_pre_sleep_cb
tr_post_wake_cb
Primary/Secondary Channel Masks
End Device Keepalive
Basic Server tr_basic_server_reset_to_factory_defaults_cb
Identify Client
Identify Server tr_identify_server_identify_start_cb
tr_identify_server_identify_stop_cb
On/Off Client
On/Off Switch Configuration Server
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
Baud 115200
Data Bits 8
Stop Bits 1
Parity None
Flow Control None

Buttons

Button Action Description
BTN0 Press Hardware reset
BTN1 Press Sends On/Off Toggle command for endpoint 1
(Also restarts network rejoin backoff algorithm if rejoin is active)
BTN2 Press Sends On/Off Toggle command for endpoint 2
(Also restarts network rejoin backoff algorithm if rejoin is active)

LEDs

LED Behavior Description
Green On for 2 seconds Device reboot and previously joined to a network
Green Blink 100ms When network rejoin attempt is made
Red On for 2 seconds Network search attempts exhausted
Blue On for identify duration Identify command received
Blue Blink 3 times x 250ms Network 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 genreated into the build directory. The APP token definition file looks like T32CM11C_app_token_def.json.