Windows::Devices::Enumeration::DeviceInformationCollection services{ co_await Windows::Devices::Enumeration::DeviceInformation::FindAllAsync( Windows::Devices::Bluetooth::Rfcomm::RfcommDeviceService::GetDeviceSelector( Windows::Devices::Bluetooth::Rfcomm::RfcommServiceId::ObexObjectPush())) }; //if (services.Size() > 0) { // Initialize the target Bluetooth BR device. Windows::Devices::Bluetooth::Rfcomm::RfcommDeviceService service{ co_await Windows::Devices::Bluetooth::Rfcomm::RfcommDeviceService::FromIdAsync(services.GetAt(0).Id()) }; // Check that the service meets this App's minimum // requirement // if (SupportsProtection(service) // && co_await IsCompatibleVersion(service)) { printf("Connection name \n"); m_service = service; printf("Connection name %ls \n", m_service.ConnectionHostName().DisplayName().c_str()); printf("Service name %ls \n ", m_service.ConnectionServiceName().c_str()); printf("Current Status %d \n ", m_service.DeviceAccessInformation().CurrentStatus()); // Create a socket and connect to the target co_await m_socket.ConnectAsync( m_service.ConnectionHostName(), m_service.ConnectionServiceName(), Windows::Networking::Sockets::SocketProtectionLevel::BluetoothEncryptionAllowNullAuthentication); //Socket Progam // I'm able to create a socket but not getting how to transfer file from PC to phone // should I need to write on android phone also to fetch the details.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)