A partir de 27 de março de 2025, recomendamos usar android-latest-release
em vez de aosp-main
para criar e contribuir com o AOSP. Para mais informações, consulte Mudanças no AOSP.
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Referência da estrutura btsock_interface_t
#include <
bt_sock.h
>
|
size_t
|
size
|
|
bt_status_t
(*
|
listen
)(
btsock_type_t
type, const char *service_name, const uint8_t *service_uuid, int channel, int *sock_fd, int flags, int callingUid)
|
|
bt_status_t
(*
|
connect
)(const bt_bdaddr_t *bd_addr,
btsock_type_t
type, const uint8_t *uuid, int channel, int *sock_fd, int flags, int callingUid)
|
|
Definição na linha
49
do arquivo
bt_sock.h
.
bt_status_t
(* connect)(const bt_bdaddr_t *bd_addr,
btsock_type_t
type, const uint8_t *uuid, int channel, int *sock_fd, int flags, int callingUid)
|
Conecta-se a um canal RFCOMM UUID do dispositivo remoto. Ele retorna o fd do socket de onde o btsock_connect_signal e um novo fd do socket a ser aceito podem ser lidos quando conectado. O callingUid é o UID do aplicativo que está solicitando o socket. É usado para fins de contabilidade de tráfego.
Definição na linha
71
do arquivo
bt_sock.h
.
bt_status_t
(* listen)(
btsock_type_t
type, const char *service_name, const uint8_t *service_uuid, int channel, int *sock_fd, int flags, int callingUid)
|
Ouvir um UUID ou canal RFCOMM. Ele retorna o fd do soquete em que o btsock_connect_signal pode ser lido quando um dispositivo remoto é conectado. Se nem um UUID nem um canal forem fornecidos, um canal será alocado e um registro de serviço poderá ser criado fornecendo o número do canal para create_sdp_record(...) em bt_sdp. O callingUid é o UID do aplicativo que está solicitando o socket. É usado para fins de contabilidade de tráfego.
Definição na linha
62
do arquivo
bt_sock.h
.
definido como o tamanho desta estrutura
Definição na linha
51
do arquivo
bt_sock.h
.
A documentação desse struct foi gerada com base no seguinte arquivo:
-
hardware/libhardware/include/hardware/
bt_sock.h
O conteúdo e os exemplos de código nesta página estão sujeitos às licenças descritas na Licença de conteúdo. Java e OpenJDK são marcas registradas da Oracle e/ou suas afiliadas.
Última atualização 2025-07-27 UTC.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Não contém as informações de que eu preciso","missingTheInformationINeed","thumb-down"],["Muito complicado / etapas demais","tooComplicatedTooManySteps","thumb-down"],["Desatualizado","outOfDate","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Problema com as amostras / o código","samplesCodeIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-07-27 UTC."],[],[],null,["# Android Hardware Abstraction Layer: btsock_interface_t Struct Reference\n\nbtsock_interface_t Struct Reference\n===================================\n\n[Data Fields](#pub-attribs) \nbtsock_interface_t Struct Reference \n\n`\n#include \u003c\n`[bt_sock.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bt_sock.h)`\n\u003e\n`\n\n|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Data Fields ----------- ||\n| size_t | [size](/reference/hal/structbtsock__interface__t#a854352f53b148adc24983a58a1866d66) |\n| ||\n| [bt_status_t](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bluetooth.h) (\\* | [listen](/reference/hal/structbtsock__interface__t#a9d38d485b8f8af482153e9fda49f1d87) )( [btsock_type_t](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bt_sock.h) type, const char \\*service_name, const uint8_t \\*service_uuid, int channel, int \\*sock_fd, int flags, int callingUid) |\n| ||\n| [bt_status_t](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bluetooth.h) (\\* | [connect](/reference/hal/structbtsock__interface__t#a3db005809916dd7c595f37b088c4a277) )(const bt_bdaddr_t \\*bd_addr, [btsock_type_t](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bt_sock.h) type, const uint8_t \\*uuid, int channel, int \\*sock_fd, int flags, int callingUid) |\n| ||\n\n\nDetailed Description\n--------------------\n\n\nDefinition at line\n[49](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bt_sock.h)\nof file\n[bt_sock.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bt_sock.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) (\\* connect)(const bt_bdaddr_t \\*bd_addr, [btsock_type_t](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bt_sock.h) type, const uint8_t \\*uuid, int channel, int \\*sock_fd, int flags, int callingUid) |\n\n\nConnect to a RFCOMM UUID channel of remote device, It returns the socket fd from which the btsock_connect_signal and a new socket fd to be accepted can be read out when connected. The callingUid is the UID of the application which is requesting the socket. This is used for traffic accounting purposes.\n\n\nDefinition at line\n[71](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bt_sock.h)\nof file\n[bt_sock.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bt_sock.h)\n.\n\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [bt_status_t](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bluetooth.h) (\\* listen)( [btsock_type_t](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bt_sock.h) type, const char \\*service_name, const uint8_t \\*service_uuid, int channel, int \\*sock_fd, int flags, int callingUid) |\n\n\nListen to a RFCOMM UUID or channel. It returns the socket fd from which btsock_connect_signal can be read out when a remote device connected. If neither a UUID nor a channel is provided, a channel will be allocated and a service record can be created providing the channel number to create_sdp_record(...) in bt_sdp. The callingUid is the UID of the application which is requesting the socket. This is used for traffic accounting purposes.\n\n\nDefinition at line\n[62](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bt_sock.h)\nof file\n[bt_sock.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bt_sock.h)\n.\n\n|-------------|\n| size_t size |\n\n\nset to size of this struct\n\n\nDefinition at line\n[51](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bt_sock.h)\nof file\n[bt_sock.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bt_sock.h)\n.\n\n*** ** * ** ***\n\nThe documentation for this struct was generated from the following file:\n\n- hardware/libhardware/include/hardware/ [bt_sock.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/bt_sock.h)"]]