aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Host/Incomplete/BluetoothHost/Lib/ServiceDiscoveryProtocol.h
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-06-02 07:05:34 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-06-02 07:05:34 +0000
commitc362709a1e2b0252cffbf1633f7cce41fea4d769 (patch)
treecbe6188d1b4e00c42045d2318964cceebedee91a /Demos/Host/Incomplete/BluetoothHost/Lib/ServiceDiscoveryProtocol.h
parentda51c1f9749842b65608d6505a41b05981416443 (diff)
downloadlufa-c362709a1e2b0252cffbf1633f7cce41fea4d769.tar.gz
lufa-c362709a1e2b0252cffbf1633f7cce41fea4d769.tar.bz2
lufa-c362709a1e2b0252cffbf1633f7cce41fea4d769.zip
The SDP UUID lists should be searched and ALL UUIDs matched for a record to be retrieved, not partial matches. Change the SDP code so that the entire list must be matched against a service attribute table's contents before it is returned.
Change matching algorithm so that it recursively searches through the entire attribute table, and not just pre-specified sequence attributes. Add browse lists and proper descriptions to the Serial Port service.
Diffstat (limited to 'Demos/Host/Incomplete/BluetoothHost/Lib/ServiceDiscoveryProtocol.h')
-rw-r--r--Demos/Host/Incomplete/BluetoothHost/Lib/ServiceDiscoveryProtocol.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/Demos/Host/Incomplete/BluetoothHost/Lib/ServiceDiscoveryProtocol.h b/Demos/Host/Incomplete/BluetoothHost/Lib/ServiceDiscoveryProtocol.h
index ec55b2fb1..50f436642 100644
--- a/Demos/Host/Incomplete/BluetoothHost/Lib/ServiceDiscoveryProtocol.h
+++ b/Demos/Host/Incomplete/BluetoothHost/Lib/ServiceDiscoveryProtocol.h
@@ -50,7 +50,7 @@
/* Macros: */
#define BT_SDP_DEBUG(l, s, ...) do { if (SDP_DEBUG_LEVEL >= l) printf_P(PSTR("(SDP) " s "\r\n"), ##__VA_ARGS__); } while (0)
- #define SDP_DEBUG_LEVEL 2
+ #define SDP_DEBUG_LEVEL 1
#define SDP_PDU_ERRORRESPONSE 0x01
#define SDP_PDU_SERVICESEARCHREQUEST 0x02
@@ -59,6 +59,8 @@
#define SDP_PDU_SERVICEATTRIBUTERESPONSE 0x05
#define SDP_PDU_SERVICESEARCHATTRIBUTEREQUEST 0x06
#define SDP_PDU_SERVICESEARCHATTRIBUTERESPONSE 0x07
+
+ #define pgm_read_ptr(x) (void*)pgm_read_word(x)
/* Enums: */
/** Data sizes for SDP Data Element headers, to indicate the size of the data contained in the element. When creating
@@ -213,9 +215,15 @@
const uint8_t TotalAttributes, void** const BufferPos);
static uint16_t SDP_AddAttributeToResponse(const uint16_t AttributeID, const void* AttributeValue, void** ResponseBuffer);
static void* SDP_GetAttributeValue(const ServiceAttributeTable_t* AttributeTable, const uint16_t AttributeID);
- static ServiceAttributeTable_t* SDP_GetAttributeTable(const uint8_t* const UUID);
+
+ static bool SDP_SearchServiceTable(uint8_t UUIDList[][UUID_SIZE_BYTES], const uint8_t TotalUUIDs,
+ const ServiceAttributeTable_t* CurrAttributeTable);
+ static void SDP_CheckUUIDMatch(uint8_t UUIDList[][UUID_SIZE_BYTES], const uint8_t TotalUUIDs, bool UUIDMatch[],
+ const void* CurrAttribute);
+
static uint8_t SDP_GetAttributeList(uint16_t AttributeList[][2], const void** const CurrentParameter);
static uint8_t SDP_GetUUIDList(uint8_t UUIDList[][UUID_SIZE_BYTES], const void** const CurrentParameter);
+
static uint32_t SDP_GetLocalAttributeContainerSize(const void* const AttributeData, uint8_t* const HeaderSize);
static uint32_t SDP_GetDataElementSize(const void** const AttributeHeader, uint8_t* const ElementHeaderSize);
#endif