Skip to content

Matter bluedroid #280

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ components/esp32-camera/
components/esp_littlefs/
components/esp-rainmaker/
components/espressif__esp-dsp/
components/espressif__esp_matter/
components/esp-insights/
components/arduino_tinyusb/tinyusb/
components/tflite-micro/
Expand Down
2 changes: 1 addition & 1 deletion configs/defconfig.common
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ CONFIG_MBEDTLS_DYNAMIC_FREE_CONFIG_DATA=y
# Matter Settings
#
# Disable Matter BLE
CONFIG_ENABLE_CHIPOBLE=n
CONFIG_ENABLE_CHIPOBLE=y
CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING=n
# ESP Insights
CONFIG_ENABLE_ESP_INSIGHTS_TRACE=n
Expand Down
10 changes: 5 additions & 5 deletions main/idf_component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ dependencies:
version: ">=1.4.2"
rules:
- if: "target in [esp32s3]"
espressif/esp_matter:
version: "^1.3.0"
require: public
rules:
- if: "target not in [esp32c2, esp32h2, esp32p4]"
# espressif/esp_matter:
# version: "^1.3.0"
# require: public
# rules:
# - if: "target not in [esp32c2, esp32h2, esp32p4]"
35 changes: 35 additions & 0 deletions patches/matter_chip_ChipDeviceScanner.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@@ -31,22 +31,19 @@
bool BluedroidGetChipDeviceInfo(esp_ble_gap_cb_param_t & scan_result, chip::Ble::ChipBLEDeviceIdentificationInfo & deviceInfo)
{
// Check for CHIP Service UUID
- if (scan_result.scan_rst.ble_adv != NULL)
+ if (scan_result.scan_rst.adv_data_len > 13 && scan_result.scan_rst.ble_adv[5] == 0xf6 &&
+ scan_result.scan_rst.ble_adv[6] == 0xff)
{
- if (scan_result.scan_rst.adv_data_len > 13 && scan_result.scan_rst.ble_adv[5] == 0xf6 &&
- scan_result.scan_rst.ble_adv[6] == 0xff)
- {
- deviceInfo.OpCode = scan_result.scan_rst.ble_adv[7];
- deviceInfo.DeviceDiscriminatorAndAdvVersion[0] = scan_result.scan_rst.ble_adv[8];
- deviceInfo.DeviceDiscriminatorAndAdvVersion[1] = scan_result.scan_rst.ble_adv[9];
- // vendor and product Id from adv
- deviceInfo.DeviceVendorId[0] = scan_result.scan_rst.ble_adv[10];
- deviceInfo.DeviceVendorId[1] = scan_result.scan_rst.ble_adv[11];
- deviceInfo.DeviceProductId[0] = scan_result.scan_rst.ble_adv[12];
- deviceInfo.DeviceProductId[1] = scan_result.scan_rst.ble_adv[13];
- deviceInfo.AdditionalDataFlag = scan_result.scan_rst.ble_adv[14];
- return true;
- }
+ deviceInfo.OpCode = scan_result.scan_rst.ble_adv[7];
+ deviceInfo.DeviceDiscriminatorAndAdvVersion[0] = scan_result.scan_rst.ble_adv[8];
+ deviceInfo.DeviceDiscriminatorAndAdvVersion[1] = scan_result.scan_rst.ble_adv[9];
+ // vendor and product Id from adv
+ deviceInfo.DeviceVendorId[0] = scan_result.scan_rst.ble_adv[10];
+ deviceInfo.DeviceVendorId[1] = scan_result.scan_rst.ble_adv[11];
+ deviceInfo.DeviceProductId[0] = scan_result.scan_rst.ble_adv[12];
+ deviceInfo.DeviceProductId[1] = scan_result.scan_rst.ble_adv[13];
+ deviceInfo.AdditionalDataFlag = scan_result.scan_rst.ble_adv[14];
+ return true;
}
return false;
}
36 changes: 36 additions & 0 deletions tools/update-components.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,39 @@ else
git -C "$TINYUSB_REPO_DIR" pull --ff-only
fi
if [ $? -ne 0 ]; then exit 1; fi

echo "Updating Matter v1.3 repository..."
MATTER_REPO_URL="https://github.com/espressif/esp-matter.git"
MATTER_REPO_DIR="$AR_COMPS/espressif__esp_matter"
MATTER_REPO_BRANCH="release/v1.3"
if [ ! -d "$MATTER_REPO_DIR" ]; then
git clone --depth 1 -b "$MATTER_REPO_BRANCH" "$MATTER_REPO_URL" "$MATTER_REPO_DIR"
else
git -C "$MATTER_REPO_DIR" fetch && \
git -C "$MATTER_REPO_DIR" pull --ff-only
fi
if [ $? -ne 0 ]; then exit 1; fi
echo "Updating CHIP v1.3 repository..."
CHIP_REPO_URL="https://github.com/espressif/connectedhomeip.git"
CHIP_REPO_DIR="$MATTER_REPO_DIR/connectedhomeip/connectedhomeip"
CHIP_REPO_BRANCH="v1.3-branch"
if [ -d "$CHIP_REPO_DIR" ]; then
# Check if directory is empty
if [ -z "$(ls -A "$CHIP_REPO_DIR")" ]; then
rm -rf "$CHIP_REPO_DIR"
git clone --depth 1 -b "$CHIP_REPO_BRANCH" "$CHIP_REPO_URL" "$CHIP_REPO_DIR"
if [ $? -ne 0 ]; then exit 1; fi
$CHIP_REPO_DIR/scripts/checkout_submodules.py --platform esp32 --shallow
if [ $? -ne 0 ]; then exit 1; fi
echo "Patching CHIP v1.3 repository..."
CHIP_BAD_FILE="$CHIP_REPO_DIR/src/platform/ESP32/bluedroid/ChipDeviceScanner.cpp"
CHIP_PATCH="$AR_PATCHES/matter_chip_ChipDeviceScanner.diff"
if [ -f "$CHIP_BAD_FILE" ]; then
patch $CHIP_BAD_FILE $CHIP_PATCH
else
echo "Error: $CHIP_BAD_FILE not found. Check the script."
exit 1
fi
fi
fi
echo "Matter v1.3 component is installed and updated."
Loading