google / mobly-bundled-snippets

Snippets to allow Mobly tests to control Android devices by exposing a simplified Android API.
Apache License 2.0
48 stars 52 forks source link

Refactor manufacturerSpecificData to ManufacturerSpecificData #179

Closed ko1in1u closed 10 months ago

ko1in1u commented 11 months ago

manufacturerSpecificData is one of arguments when adding manufacturer specific data (see AdvertiseData.Builder#addManufacturerData)

Before Change:

ad.mbs.bleStartAdvertising(
    advertiseSettings,
    {
        'IncludeDeviceName': True,
        'ManufacturerData': {'ManufacturerId': 224},
        'ManufacturerSpecificData': '[0x78, 0x01]',
    },
)

After Change:

ad.mbs.bleStartAdvertising(
    advertiseSettings,
    {
        'IncludeDeviceName': True,
        'ManufacturerData': {
                'ManufacturerId': 224,
                'ManufacturerSpecificData': '[0x78, 0x01]',
        },
    },
)

This change is Reviewable

ko1in1u commented 10 months ago

Since this is a change in the expected format of AdvertiseData does it affect any existing use cases? Also, is this expected format documented anywhere?

No usage of ManufacturerData was found internally. There is no documentation about the correct format. However, according to [AdvertiseData.getManufacturerSpecificData](https://developer.android.com/reference/android/bluetooth/le/AdvertiseData?hl=en#getManufacturerSpecificData())

Returns an array of manufacturer Id and the corresponding manufacturer specific data.

it seems more reasonal that putting ManufacturerId and ManufacturerSpecificData together