tree: e9c8b160d7466fe65c8bcd51d34372162683de3c [path history] [tgz]
  1. include/
  2. src/
  3. third_party/
  4. .gn
  5. args.gni
  6. BUILD.gn
  7. Dockerfile
  8. entrypoint.sh
  9. main.cpp
  10. README.md
examples/lock-app/linux/README.md

Lock Application for Linux

Application that showcases abilities of the Door Lock Cluster.

Building

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

Named Pipe Interface

This application accepts commands over named pipe. Pipe is located in /tmp/chip_lock_app_fifo-<PID>.

Command Format

Commands interface accepts commands formatted as a JSON object. Structure of the object:

KeyTypeValue DescriptionOptional
CmdStringContains name of the command to executeNo
ParamsObjectContains parameters for the command. Could be omitted if the command does not accept parametersYes

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.

Available commands

Set Door State

  • Name: SetDoorState
  • Parameters:
    • EndpointId (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.
  • Usage:
     echo '{"Cmd": "SetDoorState", "Params": { "EndpointId": 1, "DoorState": 1 } }' > /tmp/chip_lock_app_fifo-<PID>
    
    This command will set the door state to “Closed” resulting in Door State Change event.

Send Door Lock Alarm

  • Name: SetDoorState
  • Parameters:
    • EndpointId (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
    • AlarmCode (AlarmCode enum): code of the Lock Door Alarm to send.
  • Usage:
     echo '{"Cmd": "SendDoorLockAlarm", "Params": { "EndpointId": 1, "AlarmCode": 0 } }' > /tmp/chip_lock_app_fifo-<PID>
    
    This command will send the Door Lock Alarm event with “Lock Jammed” alarm code.