Skip to content

Commit 9554f32

Browse files
author
Unify Automated
committed
Release ver_1.0.2
1 parent 9294d3b commit 9554f32

File tree

6,865 files changed

+169152
-114262
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

6,865 files changed

+169152
-114262
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"cheshirekow.cmake-format",
2626
"xaver.clang-format"
2727
],
28-
"postStartCommand": "Xvfb &",
2928
"containerUser": "root",
3029
"remoteUser": "user",
3130
"updateRemoteUserUID": true,
@@ -47,8 +46,7 @@
4746
// "source=/opt/super,target=/opt/super,type=bind,consistency=cached",
4847
],
4948
"remoteEnv": {
50-
"DISPLAY":":0"
5149
// Uncomment when building ZigPC to specify Gecko SDK path in the container
5250
// "GSDK_LOCATION": "/opt/super"
53-
},
51+
}
5452
}

CMakeLists.txt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,23 @@ include(cmake/include/doxygen.cmake)
2727
include(cmake/include/package.cmake)
2828
include(cmake/include/uic_helper.cmake)
2929

30-
3130
enable_language(Rust)
3231
include(CMakeCargo)
3332
# ##############################################################################
3433
# Global includes
3534
# ##############################################################################
3635
include_directories(include ${CMAKE_CURRENT_BINARY_DIR}/include)
3736

