Skip to content
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

[ble] update Service Data UUID #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,6 @@ class BluetoothManager {

companion object {
private const val TAG = "chip.BluetoothManager"
private const val CHIP_UUID = "0000FEAF-0000-1000-8000-00805F9B34FB"
private const val CHIP_UUID = "0000FFF6-0000-1000-8000-00805F9B34FB"
}
}
6 changes: 3 additions & 3 deletions src/ble/BleUUID.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
namespace chip {
namespace Ble {

const ChipBleUUID CHIP_BLE_SVC_ID = { { // 0000FEAF-0000-1000-8000-00805F9B34FB
0x00, 0x00, 0xFE, 0xAF, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34,
const ChipBleUUID CHIP_BLE_SVC_ID = { { // 0000FFF6-0000-1000-8000-00805F9B34FB
0x00, 0x00, 0xFF, 0xF6, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34,
0xFB } };

inline static uint8_t HexDigitToInt(const char c)
Expand All @@ -46,7 +46,7 @@ bool UUIDsMatch(const ChipBleUUID * idOne, const ChipBleUUID * idTwo)
return (memcmp(idOne->bytes, idTwo->bytes, 16) == 0);
}

// Convert a string like "0000FEAF-0000-1000-8000-00805F9B34FB" to binary UUID
// Convert a string like "0000FFF6-0000-1000-8000-00805F9B34FB" to binary UUID
bool StringToUUID(const char * str, ChipBleUUID & uuid)
{
constexpr size_t NUM_UUID_NIBBLES = sizeof(uuid.bytes) * 2;
Expand Down
12 changes: 6 additions & 6 deletions src/ble/tests/TestBleUUID.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,45 +38,45 @@ void CheckStringToUUID_ChipUUID(nlTestSuite * inSuite, void * inContext)
{
// Test positive scenario - CHIP Service UUID
ChipBleUUID uuid;
NL_TEST_ASSERT(inSuite, StringToUUID("0000FEAF-0000-1000-8000-00805F9B34FB", uuid));
NL_TEST_ASSERT(inSuite, StringToUUID("0000FFF6-0000-1000-8000-00805F9B34FB", uuid));
NL_TEST_ASSERT(inSuite, UUIDsMatch(&uuid, &CHIP_BLE_SVC_ID));
}

void CheckStringToUUID_ChipUUID_RandomCase(nlTestSuite * inSuite, void * inContext)
{
// Test that letter case doesn't matter
ChipBleUUID uuid;
NL_TEST_ASSERT(inSuite, StringToUUID("0000FeAf-0000-1000-8000-00805f9B34Fb", uuid));
NL_TEST_ASSERT(inSuite, StringToUUID("0000FfF6-0000-1000-8000-00805f9B34Fb", uuid));
NL_TEST_ASSERT(inSuite, UUIDsMatch(&uuid, &CHIP_BLE_SVC_ID));
}

void CheckStringToUUID_ChipUUID_NoSeparators(nlTestSuite * inSuite, void * inContext)
{
// Test that separators don't matter
ChipBleUUID uuid;
NL_TEST_ASSERT(inSuite, StringToUUID("0000FEAF00001000800000805F9B34FB", uuid));
NL_TEST_ASSERT(inSuite, StringToUUID("0000FFF600001000800000805F9B34FB", uuid));
NL_TEST_ASSERT(inSuite, UUIDsMatch(&uuid, &CHIP_BLE_SVC_ID));
}

void CheckStringToUUID_TooLong(nlTestSuite * inSuite, void * inContext)
{
// Test that even one more digit is too much
ChipBleUUID uuid;
NL_TEST_ASSERT(inSuite, !StringToUUID("0000FEAF00001000800000805F9B34FB0", uuid));
NL_TEST_ASSERT(inSuite, !StringToUUID("0000FFF600001000800000805F9B34FB0", uuid));
}

void CheckStringToUUID_TooShort(nlTestSuite * inSuite, void * inContext)
{
// Test that even one less digit is too little
ChipBleUUID uuid;
NL_TEST_ASSERT(inSuite, !StringToUUID("0000FEAF00001000800000805F9B34F", uuid));
NL_TEST_ASSERT(inSuite, !StringToUUID("0000FFF600001000800000805F9B34F", uuid));
}

void CheckStringToUUID_InvalidChar(nlTestSuite * inSuite, void * inContext)
{
// Test that non-hex digits don't pass
ChipBleUUID uuid;
NL_TEST_ASSERT(inSuite, !StringToUUID("0000GEAF-0000-1000-8000-00805F9B34FB0", uuid));
NL_TEST_ASSERT(inSuite, !StringToUUID("0000GFF6-0000-1000-8000-00805F9B34FB0", uuid));
}

// clang-format off
Expand Down
4 changes: 2 additions & 2 deletions src/controller/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ chip-device-ctrl > ble-scan
2021-01-19 02:27:25,151 ChipBLEMgr INFO Discriminator = 1383
2021-01-19 02:27:25,152 ChipBLEMgr INFO Vendor Id = 9050
2021-01-19 02:27:25,152 ChipBLEMgr INFO Product Id = 65279
2021-01-19 02:27:25,155 ChipBLEMgr INFO Adv UUID = 0000feaf-0000-1000-8000-00805f9b34fb
2021-01-19 02:27:25,155 ChipBLEMgr INFO Adv UUID = 0000fff6-0000-1000-8000-00805f9b34fb
2021-01-19 02:27:25,156 ChipBLEMgr INFO Adv Data = 0067055a23fffe
2021-01-19 02:27:27,257 ChipBLEMgr INFO
2021-01-19 02:27:34,213 ChipBLEMgr INFO scanning stopped
Expand Down Expand Up @@ -273,7 +273,7 @@ chip-device-ctrl > ble-scan
2021-01-19 02:27:25,151 ChipBLEMgr INFO Discriminator = 1383
2021-01-19 02:27:25,152 ChipBLEMgr INFO Vendor Id = 9050
2021-01-19 02:27:25,152 ChipBLEMgr INFO Product Id = 65279
2021-01-19 02:27:25,155 ChipBLEMgr INFO Adv UUID = 0000feaf-0000-1000-8000-00805f9b34fb
2021-01-19 02:27:25,155 ChipBLEMgr INFO Adv UUID = 0000fff6-0000-1000-8000-00805f9b34fb
2021-01-19 02:27:25,156 ChipBLEMgr INFO Adv Data = 0067055a23fffe
2021-01-19 02:27:27,257 ChipBLEMgr INFO
2021-01-19 02:27:34,213 ChipBLEMgr INFO scanning stopped
Expand Down
4 changes: 2 additions & 2 deletions src/controller/python/chip/ChipBluezMgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@

from .ChipBleBase import ChipBleBase

chip_service = uuid.UUID("0000FEAF-0000-1000-8000-00805F9B34FB")
chip_service = uuid.UUID("0000FFF6-0000-1000-8000-00805F9B34FB")
chip_tx = uuid.UUID("18EE2EF5-263D-4559-959F-4F9C429F9D11")
chip_rx = uuid.UUID("18EE2EF5-263D-4559-959F-4F9C429F9D12")
chip_service_short = uuid.UUID("0000FEAF-0000-0000-0000-000000000000")
chip_service_short = uuid.UUID("0000FFF6-0000-0000-0000-000000000000")
chromecast_setup_service = uuid.UUID("0000FEA0-0000-1000-8000-00805F9B34FB")
chromecast_setup_service_short = uuid.UUID("0000FEA0-0000-0000-0000-000000000000")

Expand Down
4 changes: 2 additions & 2 deletions src/controller/python/chip/ChipCoreBluetoothMgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@
CBCharacteristicWriteWithResponse = 0
CBCharacteristicWriteWithoutResponse = 1

CHIP_SERVICE = CBUUID.UUIDWithString_(u"0000FEAF-0000-1000-8000-00805F9B34FB")
CHIP_SERVICE_SHORT = CBUUID.UUIDWithString_(u"FEAF")
CHIP_SERVICE = CBUUID.UUIDWithString_(u"0000FFF6-0000-1000-8000-00805F9B34FB")
CHIP_SERVICE_SHORT = CBUUID.UUIDWithString_(u"FFF6")
CHIP_TX = CBUUID.UUIDWithString_(u"18EE2EF5-263D-4559-959F-4F9C429F9D11")
CHIP_RX = CBUUID.UUIDWithString_(u"18EE2EF5-263D-4559-959F-4F9C429F9D12")
CHROMECAST_SETUP_SERVICE = CBUUID.UUIDWithString_(
Expand Down
4 changes: 2 additions & 2 deletions src/platform/EFR32/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ StaticTask_t bluetoothEventTaskStruct;
static TaskHandle_t BluetoothEventTaskHandle;

const uint8_t UUID_CHIPoBLEService[] = { 0xFB, 0x34, 0x9B, 0x5F, 0x80, 0x00, 0x00, 0x80,
0x00, 0x10, 0x00, 0x00, 0xAF, 0xFE, 0x00, 0x00 };
const uint8_t ShortUUID_CHIPoBLEService[] = { 0xAF, 0xFE };
0x00, 0x10, 0x00, 0x00, 0xF6, 0xFF, 0x00, 0x00 };
const uint8_t ShortUUID_CHIPoBLEService[] = { 0xF6, 0xFF };
const ChipBleUUID ChipUUID_CHIPoBLEChar_RX = { { 0x18, 0xEE, 0x2E, 0xF5, 0x26, 0x3D, 0x45, 0x59, 0x95, 0x9F, 0x4F, 0x9C, 0x42, 0x9F,
0x9D, 0x11 } };
const ChipBleUUID ChipUUID_CHIPoBLEChar_TX = { { 0x18, 0xEE, 0x2E, 0xF5, 0x26, 0x3D, 0x45, 0x59, 0x95, 0x9F, 0x4F, 0x9C, 0x42, 0x9F,
Expand Down
2 changes: 1 addition & 1 deletion src/platform/EFR32/gatt.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
</service>

<!--CHIPoBLE-->
<service advertise="false" name="CHIPoBLE" requirement="mandatory" sourceId="custom.type" type="primary" uuid="feaf">
<service advertise="false" name="CHIPoBLE" requirement="mandatory" sourceId="custom.type" type="primary" uuid="fff6">
<informativeText>Custom service</informativeText>

<!--CHIPoBLEChar_Rx-->
Expand Down
6 changes: 3 additions & 3 deletions src/platform/EFR32/gatt_db.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#define GATT_HEADER(F) F
#define GATT_DATA(F) F
GATT_DATA(const uint16_t bg_gattdb_data_uuidtable_16_map[]) = {
0x2800, 0x2801, 0x2803, 0x1800, 0x2a00, 0x2a01, 0x180a, 0x2a29, 0x2a24, 0x2a23, 0xfeaf, 0x1801, 0x2a05, 0x2b2a, 0x2b29, 0x2902,
0x2800, 0x2801, 0x2803, 0x1800, 0x2a00, 0x2a01, 0x180a, 0x2a29, 0x2a24, 0x2a23, 0xfff6, 0x1801, 0x2a05, 0x2b2a, 0x2b29, 0x2902,
};

GATT_DATA(const uint8_t bg_gattdb_data_uuidtable_128_map[]) = {
Expand Down Expand Up @@ -113,8 +113,8 @@ GATT_DATA(const struct bg_gattdb_buffer_with_len bg_gattdb_data_attribute_field_
} };
GATT_DATA(const struct bg_gattdb_buffer_with_len bg_gattdb_data_attribute_field_23) = { .len = 2,
.data = {
0xaf,
0xfe,
0xf6,
0xff,
} };
GATT_DATA(const struct bg_gattdb_attribute_chrvalue bg_gattdb_data_attribute_field_22) = {
.properties = 0x08,
Expand Down
4 changes: 2 additions & 2 deletions src/platform/ESP32/bluedroid/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ const uint8_t UUID_PrimaryService[] = { 0x00, 0x28 };
const uint8_t UUID_CharDecl[] = { 0x03, 0x28 };
const uint8_t UUID_ClientCharConfigDesc[] = { 0x02, 0x29 };
const uint8_t UUID_CHIPoBLEService[] = { 0xFB, 0x34, 0x9B, 0x5F, 0x80, 0x00, 0x00, 0x80,
0x00, 0x10, 0x00, 0x00, 0xAF, 0xFE, 0x00, 0x00 };
const uint8_t ShortUUID_CHIPoBLEService[] = { 0xAF, 0xFE };
0x00, 0x10, 0x00, 0x00, 0xF6, 0xFF, 0x00, 0x00 };
const uint8_t ShortUUID_CHIPoBLEService[] = { 0xF6, 0xFF };
const uint8_t UUID_CHIPoBLEChar_RX[] = { 0x11, 0x9D, 0x9F, 0x42, 0x9C, 0x4F, 0x9F, 0x95,
0x59, 0x45, 0x3D, 0x26, 0xF5, 0x2E, 0xEE, 0x18 };
const uint8_t UUID_CHIPoBLEChar_TX[] = { 0x12, 0x9D, 0x9F, 0x42, 0x9C, 0x4F, 0x9F, 0x95,
Expand Down
4 changes: 2 additions & 2 deletions src/platform/ESP32/nimble/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ struct ESP32ChipServiceData
};

const ble_uuid128_t UUID_CHIPoBLEService = {
BLE_UUID_TYPE_128, { 0xFB, 0x34, 0x9B, 0x5F, 0x80, 0x00, 0x00, 0x80, 0x00, 0x10, 0x00, 0x00, 0xAF, 0xFE, 0x00, 0x00 }
BLE_UUID_TYPE_128, { 0xFB, 0x34, 0x9B, 0x5F, 0x80, 0x00, 0x00, 0x80, 0x00, 0x10, 0x00, 0x00, 0xF6, 0xFF, 0x00, 0x00 }
};
const ble_uuid16_t ShortUUID_CHIPoBLEService = { BLE_UUID_TYPE_16, 0xFEAF };
const ble_uuid16_t ShortUUID_CHIPoBLEService = { BLE_UUID_TYPE_16, 0xFFF6 };

const ble_uuid128_t UUID128_CHIPoBLEChar_RX = {
BLE_UUID_TYPE_128, { 0x11, 0x9D, 0x9F, 0x42, 0x9C, 0x4F, 0x9F, 0x95, 0x59, 0x45, 0x3D, 0x26, 0xF5, 0x2E, 0xEE, 0x18 }
Expand Down
2 changes: 1 addition & 1 deletion src/platform/K32W/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ EventGroupHandle_t bleAppTaskLoopEvent;
/* keep the device ID of the connected peer */
uint8_t device_id;

const uint8_t ShortUUID_CHIPoBLEService[] = { 0xAF, 0xFE };
const uint8_t ShortUUID_CHIPoBLEService[] = { 0xF6, 0xFF };
const ChipBleUUID ChipUUID_CHIPoBLEChar_RX = { { 0x18, 0xEE, 0x2E, 0xF5, 0x26, 0x3D, 0x45, 0x59, 0x95, 0x9F, 0x4F, 0x9C, 0x42, 0x9F,
0x9D, 0x11 } };
const ChipBleUUID ChipUUID_CHIPoBLEChar_TX = { { 0x18, 0xEE, 0x2E, 0xF5, 0x26, 0x3D, 0x45, 0x59, 0x95, 0x9F, 0x4F, 0x9C, 0x42, 0x9F,
Expand Down
2 changes: 1 addition & 1 deletion src/platform/K32W/gatt_uuid128.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
/* Services */

/* Wireless UART */
UUID128(uuid_service_chipoble, 0xFB, 0x34, 0x9B, 0x5F, 0x80, 0x00, 0x00, 0x80, 0x00, 0x10, 0x00, 0x00, 0xAF, 0xFE, 0x00, 0x00)
UUID128(uuid_service_chipoble, 0xFB, 0x34, 0x9B, 0x5F, 0x80, 0x00, 0x00, 0x80, 0x00, 0x10, 0x00, 0x00, 0xF6, 0xFF, 0x00, 0x00)
UUID128(uuid_chipoble_tx, 0x12, 0x9D, 0x9F, 0x42, 0x9C, 0x4F, 0x9F, 0x95, 0x59, 0x45, 0x3D, 0x26, 0xF5, 0x2E, 0xEE, 0x18)
UUID128(uuid_chipoble_rx, 0x11, 0x9D, 0x9F, 0x42, 0x9C, 0x4F, 0x9F, 0x95, 0x59, 0x45, 0x3D, 0x26, 0xF5, 0x2E, 0xEE, 0x18)
2 changes: 1 addition & 1 deletion src/platform/Linux/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ CHIP_ERROR BLEManagerImpl::ConfigureBle(uint32_t aAdapterId, bool aIsCentral)
mBLEAdvConfig.mDuration = 2;
mBLEAdvConfig.mPairingStatus = 0;
mBLEAdvConfig.mType = ChipAdvType::BLUEZ_ADV_TYPE_UNDIRECTED_CONNECTABLE_SCANNABLE;
mBLEAdvConfig.mpAdvertisingUUID = "0xFEAF";
mBLEAdvConfig.mpAdvertisingUUID = "0xFFF6";

mIsCentral = aIsCentral;

Expand Down
2 changes: 1 addition & 1 deletion src/platform/Linux/bluez/Helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ static BluezGattService1 * BluezServiceCreate(gpointer apClosure)
object = bluez_object_skeleton_new(endpoint->mpServicePath);

service = bluez_gatt_service1_skeleton_new();
bluez_gatt_service1_set_uuid(service, "0xFEAF");
bluez_gatt_service1_set_uuid(service, "0xFFF6");
// device is only valid for remote services
bluez_gatt_service1_set_primary(service, TRUE);

Expand Down
2 changes: 1 addition & 1 deletion src/platform/Linux/bluez/Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ enum ChipAdvType
#define CHIP_BLE_BASE_SERVICE_UUID_STRING "-0000-1000-8000-00805f9b34fb"
#define CHIP_BLE_SERVICE_PREFIX_LENGTH 8
#define CHIP_BLE_BASE_SERVICE_PREFIX "0000"
#define CHIP_BLE_UUID_SERVICE_SHORT_STRING "feaf"
#define CHIP_BLE_UUID_SERVICE_SHORT_STRING "fff6"

#define CHIP_BLE_UUID_SERVICE_STRING \
CHIP_BLE_BASE_SERVICE_PREFIX CHIP_BLE_UUID_SERVICE_SHORT_STRING CHIP_BLE_BASE_SERVICE_UUID_STRING
Expand Down
2 changes: 1 addition & 1 deletion src/platform/Zephyr/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const bt_uuid_128 UUID128_CHIPoBLEChar_RX =
BT_UUID_INIT_128(0x11, 0x9D, 0x9F, 0x42, 0x9C, 0x4F, 0x9F, 0x95, 0x59, 0x45, 0x3D, 0x26, 0xF5, 0x2E, 0xEE, 0x18);
const bt_uuid_128 UUID128_CHIPoBLEChar_TX =
BT_UUID_INIT_128(0x12, 0x9D, 0x9F, 0x42, 0x9C, 0x4F, 0x9F, 0x95, 0x59, 0x45, 0x3D, 0x26, 0xF5, 0x2E, 0xEE, 0x18);
bt_uuid_16 UUID16_CHIPoBLEService = BT_UUID_INIT_16(0xFEAF);
bt_uuid_16 UUID16_CHIPoBLEService = BT_UUID_INIT_16(0xFFF6);

const ChipBleUUID chipUUID_CHIPoBLEChar_RX = { { 0x18, 0xEE, 0x2E, 0xF5, 0x26, 0x3D, 0x45, 0x59, 0x95, 0x9F, 0x4F, 0x9C, 0x42, 0x9F,
0x9D, 0x11 } };
Expand Down
2 changes: 1 addition & 1 deletion src/platform/cc13x2_26x2/chipOBleProfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ extern "C" {
// Simple Keys Profile Services bit fields
#define CHIPOBLEPROFILE_SERVICE 0x00000001

#define CHIPOBLE_SERV_UUID 0xFEAF // Servuce UUID
#define CHIPOBLE_SERV_UUID 0xFFF6 // Service UUID
#define CHIPOBLEPROFILE_TX_CHAR_UUID 0x129D // GATT indications/read
#define CHIPOBLEPROFILE_RX_CHAR_UUID 0x119D // GATT Writes

Expand Down
2 changes: 1 addition & 1 deletion src/platform/qpg6100/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ namespace {
#define CHIP_ADV_DATA_TYPE_SERVICE_DATA 0x16

#define CHIP_ADV_SHORT_UUID_LEN 2
#define CHIP_ADV_CHIP_OVER_BLE_SERVICE_UUID16 0xFEAF
#define CHIP_ADV_CHIP_OVER_BLE_SERVICE_UUID16 0xFFF6

// FreeeRTOS sw timer
TimerHandle_t sbleAdvTimeoutTimer;
Expand Down