Example #1
0
            protected UPnPService BuildUPnPService()
            {
                UPnPStateVariable[] RetVal = new UPnPStateVariable[21];
                RetVal[0] = new UPnPModeratedStateVariable("VerticalKeystone", typeof(System.Int16), false);
                RetVal[0].SetRange((System.Int16)(-32768),(System.Int16)(32767),(System.Int16)1);
                RetVal[0].AddAssociation("GetVerticalKeystone", "CurrentVerticalKeystone");
                RetVal[0].AddAssociation("SetVerticalKeystone", "DesiredVerticalKeystone");
                RetVal[1] = new UPnPModeratedStateVariable("LastChange", typeof(System.String), true);
                RetVal[2] = new UPnPModeratedStateVariable("A_ARG_TYPE_PresetName", typeof(System.String), false);
                RetVal[2].AllowedStringValues = new string[3]{"FactoryDefaults", "InstallationDefaults", "Vendor defined"};
                RetVal[2].AddAssociation("SelectPreset", "PresetName");
                RetVal[3] = new UPnPModeratedStateVariable("Loudness", typeof(System.Boolean), false);
                RetVal[3].AddAssociation("SetLoudness", "DesiredLoudness");
                RetVal[3].AddAssociation("GetLoudness", "CurrentLoudness");
                RetVal[4] = new UPnPModeratedStateVariable("HorizontalKeystone", typeof(System.Int16), false);
                RetVal[4].SetRange((System.Int16)(-32768),(System.Int16)(32767),(System.Int16)1);
                RetVal[4].AddAssociation("GetHorizontalKeystone", "CurrentHorizontalKeystone");
                RetVal[4].AddAssociation("SetHorizontalKeystone", "DesiredHorizontalKeystone");
                RetVal[5] = new UPnPModeratedStateVariable("A_ARG_TYPE_InstanceID", typeof(System.UInt32), false);
                RetVal[5].AddAssociation("GetHorizontalKeystone", "InstanceID");
                RetVal[5].AddAssociation("GetVolume", "InstanceID");
                RetVal[5].AddAssociation("SelectPreset", "InstanceID");
                RetVal[5].AddAssociation("SetVolume", "InstanceID");
                RetVal[5].AddAssociation("ListPresets", "InstanceID");
                RetVal[5].AddAssociation("SetVolumeDB", "InstanceID");
                RetVal[5].AddAssociation("SetRedVideoBlackLevel", "InstanceID");
                RetVal[5].AddAssociation("SetContrast", "InstanceID");
                RetVal[5].AddAssociation("SetLoudness", "InstanceID");
                RetVal[5].AddAssociation("SetBrightness", "InstanceID");
                RetVal[5].AddAssociation("GetLoudness", "InstanceID");
                RetVal[5].AddAssociation("GetColorTemperature", "InstanceID");
                RetVal[5].AddAssociation("GetSharpness", "InstanceID");
                RetVal[5].AddAssociation("GetContrast", "InstanceID");
                RetVal[5].AddAssociation("GetGreenVideoGain", "InstanceID");
                RetVal[5].AddAssociation("SetRedVideoGain", "InstanceID");
                RetVal[5].AddAssociation("SetGreenVideoBlackLevel", "InstanceID");
                RetVal[5].AddAssociation("GetVolumeDBRange", "InstanceID");
                RetVal[5].AddAssociation("GetRedVideoBlackLevel", "InstanceID");
                RetVal[5].AddAssociation("GetBlueVideoBlackLevel", "InstanceID");
                RetVal[5].AddAssociation("GetBlueVideoGain", "InstanceID");
                RetVal[5].AddAssociation("SetBlueVideoBlackLevel", "InstanceID");
                RetVal[5].AddAssociation("GetMute", "InstanceID");
                RetVal[5].AddAssociation("SetBlueVideoGain", "InstanceID");
                RetVal[5].AddAssociation("GetVerticalKeystone", "InstanceID");
                RetVal[5].AddAssociation("SetVerticalKeystone", "InstanceID");
                RetVal[5].AddAssociation("GetBrightness", "InstanceID");
                RetVal[5].AddAssociation("GetVolumeDB", "InstanceID");
                RetVal[5].AddAssociation("GetGreenVideoBlackLevel", "InstanceID");
                RetVal[5].AddAssociation("GetRedVideoGain", "InstanceID");
                RetVal[5].AddAssociation("SetMute", "InstanceID");
                RetVal[5].AddAssociation("SetGreenVideoGain", "InstanceID");
                RetVal[5].AddAssociation("SetSharpness", "InstanceID");
                RetVal[5].AddAssociation("SetHorizontalKeystone", "InstanceID");
                RetVal[5].AddAssociation("SetColorTemperature", "InstanceID");
                RetVal[6] = new UPnPModeratedStateVariable("BlueVideoBlackLevel", typeof(System.UInt16), false);
                RetVal[6].SetRange((System.UInt16)(0),(System.UInt16)(65535),(System.UInt16)1);
                RetVal[6].AddAssociation("GetBlueVideoBlackLevel", "CurrentBlueVideoBlackLevel");
                RetVal[6].AddAssociation("SetBlueVideoBlackLevel", "DesiredBlueVideoBlackLevel");
                RetVal[7] = new UPnPModeratedStateVariable("RedVideoGain", typeof(System.UInt16), false);
                RetVal[7].SetRange((System.UInt16)(0),(System.UInt16)(65535),(System.UInt16)1);
                RetVal[7].AddAssociation("SetRedVideoGain", "DesiredRedVideoGain");
                RetVal[7].AddAssociation("GetRedVideoGain", "CurrentRedVideoGain");
                RetVal[8] = new UPnPModeratedStateVariable("GreenVideoBlackLevel", typeof(System.UInt16), false);
                RetVal[8].SetRange((System.UInt16)(0),(System.UInt16)(65535),(System.UInt16)1);
                RetVal[8].AddAssociation("SetGreenVideoBlackLevel", "DesiredGreenVideoBlackLevel");
                RetVal[8].AddAssociation("GetGreenVideoBlackLevel", "CurrentGreenVideoBlackLevel");
                RetVal[9] = new UPnPModeratedStateVariable("Volume", typeof(System.UInt16), false);
                RetVal[9].SetRange((System.UInt16)(0),(System.UInt16)(65535),(System.UInt16)1);
                RetVal[9].AddAssociation("GetVolume", "CurrentVolume");
                RetVal[9].AddAssociation("SetVolume", "DesiredVolume");
                RetVal[10] = new UPnPModeratedStateVariable("Mute", typeof(System.Boolean), false);
                RetVal[10].AddAssociation("GetMute", "CurrentMute");
                RetVal[10].AddAssociation("SetMute", "DesiredMute");
                RetVal[11] = new UPnPModeratedStateVariable("Brightness", typeof(System.UInt16), false);
                RetVal[11].SetRange((System.UInt16)(0),(System.UInt16)(65535),(System.UInt16)1);
                RetVal[11].AddAssociation("SetBrightness", "DesiredBrightness");
                RetVal[11].AddAssociation("GetBrightness", "CurrentBrightness");
                RetVal[12] = new UPnPModeratedStateVariable("PresetNameList", typeof(System.String), false);
                RetVal[12].AddAssociation("ListPresets", "CurrentPresetNameList");
                RetVal[13] = new UPnPModeratedStateVariable("A_ARG_TYPE_Channel", typeof(System.String), false);
                RetVal[13].AllowedStringValues = new string[15]{"Master", "LF", "RF", "CF", "LFE", "LS", "RS", "LFC", "RFC", "SD", "SL", "SR", "T", "B", "Vendor defined"};
                RetVal[13].AddAssociation("GetVolume", "Channel");
                RetVal[13].AddAssociation("SetVolume", "Channel");
                RetVal[13].AddAssociation("SetVolumeDB", "Channel");
                RetVal[13].AddAssociation("SetLoudness", "Channel");
                RetVal[13].AddAssociation("GetLoudness", "Channel");
                RetVal[13].AddAssociation("GetVolumeDBRange", "Channel");
                RetVal[13].AddAssociation("GetMute", "Channel");
                RetVal[13].AddAssociation("GetVolumeDB", "Channel");
                RetVal[13].AddAssociation("SetMute", "Channel");
                RetVal[14] = new UPnPModeratedStateVariable("ColorTemperature", typeof(System.UInt16), false);
                RetVal[14].SetRange((System.UInt16)(0),(System.UInt16)(65535),(System.UInt16)1);
                RetVal[14].AddAssociation("GetColorTemperature", "CurrentColorTemperature");
                RetVal[14].AddAssociation("SetColorTemperature", "DesiredColorTemperature");
                RetVal[15] = new UPnPModeratedStateVariable("VolumeDB", typeof(System.Int16), false);
                RetVal[15].SetRange((System.Int16)(-32768),(System.Int16)(32767),null);
                RetVal[15].AddAssociation("SetVolumeDB", "DesiredVolume");
                RetVal[15].AddAssociation("GetVolumeDBRange", "MinValue");
                RetVal[15].AddAssociation("GetVolumeDBRange", "MaxValue");
                RetVal[15].AddAssociation("GetVolumeDB", "CurrentVolume");
                RetVal[16] = new UPnPModeratedStateVariable("Contrast", typeof(System.UInt16), false);
                RetVal[16].SetRange((System.UInt16)(0),(System.UInt16)(65535),(System.UInt16)1);
                RetVal[16].AddAssociation("SetContrast", "DesiredContrast");
                RetVal[16].AddAssociation("GetContrast", "CurrentContrast");
                RetVal[17] = new UPnPModeratedStateVariable("GreenVideoGain", typeof(System.UInt16), false);
                RetVal[17].SetRange((System.UInt16)(0),(System.UInt16)(65535),(System.UInt16)1);
                RetVal[17].AddAssociation("GetGreenVideoGain", "CurrentGreenVideoGain");
                RetVal[17].AddAssociation("SetGreenVideoGain", "DesiredGreenVideoGain");
                RetVal[18] = new UPnPModeratedStateVariable("RedVideoBlackLevel", typeof(System.UInt16), false);
                RetVal[18].SetRange((System.UInt16)(0),(System.UInt16)(65535),(System.UInt16)1);
                RetVal[18].AddAssociation("SetRedVideoBlackLevel", "DesiredRedVideoBlackLevel");
                RetVal[18].AddAssociation("GetRedVideoBlackLevel", "CurrentRedVideoBlackLevel");
                RetVal[19] = new UPnPModeratedStateVariable("BlueVideoGain", typeof(System.UInt16), false);
                RetVal[19].SetRange((System.UInt16)(0),(System.UInt16)(65535),(System.UInt16)1);
                RetVal[19].AddAssociation("GetBlueVideoGain", "CurrentBlueVideoGain");
                RetVal[19].AddAssociation("SetBlueVideoGain", "DesiredBlueVideoGain");
                RetVal[20] = new UPnPModeratedStateVariable("Sharpness", typeof(System.UInt16), false);
                RetVal[20].SetRange((System.UInt16)(0),(System.UInt16)(65535),(System.UInt16)1);
                RetVal[20].AddAssociation("GetSharpness", "CurrentSharpness");
                RetVal[20].AddAssociation("SetSharpness", "DesiredSharpness");

                UPnPService S = new UPnPService(1, "urn:schemas-upnp-org:service:RenderingControl", "urn:schemas-upnp-org:service:RenderingControl:1", true, this);
                for(int i=0;i<RetVal.Length;++i)
                {
                   S.AddStateVariable(RetVal[i]);
                }
                S.AddMethod("GetHorizontalKeystone");
                S.AddMethod("GetVolume");
                S.AddMethod("SelectPreset");
                S.AddMethod("SetVolume");
                S.AddMethod("ListPresets");
                S.AddMethod("SetVolumeDB");
                S.AddMethod("SetRedVideoBlackLevel");
                S.AddMethod("SetContrast");
                S.AddMethod("SetLoudness");
                S.AddMethod("SetBrightness");
                S.AddMethod("GetLoudness");
                S.AddMethod("GetColorTemperature");
                S.AddMethod("GetSharpness");
                S.AddMethod("GetContrast");
                S.AddMethod("GetGreenVideoGain");
                S.AddMethod("SetRedVideoGain");
                S.AddMethod("SetGreenVideoBlackLevel");
                S.AddMethod("GetVolumeDBRange");
                S.AddMethod("GetRedVideoBlackLevel");
                S.AddMethod("GetBlueVideoBlackLevel");
                S.AddMethod("GetBlueVideoGain");
                S.AddMethod("SetBlueVideoBlackLevel");
                S.AddMethod("GetMute");
                S.AddMethod("SetBlueVideoGain");
                S.AddMethod("GetVerticalKeystone");
                S.AddMethod("SetVerticalKeystone");
                S.AddMethod("GetBrightness");
                S.AddMethod("GetVolumeDB");
                S.AddMethod("GetGreenVideoBlackLevel");
                S.AddMethod("GetRedVideoGain");
                S.AddMethod("SetMute");
                S.AddMethod("SetGreenVideoGain");
                S.AddMethod("SetSharpness");
                S.AddMethod("SetHorizontalKeystone");
                S.AddMethod("SetColorTemperature");
                return(S);
            }
            protected UPnPService BuildUPnPService()
            {
                UPnPStateVariable[] RetVal = new UPnPStateVariable[20];
                RetVal[0] = new UPnPModeratedStateVariable("ContainerUpdateIDs", typeof(System.String), true);
                RetVal[1] = new UPnPModeratedStateVariable("A_ARG_TYPE_Index", typeof(System.UInt32), false);
                RetVal[1].AddAssociation("Browse", "StartingIndex");
                RetVal[1].AddAssociation("Search", "StartingIndex");
                RetVal[2] = new UPnPModeratedStateVariable("A_ARG_TYPE_UpdateID", typeof(System.UInt32), false);
                RetVal[2].AddAssociation("Browse", "UpdateID");
                RetVal[2].AddAssociation("Search", "UpdateID");
                RetVal[3] = new UPnPModeratedStateVariable("SystemUpdateID", typeof(System.UInt32), true);
                RetVal[3].AddAssociation("GetSystemUpdateID", "Id");
                RetVal[4] = new UPnPModeratedStateVariable("SearchCapabilities", typeof(System.String), false);
                RetVal[4].AddAssociation("GetSearchCapabilities", "SearchCaps");
                RetVal[5] = new UPnPModeratedStateVariable("A_ARG_TYPE_Result", typeof(System.String), false);
                RetVal[5].AddAssociation("Browse", "Result");
                RetVal[5].AddAssociation("CreateObject", "Elements");
                RetVal[5].AddAssociation("CreateObject", "Result");
                RetVal[5].AddAssociation("Search", "Result");
                RetVal[6] = new UPnPModeratedStateVariable("A_ARG_TYPE_Count", typeof(System.UInt32), false);
                RetVal[6].AddAssociation("Browse", "RequestedCount");
                RetVal[6].AddAssociation("Browse", "NumberReturned");
                RetVal[6].AddAssociation("Browse", "TotalMatches");
                RetVal[6].AddAssociation("Search", "RequestedCount");
                RetVal[6].AddAssociation("Search", "NumberReturned");
                RetVal[6].AddAssociation("Search", "TotalMatches");
                RetVal[7] = new UPnPModeratedStateVariable("A_ARG_TYPE_ObjectID", typeof(System.String), false);
                RetVal[7].AddAssociation("Browse", "ObjectID");
                RetVal[7].AddAssociation("CreateObject", "ContainerID");
                RetVal[7].AddAssociation("CreateObject", "ObjectID");
                RetVal[7].AddAssociation("CreateReference", "ContainerID");
                RetVal[7].AddAssociation("CreateReference", "ObjectID");
                RetVal[7].AddAssociation("CreateReference", "NewID");
                RetVal[7].AddAssociation("DestroyObject", "ObjectID");
                RetVal[7].AddAssociation("Search", "ContainerID");
                RetVal[7].AddAssociation("UpdateObject", "ObjectID");
                RetVal[8] = new UPnPModeratedStateVariable("A_ARG_TYPE_SearchCriteria", typeof(System.String), false);
                RetVal[8].AddAssociation("Search", "SearchCriteria");
                RetVal[9] = new UPnPModeratedStateVariable("A_ARG_TYPE_TransferTotal", typeof(System.String), false);
                RetVal[9].AddAssociation("GetTransferProgress", "TransferTotal");
                RetVal[10] = new UPnPModeratedStateVariable("A_ARG_TYPE_Filter", typeof(System.String), false);
                RetVal[10].AddAssociation("Browse", "Filter");
                RetVal[10].AddAssociation("Search", "Filter");
                RetVal[11] = new UPnPModeratedStateVariable("A_ARG_TYPE_SortCriteria", typeof(System.String), false);
                RetVal[11].AddAssociation("Browse", "SortCriteria");
                RetVal[11].AddAssociation("Search", "SortCriteria");
                RetVal[12] = new UPnPModeratedStateVariable("A_ARG_TYPE_BrowseFlag", typeof(System.String), false);
                RetVal[12].AllowedStringValues = new string[2]{"BrowseMetadata", "BrowseDirectChildren"};
                RetVal[12].AddAssociation("Browse", "BrowseFlag");
                RetVal[13] = new UPnPModeratedStateVariable("A_ARG_TYPE_TransferID", typeof(System.UInt32), false);
                RetVal[13].AddAssociation("ExportResource", "TransferID");
                RetVal[13].AddAssociation("GetTransferProgress", "TransferID");
                RetVal[13].AddAssociation("ImportResource", "TransferID");
                RetVal[13].AddAssociation("StopTransferResource", "TransferID");
                RetVal[14] = new UPnPModeratedStateVariable("A_ARG_TYPE_TransferLength", typeof(System.String), false);
                RetVal[14].AddAssociation("GetTransferProgress", "TransferLength");
                RetVal[15] = new UPnPModeratedStateVariable("A_ARG_TYPE_TagValueList", typeof(System.String), false);
                RetVal[15].AddAssociation("UpdateObject", "CurrentTagValue");
                RetVal[15].AddAssociation("UpdateObject", "NewTagValue");
                RetVal[16] = new UPnPModeratedStateVariable("A_ARG_TYPE_TransferStatus", typeof(System.String), false);
                RetVal[16].AllowedStringValues = new string[4]{"COMPLETED", "ERROR", "IN_PROGRESS", "STOPPED"};
                RetVal[16].AddAssociation("GetTransferProgress", "TransferStatus");
                RetVal[17] = new UPnPModeratedStateVariable("A_ARG_TYPE_URI", typeof(System.Uri), false);
                RetVal[17].AddAssociation("DeleteResource", "ResourceURI");
                RetVal[17].AddAssociation("ExportResource", "SourceURI");
                RetVal[17].AddAssociation("ExportResource", "DestinationURI");
                RetVal[17].AddAssociation("ImportResource", "SourceURI");
                RetVal[17].AddAssociation("ImportResource", "DestinationURI");
                RetVal[18] = new UPnPModeratedStateVariable("TransferIDs", typeof(System.String), true);
                RetVal[19] = new UPnPModeratedStateVariable("SortCapabilities", typeof(System.String), false);
                RetVal[19].AddAssociation("GetSortCapabilities", "SortCaps");

                UPnPService S = new UPnPService(1, "urn:schemas-upnp-org:service:ContentDirectory", URN, true, this);
                for(int i=0;i<RetVal.Length;++i)
                {
                   S.AddStateVariable(RetVal[i]);
                }
                S.AddMethod("Browse");
                S.AddMethod("CreateObject");
                S.AddMethod("CreateReference");
                S.AddMethod("DeleteResource");
                S.AddMethod("DestroyObject");
                S.AddMethod("ExportResource");
                S.AddMethod("GetSearchCapabilities");
                S.AddMethod("GetSortCapabilities");
                S.AddMethod("GetSystemUpdateID");
                S.AddMethod("GetTransferProgress");
                S.AddMethod("ImportResource");
                S.AddMethod("Search");
                S.AddMethod("StopTransferResource");
                S.AddMethod("UpdateObject");
                return(S);
            }
