function get_CommConfigValue($Name, $Property) { $CommConfig = get_CommunicationConfiguration(); $CommData = $CommConfig[$Name]; if (array_key_exists($Property, $CommData)) { return $CommData[$Property]; } else { return false; } IPSLogger_Err(__file__, "CommunicationDevice with Name '$Name' could NOT be found in CommunicationConfiguration"); return false; }
function Entertainment_IPSComponent_SendData($parameters) { $interfaceName = $parameters[0]; $function = $parameters[1]; $roomId = $parameters[2]; $value = $parameters[3]; $CommConfig = get_CommunicationConfiguration(); $componentConstructorParams = $CommConfig[$interfaceName][c_Property_ComponentParams]; $component = IPSComponent::CreateObjectByParams($componentConstructorParams); $component->$function($roomId, $value); }
function WinLIRC_ReceiveData_Translation(&$Control, &$Button) { $CommConfig = get_CommunicationConfiguration(); $TranslationList = $CommConfig[c_Comm_WinLIRC][c_Property_InpTranslationList]; if (array_key_exists($Control.'.'.$Button, $TranslationList)) { $Data = explode('.', $TranslationList[$Control.'.'.$Button]); IPSLogger_Trc(__file__, "Translate RemoteMessage $Control.$Button -> $Data[0].$Data[1]"); $Control = $Data[0]; $Button = $Data[1]; } else if (array_key_exists($Control, $TranslationList)) { $ControlNew = $TranslationList[$Control]; IPSLogger_Trc(__file__, "Translate RemoteMessage $Control.$Button -> $ControlNew.$Button"); $Control = $TranslationList[$Control]; } else { // Nothing to Translate ... } }
function Entertainment_SendData($DeviceName, $ControlType, $CommParams, $CommType) { $CommConfig = get_CommunicationConfiguration(); $CommInterface = $CommParams[0]; $FunctionName = $CommConfig[$CommInterface][c_Property_FunctionSnd]; $FunctionScript = $CommConfig[$CommInterface][c_Property_ScriptSnd]; $FunctionParameters = array(); foreach ($CommParams as $CommIdx=>$CommParam) { if ($CommParam==c_Template_Value) { $FunctionParameters[] = GetValue(get_ControlIdByDeviceName($DeviceName, $ControlType)); } else if ($CommParam==c_Template_Code) { $DeviceConfig = get_DeviceConfiguration(); $Value = GetValue(get_ControlIdByDeviceName($DeviceName, $ControlType)); $FunctionParameters[] = $DeviceConfig[$DeviceName][$ControlType][c_Property_Codes][$Value]; } else { $FunctionParameters[] = $CommParam; } } if (!Entertainment_Before_SendData($FunctionParameters)) { return; } IPSLogger_Trc(__file__, 'SendData '.$CommInterface.'.'.$FunctionName.'('.implode(',',$FunctionParameters).')'); try { include_once $FunctionScript; $Function = new ReflectionFunction($FunctionName); $Function->invoke($FunctionParameters); } catch (Exception $e) { IPSLogger_Err(__file__, 'Error Executing Function '.$FunctionName.':'.$e->getMessage()); } Entertainment_After_SendData($FunctionParameters); }