BLUETOOTH APPLICATION PROGRAMMING WITH THE JAVA APIS ESSENTIALS EDITION PHẦN 6

Sau khi bắt đầu cuộc điều tra sử dụng startInquiry (), JABWT trả về các thiết bị ứng dụng thông qua các sự kiện deviceDiscovered (). Một sự kiện deviceDiscovered () xảy ra mỗi khi một thiết bị Bluetooth từ xa được tìm thấy bởi các đài phát thanh Bluetooth. | Programming with the API 137 After starting the inquiry using startInquiry JABWT returns devices to the application via deviceDiscovered events. A device-Discovered event occurs every time a remote Bluetooth device is found by the Bluetooth radio. The deviceDiscovered event provides the RemoteDevice object and associated Deviceclass object each time the event occurs. The RemoteDevice object provides the Bluetooth address of a remote Bluetooth device along with methods to retrieve the friendly name and security controls for the remote device. The Deviceclass object contains the class of device of the RemoteDevice. The Deviceclass object is explained further in Section . JABWT provides a way to cancel an inquiry. An application may want to cancel an inquiry once it finds a specific Bluetooth device or if the application is paused or destroyed. The cancelInquiry method cancels an inquiry. To prevent one application from canceling the inquiry of another Bluetooth application the cancelInquiry method takes one parameter the DiscoveryListener object used when the inquiry was started. The cancelInquiry method returns true if the inquiry was canceled. If cancelInquiry returns false an inquiry could not be found associated with the DiscoveryListener provided so no inquiry is canceled. To notify the application that the inquiry has been completed the inquiryCompleted event was added to JABWT. The inquiry-Completed event provides the reason the inquiry ended as an argument to the method. The reason is specified if the inquiry completes normally. The reason is passed as part of the inquiryCompleted event if the inquiry was canceled by the application using the cancelInquiry method. The call to cancel-Inquiry is a non-blocking call. The inquiryCompleted event occurs independently of the cancelInquiry method ending. Finally the inquiryCompleted event receives a DiscoveryListener. INQUIRY_ERROR reason

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.