Example #3
0
            protected UPnPService BuildUPnPService()
            {
                UPnPStateVariable[] RetVal = new UPnPStateVariable[30];
                RetVal[0] = new UPnPModeratedStateVariable("CurrentPlayMode", typeof(System.String), false);
                RetVal[0].DefaultValue = UPnPService.CreateObjectInstance(typeof(System.String),"NORMAL");
                RetVal[0].AllowedStringValues = new string[7]{"NORMAL", "SHUFFLE", "REPEAT_ONE", "REPEAT_ALL", "RANDOM", "DIRECT_1", "INTRO"};
                RetVal[0].AddAssociation("SetPlayMode", "NewPlayMode");
                RetVal[0].AddAssociation("GetTransportSettings", "PlayMode");
                RetVal[1] = new UPnPModeratedStateVariable("RecordStorageMedium", typeof(System.String), false);
                RetVal[1].AllowedStringValues = new string[33]{"UNKNOWN", "DV", "MINI-DV", "VHS", "W-VHS", "S-VHS", "D-VHS", "VHSC", "VIDEO8", "HI8", "CD-ROM", "CD-DA", "CD-R", "CD-RW", "VIDEO-CD", "SACD", "MD-AUDIO", "MD-PICTURE", "DVD-ROM", "DVD-VIDEO", "DVD-R", "DVD+RW", "DVD-RW", "DVD-RAM", "DVD-AUDIO", "DAT", "LD", "HDD", "MICRO-MV", "NETWORK", "NONE", "NOT_IMPLEMENTED", " vendor-defined "};
                RetVal[1].AddAssociation("GetMediaInfo", "RecordMedium");
                RetVal[2] = new UPnPModeratedStateVariable("LastChange", typeof(System.String), true);
                RetVal[3] = new UPnPModeratedStateVariable("RelativeTimePosition", typeof(System.String), false);
                RetVal[3].AddAssociation("GetPositionInfo", "RelTime");
                RetVal[4] = new UPnPModeratedStateVariable("CurrentTrackURI", typeof(System.String), false);
                RetVal[4].AddAssociation("GetPositionInfo", "TrackURI");
                RetVal[5] = new UPnPModeratedStateVariable("CurrentTrackDuration", typeof(System.String), false);
                RetVal[5].AddAssociation("GetPositionInfo", "TrackDuration");
                RetVal[6] = new UPnPModeratedStateVariable("CurrentRecordQualityMode", typeof(System.String), false);
                RetVal[6].AllowedStringValues = new string[8]{"0:EP", "1:LP", "2:SP", "0:BASIC", "1:MEDIUM", "2:HIGH", "NOT_IMPLEMENTED", " vendor-defined "};
                RetVal[6].AddAssociation("GetTransportSettings", "RecQualityMode");
                RetVal[6].AddAssociation("SetRecordQualityMode", "NewRecordQualityMode");
                RetVal[7] = new UPnPModeratedStateVariable("PossibleRecordQualityModes", typeof(System.String), false);
                RetVal[7].AddAssociation("GetDeviceCapabilities", "RecQualityModes");
                RetVal[8] = new UPnPModeratedStateVariable("CurrentMediaDuration", typeof(System.String), false);
                RetVal[8].AddAssociation("GetMediaInfo", "MediaDuration");
                RetVal[9] = new UPnPModeratedStateVariable("AbsoluteCounterPosition", typeof(System.Int32), false);
                RetVal[9].AddAssociation("GetPositionInfo", "AbsCount");
                RetVal[10] = new UPnPModeratedStateVariable("RelativeCounterPosition", typeof(System.Int32), false);
                RetVal[10].AddAssociation("GetPositionInfo", "RelCount");
                RetVal[11] = new UPnPModeratedStateVariable("A_ARG_TYPE_InstanceID", typeof(System.UInt32), false);
                RetVal[11].AddAssociation("Play", "InstanceID");
                RetVal[11].AddAssociation("Stop", "InstanceID");
                RetVal[11].AddAssociation("Next", "InstanceID");
                RetVal[11].AddAssociation("Previous", "InstanceID");
                RetVal[11].AddAssociation("SetNextAVTransportURI", "InstanceID");
                RetVal[11].AddAssociation("GetMediaInfo", "InstanceID");
                RetVal[11].AddAssociation("GetDeviceCapabilities", "InstanceID");
                RetVal[11].AddAssociation("SetAVTransportURI", "InstanceID");
                RetVal[11].AddAssociation("SetPlayMode", "InstanceID");
                RetVal[11].AddAssociation("GetCurrentTransportActions", "InstanceID");
                RetVal[11].AddAssociation("GetTransportSettings", "InstanceID");
                RetVal[11].AddAssociation("GetTransportInfo", "InstanceID");
                RetVal[11].AddAssociation("Pause", "InstanceID");
                RetVal[11].AddAssociation("Seek", "InstanceID");
                RetVal[11].AddAssociation("GetPositionInfo", "InstanceID");
                RetVal[11].AddAssociation("Record", "InstanceID");
                RetVal[11].AddAssociation("SetRecordQualityMode", "InstanceID");
                RetVal[12] = new UPnPModeratedStateVariable("AVTransportURI", typeof(System.String), false);
                RetVal[12].AddAssociation("GetMediaInfo", "CurrentURI");
                RetVal[12].AddAssociation("SetAVTransportURI", "CurrentURI");
                RetVal[13] = new UPnPModeratedStateVariable("CurrentTrackMetaData", typeof(System.String), false);
                RetVal[13].AddAssociation("GetPositionInfo", "TrackMetaData");
                RetVal[14] = new UPnPModeratedStateVariable("TransportPlaySpeed", typeof(System.String), false);
                RetVal[14].AllowedStringValues = new string[2]{"1", " vendor-defined "};
                RetVal[14].AddAssociation("Play", "Speed");
                RetVal[14].AddAssociation("GetTransportInfo", "CurrentSpeed");
                RetVal[15] = new UPnPModeratedStateVariable("NextAVTransportURI", typeof(System.String), false);
                RetVal[15].AddAssociation("SetNextAVTransportURI", "NextURI");
                RetVal[15].AddAssociation("GetMediaInfo", "NextURI");
                RetVal[16] = new UPnPModeratedStateVariable("AVTransportURIMetaData", typeof(System.String), false);
                RetVal[16].AddAssociation("GetMediaInfo", "CurrentURIMetaData");
                RetVal[16].AddAssociation("SetAVTransportURI", "CurrentURIMetaData");
                RetVal[17] = new UPnPModeratedStateVariable("PossibleRecordStorageMedia", typeof(System.String), false);
                RetVal[17].AddAssociation("GetDeviceCapabilities", "RecMedia");
                RetVal[18] = new UPnPModeratedStateVariable("AbsoluteTimePosition", typeof(System.String), false);
                RetVal[18].AddAssociation("GetPositionInfo", "AbsTime");
                RetVal[19] = new UPnPModeratedStateVariable("NextAVTransportURIMetaData", typeof(System.String), false);
                RetVal[19].AddAssociation("SetNextAVTransportURI", "NextURIMetaData");
                RetVal[19].AddAssociation("GetMediaInfo", "NextURIMetaData");
                RetVal[20] = new UPnPModeratedStateVariable("PlaybackStorageMedium", typeof(System.String), false);
                RetVal[20].AllowedStringValues = new string[33]{"UNKNOWN", "DV", "MINI-DV", "VHS", "W-VHS", "S-VHS", "D-VHS", "VHSC", "VIDEO8", "HI8", "CD-ROM", "CD-DA", "CD-R", "CD-RW", "VIDEO-CD", "SACD", "MD-AUDIO", "MD-PICTURE", "DVD-ROM", "DVD-VIDEO", "DVD-R", "DVD+RW", "DVD-RW", "DVD-RAM", "DVD-AUDIO", "DAT", "LD", "HDD", "MICRO-MV", "NETWORK", "NONE", "NOT_IMPLEMENTED", " vendor-defined "};
                RetVal[20].AddAssociation("GetMediaInfo", "PlayMedium");
                RetVal[21] = new UPnPModeratedStateVariable("CurrentTransportActions", typeof(System.String), false);
                RetVal[21].AddAssociation("GetCurrentTransportActions", "Actions");
                RetVal[22] = new UPnPModeratedStateVariable("RecordMediumWriteStatus", typeof(System.String), false);
                RetVal[22].AllowedStringValues = new string[5]{"WRITABLE", "PROTECTED", "NOT_WRITABLE", "UNKNOWN", "NOT_IMPLEMENTED"};
                RetVal[22].AddAssociation("GetMediaInfo", "WriteStatus");
                RetVal[23] = new UPnPModeratedStateVariable("PossiblePlaybackStorageMedia", typeof(System.String), false);
                RetVal[23].AddAssociation("GetDeviceCapabilities", "PlayMedia");
                RetVal[24] = new UPnPModeratedStateVariable("TransportState", typeof(System.String), false);
                RetVal[24].AllowedStringValues = new string[7]{"STOPPED", "PAUSED_PLAYBACK", "PAUSED_RECORDING", "PLAYING", "RECORDING", "TRANSITIONING", "NO_MEDIA_PRESENT"};
                RetVal[24].AddAssociation("GetTransportInfo", "CurrentTransportState");
                RetVal[25] = new UPnPModeratedStateVariable("NumberOfTracks", typeof(System.UInt32), false);
                RetVal[25].SetRange((System.UInt32)(0),(System.UInt32)(4294967295),null);
                RetVal[25].AddAssociation("GetMediaInfo", "NrTracks");
                RetVal[26] = new UPnPModeratedStateVariable("A_ARG_TYPE_SeekMode", typeof(System.String), false);
                RetVal[26].AllowedStringValues = new string[8]{"ABS_TIME", "REL_TIME", "ABS_COUNT", "REL_COUNT", "TRACK_NR", "CHANNEL_FREQ", "TAPE-INDEX", "FRAME"};
                RetVal[26].AddAssociation("Seek", "Unit");
                RetVal[27] = new UPnPModeratedStateVariable("CurrentTrack", typeof(System.UInt32), false);
                RetVal[27].SetRange((System.UInt32)(0),(System.UInt32)(4294967295),(System.UInt32)1);
                RetVal[27].AddAssociation("GetPositionInfo", "Track");
                RetVal[28] = new UPnPModeratedStateVariable("TransportStatus", typeof(System.String), false);
                RetVal[28].AllowedStringValues = new string[3]{"OK", "ERROR_OCCURRED", " vendor-defined "};
                RetVal[28].AddAssociation("GetTransportInfo", "CurrentTransportStatus");
                RetVal[29] = new UPnPModeratedStateVariable("A_ARG_TYPE_SeekTarget", typeof(System.String), false);
                RetVal[29].AddAssociation("Seek", "Target");

                UPnPService S = new UPnPService(1, "urn:schemas-upnp-org:service:AVTransport", "urn:schemas-upnp-org:service:AVTransport:1", true, this);
                for(int i=0;i<RetVal.Length;++i)
                {
                   S.AddStateVariable(RetVal[i]);
                }
                S.AddMethod("Play");
                S.AddMethod("Stop");
                S.AddMethod("Next");
                S.AddMethod("Previous");
                S.AddMethod("SetNextAVTransportURI");
                S.AddMethod("GetMediaInfo");
                S.AddMethod("GetDeviceCapabilities");
                S.AddMethod("SetAVTransportURI");
                S.AddMethod("SetPlayMode");
                S.AddMethod("GetCurrentTransportActions");
                S.AddMethod("GetTransportSettings");
                S.AddMethod("GetTransportInfo");
                S.AddMethod("Pause");
                S.AddMethod("Seek");
                S.AddMethod("GetPositionInfo");
                S.AddMethod("Record");
                S.AddMethod("SetRecordQualityMode");
                return(S);
            }
