Refactor Service Discovery Protocol code in the incomplete Bluetooth Host demo, so that the UUID list is compiled via a seperate function to allow for its re-use between different SDP request types.

This commit is contained in:
Dean Camera 2010-05-10 13:56:16 +00:00
parent 05ac59d0ee
commit 53ebb2f21a
2 changed files with 72 additions and 53 deletions

View file

@ -131,18 +131,19 @@
void ServiceDiscovery_ProcessPacket(void* Data, Bluetooth_Channel_t* Channel);
#if defined(INCLUDE_FROM_SERVICEDISCOVERYPROTOCOL_C)
static void ServiceDiscovery_ProcessServiceSearch(SDP_PDUHeader_t* SDPHeader);
static void ServiceDiscovery_ProcessServiceAttribute(SDP_PDUHeader_t* SDPHeader);
static void ServiceDiscovery_ProcessServiceSearchAttribute(SDP_PDUHeader_t* SDPHeader);
static void ServiceDiscovery_ProcessServiceSearch(SDP_PDUHeader_t* SDPHeader, Bluetooth_Channel_t* Channel);
static void ServiceDiscovery_ProcessServiceAttribute(SDP_PDUHeader_t* SDPHeader, Bluetooth_Channel_t* Channel);
static void ServiceDiscovery_ProcessServiceSearchAttribute(SDP_PDUHeader_t* SDPHeader, Bluetooth_Channel_t* Channel);
static inline uint16_t ServiceDiscovery_Read16BitParameter(void** AttributeHeader)
static inline uint16_t ServiceDiscovery_Read16BitParameter(const void** AttributeHeader)
{
uint16_t ParamValue = *((uint16_t*)*AttributeHeader);
*AttributeHeader += sizeof(uint16_t);
return ParamValue;
}
static uint32_t ServiceDiscovery_GetDataElementSize(void** AttributeHeader, uint8_t* ElementHeaderSize);
static uint8_t ServiceDiscovery_GetUUIDList(uint8_t UUIDList[12][16], const void** CurrentParameter);
static uint32_t ServiceDiscovery_GetDataElementSize(const void** AttributeHeader, uint8_t* ElementHeaderSize);
#endif
#endif