examples/lock-app/linux/README.md
Application that showcases abilities of the Door Lock Cluster.
The application could be build in the same manner as all-clusters-app:
? scripts/examples/gn_build_example.sh examples/lock-app/linux out/lock-app chip_config_network_layer_ble=false
This application accepts commands over named pipe. Named pipes can be enabled by
adding the --app-pipe argument and providing the path of the file to use
<file_path>.
./out/darwin-arm64-lock/chip-lock-app --app-pipe /tmp/lock_fifo
Commands interface accepts commands formatted as a JSON object. Structure of the object:
| Key | Type | Value Description | Optional |
|---|---|---|---|
Cmd | String | Contains name of the command to execute | No |
Params | Object | Contains parameters for the command. Could be omitted if the command does not accept parameters | Yes |
For example:
{ "Cmd": "SetDoorState", "Params": { "EndpointId": 1, "DoorState": 2 } } -
command to set the Door Jammed door state.{ "Cmd": "SendDoorLockAlarm", "Params": { "AlarmCode": 0 } } - command to
send the Door Lock Alarm event with Lock Jammed alarm code.SetDoorStateEndpointId (Uint, Optional): ID of the endpoint where command should
be executed. Could be omitted, in that case the default endpoint with ID
1 is targeted.DoorState (DoorState enum): new door state. echo '{"Cmd": "SetDoorState", "Params": { "EndpointId": 1, "DoorState": 1 } }' > /tmp/lock_fifo
SetDoorStateEndpointId (Uint, Optional): ID of the endpoint where command should
be executed. Could be omitted, in that case the default endpoint with ID
1 is targetedAlarmCode (AlarmCode enum): code of the Lock Door Alarm to send. echo '{"Cmd": "SendDoorLockAlarm", "Params": { "EndpointId": 1, "AlarmCode": 0 } }' > /tmp/lock_fifo