Example #4
0
            protected UPnPService BuildUPnPService()
            {
                UPnPStateVariable[] RetVal = new UPnPStateVariable[10];
                RetVal[0] = new UPnPModeratedStateVariable("A_ARG_TYPE_ConnectionStatus", typeof(System.String), false);
                RetVal[0].AllowedStringValues = new string[5] { "OK", "ContentFormatMismatch", "InsufficientBandwidth", "UnreliableChannel", "Unknown" };
                RetVal[0].AddAssociation("GetCurrentConnectionInfo", "Status");
                RetVal[1] = new UPnPModeratedStateVariable("A_ARG_TYPE_ConnectionID", typeof(System.Int32), false);
                RetVal[1].AddAssociation("GetCurrentConnectionInfo", "ConnectionID");
                RetVal[1].AddAssociation("GetCurrentConnectionInfo", "PeerConnectionID");
                RetVal[2] = new UPnPModeratedStateVariable("A_ARG_TYPE_Direction", typeof(System.String), false);
                RetVal[2].AllowedStringValues = new string[2] { "Input", "Output" };
                RetVal[2].AddAssociation("GetCurrentConnectionInfo", "Direction");
                RetVal[3] = new UPnPModeratedStateVariable("A_ARG_TYPE_RcsID", typeof(System.Int32), false);
                RetVal[3].AddAssociation("GetCurrentConnectionInfo", "RcsID");
                RetVal[4] = new UPnPModeratedStateVariable("SourceProtocolInfo", typeof(System.String), true);
                RetVal[4].AddAssociation("GetProtocolInfo", "Source");
                RetVal[5] = new UPnPModeratedStateVariable("SinkProtocolInfo", typeof(System.String), true);
                RetVal[5].AddAssociation("GetProtocolInfo", "Sink");
                RetVal[6] = new UPnPModeratedStateVariable("A_ARG_TYPE_ProtocolInfo", typeof(System.String), false);
                RetVal[6].AddAssociation("GetCurrentConnectionInfo", "ProtocolInfo");
                RetVal[7] = new UPnPModeratedStateVariable("A_ARG_TYPE_ConnectionManager", typeof(System.String), false);
                RetVal[7].AddAssociation("GetCurrentConnectionInfo", "PeerConnectionManager");
                RetVal[8] = new UPnPModeratedStateVariable("A_ARG_TYPE_AVTransportID", typeof(System.Int32), false);
                RetVal[8].AddAssociation("GetCurrentConnectionInfo", "AVTransportID");
                RetVal[9] = new UPnPModeratedStateVariable("CurrentConnectionIDs", typeof(System.String), true);
                RetVal[9].AddAssociation("GetCurrentConnectionIDs", "ConnectionIDs");

                UPnPService S = new UPnPService(1, "urn:schemas-upnp-org:service:ConnectionManager", URN, true, this);
                for (int i = 0; i < RetVal.Length; ++i)
                {
                    S.AddStateVariable(RetVal[i]);
                }
                S.AddMethod("GetCurrentConnectionIDs");
                S.AddMethod("GetCurrentConnectionInfo");
                S.AddMethod("GetProtocolInfo");
                return (S);
            }
            protected UPnPService BuildUPnPService()
            {
                UPnPStateVariable[] RetVal = new UPnPStateVariable[2];
                RetVal[0] = new UPnPModeratedStateVariable("brightness", typeof(System.Int32), true);
                RetVal[0].AddAssociation("getBrightness", "returnBrightness");
                RetVal[0].AddAssociation("setBrightness", "inputBrightness");
                RetVal[1] = new UPnPModeratedStateVariable("temperature", typeof(System.Int32), true);
                RetVal[1].AddAssociation("getTemperature", "returnTemperature");
                RetVal[1].AddAssociation("setTemperature", "inputTemperature");

                UPnPService S = new UPnPService(1, "urn:upnp-org:serviceId:001", URN, true, this);
                for(int i=0;i<RetVal.Length;++i)
                {
                   S.AddStateVariable(RetVal[i]);
                }
                S.AddMethod("getBrightness");
                S.AddMethod("getTemperature");
                S.AddMethod("setBrightness");
                S.AddMethod("setTemperature");
                return(S);
            }
        public MainForm(string[] args)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            foreach (string parm in args)
            {
                if (parm.ToUpper().StartsWith("/CACHE:"))
                {
                    DText p = new DText();
                    p.ATTRMARK = ":";
                    p[0] = parm;
                    try
                    {
                        CacheTime = int.Parse(p[2]);
                    }
                    catch (Exception)
                    {
                    }
                }
                else if (parm.ToUpper() == "/DEBUG")
                {
                    OpenSource.Utilities.EventLogger.Enabled = true;
                    OpenSource.Utilities.EventLogger.ShowAll = true;
                    OpenSource.Utilities.InstanceTracker.Display();
                }
                else if (parm.ToUpper().StartsWith("/PORT:"))
                {
                    DText p = new DText();
                    p.ATTRMARK = ":";
                    p[0] = parm;
                    try
                    {
                        PortNum = int.Parse(p[2]);
                    }
                    catch (Exception)
                    {
                    }
                }
            }

            upnpLightDevice = UPnPDevice.CreateRootDevice(CacheTime, 1, "web\\");
            upnpLightDevice.Icon = iconImageList.Images[0];
            upnpLightDevice.HasPresentation = true;
            upnpLightDevice.PresentationURL = "/";
            upnpLightDevice.FriendlyName = this.Text + " (" + System.Windows.Forms.SystemInformation.ComputerName + ")";
            upnpLightDevice.Manufacturer = "OpenSource";
            upnpLightDevice.ManufacturerURL = "http://opentools.homeip.net";
            upnpLightDevice.ModelName = "Network Light Bulb";
            upnpLightDevice.ModelDescription = "Software Emulated Light Bulb";
            upnpLightDevice.ModelURL = new Uri("http://opentools.homeip.net");
            upnpLightDevice.ModelNumber = "XPC-L1";
            upnpLightDevice.StandardDeviceType = "DimmableLight";
            upnpLightDevice.UniqueDeviceName = System.Guid.NewGuid().ToString();

            // Switch Power
            upnpLightService = new UPnPService(1, "SwitchPower.0001", "SwitchPower", true, this);
            upnpLightService.AddMethod("SetTarget");
            upnpLightService.AddMethod("GetTarget");
            upnpLightService.AddMethod("GetStatus");

            UPnPStateVariable upnpStatusVar = new UPnPStateVariable("Status", typeof(bool), true);
            upnpStatusVar.AddAssociation("GetStatus", "ResultStatus");
            upnpStatusVar.Value = false;
            upnpLightService.AddStateVariable(upnpStatusVar);
            UPnPStateVariable upnpTargetVar = new UPnPStateVariable("Target", typeof(bool), false);
            upnpTargetVar.AddAssociation("SetTarget", "newTargetValue");
            upnpTargetVar.AddAssociation("GetTarget", "newTargetValue");
            upnpTargetVar.Value = false;
            upnpLightService.AddStateVariable(upnpTargetVar);

            // Dimmable device
            upnpDimmerService = new UPnPService(1, "Dimming.0001", "Dimming", true, this);
            upnpDimmerService.AddMethod("SetLoadLevelTarget");
            upnpDimmerService.AddMethod("GetLoadLevelTarget");
            upnpDimmerService.AddMethod("GetLoadLevelStatus");
            upnpDimmerService.AddMethod("GetMinLevel");

            UPnPStateVariable upnpLevelTargetVar = new UPnPStateVariable("LoadLevelTarget", typeof(byte), false);
            upnpLevelTargetVar.AddAssociation("SetLoadLevelTarget", "NewLoadLevelTarget");
            upnpLevelTargetVar.AddAssociation("GetLoadLevelTarget", "NewLoadLevelTarget");
            upnpLevelTargetVar.Value = (byte)100;
            upnpLevelTargetVar.SetRange((byte)0, (byte)100, null);
            upnpDimmerService.AddStateVariable(upnpLevelTargetVar);
            UPnPStateVariable upnpLevelStatusVar = new UPnPStateVariable("LoadLevelStatus", typeof(byte), true);
            upnpLevelStatusVar.AddAssociation("GetLoadLevelStatus", "RetLoadLevelStatus");
            upnpLevelStatusVar.Value = (byte)100;
            upnpLevelStatusVar.SetRange((byte)0, (byte)100, null);
            upnpDimmerService.AddStateVariable(upnpLevelStatusVar);
            UPnPStateVariable upnpMinLevelVar = new UPnPStateVariable("MinLevel", typeof(byte), false);
            upnpMinLevelVar.AddAssociation("GetMinLevel", "MinLevel");
            upnpMinLevelVar.Value = (byte)0;
            upnpDimmerService.AddStateVariable(upnpMinLevelVar);

            // Add Services
            upnpLightDevice.AddService(upnpLightService);
            upnpLightDevice.AddService(upnpDimmerService);
        }
