Connect to Bluetooth Device / how to set the rfcomm capability

前端 未结 1 1280
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-22 07:48

I\'m trying to connect to a BlueTooth device

I have paired it and when I search for it I find it :

private async void Grid_DoubleTapped(object send         


        
1条回答
  •  伪装坚强ぢ
    2020-12-22 08:31

    So you want to know what you have to write in the manifest file, as well as how to connect?

    Manifest file:

       
          
            
          
        
    
    • You can keep Id at "any".
    • Function type could either be "name:serialPort" or the serviceId specified in the example.

    Connecting:

    StreamSocket _socket;    
    RfcommDeviceService service = await RfcommDeviceService.FromIdAsync(device.id);
    await _socket.ConnectAsync(service.ConnectionHostName, service.ConnectionServiceName);
    

    Should be able to do the trick.

    0 讨论(0)
提交回复
热议问题