GetCurrentConnectionInfo() protected method

GetCurrentConnectionInfo action.
Will be called when the device stack receives an invocation of the GetCurrentConnectionInfo action for the owning device. Must be implemented iff EnableActionGetCurrentConnectionInfo was called.
protected GetCurrentConnectionInfo ( IDvInvocation aInvocation, int aConnectionID, int &aRcsID, int &aAVTransportID, string &aProtocolInfo, string &aPeerConnectionManager, int &aPeerConnectionID, string &aDirection, string &aStatus ) : void
aInvocation IDvInvocation Interface allowing querying of aspects of this particular action invocation.
aConnectionID int
aRcsID int
aAVTransportID int
aProtocolInfo string
aPeerConnectionManager string
aPeerConnectionID int
aDirection string
aStatus string
return void
Beispiel #1
0
        private static int DoGetCurrentConnectionInfo(IntPtr aPtr, IntPtr aInvocation)
        {
            GCHandle gch = GCHandle.FromIntPtr(aPtr);
            DvProviderUpnpOrgConnectionManager1 self = (DvProviderUpnpOrgConnectionManager1)gch.Target;
            DvInvocation invocation = new DvInvocation(aInvocation);
            int          connectionID;
            int          rcsID;
            int          aVTransportID;
            string       protocolInfo;
            string       peerConnectionManager;
            int          peerConnectionID;
            string       direction;
            string       status;

            try
            {
                invocation.ReadStart();
                connectionID = invocation.ReadInt("ConnectionID");
                invocation.ReadEnd();
                self.GetCurrentConnectionInfo(invocation, connectionID, out rcsID, out aVTransportID, out protocolInfo, out peerConnectionManager, out peerConnectionID, out direction, out status);
            }
            catch (ActionError e)
            {
                invocation.ReportActionError(e, "GetCurrentConnectionInfo");
                return(-1);
            }
            catch (PropertyUpdateError)
            {
                invocation.ReportError(501, String.Format("Invalid value for property {0}", new object[] { "GetCurrentConnectionInfo" }));
                return(-1);
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "GetCurrentConnectionInfo" });
                System.Diagnostics.Debug.WriteLine("         Only ActionError or PropertyUpdateError should be thrown by actions");
                return(-1);
            }
            try
            {
                invocation.WriteStart();
                invocation.WriteInt("RcsID", rcsID);
                invocation.WriteInt("AVTransportID", aVTransportID);
                invocation.WriteString("ProtocolInfo", protocolInfo);
                invocation.WriteString("PeerConnectionManager", peerConnectionManager);
                invocation.WriteInt("PeerConnectionID", peerConnectionID);
                invocation.WriteString("Direction", direction);
                invocation.WriteString("Status", status);
                invocation.WriteEnd();
            }
            catch (ActionError)
            {
                return(-1);
            }
            catch (System.Exception e)
            {
                System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "GetCurrentConnectionInfo" });
                System.Diagnostics.Debug.WriteLine("       Only ActionError can be thrown by action response writer");
            }
            return(0);
        }