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); }); }
public void OnCloseCommandSessionComplete(IMbnDeviceService deviceService, int status, uint requestId) { OnCloseCommandSessionCompleteHandler callback; if (m_OnCloseCommandCallback.TryGetTarget(out callback)) { callback.Invoke(deviceService, status, requestId); } }
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); } }
// 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); } }
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); } }
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); } } })); }
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); } }); }
// 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); } }
// Not implemented for sample public void OnSetCommandComplete(IMbnDeviceService deviceService, uint responseId, byte[] deviceServiceData, int status, uint requestId) { }
public void OnWriteDataComplete(IMbnDeviceService deviceService, int status, uint requestId) { }
// 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); } }
public void OnReadData(IMbnDeviceService deviceService, byte[] deviceServiceData) { }
private void ProcessOnSetCommandComplete(IMbnDeviceService deviceService, uint responseID, byte[] deviceServiceData, int status, uint requestID) { LogMessage("ProcessOnSetCommandComplete"); }
public void OnEventNotification(IMbnDeviceService deviceService, uint eventId, byte[] deviceServiceData) { }
public void OnCloseDataSessionComplete(IMbnDeviceService deviceService, int status, uint requestId) { }
public void OnWriteDataComplete(IMbnDeviceService deviceService, int status, uint requestID) { Console.WriteLine("OnWriteDataComplete"); }
public void OnReadData(IMbnDeviceService deviceService, Array deviceServiceData) { Console.WriteLine("OnReadData"); }
public void OnEventNotification(IMbnDeviceService deviceService, uint eventID, Array deviceServiceData) { Console.WriteLine("OnEventNotification"); }
public void OnQuerySupportedCommandsComplete(IMbnDeviceService deviceService, uint[] commandIDList, int status, uint requestId) { }
public void OnQuerySupportedCommandsComplete(IMbnDeviceService deviceService, Array commandIDList, int status, uint requestID) { Console.WriteLine("OnQuerySupportedCommandsComplete"); }
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); } }); }
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); } } })); }
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); }); }
private void ProcessOnCloseCommandSessionComplete(IMbnDeviceService deviceService, int status, uint requestId) { LogMessage("ProcessOnCloseCommandSessionComplete"); }