Remove incorrect Language ID offset attribute from the SDP server - client assumes...
authorDean Camera <dean@fourwalledcubicle.com>
Tue, 1 Jun 2010 13:11:55 +0000 (13:11 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Tue, 1 Jun 2010 13:11:55 +0000 (13:11 +0000)
Demos/Host/Incomplete/BluetoothHost/Lib/SDPServices.c
Demos/Host/Incomplete/BluetoothHost/Lib/SDPServices.h
Demos/Host/Incomplete/BluetoothHost/Lib/ServiceDiscoveryProtocol.c
Demos/Host/Incomplete/BluetoothHost/Lib/ServiceDiscoveryProtocol.h

index 2530231..0ad8c01 100644 (file)
@@ -50,21 +50,6 @@ const struct
                                {.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
@@ -110,7 +95,6 @@ const ServiceAttributeTable_t SDP_Attribute_Table[] PROGMEM =
        {\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
@@ -182,7 +166,6 @@ const ServiceAttributeTable_t RFCOMM_Attribute_Table[] PROGMEM =
        {\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
index 0fd0aa4..5ca010c 100644 (file)
@@ -48,7 +48,6 @@
                \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
index 66189c0..6bb35f6 100644 (file)
@@ -291,7 +291,7 @@ static void SDP_ProcessServiceSearchAttribute(const SDP_PDUHeader_t* const SDPHe
          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++)
@@ -351,7 +351,7 @@ static uint16_t SDP_AddListedAttributesToResponse(const ServiceAttributeTable_t*
        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++)
index c9ce951..ec55b2f 100644 (file)
                        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;