SWRA769 august   2023 CC2564C

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Demo Application
  5. 2Running the Bluetooth Code
  6. 3Server Set-Up Using HFP Demo Application
  7. 4Client Set-Up on the Demo Application
  8. 5Example: Audio Gateway with a Commercial Headset
  9. 6Application Commands
    1. 6.1  Generic Access Profile Commands
    2. 6.2  Help (DisplayHelp)
    3. 6.3  Inquiry
    4. 6.4  Pair
    5. 6.5  End Pairing
    6. 6.6  PIN Code Response
    7. 6.7  Pass Key Response
    8. 6.8  User Confirmation Response
    9. 6.9  Set Discoverability Mode
    10. 6.10 Set Connectability Mode
    11. 6.11 Set Pairability Mode
    12. 6.12 Change Simple Pairing Parameters
    13. 6.13 Get Local Address
    14. 6.14 Set Local Name
    15. 6.15 Get Local Name
    16. 6.16 Set Class of Device
    17. 6.17 Get Class of Device
    18. 6.18 Get Remote Name
  10. 7Hands-Free Profile Commands
    1. 7.1  Service Discovery
    2. 7.2  Open Audio Gateway Client
    3. 7.3  Manage Audio
    4. 7.4  Update Control Indicators
    5. 7.5  Call Waiting
    6. 7.6  Set Voice Recognition Activation
    7. 7.7  Set Speaker Gain
    8. 7.8  Set Microphone Gain
    9. 7.9  Disable Remote Sound Enhancement
    10. 7.10 Send Caller ID Notification
    11. 7.11 Set Ring Indication
    12. 7.12 Ring Indication
    13. 7.13 Send Incoming Call State
    14. 7.14 Close AG Client
    15. 7.15 Send Operator Info
    16. 7.16 Send Sub Number
    17. 7.17 Send Call List
  11. 8References
  12. 9Revision History

Service Discovery

Description

The following function is responsible for issuing a Service Search Attribute Request to a Remote SDP Server. This function returns zero if successful and a negative value if an error occurred.

Parameters

The command requires two parameter. first parameter is the Inquiry Index and the second is Profile Index.

Command Call Examples

  • "ServiceDiscovery 1 12" Attempts to Open a Audio Gateway client port on inquiry index #1 and Profile Index Number #12 (Hands-free).
  • "ServiceDiscovery 3 12" Attempts to Open a Audio Gateway client port on inquiry index #3 and Profile Index Number #12 (Hands-free).

Possible Return Values

  • (-1) BTPS_ERROR_INVALID_PARAMETER (-2) BTPS_ERROR_INVALID_BLUETOOTH_STACK_ID
  • (-4) FUNCTION_ERROR
  • (-8) INVALID_STACK_ID_ERROR
  • (-40) BTPS_ERROR_MEMORY_ALLOCATION_ERROR (-54) BTPS_ERROR_EXPECTED_UUID_ENTRY (-64) BTPS_ERROR_INTERNAL_ERROR (-103)
  • BTPS_ERROR_FEATURE_NOT_AVAILABLE

API Call

SDP_Service_Search_Attribute_Request(BluetoothStackID, InquiryResultList[(TempParam->Params[0].intParam - 1)], 1, &SDPUUIDEntry, 1, &AttributeID, SDP_Event_Callback,(unsigned long)0)

API Prototype

BTPSAPI_DECLARATION int BTPSAPI SDP_Service_Search_Attribute_Request(unsigned int BluetoothStackID, BD_ADDR_t BD_ADDR, unsigned int NumberServiceUUID,SDP_UUID_Entry_t SDP_UUID_Entry[], unsigned int NumberAttributeListElements, SDP_Attribute_ID_List_Entry_t AttributeIDList[], SDP_Response_Callback_tSDP_Response_Callback, unsigned long CallbackParameter)

Description of API

The following function is responsible for issuing an SDP Service Search Attribute Request to the specified BD_ADDR. This function returns the result of the Service Search Attribute Request in the SDP Response Callback that is specified in the calling of this function. This function accepts as input, the Bluetooth Stack ID of the Bluetooth Protocol Stack that the SDPClient resides on, the Bluetooth Board Address to remotely connect to (the Remote SDP Server resides on this BD_ADDR), the Number of Service UUID's that are to be searched for,the Servcee UUID's to actually search for, the Number of Entries in the Attribute List that are to be queried, the Attribute List to actually use in the Query, the SDP Response Callback Function, and the SDP Response Callback Function Callback Parameter. This function returns a positive, non-zero, return code if successful, or a negative return error code if therewas an error. If this function is successful, the user can call the SDP_Cancel_Service_Request() function to cancel a the SDP Service Search Request prematurely. The Number of UUID Parameter must be at least one, and the Service UUID Parameter must point to a List of at least the Number of UUID's that have been specified. Finally, theBD_ADDR Parameter and the SDP_Reponse_Callback Parameter MUST be valid or the call to this function will be unsuccessful. The Number of Attributes that are in the Attribute List must be at least one, and the Attribute ID List Parameter must point to a List of Attribute ID's that contains at least the Number of Attribute List Entries thathave been specified. Finally, the BD_ADDR Parameter and the SDP_Reponse_Callback Parameter MUST be valid or the call to this function will be unsuccessful.