38-
add_custom_target(sl_status_strings
39-
SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/include/sl_status.h ${CMAKE_CURRENT_SOURCE_DIR}/scripts/sl_status_strings.sh
40-
BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/include/sl_status_strings.h
41-
COMMAND bash ${CMAKE_CURRENT_SOURCE_DIR}/scripts/sl_status_strings.sh > ${CMAKE_CURRENT_BINARY_DIR}/include/sl_status_strings.h)
37+
add_custom_command(
38+
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/sl_status_strings.h
39+
COMMAND bash ${CMAKE_CURRENT_SOURCE_DIR}/scripts/sl_status_strings.sh >
40+
${CMAKE_CURRENT_BINARY_DIR}/include/sl_status_strings.h
41+
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/include/sl_status.h
42+
${CMAKE_CURRENT_SOURCE_DIR}/scripts/sl_status_strings.sh)
43+
add_custom_target(
44+
sl_status_strings
45+
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/include/sl_status_strings.h)
46+
4247
# ##############################################################################
4348
# Subdirectories
4449
# ##############################################################################

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ members = [
44
"applications/upvl",
55
"applications/angel",
66
"applications/image_provider",
7-
"applications/zpc/components/zwave_command_classes",
7+
"applications/zpc/components/zwave_rust/rust_command_classes",
88
"applications/zpc/components/zwave_rust/zwave_rust_proc_macros",
99
"applications/zpc/components/zwave_rust/zwave_controller",
1010
"applications/zpc/components/zwave_rust/zwave_tx",

README.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Unify SDK Overview
22

3-
Latest version of the Unify SDK Overview is available online
3+
Latest released version of the Unify SDK Overview is available online
44
[here](https://siliconlabs.github.io/UnifySDK/userguide/html/index.html).
55

66
The Unify SDK provides software source and binary packages for Raspberry Pi 4 to
@@ -13,7 +13,7 @@ The detailed architecture of the Unify SDK is discussed in the Unify SDK Specifi
1313

1414
The Unify SDK uses Unify SDK library to decouple API modules from the PHY drivers.
1515
This facilitates code reuse and enables easily adding new
16-
high-level APIs without the need to modify the PHY drivers.
16+
high-level APIs without the need to modify the PHY drivers.
1717
The library provides a number of components that simplify the task of writing a PHY driver
1818
also known as a Protocol Controller.
1919

@@ -66,12 +66,12 @@ The Unify MQTT clients can be grouped into several applications:
6666

6767
- Z-Wave Protocol controller (ZPC)
6868
- Zigbee Protocol Controller (ZigPC)
69-
- Unify SDk Smart Start Provisioning list (UPVL)
70-
- Unify SDK Multicast Group Manager (ANGLE)
69+
- Unify SDK SmartStart Provisioning list (UPVL)
70+
- Unify SDK Group Manager (ANGEL)
7171
- Unify SDK OTA Image Provider (Image Provider)
7272
- IoT Services (i.e., DEV GUI)
7373

74-
![SDK Overview](doc/assets/img/SDKOverview.svg)
74+
![SDK Overview](doc/assets/img/SDKOverview.png)
7575

7676
The Unify SDK was previously known as Unified IoT Controller or UIC for short.
7777
The old name can still be found in some parts of the SDK.
@@ -96,8 +96,8 @@ implementation details can be found in the user guide for each protocol controll
9696

9797
#### The Unified SDK Provisioning List (UPVL)
9898

99-
[The UPVL](applications/upvl/readme_user.md) serves the Smart Start Provisioning
100-
list to perform Smart Start Security 2 (S2) inclusions and maintains the ucl/SmartStart MQTT topic.
99+
[The UPVL](applications/upvl/readme_user.md) serves the SmartStart Provisioning
100+
list to perform SmartStart Security 2 (S2) inclusions and maintains the ucl/SmartStart MQTT topic.
101101

102102
#### The Unify SDK Group Manager (ANGEL)
103103

@@ -382,15 +382,15 @@ using [Valgrind](https://valgrind.org/) on a i686 architecture, compiled without
382382
debugging information.
383383

384384

385-
| Component | Flash | RAM |
386-
|-------------------|---------|-------------------------|
387-
| libuic | 4085 kb | NA |
388-
| uic-zigpc | 1880 kb | 1900 kb + 8 kb pr node |
389-
| uic-zpc | 5888 kb | 1500 kb + 8 kb pr node |
390-
| uic-angel | 3220 kb | 1000 kb |
391-
| uic-image-provider| 3281 kb | 1000 kb |
392-
| uic-upvl | 3339 kb | 1000 kb |
393-
| uic-dev-gui | 95 MB | 1000 kb |
385+
| Component | Flash | RAM |
386+
| ------------------ | ------- | ---------------------- |
387+
| libuic | 4085 kb | NA |
388+
| uic-zigpc | 1880 kb | 1900 kb + 8 kb pr node |
389+
| uic-zpc | 5888 kb | 1500 kb + 8 kb pr node |
390+
| uic-angel | 3220 kb | 1000 kb |
391+
| uic-image-provider | 3281 kb | 1000 kb |
392+
| uic-upvl | 3339 kb | 1000 kb |
393+
| uic-dev-gui | 95 MB | 1000 kb |
394394

395395
The SDK depends on the following debian packages:
396396

@@ -414,14 +414,14 @@ files should be used for reference. It is very important that all the Unify
414414
components runs as a dedicated system user to prevent attackers from
415415
compromising the entire system. Also note that most components need write
416416
access to parts of the filesystem. The default path for writing files is
417-
`/var/lib/uic`.
417+
`/var/lib/uic`.
418418
## FAQ
419419
* *How can I see if the Unify components are running?*<br>
420420
Unify applications are running as Linux `systemd` services. To get a status overview of all installed Unify components, run the following command:<br>
421421
```sh
422422
systemctl status `ls /lib/systemd/system/uic-*.service | xargs -n 1 basename`
423423
```
424-
The output of this command will tell if the service is loaded and/or is active:
424+
The output of this command will tell if the service is loaded and/or is active:
425425
```sh
426426
● uic-dev-gui-api.service - Unify User Interface API
427427
Loaded: loaded (/lib/systemd/system/uic-dev-gui-api.service; enabled; vendor preset: enabled)
@@ -431,7 +431,7 @@ The output of this command will tell if the service is loaded and/or is active:
431431
Logging is collected via Linux `systemd`. In the terminal `journalctl` is able to print the collected logs from all Unify components. Getting the log of, for instance `uic-upvl`, is done via command:
432432
```sh
433433
journalctl -u uic-upvl
434-
```
434+
```
435435
* *How do I clear Unify caches and databases?*<br>
436436
Execute the following command in a terminal on the Unify gateway:
437437
```sh
@@ -453,7 +453,7 @@ cat /etc/uic/uic.cfg
453453
```
454454
It outputs the configured rf_region:
455455
```bash
456-
pi@raspberrypi:/etc/uic $ cat uic.cfg
456+
pi@raspberrypi:/etc/uic $ cat uic.cfg
457457
zpc:
458458
serial: /dev/ttyUSB0
459459
rf_region: US
@@ -477,9 +477,9 @@ run:
477477
```
478478
Replace the serial argument with the port the Z-Wave controller is connected to.
479479
* *I have an old Z-Wave device, is it still supported?*<br>
480-
Yes. However, older devices may be inconsistent in reporting their actual state. This usually means that operating the same command for a second time, the state get updated correctly.
480+
Yes. However, older devices may be inconsistent in reporting their actual state. This usually means that operating the same command for a second time, the state get updated correctly.
481481
* *Can I get detailed diagnostics about devices, its clusters and the network?*<br>
482-
Using application [`mqtt explorer`](http://mqtt-explorer.com) can give more insights in your Unify network.
482+
Using application [`mqtt explorer`](http://mqtt-explorer.com) can give more insights in your Unify network.
483483
* *How do I determine the root cause for my failed firmware update?*<br>
484484
The lastError field in the OTA tab of the dev_gui is giving a rough error code. The logging of the uic-zpc usually gives a more detailed explanation of the reason why a firmware update is not accepted.
485485
* *My device shows up with more clusters than expected!*<br>
@@ -525,8 +525,8 @@ the MSLA applicable to Source Code.
525525
| Editline | for console UI | <https://sourceforge.net/projects/libedit/> | BSD |
526526
| Sqlite | for persistent storage | <https://www.sqlite.org/copyright.html> | public domain |
527527
| Boost | logging, data structures, config files and json | <https://www.boost.org/LICENSE_1_0.txt> | Boost |
528+
| nlohmann/json | json | <https://github.com/nlohmann/> | MIT |
528529
| CMock | Unittest | <https://github.com/ThrowTheSwitch/CMock/blob/master/LICENSE.txt> | |
529530
| Unity | Unittest | <https://github.com/ThrowTheSwitch/Unity/blob/master/LICENSE.txt> | |
530531
| React | User interface | <https://github.com/facebook/react/blob/master/LICENSE> | MIT |
531532
| React License | User interface | <https://github.com/react-icons/react-icons/blob/master/packages/react-icons/LICENSE> | Misc *TBD* |
532-

applications/angel/.cargo/config

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11

22
# ANGEL Release Notes
33

4+
## [1.0.2] - Oct 2021
5+
### Fixed
6+
* Fixed to publish group capabilities correctly
7+
48
## Known Bugs

applications/angel/src/cache.rs

Lines changed: 58 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use std::collections::BTreeMap;
1414
use std::iter::FromIterator;
1515
use std::{collections::HashSet, vec};
16-
use uic_log::log_warning;
16+
use uic_log::log_debug;
1717

1818
#[derive(Clone, Debug, PartialEq)]
1919
pub struct EntryChanged {
@@ -70,13 +70,13 @@ impl Cache {
7070
if let Some(cached_group) = self.groups_for_endpoints.get(&key) {
7171
for group in cached_group {
7272
if !groups.contains(group) {
73-
to_be_removed.push(group.clone());
73+
to_be_removed.push(*group);
7474
}
7575
}
7676

7777
for group in groups {
7878
if !cached_group.contains(group) {
79-
to_be_added.push(group.clone());
79+
to_be_added.push(*group);
8080
}
8181
}
8282
} else {
@@ -100,9 +100,9 @@ impl Cache {
100100
}
101101

102102
if let Some(groups) = self.groups_for_endpoints.get(&(unid.to_string(), endpoint)) {
103-
return Vec::from_iter(groups.clone());
103+
Vec::from_iter(groups.clone())
104104
} else {
105-
return Vec::new();
105+
Vec::new()
106106
}
107107
}
108108

@@ -148,7 +148,7 @@ impl Cache {
148148
let mut reverse_lookup: BTreeMap<u16, BTreeMap<String, Vec<u16>>> = BTreeMap::new();
149149
for (k, v) in &self.groups_for_endpoints {
150150
for group in v {
151-
if let Some(unid_list) = reverse_lookup.get_mut(&group) {
151+
if let Some(unid_list) = reverse_lookup.get_mut(group) {
152152
if let Some(ep_list) = unid_list.get_mut(&k.0) {
153153
ep_list.push(k.1);
154154
} else {
@@ -157,7 +157,7 @@ impl Cache {
157157
} else {
158158
let mut map = BTreeMap::new();
159159
map.insert(k.0.to_owned(), vec![k.1]);
160-
reverse_lookup.insert(group.clone(), map);
160+
reverse_lookup.insert(*group, map);
161161
}
162162
}
163163
}
@@ -170,10 +170,10 @@ impl Cache {
170170
/// or when the new name == the old name
171171
pub fn update_group_name(&mut self, groupid: u16, name: &str) -> bool {
172172
if self.get_group_name(groupid).is_some() && name.is_empty() {
173-
log_warning(
173+
log_debug(
174174
"cache",
175175
format!(
176-
"omitting groupname update of group {} because of an empty string.",
176+
"Group Name is empty for Group ID {}. Omitting Group Name update",
177177
self.group_names.get(&groupid).unwrap()
178178
),
179179
);
@@ -188,6 +188,10 @@ impl Cache {
188188
self.group_names.get(&groupid).map(|s| s.into())
189189
}
190190

191+
pub fn remove_group_name(&mut self, groupid: u16) {
192+
self.group_names.remove(&groupid);
193+
}
194+
191195
/// Update the list of supported-commands, per cluster, for the given endpoint.
192196
pub fn set_endpoint_cluster_supported_commands(
193197
&mut self,
@@ -197,7 +201,7 @@ impl Cache {
197201
) {
198202
let endpoint = self
199203
.supported_commands_for_endpoints
200-
.entry(key.clone())
204+
.entry(key)
201205
.or_insert(BTreeMap::new());
202206
endpoint.insert(cluster_name.to_string(), commands);
203207
}
@@ -213,7 +217,7 @@ impl Cache {
213217
return Some(cluster_commands.clone());
214218
}
215219
}
216-
return None;
220+
None
217221
}
218222

219223
/// Get the list of endpoints that belong to group.
@@ -222,12 +226,47 @@ impl Cache {
222226
let mut return_vec: Vec<(String, u16)> = Vec::new();
223227
for (unid, eps) in unid_list {
224228
for ep in eps {
225-
return_vec.push((unid.clone(), ep.clone()));
229+
return_vec.push((unid.clone(), *ep));
230+
}
231+
}
232+
return Some(return_vec);
233+
}
234+
None
235+
}
236+
237+
/// Get the list of commands supported by group per clusters.
238+
pub fn get_group_supported_commands_per_cluster(
239+
&self,
240+
group_id: &u16, // ep: (String, u16),
241+
) -> Option<BTreeMap<String, HashSet<String>>> {
242+
if let Some(eps) = self.get_endpoints_for_group(group_id) {
243+
return self.get_endpoints_supported_commands_per_cluster(eps);
244+
}
245+
None
246+
}
247+
248+
/// Get the list of commands supported by endpoint per clusters.
249+
pub fn get_endpoints_supported_commands_per_cluster(
250+
&self,
251+
end_points: Vec<(String, u16)>,
252+
) -> Option<BTreeMap<String, HashSet<String>>> {
253+
let mut return_vec: BTreeMap<String, HashSet<String>> = BTreeMap::new();
254+
if !end_points.is_empty() {
255+
for ep in end_points {
256+
if let Some(ep_cluster_commands) = self.supported_commands_for_endpoints.get(&ep) {
257+
for (cluster, commands) in ep_cluster_commands.iter() {
258+
let cluster_commands = return_vec
259+
.entry(cluster.to_string())
260+
.or_insert(HashSet::new());
261+
for command in commands.iter() {
262+
cluster_commands.insert(command.to_string());
263+
}
264+
}
226265
}
227266
}
228267
return Some(return_vec);
229268
}
230-
return None;
269+
None
231270
}
232271
}
233272

@@ -241,35 +280,35 @@ mod tests {
241280
unid: unid.to_string(),
242281
endpoints: ep,
243282
};
244-
changes.iter().find(|&x| x == &entr).is_some()
283+
changes.iter().any(|x| x == &entr)
245284
}
246285

247286
#[test]
248287
fn set_groups_for_nodes_test() {
249288
let mut cache = Cache::new();
250-
let changes = cache.set_group_list_for_node("zw-1235", 0, &vec![3, 4, 5]);
289+
let changes = cache.set_group_list_for_node("zw-1235", 0, &[3, 4, 5]);
251290
assert_eq!(changes.len(), 3);
252291
assert!(change_contains(&changes, "zw-1235", 3, vec![0]));
253292
assert!(change_contains(&changes, "zw-1235", 4, vec![0]));
254293
assert!(change_contains(&changes, "zw-1235", 5, vec![0]));
255294

256295
// no data change equals no update
257-
let changes = cache.set_group_list_for_node("zw-1235", 0, &vec![3, 4, 5]);
296+
let changes = cache.set_group_list_for_node("zw-1235", 0, &[3, 4, 5]);
258297
assert_eq!(changes.len(), 0);
259298

260299
// remove group 5
261-
let changes = cache.set_group_list_for_node("zw-1235", 0, &vec![3, 4]);
300+
let changes = cache.set_group_list_for_node("zw-1235", 0, &[3, 4]);
262301
assert_eq!(changes.len(), 1);
263302
assert!(change_contains(&changes, "zw-1235", 5, vec![]));
264303

265304
// add different unid doesnt effect result
266-
let changes = cache.set_group_list_for_node("aa-000", 0, &vec![0, 3]);
305+
let changes = cache.set_group_list_for_node("aa-000", 0, &[0, 3]);
267306
assert_eq!(changes.len(), 2);
268307
assert!(change_contains(&changes, "aa-000", 0, vec![0]));
269308
assert!(change_contains(&changes, "aa-000", 3, vec![0]));
270309

271310
// add extra end-point
272-
let changes = cache.set_group_list_for_node("zw-1235", 2, &vec![3, 66]);
311+
let changes = cache.set_group_list_for_node("zw-1235", 2, &[3, 66]);
273312
assert_eq!(changes.len(), 2);
274313
assert!(change_contains(&changes, "zw-1235", 3, vec![0, 2]));
275314
assert!(change_contains(&changes, "zw-1235", 66, vec![2]));

0 commit comments

Comments
 (0)