|
| 1 | +# Matter NXP Door Lock Example Application |
| 2 | + |
| 3 | +This reference application implements an Door Lock device type. It uses board |
| 4 | +buttons or `matter-cli` for user input and LEDs for state feedback. You can use |
| 5 | +this example as a reference for creating your own application. |
| 6 | + |
| 7 | +The example is based on: |
| 8 | + |
| 9 | +- [Matter](https://github.com/project-chip/connectedhomeip) |
| 10 | +- [NXP github SDK](https://github.com/nxp-mcuxpresso/mcux-sdk) |
| 11 | + |
| 12 | +- [Matter NXP Door Lock Example Application](#matter-nxp-door-lock-example-application) |
| 13 | + - [Supported devices](#supported-devices) |
| 14 | + - [Introduction](#introduction) |
| 15 | + - [Device UI](#device-ui) |
| 16 | + - [Prerequisites for building](#prerequisites-for-building) |
| 17 | + - [Building](#building) |
| 18 | + - [Data model](#data-model) |
| 19 | + - [Manufacturing data](#manufacturing-data) |
| 20 | + - [Flashing and debugging](#flashing-and-debugging) |
| 21 | + |
| 22 | +## Supported devices |
| 23 | + |
| 24 | +- [k32w1](k32w1/README.md) |
| 25 | +- [mcxw71](mcxw71/README.md) |
| 26 | + |
| 27 | +## Introduction |
| 28 | + |
| 29 | +The application showcases a door lock device that communicates with clients over |
| 30 | +a low-power, 802.15.4 Thread network. |
| 31 | + |
| 32 | +It can be commissioned into an existing Matter network using a controller such |
| 33 | +as `chip-tool`. |
| 34 | + |
| 35 | +This example implements a `User-Intent Commissioning Flow`, meaning the user has |
| 36 | +to press a button in order for the device to be ready for commissioning. The |
| 37 | +initial commissioning is done through `ble-thread` pairing method. |
| 38 | + |
| 39 | +The Thread network dataset will be transferred on the device using a secure |
| 40 | +session over Bluetooth LE. In order to start the commissioning process, the user |
| 41 | +must enable BLE advertising on the device manually. To pair successfully, the |
| 42 | +commissioner must know the commissioning information corresponding to the |
| 43 | +device: setup passcode and discriminator. This data is usually encoded within a |
| 44 | +QR code or printed to the UART console. |
| 45 | + |
| 46 | +## Device UI |
| 47 | + |
| 48 | +The example application provides a simple UI that depicts the state of the |
| 49 | +device and offers basic user control. This UI is implemented via the |
| 50 | +general-purpose LEDs and buttons built in the evaluation boards. Please see each |
| 51 | +supported device readme file for details. |
| 52 | + |
| 53 | +## Prerequisites for building |
| 54 | + |
| 55 | +In order to build the example, it is recommended to use a Linux distribution. |
| 56 | +Please visit the supported Operating Systems list in |
| 57 | +[BUILDING.md](../../../docs/guides/BUILDING.md#prerequisites). |
| 58 | + |
| 59 | +- Make sure that below prerequisites are correctly installed (as described in |
| 60 | + [BUILDING.md](../../../docs/guides/BUILDING.md#prerequisites)) |
| 61 | + |
| 62 | +``` |
| 63 | +sudo apt-get install git gcc g++ pkg-config libssl-dev libdbus-1-dev libglib2.0-dev libavahi-client-dev ninja-build python3-venv python3-dev python3-pip unzip libgirepository1.0-dev libcairo2-dev libreadline-dev |
| 64 | +``` |
| 65 | + |
| 66 | +- Step 1: checkout NXP specific submodules only |
| 67 | + |
| 68 | + ``` |
| 69 | + user@ubuntu:~/Desktop/git/connectedhomeip$ scripts/checkout_submodules.py --shallow --platform nxp --recursive |
| 70 | + ``` |
| 71 | +
|
| 72 | +- Step 2: activate local environment |
| 73 | +
|
| 74 | + ``` |
| 75 | + user@ubuntu:~/Desktop/git/connectedhomeip$ source scripts/activate.sh |
| 76 | + ``` |
| 77 | +
|
| 78 | + If the script says the environment is out of date, you can update it by |
| 79 | + running the following command: |
| 80 | +
|
| 81 | + ``` |
| 82 | + user@ubuntu:~/Desktop/git/connectedhomeip$ source scripts/bootstrap.sh |
| 83 | + ``` |
| 84 | +
|
| 85 | +- Step 3: Init NXP SDK(s) |
| 86 | +
|
| 87 | + ``` |
| 88 | + user@ubuntu:~/Desktop/git/connectedhomeip$ third_party/nxp/nxp_matter_support/scripts/update_nxp_sdk.py --platform common |
| 89 | + ``` |
| 90 | +
|
| 91 | +Note: By default, `update_nxp_sdk.py` will try to initialize all NXP SDKs. |
| 92 | +Please run the script with arg `--help` to view all available options. |
| 93 | +
|
| 94 | +## Building |
| 95 | +
|
| 96 | +There are two options for building this reference app: |
| 97 | +
|
| 98 | +- Using `build_examples.py` framework. |
| 99 | +- Manually generating `ninja` files using `gn`. |
| 100 | +
|
| 101 | +For manual generation and building, please see the specific readme file for your |
| 102 | +device. |
| 103 | +
|
| 104 | +A list of all available contact sensor targets can be viewed in the following |
| 105 | +table: |
| 106 | +
|
| 107 | +| target name | description | |
| 108 | +| ---------------------------- | ---------------- | |
| 109 | +| nxp-device-freertos-lock-app | Default lock app | |
| 110 | +
|
| 111 | +where `device` can be one of the [Supported devices](#supported-devices). |
| 112 | +
|
| 113 | +### Data model |
| 114 | +
|
| 115 | +The application uses an NXP specific data model file: |
| 116 | +
|
| 117 | +| path | description | |
| 118 | +| ------------------ | ------------------------------------ | |
| 119 | +| `zap/lock-app.zap` | Data model for Door Lock device type | |
| 120 | +
|
| 121 | +The data model can be changed by simply replacing the gn `deps` statement |
| 122 | +corresponding to data model target. |
| 123 | +
|
| 124 | +### Manufacturing data |
| 125 | +
|
| 126 | +Use `chip_with_factory_data=1` in the gn build command to enable factory data. |
| 127 | +
|
| 128 | +For a full guide on manufacturing flow, please see |
| 129 | +[Guide for writing manufacturing data on NXP devices](../../../docs/guides/nxp/nxp_manufacturing_flow.md). |
| 130 | +
|
| 131 | +## Flashing and debugging |
| 132 | +
|
| 133 | +Please see the device specific readme file. |
0 commit comments