// // WARNING: EXTRA-SENSITIVE CODE ! Don't change a single dot in the code below without running // the "hidden/AutoTest" test suite (using the dedicated test tool) // public static void deviceArrival(YModule m) { string ms = m.get_serialNumber(); //InternalStuff.log("*** device arrival(" + m.get_serialNumber() + ")"); string key = ms + ".module"; string mynamespace = InternalStuff.currentNameSpace; // try to find some unknown module proxy can be linked to the new arrival //InternalStuff.log("*** looking for existing Module proxies"); for (int j = 0; j < _allProxies.Count; j++) { if (_allProxies[j].IsUnknown) { if (_allProxies[j].GetType().ToString() == mynamespace + ".YModuleProxy") { //InternalStuff.log(" found"); _allProxies[j].linkToHardware(ms); _allProxies[j].arrival(); } } else if (_allProxies[j].get_funcHardwareId() == key) { _allProxies[j].linkToHardware(ms); _allProxies[j].arrival(); } } string myNameSpace = InternalStuff.currentNameSpace; // try to find some unknown function proxy can be linked to the new arrival //InternalStuff.log("*** looking for existing Function proxies"); for (int i = 0; i < m.functionCount(); i++) { string hwid = ms + "." + m.functionId(i); string type = m.functionType(i); string basetype = m.functionBaseType(i); for (int j = 0; j < _allProxies.Count; j++) { if (_allProxies[j].IsUnknown) { string proxyType = _allProxies[j].GetType().ToString(); if (proxyType == myNameSpace + ".Y" + type + "Proxy" || proxyType == myNameSpace + ".Y" + basetype + "Proxy") { //InternalStuff.log(" found " + type); _allProxies[j].linkToHardware(hwid); _allProxies[j].arrival(); } } else if (_allProxies[j].get_funcHardwareId() == hwid) { _allProxies[j].linkToHardware(hwid); _allProxies[j].arrival(); } } } m.registerConfigChangeCallback(configChangeCallback); configChangeCallback(m); // not triggered automatically at register InternalStuff.log("Arrival completed"); }