自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release
而非 aosp-main
建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
btsdp_interface_t 結構體參考資料
#include <
bt_sdp.h
>
請在 Socket 介面中使用 listen 建立 rfcomm 和/或 l2cap PSM 通道 (不含 UUID 和 service_name,並在標記中設定 BTSOCK_FLAG_NO_SDP 標記)。接著,請使用 createSdpRecord 建立與 rfcomm/l2cap 管道相關聯的 SDP 記錄。
傳回 SDP 記錄的句柄,可剖析為 remove_sdp_record。
record (in) 要建立的 SDP 記錄。record_handle (out) 對應的記錄句柄會寫入此指標。
定義位於檔案
bt_sdp.h 的
143
行。
移除由 createSdpRecord 建立的 SDP 記錄
定義位於檔案
bt_sdp.h
的
146
行。
bt_status_t
(* sdp_search)(bt_bdaddr_t *bd_addr, const uint8_t *uuid)
|
這個結構體的說明文件是由下列檔案產生:
-
hardware/libhardware/include/hardware/
bt_sdp.h
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-27 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-27 (世界標準時間)。"],[],[],null,["# Android Hardware Abstraction Layer: btsdp_interface_t Struct Reference\n\nbtsdp_interface_t Struct Reference\n==================================\n\n[Data Fields](#pub-attribs) \nbtsdp_interface_t Struct Reference \n\n`\n#include \u003c\n`[bt_sdp.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bt_sdp.h)`\n\u003e\n`\n\n|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Data Fields ----------- ||\n| size_t | [size](/reference/hal/structbtsdp__interface__t#a854352f53b148adc24983a58a1866d66) |\n| ||\n| [bt_status_t](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bluetooth.h) (\\* | [init](/reference/hal/structbtsdp__interface__t#a1fc7441984c7bf89fc8bb4719b943db4) )( [btsdp_callbacks_t](/reference/hal/structbtsdp__callbacks__t) \\*callbacks) |\n| ||\n| [bt_status_t](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bluetooth.h) (\\* | [deinit](/reference/hal/structbtsdp__interface__t#a6d26449b7562197ad32b98495759085e) )() |\n| ||\n| [bt_status_t](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bluetooth.h) (\\* | [sdp_search](/reference/hal/structbtsdp__interface__t#a58527da515be3086e14b10e1c5f13f7b) )(bt_bdaddr_t \\*bd_addr, const uint8_t \\*uuid) |\n| ||\n| [bt_status_t](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bluetooth.h) (\\* | [create_sdp_record](/reference/hal/structbtsdp__interface__t#a73db7398c35a3aa6fed7a67284f496d0) )( [bluetooth_sdp_record](/reference/hal/unionbluetooth__sdp__record) \\*record, int \\*record_handle) |\n| ||\n| [bt_status_t](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bluetooth.h) (\\* | [remove_sdp_record](/reference/hal/structbtsdp__interface__t#a5edc4376964673ce7817eb7143bc9d0f) )(int sdp_handle) |\n| ||\n\n\nDetailed Description\n--------------------\n\n\nDefinition at line\n[120](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bt_sdp.h)\nof file\n[bt_sdp.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bt_sdp.h)\n.\n\nField Documentation\n-------------------\n\n\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [bt_status_t](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bluetooth.h) (\\* create_sdp_record)( [bluetooth_sdp_record](/reference/hal/unionbluetooth__sdp__record) \\*record, int \\*record_handle) |\n\n\nUse listen in the socket interface to create rfcomm and/or l2cap PSM channels, (without UUID and service_name and set the BTSOCK_FLAG_NO_SDP flag in flags). Then use createSdpRecord to create the SDP record associated with the rfcomm/l2cap channels.\n\n\nReturns a handle to the SDP record, which can be parsed to remove_sdp_record.\n\n\nrecord (in) The SDP record to create record_handle (out)The corresponding record handle will be written to this pointer.\n\n\nDefinition at line\n[143](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bt_sdp.h)\nof file\n[bt_sdp.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bt_sdp.h)\n.\n\n|-----------------------------------------------------------------------------------------------------------------------------------|\n| [bt_status_t](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bluetooth.h) (\\* deinit)() |\n\n\nUnregister BT SDP\n\n\nDefinition at line\n[128](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bt_sdp.h)\nof file\n[bt_sdp.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bt_sdp.h)\n.\n\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [bt_status_t](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bluetooth.h) (\\* init)( [btsdp_callbacks_t](/reference/hal/structbtsdp__callbacks__t) \\*callbacks) |\n\n\nRegister BT SDP search callbacks\n\n\nDefinition at line\n[125](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bt_sdp.h)\nof file\n[bt_sdp.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bt_sdp.h)\n.\n\n|------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [bt_status_t](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bluetooth.h) (\\* remove_sdp_record)(int sdp_handle) |\n\n\nRemove a SDP record created by createSdpRecord\n\n\nDefinition at line\n[146](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bt_sdp.h)\nof file\n[bt_sdp.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bt_sdp.h)\n.\n\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [bt_status_t](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bluetooth.h) (\\* sdp_search)(bt_bdaddr_t \\*bd_addr, const uint8_t \\*uuid) |\n\n\nSearch for SDP records with specific uuid on remote device\n\n\nDefinition at line\n[131](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bt_sdp.h)\nof file\n[bt_sdp.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bt_sdp.h)\n.\n\n|-------------|\n| size_t size |\n\n\nSet to size of this struct\n\n\nDefinition at line\n[122](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bt_sdp.h)\nof file\n[bt_sdp.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bt_sdp.h)\n.\n\n*** ** * ** ***\n\nThe documentation for this struct was generated from the following file:\n\n- hardware/libhardware/include/hardware/ [bt_sdp.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bt_sdp.h)"]]