Example #7
0
            protected UPnPService BuildUPnPService()
            {
                UPnPStateVariable[] RetVal = new UPnPStateVariable[14];
                RetVal[0] = new UPnPModeratedStateVariable("A_ARG_TYPE_BrowseFlag", typeof(System.String), false);
                RetVal[0].AllowedStringValues = new string[2] { "BrowseMetadata", "BrowseDirectChildren" };
                RetVal[0].AddAssociation("Browse", "BrowseFlag");
                RetVal[1] = new UPnPModeratedStateVariable("ContainerUpdateIDs", typeof(System.String), true);
                RetVal[2] = new UPnPModeratedStateVariable("SystemUpdateID", typeof(System.UInt32), true);
                RetVal[2].AddAssociation("GetSystemUpdateID", "Id");
                RetVal[3] = new UPnPModeratedStateVariable("A_ARG_TYPE_Count", typeof(System.UInt32), false);
                RetVal[3].AddAssociation("Browse", "RequestedCount");
                RetVal[3].AddAssociation("Browse", "NumberReturned");
                RetVal[3].AddAssociation("Browse", "TotalMatches");
                RetVal[3].AddAssociation("Search", "RequestedCount");
                RetVal[3].AddAssociation("Search", "NumberReturned");
                RetVal[3].AddAssociation("Search", "TotalMatches");
                RetVal[4] = new UPnPModeratedStateVariable("A_ARG_TYPE_SortCriteria", typeof(System.String), false);
                RetVal[4].AddAssociation("Browse", "SortCriteria");
                RetVal[4].AddAssociation("Search", "SortCriteria");
                RetVal[5] = new UPnPModeratedStateVariable("SortCapabilities", typeof(System.String), false);
                RetVal[5].AddAssociation("GetSortCapabilities", "SortCaps");
                RetVal[6] = new UPnPModeratedStateVariable("A_ARG_TYPE_Index", typeof(System.UInt32), false);
                RetVal[6].AddAssociation("Browse", "StartingIndex");
                RetVal[6].AddAssociation("Search", "StartingIndex");
                RetVal[7] = new UPnPModeratedStateVariable("A_ARG_TYPE_ObjectID", typeof(System.String), false);
                RetVal[7].AddAssociation("Browse", "ObjectID");
                RetVal[7].AddAssociation("Search", "ContainerID");
                RetVal[8] = new UPnPModeratedStateVariable("A_ARG_TYPE_UpdateID", typeof(System.UInt32), false);
                RetVal[8].AddAssociation("Browse", "UpdateID");
                RetVal[8].AddAssociation("Search", "UpdateID");
                RetVal[9] = new UPnPModeratedStateVariable("A_ARG_TYPE_Result", typeof(System.String), false);
                RetVal[9].AddAssociation("Browse", "Result");
                RetVal[9].AddAssociation("Search", "Result");
                RetVal[10] = new UPnPModeratedStateVariable("SearchCapabilities", typeof(System.String), false);
                RetVal[10].AddAssociation("GetSearchCapabilities", "SearchCaps");
                RetVal[11] = new UPnPModeratedStateVariable("A_ARG_TYPE_SearchCriteria", typeof(System.String), false);
                RetVal[11].AddAssociation("Search", "SearchCriteria");
                RetVal[12] = new UPnPModeratedStateVariable("A_ARG_TYPE_Filter", typeof(System.String), false);
                RetVal[12].AddAssociation("Browse", "Filter");
                RetVal[12].AddAssociation("Search", "Filter");
                RetVal[13] = new UPnPModeratedStateVariable("A_ARG_TYPE_Featurelist", typeof(System.String), false);
                RetVal[13].AddAssociation("X_GetFeatureList", "Featurelist");

                UPnPService S = new UPnPService(1, "urn:upnp-org:serviceId:ContentDirectory", "urn:schemas-upnp-org:service:ContentDirectory:1", true, this);
                for (int i = 0; i < RetVal.Length; ++i)
                {
                    S.AddStateVariable(RetVal[i]);
                }
                S.AddMethod("Browse");
                S.AddMethod("GetSearchCapabilities");
                S.AddMethod("GetSortCapabilities");
                S.AddMethod("GetSystemUpdateID");
                S.AddMethod("X_GetFeatureList");
                S.AddMethod("Search");
                return (S);
            }
            protected UPnPService BuildUPnPService()
            {
                UPnPStateVariable[] RetVal = new UPnPStateVariable[8];
                RetVal[0] = new UPnPModeratedStateVariable("AuthorizationDeniedUpdateID", typeof(System.UInt32), true);
                RetVal[1] = new UPnPModeratedStateVariable("A_ARG_TYPE_DeviceID", typeof(System.String), false);
                RetVal[1].AddAssociation("IsAuthorized", "DeviceID");
                RetVal[1].AddAssociation("IsValidated", "DeviceID");
                RetVal[2] = new UPnPModeratedStateVariable("A_ARG_TYPE_RegistrationRespMsg", typeof(System.Byte[]), false);
                RetVal[2].AddAssociation("RegisterDevice", "RegistrationRespMsg");
                RetVal[3] = new UPnPModeratedStateVariable("ValidationRevokedUpdateID", typeof(System.UInt32), true);
                RetVal[4] = new UPnPModeratedStateVariable("ValidationSucceededUpdateID", typeof(System.UInt32), true);
                RetVal[5] = new UPnPModeratedStateVariable("A_ARG_TYPE_Result", typeof(System.Int32), false);
                RetVal[5].AddAssociation("IsAuthorized", "Result");
                RetVal[5].AddAssociation("IsValidated", "Result");
                RetVal[6] = new UPnPModeratedStateVariable("AuthorizationGrantedUpdateID", typeof(System.UInt32), true);
                RetVal[7] = new UPnPModeratedStateVariable("A_ARG_TYPE_RegistrationReqMsg", typeof(System.Byte[]), false);
                RetVal[7].AddAssociation("RegisterDevice", "RegistrationReqMsg");

                UPnPService S = new UPnPService(1, "urn:microsoft.com:serviceId:X_MS_MediaReceiverRegistrar", "urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1", true, this);
                for (int i = 0; i < RetVal.Length; ++i)
                {
                    S.AddStateVariable(RetVal[i]);
                }
                S.AddMethod("IsAuthorized");
                S.AddMethod("IsValidated");
                S.AddMethod("RegisterDevice");
                return (S);
            }
            protected UPnPService BuildUPnPService()
            {
                UPnPStateVariable[] RetVal = new UPnPStateVariable[12];
                RetVal[0] = new UPnPModeratedStateVariable("Reverse", typeof(System.Boolean), false);
                RetVal[0].AddAssociation("Register", "Reverse");
                RetVal[1] = new UPnPModeratedStateVariable("ErrorString", typeof(System.String), false);
                RetVal[1].AddAssociation("InvokeAsyncResponse", "ErrorString");
                RetVal[2] = new UPnPModeratedStateVariable("StateVariableName", typeof(System.String), false);
                RetVal[2].AddAssociation("FireEvent", "StateVariable");
                RetVal[3] = new UPnPModeratedStateVariable("ServiceID", typeof(System.String), false);
                RetVal[3].AddAssociation("Invoke", "ServiceID");
                RetVal[3].AddAssociation("FireEvent", "ServiceID");
                RetVal[3].AddAssociation("InvokeAsync", "ServiceID");
                RetVal[3].AddAssociation("GetDocument", "ServiceID");
                RetVal[3].AddAssociation("GetStateTable", "ServiceID");
                RetVal[4] = new UPnPModeratedStateVariable("Document", typeof(System.Byte[]), false);
                RetVal[4].AddAssociation("GetDocument", "Document");
                RetVal[5] = new UPnPModeratedStateVariable("Args", typeof(System.Byte[]), false);
                RetVal[5].AddAssociation("Invoke", "InArgs");
                RetVal[5].AddAssociation("Invoke", "OutArgs");
                RetVal[5].AddAssociation("InvokeAsync", "InArgs");
                RetVal[5].AddAssociation("InvokeAsyncResponse", "OutArgs");
                RetVal[5].AddAssociation("GetStateTable", "Variables");
                RetVal[6] = new UPnPModeratedStateVariable("Handle", typeof(System.Int32), false);
                RetVal[6].AddAssociation("InvokeAsync", "Handle");
                RetVal[6].AddAssociation("InvokeAsyncResponse", "Handle");
                RetVal[7] = new UPnPModeratedStateVariable("ProxyUri", typeof(System.Uri), false);
                RetVal[7].AddAssociation("Register", "Proxy");
                RetVal[7].AddAssociation("UnRegister", "Proxy");
                RetVal[8] = new UPnPModeratedStateVariable("ActionName", typeof(System.String), false);
                RetVal[8].AddAssociation("Invoke", "Action");
                RetVal[8].AddAssociation("InvokeAsync", "Action");
                RetVal[9] = new UPnPModeratedStateVariable("StateVariableValue", typeof(System.String), false);
                RetVal[9].AddAssociation("FireEvent", "Value");
                RetVal[10] = new UPnPModeratedStateVariable("DeviceUDN", typeof(System.String), false);
                RetVal[10].AddAssociation("Invoke", "DeviceUDN");
                RetVal[10].AddAssociation("FireEvent", "DeviceUDN");
                RetVal[10].AddAssociation("AddDevice", "Sender");
                RetVal[10].AddAssociation("AddDevice", "DeviceUDN");
                RetVal[10].AddAssociation("InvokeAsync", "Caller");
                RetVal[10].AddAssociation("InvokeAsync", "DeviceUDN");
                RetVal[10].AddAssociation("GetDocument", "DeviceUDN");
                RetVal[10].AddAssociation("GetStateTable", "DeviceUDN");
                RetVal[10].AddAssociation("RemoveDevice", "DeviceUDN");
                RetVal[11] = new UPnPModeratedStateVariable("ErrorCode", typeof(System.Int32), false);
                RetVal[11].AddAssociation("InvokeAsyncResponse", "ErrorCode");

                UPnPService S = new UPnPService(1, "UPNPRELAY_0-2", "urn:schemas-upnp-org:service:UPnPRelay:1", true, this);
                for(int i=0;i<RetVal.Length;++i)
                {
                   S.AddStateVariable(RetVal[i]);
                }
                S.AddMethod("Invoke");
                S.AddMethod("FireEvent");
                S.AddMethod("AddDevice");
                S.AddMethod("InvokeAsync");
                S.AddMethod("GetDocument");
                S.AddMethod("InvokeAsyncResponse");
                S.AddMethod("Register");
                S.AddMethod("GetStateTable");
                S.AddMethod("RemoveDevice");
                S.AddMethod("UnRegister");
                return(S);
            }