コード例 #1
0
 async void ProcessOnCloseCommandSessionComplete(IMbnDeviceService deviceService, int status, uint requestId)
 {
     await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
     {
         string deviceServiceID   = deviceService.DeviceServiceID;
         deviceServicesOutputStr += "\nOnCloseCommandSessionComplete event received for DS: " + deviceServiceID + " request ID: " + requestId.ToString() + " status: 0x" + status.ToString("X");
         rootPage.NotifyUser(deviceServicesOutputStr, NotifyType.StatusMessage);
     });
 }
コード例 #2
0
        public void OnCloseCommandSessionComplete(IMbnDeviceService deviceService, int status, uint requestId)
        {
            OnCloseCommandSessionCompleteHandler callback;

            if (m_OnCloseCommandCallback.TryGetTarget(out callback))
            {
                callback.Invoke(deviceService, status, requestId);
            }
        }
コード例 #3
0
        public void OnQueryCommandComplete(IMbnDeviceService deviceService, uint responseId, byte[] deviceServiceData, int status, uint requestId)
        {
            OnQueryCommandCompleteHandler callback;

            if (m_OnQueryCommandCallback.TryGetTarget(out callback))
            {
                callback.Invoke(deviceService, responseId, deviceServiceData, status, requestId);
            }
        }
コード例 #4
0
        // This will be called back when open command session operation is complete
        public void OnOpenCommandSessionComplete(IMbnDeviceService deviceService, int status, uint requestId)
        {
            // Invoke main page thread to show UI
            OnOpenCommandSessionCompleteHandler callback;

            if (m_OnOpenCommandSessionCallback.TryGetTarget(out callback))
            {
                callback.Invoke(deviceService, status, requestId);
            }
        }
コード例 #5
0
        public void OnSetCommandComplete(IMbnDeviceService deviceService, uint responseID, Array deviceServiceData, int status, uint requestID)
        {
            // Invoke main page thread to show UI
            OnSetCommandCompleteHandler callback;

            if (m_OnSetCommandCallback.TryGetTarget(out callback))
            {
                callback.Invoke(deviceService, responseID, (byte[])deviceServiceData, status, requestID);
            }
        }
コード例 #6
0
        async void ProcessOnOpenCommandSessionComplete(IMbnDeviceService deviceService, int status, uint requestId)
        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, new DispatchedHandler(() =>
            {
                try
                {
                    string deviceServiceID = deviceService.DeviceServiceID;
                    deviceServicesOutputStr += "\nOnOpenCommandSessionComplete event received for DS: " + deviceServiceID + " request ID: " + requestId.ToString() + " status: 0x" + status.ToString("X");
                    if (deviceService.IsCommandSessionOpen == 1)
                    {
                        uint queryRequestID = 0;
                        // Generate query data
                        // Create the MBIM_PHONEBOOK_READ_REQ structure to get all entries in the phonebook
                        // We use the DataWriter object for this purpose
                        DataWriter dataWriter = new DataWriter();
                        dataWriter.ByteOrder = ByteOrder.LittleEndian; // MBIM byte ordering is Little Endian

                        dataWriter.WriteInt32(0);                      // FilterFlag = MBIMPhonebookFlagAll
                        dataWriter.WriteInt32(0);                      // FilterMessageIndex = 0

                        // Get the raw bytes out so that we can send it down to the API
                        byte[] data = dataWriter.DetachBuffer().ToArray();

                        uint commandID = 2;  // MBIM_CID_PHONEBOOK_READ
                        // Query command
                        deviceService.QueryCommand(commandID, data, out queryRequestID);
                        deviceServicesOutputStr += "\n\nWaiting for QueryCommand to complete for requestId: " + queryRequestID.ToString() + "\n";
                    }
                    rootPage.NotifyUser(deviceServicesOutputStr, NotifyType.StatusMessage);
                }
                catch (Exception e)
                {
                    deviceServicesOutputStr = "";
                    rootPage.NotifyUser(ParseExceptionCode(e), NotifyType.ErrorMessage);
                    if (deviceService.IsCommandSessionOpen == 1)
                    {
                        // Close command session
                        uint closeRequestID = 0;
                        deviceService.CloseCommandSession(out closeRequestID);
                        rootPage.NotifyUser("Waiting for CloseCommandSession to complete for requestId: " + closeRequestID.ToString(), NotifyType.StatusMessage);
                    }
                }
            }));
        }
