You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to change the Bluetooth name, but I have tried many ways and cannot change the Bluetooth name,
May I ask how to allow users to customize BLE names? Additionally, I noticed that there is a 16 byte limit. Does this 16 byte limit require subtracting 4 bytes from the description code?
Do you want to change the BLE advertisement name, you can add as below in the file :
memset(advData, 0, sizeof(advData));
advData[index++] = 0x02; // length
advData[index++] = CHIP_ADV_DATA_TYPE_FLAGS; // AD type : flags
advData[index++] = CHIP_ADV_DATA_FLAGS; // AD value
advData[index++] = 0x04; // length
advData[index++] = 0x9; // AD type : flags
advData[index++] = 'T'; // AD value
advData[index++] = 'S'; // AD value
advData[index++] = 'T'; // AD value
advData[index++] = kServiceDataTypeSize + sizeof(ESP32ChipServiceData); // length
advData[index++] = CHIP_ADV_DATA_TYPE_SERVICE_DATA; // AD type: (Service Data - 16-bit UUID)
advData[index++] = static_cast<uint8_t>(ShortUUID_CHIPoBLEService.value & 0xFF); // AD value
advData[index++] = static_cast<uint8_t>((ShortUUID_CHIPoBLEService.value >> 8) & 0xFF); // AD value
I want to change the Bluetooth name, but I have tried many ways and cannot change the Bluetooth name,
May I ask how to allow users to customize BLE names? Additionally, I noticed that there is a 16 byte limit. Does this 16 byte limit require subtracting 4 bytes from the description code?
Method 1:
Change and set in menuconfig
Method 2:
void SetBLEDeviceName(void)
{
const char *deviceName = "Xz_NC";
chip::DeviceLayer::ConnectivityMgr().SetBLEDeviceName(deviceName);
}
Method 3:
#define CHIP_DEVICE_CONFIG_BLE_DEVICE_NAME_PREFIX “81MtCn01”
The text was updated successfully, but these errors were encountered: