A partir del 27 de marzo de 2025, te recomendamos que uses android-latest-release
en lugar de aosp-main
para compilar y contribuir a AOSP. Para obtener más información, consulta Cambios en AOSP.
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Referencia de la estructura btsock_interface_t
#include <
bt_sock.h
>
|
size_t
|
tamaño
|
|
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)
|
|
Definición en la línea
49
del archivo
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)
|
Se conecta a un canal UUID de RFCOMM del dispositivo remoto. Muestra el fd de socket desde el que se pueden leer btsock_connect_signal y un nuevo fd de socket que se aceptará cuando se conecte. callingUid es el UID de la aplicación que solicita el socket. Se usa para la contabilización del tráfico.
Definición en la línea
71
del archivo
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)
|
Escuchar un UUID o canal de RFCOMM Devuelve el fd de socket desde el que se puede leer btsock_connect_signal cuando se conecta un dispositivo remoto. Si no se proporciona un UUID ni un canal, se asignará un canal y se podrá crear un registro de servicio que proporcione el número de canal a create_sdp_record(...) en bt_sdp. callingUid es el UID de la aplicación que solicita el socket. Se usa para la contabilización del tráfico.
Definición en la línea
62
del archivo
bt_sock.h
.
se establece en el tamaño de esta estructura
Definición en la línea
51
del archivo
bt_sock.h
.
La documentación de esta struct se generó a partir del siguiente archivo:
-
hardware/libhardware/include/hardware/
bt_sock.h
El contenido y las muestras de código que aparecen en esta página están sujetas a las licencias que se describen en la Licencia de Contenido. Java y OpenJDK son marcas registradas de Oracle o sus afiliados.
Última actualización: 2025-07-27 (UTC)
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Falta la información que necesito","missingTheInformationINeed","thumb-down"],["Muy complicado o demasiados pasos","tooComplicatedTooManySteps","thumb-down"],["Desactualizado","outOfDate","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Problema con las muestras o los códigos","samplesCodeIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 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)"]]