- /* Retrieve a PROGMEM pointer to the value of the current Attribute ID, if it exists in the UUID's Attribute table */
- const void* AttributeValue = SDP_GetAttributeValue(AttributeTable, CurrAttributeID);
-
- /* If the Attribute does not exist in the current UUID's Attribute table, continue to the next Attribute ID */
- if (AttributeValue == NULL)
- continue;
-
- BT_SDP_DEBUG(2, " -- Add Attribute 0x%04X", CurrAttributeID);
+ /* Get the current Attribute's ID from the current attribute table entry */
+ uint16_t CurrAttributeID = pgm_read_word(&AttributeTable->AttributeID);
+
+ /* Check if the current Attribute's ID is within the current Attribute range */
+ if ((CurrAttributeID >= AttributeIDRange[0]) && (CurrAttributeID <= AttributeIDRange[1]))
+ {
+ BT_SDP_DEBUG(2, " -- Add Attribute 0x%04X", CurrAttributeID);