(function(c){var d=new function(){this.ErrorClass={None:0,HTTP:1,SYSTEM:60583,ADS:60584,MDP:60582,MDP_specific:60591,MDPWEB:41021,UPNP:32772,DEVMAN:32773};this.GetErrorType=function(a){if(isNaN(a))return this.ErrorClass.None;a=Number(a);return 0==a?this.ErrorClass.None:1E3>a&&0<a?this.ErrorClass.HTTP:a>>>16};this.GetErrorTypeStr=function(a){switch(this.GetErrorType(a)){case this.ErrorClass.None:return"Unknown";case this.ErrorClass.HTTP:return"HTTP";case this.ErrorClass.SYSTEM:return"Windows";case this.ErrorClass.ADS:return"ADS";
case this.ErrorClass.MDP:case this.ErrorClass.MDP_specific:return"MDP";case this.ErrorClass.MDPWEB:return"MDP Webservice";case this.ErrorClass.UPNP:return"UPNP";case this.ErrorClass.DEVMAN:return"Device Manager"}};this.UPnPErrToMdpErr=function(a){if(isNaN(a))return a;a=Number(a);switch(a){case 2147747260:case 2147747261:case 2147747262:case 2147747263:return a;case 2147747270:return 3970301953;case 2147747271:return 3970302208;case 2147747272:return 3970302209;case 2147747273:return 3970302210;case 2147747274:return 3970302211;
case 2147747275:return 3970302212;case 2147747276:return 3970302213;case 2147747277:return 3970302214;case 2147747278:return 3970302215;case 2147747279:return 3970302464;case 2147747280:return 3970305792;case 2147747281:return 3970306048;default:return a}};this.ErrorCodeToErrorMessage=function(a){if(isNaN(a))return a;a=Number(a);var b=this.GetErrorType(a);if(b==this.ErrorClass.None)return"Success - No Error";if(b!=this.ErrorClass.HTTP){if(b==this.ErrorClass.SYSTEM)return c(a&65535);if(b==this.ErrorClass.ADS)switch(a&=
65535,a){case 1792:return"error class <device error>";case 1793:return"Service is not supported by server";case 1794:return"invalid index group";case 1795:return"invalid index offset";case 1796:return"reading/writing not permitted";case 1797:return"parameter size not correct";case 1798:return"invalid parameter value(s)";case 1799:return"device is not in a ready state";case 1800:return"device is busy";case 1801:return"invalid context (must be in Windows)";case 1802:return"out of memory";case 1803:return"invalid parameter value(s)";
case 1804:return"not found (files, ...)";case 1805:return"syntax error in command or file";case 1806:return"objects do not match";case 1807:return"object already exists";case 1808:return"symbol not found";case 1809:return"symbol version invalid";case 1810:return"server is in invalid state";case 1811:return"AdsTransMode not supported";case 1812:return"Notification handle is invalid";case 1813:return"Notification client not registered";case 1814:return"no more notification handles";case 1815:return"size for watch too big";
case 1816:return"device not initialized";case 1817:return"device has a timeout";case 1818:return"query interface failed";case 1819:return"wrong interface required";case 1820:return"class ID is invalid";case 1821:return"object ID is invalid";case 1822:return"request is pending";case 1823:return"request is aborted";case 1824:return"signal warning";case 1825:return"invalid array index";case 1826:return"symbol not active";case 1827:return"access denied";case 1828:return"missing license";case 1836:return"exception occured during system start";
case 1856:return"Error class <client error>";case 1857:return"invalid parameter at service";case 1858:return"polling list is empty";case 1859:return"var connection already in use";case 1860:return"invoke ID in use";case 1861:return"timeout elapsed";case 1862:return"error in win32 subsystem";case 1863:return"Invalid client timeout value";case 1864:return"ads-port not opened";case 1872:return"internal error in ads sync";case 1873:return"hash table overflow";case 1874:return"key not found in hash";case 1875:return"no more symbols in cache";
case 1876:return"invalid response received";case 1877:return"sync port is locked";default:return"Unknown ADS Error: "+a}else if(b==this.ErrorClass.UPNP)switch(a){case 2147747260:return"Invalid Port";case 2147747261:return"Invalid Length";case 2147747262:return"Invalid Data";case 2147747263:return"Load";default:return"Unknown UPNP Error: "+a}else if(b==this.ErrorClass.MDP)switch(a){case 3970301953:return"Fail - Unspecified error";case 3970302208:return"Invalid index";case 3970302209:return"Invalid access";
case 3970302210:return"Buffer too small";case 3970302211:return"Type not supported";case 3970302212:return"Out of memory";case 3970302213:return"No data available";case 3970302214:return"Invalid data";case 3970302215:return"Invalid arg";case 3970302216:return"Value out of range";case 3970302464:return"Server is busy";case 3970302465:return"MDP API not initialized";case 3970305792:return"Not implemented";case 3970306048:return"Not supported";case 3970306047:return"Unexpected error";default:return"Unknown MDP Error: "+
a}else if(b==this.ErrorClass.MDP_specific)switch(a){case 3970892801:return"User already exists";case 3970892802:return"User does not exist";case 3970892803:return"Group already exists";case 3970892804:return"Group does not exist";case 3970892816:return"Server is not installed";case 3970892817:return"Share already exists";case 3970892818:return"Share does not exist";case 3970892832:return"Ads route already exists";case 3970892833:return"Ads port could not be opened";case 3970892848:return"A variable with this name already exists";
case 3970892849:return"Variable with requested name does not exist";case 3970892850:return"Section with specified name does not exist";case 3970892851:return"The name of the variable was invalid";case 3970892864:return"The name of the key (e.g. 'HKLM') was invalid";default:return"Unknown MDP Error: "+a}else if(b==this.ErrorClass.DEVMAN)switch(a){case 2147811329:return"Fail - Unspecified Error";case 2147811344:return"Could not create XMLHttpObject";case 2147811345:return"Request timed out";case 2147811346:return"Soapresponse has faultstring";
case 2147811347:return"Soapresponse empty";case 2147811360:return"Communication module is busy!";case 2147811376:return"Please enter a valid date!";case 2147811377:return"Please check your input!";case 2147811381:return"Could not add exclusion. FBWF is disabled!";default:return"Unknown DeviceManager Error: "+a}else if(b==this.ErrorClass.MDPWEB)switch(a){case 2688352256:return"Success";case 2688352257:return"Unspecific error";case 2688352258:return"Invalid HTTP Method (POST required)";case 2688352259:return"Invalid SOAP Message";
case 2688352512:return"Out of memory";case 2688352513:return"Readbuffer too small";case 2688352514:return"Invalid writebuffer";case 2688352515:return"Out of range";case 2688352516:return"Invalid argument";case 2688352517:return"Maximum amount of subcommands reached";case 2688352518:return"Maximum length of readbuffer reached";case 2688352519:return"Maximum length of writebuffer reached"}else return"Unknown Error: "+a}};var c=function(a){if(isNaN(a))return a;a=Number(a);switch(a){case 0:return"The operation completed successfully.";
case 1:return"Incorrect function.";case 2:return"The system cannot find the file specified.";case 3:return"The system cannot find the path specified.";case 4:return"The system cannot open the file.";case 5:return"Access Denied.";case 6:return"The handle is invalid.";case 21:return"The device is not ready.";case 53:return"The network path was not found.";case 87:return"The parameter is incorrect.";case 121:return"The semaphore timeout period has expired.";case 123:return"The filename, directory name, or volume label syntax is incorrect.";
case 1377:return"One or more of the members specified were not members of the local group. No members were deleted.";case 1378:return"One or more of the members specified were already members of the local group. No new members were added.";case 1388:return"One or more of the members cannot be added because their account type is invalid. No new members were added.";case 1722:return"The RPC server is unavailable.";case 2202:return"The specified username is invalid.";case 2224:return"The specified user already exists.";
case 2245:return"The password does not meet the password policy requirements. Check the minimum password length, password complexity and password history requirements.";default:return"Unknown ("+a+")"}};this.ErrorCodeDisplay=function(a){if(isNaN(a))return a;a=Number(a);return this.GetErrorType(a)==this.ErrorClass.HTTP?a.toString(10):"0x"+a.toString(16).toUpperCase()}};c.CommunicationModule_ERROR=d})(window);
