Skip to content

Commit 75314d6

Browse files
committed
Address review comments
1 parent df29dc9 commit 75314d6

8 files changed

+102
-110
lines changed

docs/guides/fabric_synchronization_guide.md

+18-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,24 @@
66

77
## Fabric Sync Example Applications
88

9-
Fabric-Admin and Fabric-Bridge applications are provided to demonstrate Fabric
10-
Synchronization feature. You can find them in the examples.
9+
Fabric-Admin and Fabric-Bridge example applications are provided to demonstrate
10+
Fabric Synchronization feature. You can find them in the examples.
11+
12+
![matter_fabric_synchronization](images/matter_fabric_synchronization.png)
13+
14+
Fabric-Admin example app implements the Fabric Administrator role and
15+
communicate with the Fabric-Bridge-App on the other side, facilitating the
16+
Fabric Synchronization process.
17+
18+
Fabric-Bridge-App example app implements the Aggregator device type with Fabric
19+
Synchronization condition met and demonstrates the end-to-end Fabric
20+
Synchronization feature using dynamic endpoints.
21+
22+
Fabric Synchronization can be triggered from either side. The initiator of the
23+
Fabric Synchronization process, who shares their devices, takes on the
24+
Commissioner role. The recipient of the Fabric Synchronization request, who
25+
receives the shared devices, assumes the Commissionee role. This flexibility
26+
enables a seamless and efficient synchronization process.
1127

1228
### Building the Example Application
1329

Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/bash
2+
3+
# Default paths
4+
FABRIC_ADMIN_PATH="./fabric-admin"
5+
FABRIC_ADMIN_LOG="/tmp/fabric_admin.log"
6+
7+
# Detect platform and set default paths
8+
if [[ $(uname -m) == "x86_64" ]]; then
9+
FABRIC_ADMIN_PATH="out/debug/standalone/fabric-admin"
10+
fi
11+
12+
# Check if --verbose option is specified
13+
VERBOSE=false
14+
for arg in "$@"; do
15+
if [ "$arg" == "--verbose" ]; then
16+
VERBOSE=true
17+
break
18+
fi
19+
done
20+
21+
# Kill fabric-admin if it is running
22+
echo "Checking for running fabric-admin process..."
23+
fabric_admin_pid=$(pgrep -f "$FABRIC_ADMIN_PATH")
24+
if [ ! -z "$fabric_admin_pid" ]; then
25+
echo "Found fabric-admin with PID $fabric_admin_pid, attempting to kill..."
26+
kill -9 "$fabric_admin_pid"
27+
echo "Killed fabric-admin with PID $fabric_admin_pid"
28+
fi
29+
30+
# Remove /tmp/chip_* files and directories
31+
echo "Removing /tmp/chip_* files and directories..."
32+
sudo rm -rf /tmp/chip_*
33+
echo "Removed /tmp/chip_* files and directories"
34+
35+
# Start fabric-admin with or without log file path based on --verbose option
36+
echo "Starting fabric-admin..."
37+
if [ "$VERBOSE" = true ]; then
38+
"$FABRIC_ADMIN_PATH"
39+
else
40+
"$FABRIC_ADMIN_PATH" --log-file-path "$FABRIC_ADMIN_LOG"
41+
fi

examples/fabric-admin/scripts/run_fabric_sink_rp4.sh

-28
This file was deleted.

examples/fabric-admin/scripts/run_fabric_sink_x86.sh

-28
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/bash
2+
3+
# Default paths
4+
FABRIC_ADMIN_PATH="./fabric-admin"
5+
FABRIC_BRIDGE_APP_PATH="./fabric-bridge-app"
6+
FABRIC_ADMIN_LOG="/tmp/fabric_admin.log"
7+
FABRIC_BRIDGE_APP_LOG="/tmp/fabric_bridge_app.log"
8+
BLE_ADAPTER=""
9+
10+
# Detect platform and set default paths
11+
PLATFORM=$(uname -m)
12+
if [[ "$PLATFORM" == "x86_64" ]]; then
13+
FABRIC_ADMIN_PATH="out/debug/standalone/fabric-admin"
14+
FABRIC_BRIDGE_APP_PATH="out/debug/standalone/fabric-bridge-app"
15+
elif [[ "$PLATFORM" == "armv7l" ]]; then
16+
# Assuming armv7l is RP4
17+
BLE_ADAPTER="--ble-adapter 0"
18+
fi
19+
20+
# Check if --verbose option is specified
21+
VERBOSE=false
22+
for arg in "$@"; do
23+
if [ "$arg" == "--verbose" ]; then
24+
VERBOSE=true
25+
break
26+
fi
27+
done
28+
29+
# Stop any running instances and clean up
30+
./stop_fabric_source.sh
31+
32+
# Start fabric-bridge-app if available and redirect its output to /dev/null
33+
if [ -f "$FABRIC_BRIDGE_APP_PATH" ]; then
34+
"$FABRIC_BRIDGE_APP_PATH" >"$FABRIC_BRIDGE_APP_LOG" 2>&1 &
35+
echo "Started fabric-bridge-app"
36+
fi
37+
38+
# Start fabric-admin with or without log file path based on --verbose option
39+
if [ "$VERBOSE" = true ]; then
40+
"$FABRIC_ADMIN_PATH" $BLE_ADAPTER
41+
else
42+
"$FABRIC_ADMIN_PATH" $BLE_ADAPTER --log-file-path "$FABRIC_ADMIN_LOG"
43+
fi

examples/fabric-admin/scripts/run_fabric_source_rp4.sh

-26
This file was deleted.

examples/fabric-admin/scripts/run_fabric_source_x86.sh

-26
This file was deleted.

0 commit comments

Comments
 (0)