SWRA769 august 2023 CC2564C
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.
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.
GAP_Query_Remote_Device_Name(BluetoothStackID, InquiryResultList[(TempParam->Params[0].intParam – 1)], GAP_Event_Callback, (unsigned long)0);
int BTPSAPI GAP_Query_Remote_Device_Name(unsigned int BluetoothStackID, BD_ADDR_t BD_ADDR, GAP_Event_Callback_t GAP_Event_Callback, unsigned longCallbackParameter);
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).