private static int DoGet(IntPtr aPtr, IntPtr aInvocation) { GCHandle gch = GCHandle.FromIntPtr(aPtr); DvProviderAvOpenhomeOrgCredentials1 self = (DvProviderAvOpenhomeOrgCredentials1)gch.Target; DvInvocation invocation = new DvInvocation(aInvocation); string id; string userName; byte[] password; bool enabled; string status; string data; try { invocation.ReadStart(); id = invocation.ReadString("Id"); invocation.ReadEnd(); self.Get(invocation, id, out userName, out password, out enabled, out status, out data); } catch (ActionError e) { invocation.ReportActionError(e, "Get"); return(-1); } catch (PropertyUpdateError) { invocation.ReportError(501, String.Format("Invalid value for property {0}", new object[] { "Get" })); return(-1); } catch (Exception e) { System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "Get" }); System.Diagnostics.Debug.WriteLine(" Only ActionError or PropertyUpdateError should be thrown by actions"); return(-1); } try { invocation.WriteStart(); invocation.WriteString("UserName", userName); invocation.WriteBinary("Password", password); invocation.WriteBool("Enabled", enabled); invocation.WriteString("Status", status); invocation.WriteString("Data", data); invocation.WriteEnd(); } catch (ActionError) { return(-1); } catch (System.Exception e) { System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "Get" }); System.Diagnostics.Debug.WriteLine(" Only ActionError can be thrown by action response writer"); } return(0); }
private static int DoRead(IntPtr aPtr, IntPtr aInvocation) { GCHandle gch = GCHandle.FromIntPtr(aPtr); DvProviderLinnCoUkFlash1 self = (DvProviderLinnCoUkFlash1)gch.Target; DvInvocation invocation = new DvInvocation(aInvocation); uint aId; uint aAddress; uint aLength; byte[] aBuffer; try { invocation.ReadStart(); aId = invocation.ReadUint("aId"); aAddress = invocation.ReadUint("aAddress"); aLength = invocation.ReadUint("aLength"); invocation.ReadEnd(); self.Read(invocation, aId, aAddress, aLength, out aBuffer); } catch (ActionError e) { invocation.ReportActionError(e, "Read"); return(-1); } catch (PropertyUpdateError) { invocation.ReportError(501, String.Format("Invalid value for property {0}", new object[] { "Read" })); return(-1); } catch (Exception e) { System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "Read" }); System.Diagnostics.Debug.WriteLine(" Only ActionError or PropertyUpdateError should be thrown by actions"); return(-1); } try { invocation.WriteStart(); invocation.WriteBinary("aBuffer", aBuffer); invocation.WriteEnd(); } catch (ActionError) { return(-1); } catch (System.Exception e) { System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "Read" }); System.Diagnostics.Debug.WriteLine(" Only ActionError can be thrown by action response writer"); } return(0); }
private static int DoPlaylistReadArray(IntPtr aPtr, IntPtr aInvocation) { GCHandle gch = GCHandle.FromIntPtr(aPtr); DvProviderAvOpenhomeOrgPlaylistManager1 self = (DvProviderAvOpenhomeOrgPlaylistManager1)gch.Target; DvInvocation invocation = new DvInvocation(aInvocation); uint id; byte[] array; try { invocation.ReadStart(); id = invocation.ReadUint("Id"); invocation.ReadEnd(); self.PlaylistReadArray(invocation, id, out array); } catch (ActionError e) { invocation.ReportActionError(e, "PlaylistReadArray"); return -1; } catch (PropertyUpdateError) { invocation.ReportError(501, String.Format("Invalid value for property {0}", "PlaylistReadArray")); return -1; } catch (Exception e) { Console.WriteLine("WARNING: unexpected exception {0}(\"{1}\") thrown by {2} in {3}", e.GetType(), e.Message, "PlaylistReadArray", e.TargetSite.Name); Console.WriteLine(" Only ActionError or PropertyUpdateError should be thrown by actions"); return -1; } try { invocation.WriteStart(); invocation.WriteBinary("Array", array); invocation.WriteEnd(); } catch (ActionError) { return -1; } catch (System.Exception e) { Console.WriteLine("ERROR: unexpected exception {0}(\"{1}\") thrown by {2} in {3}", e.GetType(), e.Message, "PlaylistReadArray", e.TargetSite.Name); Console.WriteLine(" Only ActionError can be thrown by action response writer"); } return 0; }
private static int DoIdArray(IntPtr aPtr, IntPtr aInvocation, uint aVersion) { GCHandle gch = GCHandle.FromIntPtr(aPtr); DvProviderAvOpenhomeOrgRadio1 self = (DvProviderAvOpenhomeOrgRadio1)gch.Target; DvInvocation invocation = new DvInvocation(aInvocation); uint token; byte[] array; try { invocation.ReadStart(); invocation.ReadEnd(); self.IdArray(aVersion, out token, out array); } catch (ActionError) { invocation.ReportError(501, "Invalid XML"); return -1; } catch (PropertyUpdateError) { invocation.ReportError(501, "Invalid XML"); return -1; } catch (Exception e) { Console.WriteLine("WARNING: unexpected exception {0}(\"{1}\") thrown by {2}", e.GetType(), e.Message, e.TargetSite.Name); Console.WriteLine(" Only ActionError or PropertyUpdateError can be thrown by actions"); return -1; } try { invocation.WriteStart(); invocation.WriteUint("Token", token); invocation.WriteBinary("Array", array); invocation.WriteEnd(); } catch (ActionError) { return -1; } catch (System.Exception e) { Console.WriteLine("ERROR: unexpected exception {0}(\"{1}\") thrown by {2}", e.GetType(), e.Message, e.TargetSite.Name); Console.WriteLine(" Only ActionError can be thrown by action response writer"); System.Diagnostics.Process.GetCurrentProcess().Kill(); } return 0; }
private static int DoGetBinary(IntPtr aPtr, IntPtr aInvocation) { GCHandle gch = GCHandle.FromIntPtr(aPtr); DvProviderOpenhomeOrgTestBasic1 self = (DvProviderOpenhomeOrgTestBasic1)gch.Target; DvInvocation invocation = new DvInvocation(aInvocation); byte[] valueBin; try { invocation.ReadStart(); invocation.ReadEnd(); self.GetBinary(invocation, out valueBin); } catch (ActionError e) { invocation.ReportActionError(e, "GetBinary"); return -1; } catch (PropertyUpdateError) { invocation.ReportError(501, String.Format("Invalid value for property {0}", new object[] { "GetBinary" })); return -1; } catch (Exception e) { System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "GetBinary" }); System.Diagnostics.Debug.WriteLine(" Only ActionError or PropertyUpdateError should be thrown by actions"); return -1; } try { invocation.WriteStart(); invocation.WriteBinary("ValueBin", valueBin); invocation.WriteEnd(); } catch (ActionError) { return -1; } catch (System.Exception e) { System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "GetBinary" }); System.Diagnostics.Debug.WriteLine(" Only ActionError can be thrown by action response writer"); } return 0; }
private static int DoEchoBinary(IntPtr aPtr, IntPtr aInvocation) { GCHandle gch = GCHandle.FromIntPtr(aPtr); DvProviderOpenhomeOrgTestBasic1 self = (DvProviderOpenhomeOrgTestBasic1)gch.Target; DvInvocation invocation = new DvInvocation(aInvocation); byte[] value; byte[] result; try { invocation.ReadStart(); value = invocation.ReadBinary("Value"); invocation.ReadEnd(); self.EchoBinary(invocation, value, out result); } catch (ActionError e) { invocation.ReportActionError(e, "EchoBinary"); return -1; } catch (PropertyUpdateError) { invocation.ReportError(501, String.Format("Invalid value for property {0}", "EchoBinary")); return -1; } catch (Exception e) { Console.WriteLine("WARNING: unexpected exception {0}(\"{1}\") thrown by {2} in {3}", e.GetType(), e.Message, "EchoBinary", e.TargetSite.Name); Console.WriteLine(" Only ActionError or PropertyUpdateError should be thrown by actions"); return -1; } try { invocation.WriteStart(); invocation.WriteBinary("Result", result); invocation.WriteEnd(); } catch (ActionError) { return -1; } catch (System.Exception e) { Console.WriteLine("ERROR: unexpected exception {0}(\"{1}\") thrown by {2} in {3}", e.GetType(), e.Message, "EchoBinary", e.TargetSite.Name); Console.WriteLine(" Only ActionError can be thrown by action response writer"); } return 0; }
private static int DoEchoBinary(IntPtr aPtr, IntPtr aInvocation, uint aVersion) { GCHandle gch = GCHandle.FromIntPtr(aPtr); DvProviderOpenhomeOrgTestBasic1 self = (DvProviderOpenhomeOrgTestBasic1)gch.Target; DvInvocation invocation = new DvInvocation(aInvocation); byte[] value; byte[] result; try { invocation.ReadStart(); value = invocation.ReadBinary("Value"); invocation.ReadEnd(); self.EchoBinary(aVersion, value, out result); } catch (ActionError) { invocation.ReportError(501, "Invalid XML"); return -1; } catch (PropertyUpdateError) { invocation.ReportError(501, "Invalid XML"); return -1; } catch (Exception e) { Console.WriteLine("WARNING: unexpected exception {0}(\"{1}\") thrown by {2}", e.GetType(), e.Message, e.TargetSite.Name); Console.WriteLine(" Only ActionError or PropertyUpdateError can be thrown by actions"); return -1; } try { invocation.WriteStart(); invocation.WriteBinary("Result", result); invocation.WriteEnd(); } catch (ActionError) { return -1; } catch (System.Exception e) { Console.WriteLine("ERROR: unexpected exception {0}(\"{1}\") thrown by {2}", e.GetType(), e.Message, e.TargetSite.Name); Console.WriteLine(" Only ActionError can be thrown by action response writer"); System.Diagnostics.Process.GetCurrentProcess().Kill(); } return 0; }
private static int DoGet(IntPtr aPtr, IntPtr aInvocation) { GCHandle gch = GCHandle.FromIntPtr(aPtr); DvProviderAvOpenhomeOrgCredentials1 self = (DvProviderAvOpenhomeOrgCredentials1)gch.Target; DvInvocation invocation = new DvInvocation(aInvocation); string id; string userName; byte[] password; bool enabled; string status; string data; try { invocation.ReadStart(); id = invocation.ReadString("Id"); invocation.ReadEnd(); self.Get(invocation, id, out userName, out password, out enabled, out status, out data); } catch (ActionError e) { invocation.ReportActionError(e, "Get"); return -1; } catch (PropertyUpdateError) { invocation.ReportError(501, String.Format("Invalid value for property {0}", "Get")); return -1; } catch (Exception e) { Console.WriteLine("WARNING: unexpected exception {0}(\"{1}\") thrown by {2} in {3}", e.GetType(), e.Message, "Get", e.TargetSite.Name); Console.WriteLine(" Only ActionError or PropertyUpdateError should be thrown by actions"); return -1; } try { invocation.WriteStart(); invocation.WriteString("UserName", userName); invocation.WriteBinary("Password", password); invocation.WriteBool("Enabled", enabled); invocation.WriteString("Status", status); invocation.WriteString("Data", data); invocation.WriteEnd(); } catch (ActionError) { return -1; } catch (System.Exception e) { Console.WriteLine("ERROR: unexpected exception {0}(\"{1}\") thrown by {2} in {3}", e.GetType(), e.Message, "Get", e.TargetSite.Name); Console.WriteLine(" Only ActionError can be thrown by action response writer"); } return 0; }