コード例 #7
0
        async void ProcessOnQueryCommandComplete(IMbnDeviceService deviceService, uint responseId, byte[] deviceServiceData, int status, uint requestId)
        {
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                try
                {
                    string deviceServiceID   = deviceService.DeviceServiceID;
                    deviceServicesOutputStr += "\nOnQueryCommandComplete event received for DS: " + deviceServiceID + " request ID: " + requestId.ToString() + " status: 0x" + status.ToString("X");
                    ParseResponse(deviceServiceData);

                    // Close command session
                    uint closeRequestID = 0;
                    deviceService.CloseCommandSession(out closeRequestID);
                    deviceServicesOutputStr += "\n\nWaiting for CloseCommandSession to complete for requestId: " + closeRequestID.ToString() + "\n";
                    rootPage.NotifyUser(deviceServicesOutputStr, NotifyType.StatusMessage);
                }
                catch (Exception e)
                {
                    deviceServicesOutputStr = "";
                    rootPage.NotifyUser(ParseExceptionCode(e), NotifyType.ErrorMessage);
                }
            });
        }
コード例 #8
0
ファイル: MBApiImplementation.cs プロジェクト: mbin/Win81App
 // This will be called back when close command session operation is complete
 public void OnCloseCommandSessionComplete(IMbnDeviceService deviceService, int status, uint requestId)
 {
     // Invoke main page thread to show UI
     OnCloseCommandSessionCompleteHandler callback;
     if (m_OnCloseCommandCallback.TryGetTarget(out callback))
     {
         callback.Invoke(deviceService, status, requestId);
     }
 }
コード例 #9
0
ファイル: MBApiImplementation.cs プロジェクト: mbin/Win81App
 // Not implemented for sample
 public void OnSetCommandComplete(IMbnDeviceService deviceService, uint responseId, byte[] deviceServiceData, int status, uint requestId) { }
コード例 #10
0
 public void OnWriteDataComplete(IMbnDeviceService deviceService, int status, uint requestId)
 {
 }
コード例 #11
0
ファイル: MBApiImplementation.cs プロジェクト: mbin/Win81App
 // This will be called back when query command operation is complete
 public void OnQueryCommandComplete(IMbnDeviceService deviceService, uint responseId, byte[] deviceServiceData, int status, uint requestId)
 {
     // Invoke main page thread to show UI
     OnQueryCommandCompleteHandler callback;
     if (m_OnQueryCommandCallback.TryGetTarget(out callback))
     {
         callback.Invoke(deviceService, responseId, deviceServiceData, status, requestId);
     }
 }
コード例 #12
0
ファイル: MBApiImplementation.cs プロジェクト: mbin/Win81App
 public void OnReadData(IMbnDeviceService deviceService, byte[] deviceServiceData) { }
コード例 #13
0
 private void ProcessOnSetCommandComplete(IMbnDeviceService deviceService, uint responseID, byte[] deviceServiceData, int status, uint requestID)
 {
     LogMessage("ProcessOnSetCommandComplete");
 }
コード例 #14
0
 public void OnEventNotification(IMbnDeviceService deviceService, uint eventId, byte[] deviceServiceData)
 {
 }
コード例 #15
0
ファイル: MBApiImplementation.cs プロジェクト: mbin/Win81App
 public void OnCloseDataSessionComplete(IMbnDeviceService deviceService, int status, uint requestId) { }
コード例 #16
0
 public void OnWriteDataComplete(IMbnDeviceService deviceService, int status, uint requestID)
 {
     Console.WriteLine("OnWriteDataComplete");
 }
コード例 #17
0
 public void OnReadData(IMbnDeviceService deviceService, Array deviceServiceData)
 {
     Console.WriteLine("OnReadData");
 }
コード例 #18
0
 public void OnEventNotification(IMbnDeviceService deviceService, uint eventID, Array deviceServiceData)
 {
     Console.WriteLine("OnEventNotification");
 }
コード例 #19
0
 public void OnQuerySupportedCommandsComplete(IMbnDeviceService deviceService, uint[] commandIDList, int status, uint requestId)
 {
 }
コード例 #20
0
 public void OnReadData(IMbnDeviceService deviceService, byte[] deviceServiceData)
 {
 }
コード例 #21
0
ファイル: MBApiImplementation.cs プロジェクト: mbin/Win81App
 public void OnEventNotification(IMbnDeviceService deviceService, uint eventId, byte[] deviceServiceData) { }
コード例 #22
0
 // Not implemented for sample
 public void OnSetCommandComplete(IMbnDeviceService deviceService, uint responseId, byte[] deviceServiceData, int status, uint requestId)
 {
 }
コード例 #23
0
ファイル: MBApiImplementation.cs プロジェクト: mbin/Win81App
 public void OnQuerySupportedCommandsComplete(IMbnDeviceService deviceService, uint[] commandIDList, int status, uint requestId) { }
コード例 #24
0
 public void OnQuerySupportedCommandsComplete(IMbnDeviceService deviceService, Array commandIDList, int status, uint requestID)
 {
     Console.WriteLine("OnQuerySupportedCommandsComplete");
 }
