Each BluetoothDevice object returned through the discovery broadcasts  dịch - Each BluetoothDevice object returned through the discovery broadcasts  Việt làm thế nào để nói

Each BluetoothDevice object returne

Each BluetoothDevice object returned through the discovery broadcasts represents a remote Bluetooth Device discovered.
In the following sections you will use Bluetooth Device objects to create a connection, bond, and ultimately transfer data between the local Bluetooth Adapter and remote Bluetooth Devices.
Bluetooth Communications
The Android Bluetooth communications APIs are wrappers around RFCOMM, the Bluetooth radio frequency communications protocol. RFCOMM supports RS232 serial communication over the Logical Link Control and Adaptation Protocol (L2CAP) layer.
In practice, this alphabet soup provides a mechanism for opening communication sockets between two paired Bluetooth devices.
(//) Before your application can communicate between devices, the devices must be paired (bonded). If users attempt to connect two unpaired devices, they will be prompted to pair them before the connection is established.
You can establish an RFCOMM communication channel for bidirectional communications using the following classes.
^ BluetoothServerSocket — Used to establish a listening socket for initiating a link between devices. To establish a handshake, one device acts as a server to listen for, and accept, incoming connection requests.
^ BluetoothSocket — Used to create a new client to connect to a listening Bluetooth Server Socket. Also returned by the Bluetooth Server Socket after a connection is established. Once a connection is established, Bluetooth Sockets are used by both the server and client to transfer data streams.
When creating an application that uses Bluetooth as a peer-to-peer transport layer, you’ll need to implement both a Bluetooth Server Socket to listen for connections and a Bluetooth Socket to initiate a new channel and handle communications.
When connected, the Bluetooth Server Socket returns a Bluetooth Socket that’s then used by the server device to send and receive data. This server-side Bluetooth Socket is used in exactly the same way as the client socket. The designations of server and client are relevant only to how the connec¬tion is established; they don’t affect how data flows after that connection is made.
Opening a Bluetooth Server Socket Listener
A Bluetooth Server Socket is used to listen for incoming Bluetooth Socket connection requests from remote Bluetooth Devices. In order for two Bluetooth devices to be connected, one must act as a server (listening for and accepting incoming requests) and the other as a client (initiating the request to connect to the server). After the two are connected, the communications between the server and host device are handled through a Bluetooth Socket at both ends.
To have your Bluetooth Adapter act as a server, call its listenUsingRfcommWithServiceRecord method to listen for incoming connection requests. Pass in a name to identify your server and a uni¬versally unique identifier (UUID). The method will return a BluetoothServerSocket object — note that the client Bluetooth Socket that connects to this listener will need to know its UUID in order to connect.
Call accept on the Server Socket, optionally passing in a timeout duration, to have it start listening for connections. The Server Socket will now block until a remote Bluetooth Socket client with a matching UUID attempts to connect.
If a connection request is made from a remote device that is not yet paired with the local Bluetooth Adapter, the user will be prompted to accept a pairing request before the accept call returns. This prompt is made via a Notification, or a Dialog, as shown in Figure 16-3.
0/5000
Từ: -
Sang: -
Kết quả (Việt) 1: [Sao chép]
Sao chép!
Each BluetoothDevice object returned through the discovery broadcasts represents a remote Bluetooth Device discovered.In the following sections you will use Bluetooth Device objects to create a connection, bond, and ultimately transfer data between the local Bluetooth Adapter and remote Bluetooth Devices.Bluetooth CommunicationsThe Android Bluetooth communications APIs are wrappers around RFCOMM, the Bluetooth radio frequency communications protocol. RFCOMM supports RS232 serial communication over the Logical Link Control and Adaptation Protocol (L2CAP) layer.In practice, this alphabet soup provides a mechanism for opening communication sockets between two paired Bluetooth devices.(//) Before your application can communicate between devices, the devices must be paired (bonded). If users attempt to connect two unpaired devices, they will be prompted to pair them before the connection is established.You can establish an RFCOMM communication channel for bidirectional communications using the following classes.^ BluetoothServerSocket — Used to establish a listening socket for initiating a link between devices. To establish a handshake, one device acts as a server to listen for, and accept, incoming connection requests.^ BluetoothSocket — Used to create a new client to connect to a listening Bluetooth Server Socket. Also returned by the Bluetooth Server Socket after a connection is established. Once a connection is established, Bluetooth Sockets are used by both the server and client to transfer data streams.When creating an application that uses Bluetooth as a peer-to-peer transport layer, you’ll need to implement both a Bluetooth Server Socket to listen for connections and a Bluetooth Socket to initiate a new channel and handle communications.When connected, the Bluetooth Server Socket returns a Bluetooth Socket that’s then used by the server device to send and receive data. This server-side Bluetooth Socket is used in exactly the same way as the client socket. The designations of server and client are relevant only to how the connec¬tion is established; they don’t affect how data flows after that connection is made.Opening a Bluetooth Server Socket ListenerA Bluetooth Server Socket is used to listen for incoming Bluetooth Socket connection requests from remote Bluetooth Devices. In order for two Bluetooth devices to be connected, one must act as a server (listening for and accepting incoming requests) and the other as a client (initiating the request to connect to the server). After the two are connected, the communications between the server and host device are handled through a Bluetooth Socket at both ends.To have your Bluetooth Adapter act as a server, call its listenUsingRfcommWithServiceRecord method to listen for incoming connection requests. Pass in a name to identify your server and a uni¬versally unique identifier (UUID). The method will return a BluetoothServerSocket object — note that the client Bluetooth Socket that connects to this listener will need to know its UUID in order to connect.Call accept on the Server Socket, optionally passing in a timeout duration, to have it start listening for connections. The Server Socket will now block until a remote Bluetooth Socket client with a matching UUID attempts to connect.If a connection request is made from a remote device that is not yet paired with the local Bluetooth Adapter, the user will be prompted to accept a pairing request before the accept call returns. This prompt is made via a Notification, or a Dialog, as shown in Figure 16-3.
đang được dịch, vui lòng đợi..
Kết quả (Việt) 2:[Sao chép]
Sao chép!
Mỗi đối tượng BluetoothDevice trở lại thông qua các chương trình phát sóng phát hiện một thiết bị Bluetooth từ xa phát hiện ra.
Trong các phần sau, bạn sẽ sử dụng đối tượng thiết bị Bluetooth để tạo ra một kết nối, trái phiếu, và cuối cùng là chuyển dữ liệu giữa Adapter Bluetooth cục bộ và các thiết bị Bluetooth từ xa.
Bluetooth Truyền
Android API truyền Bluetooth là hàm bao quanh RFCOMM, giao thức truyền thông tần số vô tuyến Bluetooth. RFCOMM hỗ trợ RS232 giao tiếp nối tiếp qua các lớp khiển logic Link và thích ứng Protocol (L2CAP).
Trong thực tế, súp bảng chữ cái này cung cấp một cơ chế cho việc mở ổ cắm giao tiếp giữa hai thiết bị Bluetooth đã ghép nối.
(//) Trước khi ứng dụng của bạn có thể giao tiếp giữa các thiết bị, các các thiết bị phải được ghép nối (ngoại quan). Nếu người dùng cố gắng để kết nối hai thiết bị lẻ, họ sẽ được nhắc nhở để ghép chúng trước khi kết nối được thiết lập.
Bạn có thể thiết lập một kênh thông tin liên lạc RFCOMM cho thông tin liên lạc hai chiều bằng cách sử dụng các lớp học sau.
^ BluetoothServerSocket - Được sử dụng để thiết lập một ổ cắm lắng nghe để bắt đầu một liên kết giữa các thiết bị. Để thiết lập một cái bắt tay, một thiết bị hoạt động như một máy chủ để lắng nghe, và chấp nhận, yêu cầu kết nối đến.
^ BluetoothSocket - Được sử dụng để tạo ra một khách hàng mới để kết nối với một máy chủ nghe Bluetooth Socket. Cũng được trả về bởi Bluetooth server socket sau khi một kết nối được thiết lập. Khi một kết nối được thiết lập, Bluetooth Sockets được sử dụng bởi cả hai máy chủ và máy khách để chuyển dòng dữ liệu.
Khi tạo một ứng dụng sử dụng Bluetooth như một tầng peer-to-peer, bạn sẽ cần phải thực hiện cả một Socket Bluetooth Server lắng nghe cho các kết nối và một socket Bluetooth để bắt đầu một kênh mới và xử lý các thông tin liên lạc.
Khi kết nối, Bluetooth server socket trả về một socket Bluetooth đó là sau đó được sử dụng bởi các thiết bị máy chủ để gửi và nhận dữ liệu. Đây server-side Bluetooth socket được sử dụng trong cách chính xác giống như các ổ cắm khách hàng. Các kiểu của máy chủ và máy khách chỉ liên quan đến cách thức connec¬tion được thành lập; họ không ảnh hưởng đến cách các luồng dữ liệu sau khi kết nối được thực hiện.
Mở một Bluetooth server socket Listener
Một Bluetooth server socket được sử dụng để lắng nghe cho đến yêu cầu kết nối Bluetooth socket từ thiết bị Bluetooth từ xa. Để cho hai thiết bị Bluetooth được kết nối, người ta phải hành động như một máy chủ (lắng nghe và chấp nhận yêu cầu đầu vào) và người kia là một khách hàng (bắt đầu các yêu cầu kết nối đến máy chủ). Sau hai được kết nối, thông tin liên lạc giữa máy chủ và thiết bị lưu trữ được xử lý thông qua một Socket Bluetooth ở cả hai đầu.
Để có hành động Bluetooth Adapter của bạn như một máy chủ, gọi phương thức listenUsingRfcommWithServiceRecord của mình để lắng nghe yêu cầu kết nối đến. Pass trong một tên để xác định máy chủ của bạn và nhận dạng uni¬versally duy nhất (UUID). Phương pháp này sẽ trả về một đối tượng BluetoothServerSocket - lưu ý rằng các khách hàng Bluetooth Ổ cắm kết nối với người nghe này sẽ cần phải biết UUID của nó để kết nối.
Gọi chấp nhận trên Socket Server, tùy chọn đi qua trong một thời gian chờ, để có nó bắt đầu nghe cho kết nối. Socket Server bây giờ sẽ chặn cho đến khi một khách hàng Bluetooth socket từ xa với một nỗ lực hợp UUID để kết nối.
Nếu một yêu cầu kết nối được làm từ một thiết bị điều khiển từ xa mà chưa được ghép nối với các adapter Bluetooth cục bộ, người dùng sẽ được nhắc nhở để chấp nhận một kết nối yêu cầu trước khi chấp nhận trả lại cuộc gọi. Nhắc nhở này được thực hiện thông qua một thông báo, hoặc một hộp thoại, như thể hiện trong hình 16-3.
đang được dịch, vui lòng đợi..
 
Các ngôn ngữ khác
Hỗ trợ công cụ dịch thuật: Albania, Amharic, Anh, Armenia, Azerbaijan, Ba Lan, Ba Tư, Bantu, Basque, Belarus, Bengal, Bosnia, Bulgaria, Bồ Đào Nha, Catalan, Cebuano, Chichewa, Corsi, Creole (Haiti), Croatia, Do Thái, Estonia, Filipino, Frisia, Gael Scotland, Galicia, George, Gujarat, Hausa, Hawaii, Hindi, Hmong, Hungary, Hy Lạp, Hà Lan, Hà Lan (Nam Phi), Hàn, Iceland, Igbo, Ireland, Java, Kannada, Kazakh, Khmer, Kinyarwanda, Klingon, Kurd, Kyrgyz, Latinh, Latvia, Litva, Luxembourg, Lào, Macedonia, Malagasy, Malayalam, Malta, Maori, Marathi, Myanmar, Mã Lai, Mông Cổ, Na Uy, Nepal, Nga, Nhật, Odia (Oriya), Pashto, Pháp, Phát hiện ngôn ngữ, Phần Lan, Punjab, Quốc tế ngữ, Rumani, Samoa, Serbia, Sesotho, Shona, Sindhi, Sinhala, Slovak, Slovenia, Somali, Sunda, Swahili, Séc, Tajik, Tamil, Tatar, Telugu, Thái, Thổ Nhĩ Kỳ, Thụy Điển, Tiếng Indonesia, Tiếng Ý, Trung, Trung (Phồn thể), Turkmen, Tây Ban Nha, Ukraina, Urdu, Uyghur, Uzbek, Việt, Xứ Wales, Yiddish, Yoruba, Zulu, Đan Mạch, Đức, Ả Rập, dịch ngôn ngữ.

Copyright ©2024 I Love Translation. All reserved.

E-mail: