{.Header = (SDP_DATATYPE_UUID | SDP_DATASIZE_128Bit), .UUID = {BASE_80BIT_UUID, {0x00, 0x00, 0x00, 0x00, 0x10, 0x00}},}\r
}\r
};\r
- \r
-const struct\r
-{\r
- uint8_t Header;\r
- uint8_t Size;\r
- Item16Bit_t OffsetList[];\r
-} PROGMEM SDP_Attribute_LangOffset =\r
- {\r
- .Header = (SDP_DATATYPE_Sequence | SDP_DATASIZE_Variable8Bit),\r
- .Size = (sizeof(Item16Bit_t) * 1),\r
- .OffsetList =\r
- {\r
- {.Header = (SDP_DATATYPE_UnsignedInt | SDP_DATASIZE_16Bit), .Value = SWAPENDIAN_16(0x0100)}\r
- }\r
- }; \r
\r
const struct\r
{\r
{\r
{.AttributeID = SDP_ATTRIBUTE_ID_SERVICERECORDHANDLE, .Data = &SDP_Attribute_ServiceHandle },\r
{.AttributeID = SDP_ATTRIBUTE_ID_SERVICECLASSIDS, .Data = &SDP_Attribute_ServiceClassIDs },\r
- {.AttributeID = SDP_ATTRIBUTE_ID_LANGIDOFFSET, .Data = &SDP_Attribute_LangOffset },\r
{.AttributeID = SDP_ATTRIBUTE_ID_VERSION, .Data = &SDP_Attribute_Version },\r
{.AttributeID = SDP_ATTRIBUTE_ID_SERVICENAME, .Data = &SDP_Attribute_ServiceName },\r
{.AttributeID = SDP_ATTRIBUTE_ID_SERVICEDESCRIPTION, .Data = &SDP_Attribute_ServiceDescription },\r
{\r
{.AttributeID = SDP_ATTRIBUTE_ID_SERVICERECORDHANDLE, .Data = &RFCOMM_Attribute_ServiceHandle },\r
{.AttributeID = SDP_ATTRIBUTE_ID_SERVICECLASSIDS, .Data = &RFCOMM_Attribute_ServiceClassIDs },\r
- {.AttributeID = SDP_ATTRIBUTE_ID_LANGIDOFFSET, .Data = &RFCOMM_Attribute_LangOffset },\r
{.AttributeID = SDP_ATTRIBUTE_ID_SERVICENAME, .Data = &RFCOMM_Attribute_ServiceName },\r
{.AttributeID = SDP_ATTRIBUTE_ID_SERVICEDESCRIPTION, .Data = &RFCOMM_Attribute_ServiceDescription },\r
\r
\r
#define SDP_ATTRIBUTE_ID_SERVICERECORDHANDLE 0x0000\r
#define SDP_ATTRIBUTE_ID_SERVICECLASSIDS 0x0001\r
- #define SDP_ATTRIBUTE_ID_LANGIDOFFSET 0x0006\r
#define SDP_ATTRIBUTE_ID_VERSION 0x0200\r
#define SDP_ATTRIBUTE_ID_SERVICENAME 0x0100\r
#define SDP_ATTRIBUTE_ID_SERVICEDESCRIPTION 0x0101\r
MaxAttributeSize = sizeof(ResponsePacket.ResponseData);
/* Add the outer Data Element Sequence header for all of the retrieved Attributes */
- uint16_t* TotalResponseSize = SDP_AddDataElementHeader16(&CurrResponsePos, SDP_DATATYPE_Sequence);
+ uint16_t* TotalResponseSize = SDP_AddSequence16(&CurrResponsePos);
/* Search through the list of UUIDs one at a time looking for matching search Attributes */
for (uint8_t CurrUUIDItem = 0; CurrUUIDItem < TotalUUIDs; CurrUUIDItem++)
uint16_t TotalResponseSize;
/* Add an inner Data Element Sequence header for the current services's found Attributes */
- uint16_t* AttributeListSize = SDP_AddDataElementHeader16(BufferPos, SDP_DATATYPE_Sequence);
+ uint16_t* AttributeListSize = SDP_AddSequence16(BufferPos);
/* Search through the list of Attributes one at a time looking for values in the current UUID's Attribute table */
for (uint8_t CurrAttribute = 0; CurrAttribute < TotalAttributes; CurrAttribute++)
return Data;
}
- /** Adds a new Data Element container of the given type with a 16-bit size header to the buffer. The
- * buffer pointer's position is advanced past the added header once the element has been added. The
- * returned size header value is pre-zeroed out so that it can be incremented as data is placed into
- * the Data Element container.
+ /** Adds a new Data Element Sequence container with a 16-bit size header to the buffer. The buffer
+ * pointer's position is advanced past the added header once the element has been added. The returned
+ * size header value is pre-zeroed out so that it can be incremented as data is placed into the Data
+ * Element Sequence container.
*
* The total added size of the container header is three bytes, regardless of the size of its contents
* as long as the contents' size in bytes fits into a 16-bit integer.
*
* \param[in, out] BufferPos Pointer to a buffer where the container header is to be placed
- * \param[in] Type Type of data the container is to store, a value from the \ref ServiceDiscovery_DataTypes_t enum
*
* \return Pointer to the 16-bit size value of the contaner header, which has been pre-zeroed
*/
- static inline uint16_t* SDP_AddDataElementHeader16(void** BufferPos, const uint8_t Type)
+ static inline uint16_t* SDP_AddSequence16(void** BufferPos)
{
- SDP_WriteData8(BufferPos, (SDP_DATASIZE_Variable16Bit | Type));
+ SDP_WriteData8(BufferPos, (SDP_DATASIZE_Variable16Bit | SDP_DATATYPE_Sequence));
- uint16_t* SizePos = (uint16_t*)*BufferPos;
-
+ uint16_t* SizePos = *BufferPos;
SDP_WriteData16(BufferPos, 0);
return SizePos;