|
| 1 | +.. _bt_mesh_prop_readme: |
| 2 | + |
| 3 | +Generic Property models |
| 4 | +####################### |
| 5 | + |
| 6 | +The Generic Property models allow remote access to the Device Properties of a |
| 7 | +mesh node. Read more about device properties in |
| 8 | +:ref:`bt_mesh_properties_readme`. |
| 9 | + |
| 10 | +There Generic Property models fall into two categories: |
| 11 | + |
| 12 | +- :ref:`bt_mesh_prop_srv_readme` |
| 13 | +- :ref:`bt_mesh_prop_cli_readme` |
| 14 | + |
| 15 | +Configuration |
| 16 | +============== |
| 17 | + |
| 18 | +There are two configuration parameters associated with the Generic Property |
| 19 | +models: |
| 20 | + |
| 21 | +- :option:`CONFIG_BT_MESH_PROP_MAXSIZE`: The largest available property value. |
| 22 | +- :option:`CONFIG_BT_MESH_PROP_MAXCOUNT`: The largest number of properties |
| 23 | + available on a single Generic Property Server. |
| 24 | + |
| 25 | +.. _bt_mesh_prop_srv_readme: |
| 26 | + |
| 27 | +Generic Property Servers |
| 28 | +======================== |
| 29 | + |
| 30 | +A Generic Property Server holds a list of Device Properties. |
| 31 | +There are four different property servers: |
| 32 | + |
| 33 | +- **Generic Manufacturer Property Server**: Provides access to Manufacturer |
| 34 | + properties, which are read-only properties set by the device manufacturer. |
| 35 | +- **Generic Admin Property Server**: Provides access to Admin properties, which |
| 36 | + can be read and written to. |
| 37 | +- **Generic User Property Server**: Provides access to both Admin and |
| 38 | + Manufacturer properties on its element, but only if the Property owner allows |
| 39 | + it. |
| 40 | +- **Generic Client Property Server**: Provides a list of all properties |
| 41 | + supported by the Generic Property Client on the same element. The Client |
| 42 | + Property Server does not actually own any properties, and does not need the |
| 43 | + user to provide access to any property values. |
| 44 | + |
| 45 | +Typically, only the administrator of the mesh network should have access to the |
| 46 | +Admin or Manufacturer servers, all other mesh nodes should operate on the User |
| 47 | +server. The Manufacturer and Admin servers may change the User property access |
| 48 | +rights for each individual Property it owns at runtime. |
| 49 | + |
| 50 | +The Manufacturer and Admin Servers must provide a list of all Properties they |
| 51 | +own in the initialization of the model. Access to the property values should be |
| 52 | +provided through the server getter (:cpp:member:`bt_mesh_prop_srv::get`) and |
| 53 | +setter (:cpp:member:`bt_mesh_prop_srv::set`) callbacks. |
| 54 | + |
| 55 | +The User Property server does not own any properties, but relies on Admin and |
| 56 | +Manufacturer servers on the same element to provide access to theirs. An |
| 57 | +element with a User Property Server and no Admin or Manufacturer Servers is |
| 58 | +useless. |
| 59 | + |
| 60 | +The model keeps the user access field of each Admin and Manufacturer property |
| 61 | +in persistent storage. The property values themselves have to be stored by the |
| 62 | +application. |
| 63 | + |
| 64 | +The set of Property IDs and their order cannot be changed. |
| 65 | + |
| 66 | +States |
| 67 | +******* |
| 68 | + |
| 69 | +**Device Properties**: :cpp:type:`bt_mesh_prop` |
| 70 | + |
| 71 | +A single server may own several Device Properties, which are accessed by their |
| 72 | +Property ID. Each Property holds a value and a user access parameter, which |
| 73 | +controls the Property's availability to a Generic User Property Server on the |
| 74 | +same element. |
| 75 | + |
| 76 | +The Device properties have slightly different access restrictions depending on |
| 77 | +the type of server that owns them: |
| 78 | + |
| 79 | +- **Manufacturer Property**: The value can only be read. |
| 80 | +- **Admin Property**: The value can be read and written. |
| 81 | +- **Client Property**: Has no associated value, and is only a listing of the |
| 82 | + property IDs supported by the accompanying Generic Property Client. |
| 83 | + |
| 84 | +Extended models |
| 85 | +**************** |
| 86 | + |
| 87 | +The Generic Admin Property Server and Generic Manufacturer Property Server both |
| 88 | +extend the Generic User Property Server. As a consequence, a single element can |
| 89 | +only hold one Generic Manufacturer or Generic Admin Property Server. |
| 90 | + |
| 91 | +Persistent storage |
| 92 | +******************* |
| 93 | + |
| 94 | +The Generic Manufacturer Property Server and Generic Admin Property Server |
| 95 | +models will store changes to the user access rights of their properties. |
| 96 | +Any permanent changes to the property values themselves should be stored |
| 97 | +manually by the application. |
| 98 | + |
| 99 | +API documentation |
| 100 | +****************** |
| 101 | + |
| 102 | +| Header file: :file:`include/bluetooth/mesh/gen_prop_srv.h` |
| 103 | +| Source file: :file:`subsys/bluetooth/mesh/gen_prop_srv.c` |
| 104 | +
|
| 105 | +.. doxygengroup:: bt_mesh_prop_srv |
| 106 | + :project: nrf |
| 107 | + :members: |
| 108 | + |
| 109 | +---- |
| 110 | + |
| 111 | +.. _bt_mesh_prop_cli_readme: |
| 112 | + |
| 113 | +Generic Property Client |
| 114 | +======================= |
| 115 | + |
| 116 | +The Generic Property Client model can access properties from a Property Server |
| 117 | +remotely. The Property Client can talk directly to all types of Property |
| 118 | +Servers, but only if it shares an application key with the target server. |
| 119 | + |
| 120 | +Generally, the Property Client should only target User Property Servers, unless |
| 121 | +it is part of some network administrator node that is responsible for |
| 122 | +configuring the other mesh nodes. |
| 123 | + |
| 124 | +To ease configuration, the Property Client can be paired with a Client Property |
| 125 | +Server that lists which properties this Client will request. |
| 126 | + |
| 127 | +Extended models |
| 128 | +**************** |
| 129 | + |
| 130 | +None. |
| 131 | + |
| 132 | +API documentation |
| 133 | +****************** |
| 134 | + |
| 135 | +| Header file: :file:`include/bluetooth/mesh/gen_prop_cli.h` |
| 136 | +| Source file: :file:`subsys/bluetooth/mesh/gen_prop_cli.c` |
| 137 | +
|
| 138 | +.. doxygengroup:: bt_mesh_prop_cli |
| 139 | + :project: nrf |
| 140 | + :members: |
| 141 | + |
| 142 | +---- |
| 143 | + |
| 144 | +Common types |
| 145 | +============= |
| 146 | + |
| 147 | +| Header file: :file:`include/bluetooth/mesh/gen_prop.h` |
| 148 | +
|
| 149 | +.. doxygenfile:: gen_prop.h |
| 150 | + :project: nrf |
0 commit comments