Bluetooth yazıcıda yazdırması gereken Windows Phone 8.1 mağaza uygulamasını (XAML) geliştiriyorum. kullanmak içinWindows Phone 8.1 streamsocket.connectAsync "Daha fazla veri yok. (HRESULT özel durum: 0x80070103)"
Dim dfdevs1 = Await DeviceInformation.FindAllAsync(RfcommDeviceService.GetDeviceSelector(RfcommServiceId.SerialPort))
' same result with Await DeviceInformation.FindAllAsync(RfcommDeviceService.GetDeviceSelector(RfcommServiceId.FromUuid(New Guid("00001101-0000-1000-8000-00805F9B34FB")))
Maalesef sadece son yöntem bana "RemoteServiceName" verecektir:
PeerFinder.AllowBluetooth = True
PeerFinder.Role = PeerRole.Client
PeerFinder.AlternateIdentities.Item("Bluetooth:SDP") = "{00001101-0000-1000-8000-00805F9B34FB}"
'PeerFinder.AlternateIdentities.Item("Bluetooth:Paired") = ""
Dim devs = Await PeerFinder.FindAllPeersAsync()
Dim dev As PeerInformation = devs(0)
Dim btdevs = Await DeviceInformation.FindAllAsync(BluetoothDevice.GetDeviceSelector())
Dim btdv = btdevs(0)
Ve bulundu:
cihaz ilk iki yöntemle başarıyla bulunursa StreamSocket.ConnectAsync
StreamSocket.ConnectAsync için farklı bir bileşimi denedim:
"Daha fazla veri yok. (HRESULT özel durum: 0x80070103)"
dim _soc = New StreamSocket()
Await _soc.ConnectAsync(dev.HostName, "{00001101-0000-1000-8000-00805F9B34FB}"
için aynı Ve Başımı beceriyor bazı gün sonra fikirlerin dışarı gerçekten öyleyim
dim _soc = New StreamSocket()
Await _soc.ConnectAsync(btdv.HostName, "{00001101-0000-1000-8000-00805F9B34FB}"
için aynı tahmin edebileceğiniz gibi. Ve beni en çok rahatsız eden şey, kodun ilk kombinasyonunun Windows Phone 8.0
için Evet ve Evet, AppManifest öğesinde her şey ayarlanmış olmasıdır:
<DeviceCapability Name="proximity" />
<m2:DeviceCapability Name="bluetooth.rfcomm">
<m2:Device Id="any">
<!--<m2:Function Type="name:serialPort" />-->
<m2:Function Type="serviceId:00001101-0000-1000-8000-00805F9B34FB" />
</m2:Device>
</m2:DeviceCapability>
Herhangi bir fikir çok takdir edilecektir.