aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Host/Incomplete/BluetoothHost/Lib/ServiceDiscoveryProtocol.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-06-03 03:58:57 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-06-03 03:58:57 +0000
commit008e0e2e0a13e64e03f27f1c9a008ef201560878 (patch)
tree53e4c17848b5a295484c00d5df6864956bfc7e0a /Demos/Host/Incomplete/BluetoothHost/Lib/ServiceDiscoveryProtocol.c
parent5144ea76f646cd9f649de16e3d67dfead2d3c2bf (diff)
downloadlufa-008e0e2e0a13e64e03f27f1c9a008ef201560878.tar.gz
lufa-008e0e2e0a13e64e03f27f1c9a008ef201560878.tar.bz2
lufa-008e0e2e0a13e64e03f27f1c9a008ef201560878.zip
Add start of RFCOMM service layer to the incomplete BluetoothHost demo.
Reduce the size of the attribute search list from 15 ranges to 8 to save RAM.
Diffstat (limited to 'Demos/Host/Incomplete/BluetoothHost/Lib/ServiceDiscoveryProtocol.c')
-rw-r--r--Demos/Host/Incomplete/BluetoothHost/Lib/ServiceDiscoveryProtocol.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/Demos/Host/Incomplete/BluetoothHost/Lib/ServiceDiscoveryProtocol.c b/Demos/Host/Incomplete/BluetoothHost/Lib/ServiceDiscoveryProtocol.c
index df0db3bed..0ee0784c5 100644
--- a/Demos/Host/Incomplete/BluetoothHost/Lib/ServiceDiscoveryProtocol.c
+++ b/Demos/Host/Incomplete/BluetoothHost/Lib/ServiceDiscoveryProtocol.c
@@ -119,11 +119,10 @@ static void SDP_ProcessServiceSearch(const SDP_PDUHeader_t* const SDPHeader, Blu
/* Copy over the service record handle to the response list */
uint8_t AttrHeaderSize;
- SDP_GetLocalAttributeContainerSize(AttributeValue, &AttrHeaderSize);
- memcpy_P(CurrResponsePos, AttributeValue + AttrHeaderSize, sizeof(uint32_t));
- CurrResponsePos += AttrHeaderSize + sizeof(uint32_t);
+ uint8_t AttrSize = SDP_GetLocalAttributeContainerSize(AttributeValue, &AttrHeaderSize);
+ memcpy_P(CurrResponsePos, AttributeValue + AttrHeaderSize, AttrSize);
+ CurrResponsePos += AttrHeaderSize + AttrSize;
- /* Increment the total number of service records added to the list */
AddedServiceHandles++;
}
@@ -172,7 +171,7 @@ static void SDP_ProcessServiceAttribute(const SDP_PDUHeader_t* const SDPHeader,
BT_SDP_DEBUG(2, "-- Max Return Attribute Bytes: 0x%04X", MaxAttributeSize);
/* Retrieve the list of Attributes from the request */
- uint16_t AttributeList[15][2];
+ uint16_t AttributeList[8][2];
uint8_t TotalAttributes = SDP_GetAttributeList(AttributeList, &CurrentParameter);
BT_SDP_DEBUG(2, "-- Total Attributes: %d", TotalAttributes);
@@ -263,7 +262,7 @@ static void SDP_ProcessServiceSearchAttribute(const SDP_PDUHeader_t* const SDPHe
BT_SDP_DEBUG(2, "-- Max Return Attribute Bytes: 0x%04X", MaxAttributeSize);
/* Retrieve the list of Attributes from the request */
- uint16_t AttributeList[15][2];
+ uint16_t AttributeList[8][2];
uint8_t TotalAttributes = SDP_GetAttributeList(AttributeList, &CurrentParameter);
BT_SDP_DEBUG(2, "-- Total Attributes: %d", TotalAttributes);