KW40Z_Connectivity_Software_1.0.1 KSDK_1.3.0 IAR 7.5
https://www.bluetooth.com/specifications/assigned-numbers/generic-access-profile
What additional data should be contained in advertising data as best practice ?
(AdFlags, ServiceList, ClassOfDevice, ManufacturerSpecificData, TxPowerLevel)
gap_types.h
/*! AD Type values as defined by Bluetooth SIG used when defining gapAdStructure_t structures for advertising or scan response data. */
typedef enum gapAdType_tag {
gAdFlags_c = 0x01, /*!< Defined by the Bluetooth SIG. */
gAdIncomplete16bitServiceList_c = 0x02, /*!< Defined by the Bluetooth SIG. */
gAdComplete16bitServiceList_c = 0x03, /*!< Defined by the Bluetooth SIG. */
gAdIncomplete32bitServiceList_c = 0x04, /*!< Defined by the Bluetooth SIG. */
gAdComplete32bitServiceList_c = 0x05, /*!< Defined by the Bluetooth SIG. */
gAdIncomplete128bitServiceList_c = 0x06, /*!< Defined by the Bluetooth SIG. */
gAdComplete128bitServiceList_c = 0x07, /*!< Defined by the Bluetooth SIG. */
gAdShortenedLocalName_c = 0x08, /*!< Defined by the Bluetooth SIG. */
gAdCompleteLocalName_c = 0x09, /*!< Defined by the Bluetooth SIG. */
gAdTxPowerLevel_c = 0x0A, /*!< Defined by the Bluetooth SIG. */
gAdClassOfDevice_c = 0x0D, /*!< Defined by the Bluetooth SIG. */
gAdSimplePairingHashC192_c = 0x0E, /*!< Defined by the Bluetooth SIG. */
gAdSimplePairingRandomizerR192_c = 0x0F, /*!< Defined by the Bluetooth SIG. */
gAdSecurityManagerTkValue_c = 0x10, /*!< Defined by the Bluetooth SIG. */
gAdSecurityManagerOobFlags_c = 0x11, /*!< Defined by the Bluetooth SIG. */
gAdSlaveConnectionIntervalRange_c = 0x12, /*!< Defined by the Bluetooth SIG. */
gAdServiceSolicitationList16bit_c = 0x14, /*!< Defined by the Bluetooth SIG. */
gAdServiceSolicitationList32bit_c = 0x1F, /*!< Defined by the Bluetooth SIG. */
gAdServiceSolicitationList128bit_c = 0x15, /*!< Defined by the Bluetooth SIG. */
gAdServiceData16bit_c = 0x16, /*!< Defined by the Bluetooth SIG. */
gAdServiceData32bit_c = 0x20, /*!< Defined by the Bluetooth SIG. */
gAdServiceData128bit_c = 0x21, /*!< Defined by the Bluetooth SIG. */
gAdPublicTargetAddress_c = 0x17, /*!< Defined by the Bluetooth SIG. */
gAdRandomTargetAddress_c = 0x18, /*!< Defined by the Bluetooth SIG. */
gAdAppearance_c = 0x19, /*!< Defined by the Bluetooth SIG. */
gAdAdvertisingInterval_c = 0x1A, /*!< Defined by the Bluetooth SIG. */
gAdLeDeviceAddress_c = 0x1B, /*!< Defined by the Bluetooth SIG. */
gAdLeRole_c = 0x1C, /*!< Defined by the Bluetooth SIG. */
gAdSimplePairingHashC256_c = 0x1D, /*!< Defined by the Bluetooth SIG. */
gAdSimplePairingRandomizerR256_c = 0x1E, /*!< Defined by the Bluetooth SIG. */
gAd3dInformationData_c = 0x3D, /*!< Defined by the Bluetooth SIG. */
gAdManufacturerSpecificData_c = 0xFF /*!< Defined by the Bluetooth SIG. */
} gapAdType_t;
What is the purpose of Incomplete Service List ?
Should be use to add more 128b UUID's ?
app_config.c
/* Scanning and Advertising Data */
static const uint8_t adData0[1] = { (gapAdTypeFlags_t)(gLeGeneralDiscoverableMode_c | gBrEdrNotSupported_c) };
static const uint8_t adData1[] = { 0xE0, 0x1C, 0x4B, 0x5E, 0x1E, 0xEB, 0xA1, 0x5C, 0xEE, 0xF4, 0x5E, 0xBA, 0x50, 0x55, 0xFF, 0x01};
static const gapAdStructure_t advScanStruct[3] = {
{
.length = NumberOfElements(adData0) + 1,
.adType = gAdFlags_c,
.aData = (void *)adData0
},
{
.length = NumberOfElements(adData1) + 1,
.adType = gAdComplete128bitServiceList_c,
.aData = (void *)adData1
},
{
.length = 8 + 1,
.adType = gAdShortenedLocalName_c,
.aData = "FSL_OTAC"
}
};
gapAdvertisingData_t gAppAdvertisingData =
{
NumberOfElements(advScanStruct),
(void *)advScanStruct
};
There is a way to assert the length of adv data package ?
size = NumberOfElements(advScanStruct); assert( size <= LIMIT ) ?
Or compile time check ?
LIMIT should be 31 bytes ?
The value value_device_name should be the same as gAdShortenedLocalName_c aData ?
gatt_db.h
PRIMARY_SERVICE(service_gap, gBleSig_GenericAccessProfile_d)
CHARACTERISTIC(char_device_name, gBleSig_GapDeviceName_d, (gGattCharPropRead_c) )
VALUE(value_device_name, gBleSig_GapDeviceName_d, (gPermissionFlagReadable_c), 19, "FSL_BLE_OTAP_CLIENT")
CHARACTERISTIC(char_appearance, gBleSig_GapAppearance_d, (gGattCharPropRead_c) )
VALUE(value_appearance, gBleSig_GapAppearance_d, (gPermissionFlagReadable_c), 2, UuidArray(gUnknown_c))
CHARACTERISTIC(char_ppcp, gBleSig_GapPpcp_d, (gGattCharPropRead_c) )
VALUE(value_ppcp, gBleSig_GapPpcp_d, (gPermissionFlagReadable_c), 8, 0x0A, 0x00, 0x10, 0x00, 0x64, 0x00, 0xE2, 0x04)
Thank you,
Lucian.