2016-06-30 4 views
1

Windows IoT 코어에서 실행되는 Raspberry Pi 3을 사용하여 맞춤 장치 페어링을 시도하고 있습니다. 장치 열거 및 사용자 지정 페어링 (시나리오 9) https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/DeviceEnumerationAndPairing/cs 용 github에 제공된 공식 샘플은 사용자 상호 작용이 가능한 로컬 컴퓨터에서 올바르게 작동합니다.맞춤형 페어링을 위해 Windows iot 코어에서 확인을 제공하는 방법

하지만 Windows에서 어떻게해야합니까? 심지어 샘플 코드는이 데스크톱 또는 모바일에서 실행되는 경우

// 윈도우 자체가 "동의"의 일환으로 확인 대화 상자가 나타납니다 말한다

//이 윈도우의 IoT 코어 '에 대한 앱의 경우 'Windows Consent UX가없는 경우 사용자 자신의 확인을 제공 할 수 있습니다.

private async void PairingRequestedHandler(
     DeviceInformationCustomPairing sender, 
     DevicePairingRequestedEventArgs args) 
    { 
     switch (args.PairingKind) 
     { 
      case DevicePairingKinds.ConfirmOnly: 
      // Windows itself will pop the confirmation dialog as part of "consent" 
      //if this is running on Desktop or Mobile 
      // If this is an App for 'Windows IoT Core' where there is no Windows 
      //Consent UX, you may want to provide your own confirmation. 

       args.Accept(); 
       break; 

어떻게 내 자신의 확인을 제공합니까? 도와주세요

답변

1

확인은 선택 사항이며 시스템 수준 사용자 환경의 일부로 데스크톱과 모바일에서만 수행됩니다. Accept 메서드를 호출하면 페어링이 진행됩니다. 당신이 MessageDialog 현재의 IoT 코어에서 지원되지 않기 때문에 확인 일들이 까다로운 제공하는 경우

는 : 대안으로 https://developer.microsoft.com/en-us/windows/iot/win10/unavailableapis

, 다른 경험을 모방 creating your own UserControl 또는 using a Flyout을 제안했다.

0

공식 IoTCoreDefaultApp는 Visibility 속성 "Yes"및 "No"버튼을 사용하여 동작을 모방합니다.

enter image description here

체크 아웃 https://github.com/ms-iot/samples/tree/develop/IoTCoreDefaultApp에서 샘플 코드를.

특히, https://github.com/ms-iot/samples/blob/develop/IoTCoreDefaultApp/IoTCoreDefaultApp/Views/Settings.xaml.cs에 선 536 ~ 562에서

private async void DisplayMessagePanel(string confirmationMessage, MessageType messageType) 

조심.

이것은 IoT 앱에서 사용할 수있는 트릭입니다.