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

Get Remote Name

Description

The GetRemoteName command is responsible for querying the Bluetooth Device Name of a Remote Device. This function returns zero on a successful execution and a negative value onall errors. The command requires that a valid Bluetooth Stack ID exists before running is called after using the Inquiry command. The DisplayInquiryList command is useful in this situation to find which Remote Device goes with which Inquiry Index.

Parameters

The GetRemoteName command requires one parameter which is the Inquiry Index of the Remote Bluetooth Device. This value can be found after an Inquiry or displayed when thecommand DisplayInquiryList is used.

Command Call Examples

  • "GetRemoteName 5" Attempts to query the Device Name for the Remote Device that is at the fifth Inquiry Index.
  • "GetRemoteName 8" Attempts to query the Device Name for the Remote Device that is at the eighth Inquiry Index.

Possible Return Values

  • (0) Successfully Queried Remote Name
  • (-6) INVALID_PARAMETERS_ERROR
  • (-4) FUNCTION_ERROR
  • (-8) INVALID_STACK_ID_ERROR
  • (-2) BTPS_ERROR_INVALID_BLUETOOTH_STACK_ID
  • (-1) BTPS_ERROR_INVALID_PARAMETER
  • (-59) BTPS_ERROR_ADDING_CALLBACK_INFORMATION
  • (-57) BTPS_ERROR_DEVICE_HCI_ERROR

API Call

GAP_Query_Remote_Device_Name(BluetoothStackID, InquiryResultList[(TempParam->Params[0].intParam – 1)], GAP_Event_Callback, (unsigned long)0);

API Prototype

int BTPSAPI GAP_Query_Remote_Device_Name(unsigned int BluetoothStackID, BD_ADDR_t BD_ADDR, GAP_Event_Callback_t GAP_Event_Callback, unsigned longCallbackParameter);

Description of API

This function is provided to allow a mechanism to query the user-friendly Bluetooth device name of the specified remote Bluetooth device. This function accepts as input the Bluetooth device address of the remote Bluetooth device to query the name of and the GAP event callback information that is to be used when the remote device name process has completed. This function returns zero if successful, or a negative return error code if the remote name request was unable to be submitted. If this function returns success, then the caller is notified via the specified callback when the remote name information has been determined (or there was an error). This function cannot be used to determine the user-friendly name of the localBluetooth device. The GAP_Query_Local_Name function is used to query the user-friendly name of the local Bluetooth device. Because this function is asynchronous in nature (specifying a remote device address), this function notifies the caller of the result via the specified callback. The caller is free to cancel the remote name request at any time by issuing the GAP_Cancel_Query_Remote_Name function and specifying the Bluetooth device address of the Bluetooth device that was specified in the original call to this function. Note that when the callback is cancelled and the operation attempts to cancel, then the callback is cancelled (i.e. the GAP module still performs the remote name request, but no callback is ever issued).