コード例 #25
0
ファイル: MBApiImplementation.cs プロジェクト: mbin/Win81App
 public void OnWriteDataComplete(IMbnDeviceService deviceService, int status, uint requestId) { }
コード例 #26
0
ファイル: MBApiImplementation.cs プロジェクト: mbin/Win81App
        async void ProcessOnQueryCommandComplete(IMbnDeviceService deviceService, uint responseId, byte[] deviceServiceData, int status, uint requestId)
        {
            // Dispatch to UI thread
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                try
                {
                    string deviceServiceID = deviceService.DeviceServiceID;
                    deviceServicesOutputStr += "\nOnQueryCommandComplete event received for DS: " + deviceServiceID + " request ID: " + requestId.ToString() + " status: 0x" + status.ToString("X");
                    ParseResponse(deviceServiceData);

                    // Close command session
                    uint closeRequestID = 0;
                    deviceService.CloseCommandSession(out closeRequestID);
                    deviceServicesOutputStr += "\n\nWaiting for CloseCommandSession to complete for requestId: " + closeRequestID.ToString() + "\n";
                    rootPage.NotifyUser(deviceServicesOutputStr, NotifyType.StatusMessage);
                }
                catch (Exception e)
                {
                    deviceServicesOutputStr = "";
                    rootPage.NotifyUser(ParseExceptionCode(e), NotifyType.ErrorMessage);
                }
            });
        }
コード例 #27
0
ファイル: MBApiImplementation.cs プロジェクト: mbin/Win81App
        async void ProcessOnOpenCommandSessionComplete(IMbnDeviceService deviceService, int status, uint requestId)
        {
            // Dispatch to UI thread
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, new DispatchedHandler(() =>
            {
                try
                {
                    string deviceServiceID = deviceService.DeviceServiceID;
                    deviceServicesOutputStr += "\nOnOpenCommandSessionComplete event received for DS: " + deviceServiceID + " request ID: " + requestId.ToString() + " status: 0x" + status.ToString("X");
                    if (deviceService.IsCommandSessionOpen == 1)
                    {
                        uint queryRequestID = 0;
                        // Generate query data
                        // Create the MBIM_PHONEBOOK_READ_REQ structure to get all entries in the phonebook
                        // We use the DataWriter object for this purpose
                        DataWriter dataWriter = new DataWriter();
                        dataWriter.ByteOrder = ByteOrder.LittleEndian;  // MBIM byte ordering is Little Endian

                        dataWriter.WriteInt32(0);   // FilterFlag = MBIMPhonebookFlagAll
                        dataWriter.WriteInt32(0);   // FilterMessageIndex = 0

                        // Get the raw bytes out so that we can send it down to the API
                        byte[] data = dataWriter.DetachBuffer().ToArray();

                        uint commandID = 2;  // MBIM_CID_PHONEBOOK_READ
                        // Query command
                        deviceService.QueryCommand(commandID, data, out queryRequestID);
                        deviceServicesOutputStr += "\n\nWaiting for QueryCommand to complete for requestId: " + queryRequestID.ToString() + "\n";
                    }
                    rootPage.NotifyUser(deviceServicesOutputStr, NotifyType.StatusMessage);
                }
                catch (Exception e)
                {
                    deviceServicesOutputStr = "";
                    rootPage.NotifyUser(ParseExceptionCode(e), NotifyType.ErrorMessage);
                    if (deviceService.IsCommandSessionOpen == 1)
                    {
                        // Close command session
                        uint closeRequestID = 0;
                        deviceService.CloseCommandSession(out closeRequestID);
                        rootPage.NotifyUser("Waiting for CloseCommandSession to complete for requestId: " + closeRequestID.ToString(), NotifyType.StatusMessage);
                    }
                }
            }));
        }
コード例 #28
0
ファイル: MBApiImplementation.cs プロジェクト: mbin/Win81App
 async void ProcessOnCloseCommandSessionComplete(IMbnDeviceService deviceService, int status, uint requestId)
 {
     // Dispatch to UI thread
     await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
     {
         string deviceServiceID = deviceService.DeviceServiceID;
         deviceServicesOutputStr += "\nOnCloseCommandSessionComplete event received for DS: " + deviceServiceID + " request ID: " + requestId.ToString() + " status: 0x" + status.ToString("X");
         rootPage.NotifyUser(deviceServicesOutputStr, NotifyType.StatusMessage);
     });
 }
コード例 #29
0
 private void ProcessOnCloseCommandSessionComplete(IMbnDeviceService deviceService, int status, uint requestId)
 {
     LogMessage("ProcessOnCloseCommandSessionComplete");
 }
コード例 #30
0
 public void OnCloseDataSessionComplete(IMbnDeviceService deviceService, int status, uint requestId)
 {
 }