text: /******************************************************************************
  *    Copyright (c) Open Connectivity Foundation (OCF), AllJoyn Open Source
  *    Project (AJOSP) Contributors and others.
  *    
  *    SPDX-License-Identifier: Apache-2.0
  *    
  *    All rights reserved. This program and the accompanying materials are
  *    made available under the terms of the Apache License, Version 2.0
  *    which accompanies this distribution, and is available at
  *    http://www.apache.org/licenses/LICENSE-2.0
  *    
  *    Copyright (c) Open Connectivity Foundation and Contributors to AllSeen
  *    Alliance. All rights reserved.
  *    
  *    Permission to use, copy, modify, and/or distribute this software for
  *    any purpose with or without fee is hereby granted, provided that the
  *    above copyright notice and this permission notice appear in all
  *    copies.
  *    
  *    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  *    WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  *    WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  *    AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  *    DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  *    PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  *    TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  *    PERFORMANCE OF THIS SOFTWARE.
  ******************************************************************************/
  #include "stdafx.h"
  #include "LampDetailsBusObject.h"
  
  #define CHECK_BREAK(x) if ((status = x) != ER_OK) { break; }
  #define CHECK_RETURN(x) if ((status = x) != ER_OK) { return status; }
  
  static AJ_PCSTR LAMPSERVICE_OBJECT_PATH = "/org/allseen/LSF/Lamp";
  static AJ_PCSTR LAMPDETAILS_INTERFACE_NAME = "org.allseen.LSF.LampDetails";
  
  LampDetailsBusObject::LampDetailsBusObject(ajn::BusAttachment& t_BusAttachment, const std::string& t_BusName, const ajn::SessionId t_SessionId) :
  m_BusAttachment(&t_BusAttachment), m_BusName(t_BusName), m_SessionId(t_SessionId)
  {
  	QStatus status = ER_OK;
  
  	const ajn::InterfaceDescription* getIface = NULL;
  	getIface = m_BusAttachment->GetInterface(LAMPDETAILS_INTERFACE_NAME);
  	if (!getIface) {
  		ajn::InterfaceDescription* createIface = NULL;
  		status = m_BusAttachment->CreateInterface(LAMPDETAILS_INTERFACE_NAME, createIface, ajn::AJ_IFC_SECURITY_OFF);
  		if (createIface && status == ER_OK) {
  			do {
  				CHECK_BREAK(createIface->AddProperty("Version", "u", ajn::PROP_ACCESS_READ))
  				CHECK_BREAK(createIface->AddProperty("Make", "u", ajn::PROP_ACCESS_READ))
  				CHECK_BREAK(createIface->AddProperty("Model", "u", ajn::PROP_ACCESS_READ))
  				CHECK_BREAK(createIface->AddProperty("Type", "u", ajn::PROP_ACCESS_READ))
  				CHECK_BREAK(createIface->AddProperty("LampType", "u", ajn::PROP_ACCESS_READ))
  				CHECK_BREAK(createIface->AddProperty("LampBaseType", "u", ajn::PROP_ACCESS_READ))
  				CHECK_BREAK(createIface->AddProperty("LampBeamAngle", "u", ajn::PROP_ACCESS_READ))
  				CHECK_BREAK(createIface->AddProperty("Dimmable", "b", ajn::PROP_ACCESS_READ))
  				CHECK_BREAK(createIface->AddProperty("Color", "b", ajn::PROP_ACCESS_READ))
  				CHECK_BREAK(createIface->AddProperty("VariableColorTemp", "b", ajn::PROP_ACCESS_READ))
  				CHECK_BREAK(createIface->AddProperty("HasEffects", "b", ajn::PROP_ACCESS_READ))
  				CHECK_BREAK(createIface->AddProperty("MinVoltage", "u", ajn::PROP_ACCESS_READ))
  				CHECK_BREAK(createIface->AddProperty("MaxVoltage", "u", ajn::PROP_ACCESS_READ))
  				CHECK_BREAK(createIface->AddProperty("Wattage", "u", ajn::PROP_ACCESS_READ))
  				CHECK_BREAK(createIface->AddProperty("IncandescentEquivalent", "u", ajn::PROP_ACCESS_READ))
  				CHECK_BREAK(createIface->AddProperty("MaxLumens", "u", ajn::PROP_ACCESS_READ))
  				CHECK_BREAK(createIface->AddProperty("MinTemperature", "u", ajn::PROP_ACCESS_READ))
  				CHECK_BREAK(createIface->AddProperty("MaxTemperature", "u", ajn::PROP_ACCESS_READ))
  				CHECK_BREAK(createIface->AddProperty("ColorRenderingIndex", "u", ajn::PROP_ACCESS_READ))
  				CHECK_BREAK(createIface->AddProperty("LampID", "s", ajn::PROP_ACCESS_READ))
  
  				createIface->Activate();
  				return;
  			} while (0);
  		} //if (createIface)
  	} //if (!getIface)
  }
  
  QStatus LampDetailsBusObject::GetVersion(uint32_t& t_Version)
  {
  	QStatus status = ER_OK;
  
  	const ajn::InterfaceDescription* p_InterfaceDescription = m_BusAttachment->GetInterface(LAMPDETAILS_INTERFACE_NAME);
  	if (!p_InterfaceDescription) {
  		return ER_FAIL;
  	}
  
  	ajn::ProxyBusObject* proxyBusObj = new ajn::ProxyBusObject(*m_BusAttachment, m_BusName.c_str(), LAMPSERVICE_OBJECT_PATH, m_SessionId);
  	if (!proxyBusObj) {
  		return ER_FAIL;
  	}
  	do {
  		ajn::MsgArg arg;
  		CHECK_BREAK(proxyBusObj->AddInterface(*p_InterfaceDescription))
  		CHECK_BREAK(proxyBusObj->GetProperty(LAMPDETAILS_INTERFACE_NAME, "Version", arg))
  		t_Version = arg.v_variant.val->v_uint32;
  	} while (0);
  	delete proxyBusObj;
  	return status;
  }
  
  QStatus LampDetailsBusObject::GetMake(uint32_t& t_Make)
  {
  	QStatus status = ER_OK;
  
  	const ajn::InterfaceDescription* p_InterfaceDescription = m_BusAttachment->GetInterface(LAMPDETAILS_INTERFACE_NAME);
  	if (!p_InterfaceDescription) {
  		return ER_FAIL;
  	}
  
  	ajn::ProxyBusObject* proxyBusObj = new ajn::ProxyBusObject(*m_BusAttachment, m_BusName.c_str(), LAMPSERVICE_OBJECT_PATH, m_SessionId);
  	if (!proxyBusObj) {
  		return ER_FAIL;
  	}
  	do {
  		ajn::MsgArg arg;
  		CHECK_BREAK(proxyBusObj->AddInterface(*p_InterfaceDescription))
  		CHECK_BREAK(proxyBusObj->GetProperty(LAMPDETAILS_INTERFACE_NAME, "Make", arg))
  		t_Make = arg.v_variant.val->v_uint32;
  	} while (0);
  	delete proxyBusObj;
  	return status;
  }
  
  QStatus LampDetailsBusObject::GetModel(uint32_t& t_Model)
  {
  	QStatus status = ER_OK;
  
  	const ajn::InterfaceDescription* p_InterfaceDescription = m_BusAttachment->GetInterface(LAMPDETAILS_INTERFACE_NAME);
  	if (!p_InterfaceDescription) {
  		return ER_FAIL;
  	}
  
  	ajn::ProxyBusObject* proxyBusObj = new ajn::ProxyBusObject(*m_BusAttachment, m_BusName.c_str(), LAMPSERVICE_OBJECT_PATH, m_SessionId);
  	if (!proxyBusObj) {
  		return ER_FAIL;
  	}
  	do {
  		ajn::MsgArg arg;
  		CHECK_BREAK(proxyBusObj->AddInterface(*p_InterfaceDescription))
  		CHECK_BREAK(proxyBusObj->GetProperty(LAMPDETAILS_INTERFACE_NAME, "Model", arg))
  		t_Model = arg.v_variant.val->v_uint32;
  	} while (0);
  	delete proxyBusObj;
  	return status;
  }
  
  QStatus LampDetailsBusObject::GetType(uint32_t& t_Type)
  {
  	QStatus status = ER_OK;
  
  	const ajn::InterfaceDescription* p_InterfaceDescription = m_BusAttachment->GetInterface(LAMPDETAILS_INTERFACE_NAME);
  	if (!p_InterfaceDescription) {
  		return ER_FAIL;
  	}
  
  	ajn::ProxyBusObject* proxyBusObj = new ajn::ProxyBusObject(*m_BusAttachment, m_BusName.c_str(), LAMPSERVICE_OBJECT_PATH, m_SessionId);
  	if (!proxyBusObj) {
  		return ER_FAIL;
  	}
  	do {
  		ajn::MsgArg arg;
  		CHECK_BREAK(proxyBusObj->AddInterface(*p_InterfaceDescription))
  		CHECK_BREAK(proxyBusObj->GetProperty(LAMPDETAILS_INTERFACE_NAME, "Type", arg))
  		t_Type = arg.v_variant.val->v_uint32;
  	} while (0);
  	delete proxyBusObj;
  	return status;
  }
  
  QStatus LampDetailsBusObject::GetLampType(uint32_t& t_LampType)
  {
  	QStatus status = ER_OK;
  
  	const ajn::InterfaceDescription* p_InterfaceDescription = m_BusAttachment->GetInterface(LAMPDETAILS_INTERFACE_NAME);
  	if (!p_InterfaceDescription) {
  		return ER_FAIL;
  	}
  
  	ajn::ProxyBusObject* proxyBusObj = new ajn::ProxyBusObject(*m_BusAttachment, m_BusName.c_str(), LAMPSERVICE_OBJECT_PATH, m_SessionId);
  	if (!proxyBusObj) {
  		return ER_FAIL;
  	}
  	do {
  		ajn::MsgArg arg;
  		CHECK_BREAK(proxyBusObj->AddInterface(*p_InterfaceDescription))
  		CHECK_BREAK(proxyBusObj->GetProperty(LAMPDETAILS_INTERFACE_NAME, "LampType", arg))
  		t_LampType = arg.v_variant.val->v_uint32;
  	} while (0);
  	delete proxyBusObj;
  	return status;
  }
  
  QStatus LampDetailsBusObject::GetLampBaseType(uint32_t& t_LampBaseType)
  {
  	QStatus status = ER_OK;
  
  	const ajn::InterfaceDescription* p_InterfaceDescription = m_BusAttachment->GetInterface(LAMPDETAILS_INTERFACE_NAME);
  	if (!p_InterfaceDescription) {
  		return ER_FAIL;
  	}
  
  	ajn::ProxyBusObject* proxyBusObj = new ajn::ProxyBusObject(*m_BusAttachment, m_BusName.c_str(), LAMPSERVICE_OBJECT_PATH, m_SessionId);
  	if (!proxyBusObj) {
  		return ER_FAIL;
  	}
  	do {
  		ajn::MsgArg arg;
  		CHECK_BREAK(proxyBusObj->AddInterface(*p_InterfaceDescription))
  		CHECK_BREAK(proxyBusObj->GetProperty(LAMPDETAILS_INTERFACE_NAME, "LampBaseType", arg))
  		t_LampBaseType = arg.v_variant.val->v_uint32;
  	} while (0);
  	delete proxyBusObj;
  	return status;
  }
  
  QStatus LampDetailsBusObject::GetLampBeamAngle(uint32_t& t_LampBeamAngle)
  {
  	QStatus status = ER_OK;
  
  	const ajn::InterfaceDescription* p_InterfaceDescription = m_BusAttachment->GetInterface(LAMPDETAILS_INTERFACE_NAME);
  	if (!p_InterfaceDescription) {
  		return ER_FAIL;
  	}
  
  	ajn::ProxyBusObject* proxyBusObj = new ajn::ProxyBusObject(*m_BusAttachment, m_BusName.c_str(), LAMPSERVICE_OBJECT_PATH, m_SessionId);
  	if (!proxyBusObj) {
  		return ER_FAIL;
  	}
  	do {
  		ajn::MsgArg arg;
  		CHECK_BREAK(proxyBusObj->AddInterface(*p_InterfaceDescription))
  		CHECK_BREAK(proxyBusObj->GetProperty(LAMPDETAILS_INTERFACE_NAME, "LampBeamAngle", arg))
  		t_LampBeamAngle = arg.v_variant.val->v_uint32;
  	} while (0);
  	delete proxyBusObj;
  	return status;
  }
  
  QStatus LampDetailsBusObject::GetDimmable(bool& t_Dimmable)
  {
  	QStatus status = ER_OK;
  
  	const ajn::InterfaceDescription* p_InterfaceDescription = m_BusAttachment->GetInterface(LAMPDETAILS_INTERFACE_NAME);
  	if (!p_InterfaceDescription) {
  		return ER_FAIL;
  	}
  
  	ajn::ProxyBusObject* proxyBusObj = new ajn::ProxyBusObject(*m_BusAttachment, m_BusName.c_str(), LAMPSERVICE_OBJECT_PATH, m_SessionId);
  	if (!proxyBusObj) {
  		return ER_FAIL;
  	}
  	do {
  		ajn::MsgArg arg;
  		CHECK_BREAK(proxyBusObj->AddInterface(*p_InterfaceDescription))
  		CHECK_BREAK(proxyBusObj->GetProperty(LAMPDETAILS_INTERFACE_NAME, "Dimmable", arg))
  		t_Dimmable = arg.v_variant.val->v_bool;
  	} while (0);
  	delete proxyBusObj;
  	return status;
  }
  
  QStatus LampDetailsBusObject::GetColor(bool& t_Color)
  {
  	QStatus status = ER_OK;
  
  	const ajn::InterfaceDescription* p_InterfaceDescription = m_BusAttachment->GetInterface(LAMPDETAILS_INTERFACE_NAME);
  	if (!p_InterfaceDescription) {
  		return ER_FAIL;
  	}
  
  	ajn::ProxyBusObject* proxyBusObj = new ajn::ProxyBusObject(*m_BusAttachment, m_BusName.c_str(), LAMPSERVICE_OBJECT_PATH, m_SessionId);
  	if (!proxyBusObj) {
  		return ER_FAIL;
  	}
  	do {
  		ajn::MsgArg arg;
  		CHECK_BREAK(proxyBusObj->AddInterface(*p_InterfaceDescription))
  		CHECK_BREAK(proxyBusObj->GetProperty(LAMPDETAILS_INTERFACE_NAME, "Color", arg))
  		t_Color = arg.v_variant.val->v_bool;
  	} while (0);
  	delete proxyBusObj;
  	return status;
  }
  
  QStatus LampDetailsBusObject::GetVariableColorTemp(bool& t_VariableColorTemp)
  {
  	QStatus status = ER_OK;
  
  	const ajn::InterfaceDescription* p_InterfaceDescription = m_BusAttachment->GetInterface(LAMPDETAILS_INTERFACE_NAME);
  	if (!p_InterfaceDescription) {
  		return ER_FAIL;
  	}
  
  	ajn::ProxyBusObject* proxyBusObj = new ajn::ProxyBusObject(*m_BusAttachment, m_BusName.c_str(), LAMPSERVICE_OBJECT_PATH, m_SessionId);
  	if (!proxyBusObj) {
  		return ER_FAIL;
  	}
  	do {
  		ajn::MsgArg arg;
  		CHECK_BREAK(proxyBusObj->AddInterface(*p_InterfaceDescription))
  		CHECK_BREAK(proxyBusObj->GetProperty(LAMPDETAILS_INTERFACE_NAME, "VariableColorTemp", arg))
  		t_VariableColorTemp = arg.v_variant.val->v_bool;
  	} while (0);
  	delete proxyBusObj;
  	return status;
  }
  
  QStatus LampDetailsBusObject::GetHasEffects(bool& t_HasEffects)
  {
  	QStatus status = ER_OK;
  
  	const ajn::InterfaceDescription* p_InterfaceDescription = m_BusAttachment->GetInterface(LAMPDETAILS_INTERFACE_NAME);
  	if (!p_InterfaceDescription) {
  		return ER_FAIL;
  	}
  
  	ajn::ProxyBusObject* proxyBusObj = new ajn::ProxyBusObject(*m_BusAttachment, m_BusName.c_str(), LAMPSERVICE_OBJECT_PATH, m_SessionId);
  	if (!proxyBusObj) {
  		return ER_FAIL;
  	}
  	do {
  		ajn::MsgArg arg;
  		CHECK_BREAK(proxyBusObj->AddInterface(*p_InterfaceDescription))
  		CHECK_BREAK(proxyBusObj->GetProperty(LAMPDETAILS_INTERFACE_NAME, "HasEffects", arg))
  		t_HasEffects = arg.v_variant.val->v_bool;
  	} while (0);
  	delete proxyBusObj;
  	return status;
  }
  
  QStatus LampDetailsBusObject::GetMinVoltage(uint32_t& t_MinVoltage)
  {
  	QStatus status = ER_OK;
  
  	const ajn::InterfaceDescription* p_InterfaceDescription = m_BusAttachment->GetInterface(LAMPDETAILS_INTERFACE_NAME);
  	if (!p_InterfaceDescription) {
  		return ER_FAIL;
  	}
  
  	ajn::ProxyBusObject* proxyBusObj = new ajn::ProxyBusObject(*m_BusAttachment, m_BusName.c_str(), LAMPSERVICE_OBJECT_PATH, m_SessionId);
  	if (!proxyBusObj) {
  		return ER_FAIL;
  	}
  	do {
  		ajn::MsgArg arg;
  		CHECK_BREAK(proxyBusObj->AddInterface(*p_InterfaceDescription))
  		CHECK_BREAK(proxyBusObj->GetProperty(LAMPDETAILS_INTERFACE_NAME, "MinVoltage", arg))
  		t_MinVoltage = arg.v_variant.val->v_uint32;
  	} while (0);
  	delete proxyBusObj;
  	return status;
  }
  
  QStatus LampDetailsBusObject::GetMaxVoltage(uint32_t& t_MaxVoltage)
  {
  	QStatus status = ER_OK;
  
  	const ajn::InterfaceDescription* p_InterfaceDescription = m_BusAttachment->GetInterface(LAMPDETAILS_INTERFACE_NAME);
  	if (!p_InterfaceDescription) {
  		return ER_FAIL;
  	}
  
  	ajn::ProxyBusObject* proxyBusObj = new ajn::ProxyBusObject(*m_BusAttachment, m_BusName.c_str(), LAMPSERVICE_OBJECT_PATH, m_SessionId);
  	if (!proxyBusObj) {
  		return ER_FAIL;
  	}
  	do {
  		ajn::MsgArg arg;
  		CHECK_BREAK(proxyBusObj->AddInterface(*p_InterfaceDescription))
  		CHECK_BREAK(proxyBusObj->GetProperty(LAMPDETAILS_INTERFACE_NAME, "MaxVoltage", arg))
  		t_MaxVoltage = arg.v_variant.val->v_uint32;
  	} while (0);
  	delete proxyBusObj;
  	return status;
  }
  
  QStatus LampDetailsBusObject::GetWattage(uint32_t& t_Wattage)
  {
  	QStatus status = ER_OK;
  
  	const ajn::InterfaceDescription* p_InterfaceDescription = m_BusAttachment->GetInterface(LAMPDETAILS_INTERFACE_NAME);
  	if (!p_InterfaceDescription) {
  		return ER_FAIL;
  	}
  
  	ajn::ProxyBusObject* proxyBusObj = new ajn::ProxyBusObject(*m_BusAttachment, m_BusName.c_str(), LAMPSERVICE_OBJECT_PATH, m_SessionId);
  	if (!proxyBusObj) {
  		return ER_FAIL;
  	}
  	do {
  		ajn::MsgArg arg;
  		CHECK_BREAK(proxyBusObj->AddInterface(*p_InterfaceDescription))
  		CHECK_BREAK(proxyBusObj->GetProperty(LAMPDETAILS_INTERFACE_NAME, "Wattage", arg))
  		t_Wattage = arg.v_variant.val->v_uint32;
  	} while (0);
  	delete proxyBusObj;
  	return status;
  }
  
  QStatus LampDetailsBusObject::GetIncandescentEquivalent(uint32_t& t_IncandescentEquivalent)
  {
  	QStatus status = ER_OK;
  
  	const ajn::InterfaceDescription* p_InterfaceDescription = m_BusAttachment->GetInterface(LAMPDETAILS_INTERFACE_NAME);
  	if (!p_InterfaceDescription) {
  		return ER_FAIL;
  	}
  
  	ajn::ProxyBusObject* proxyBusObj = new ajn::ProxyBusObject(*m_BusAttachment, m_BusName.c_str(), LAMPSERVICE_OBJECT_PATH, m_SessionId);
  	if (!proxyBusObj) {
  		return ER_FAIL;
  	}
  	do {
  		ajn::MsgArg arg;
  		CHECK_BREAK(proxyBusObj->AddInterface(*p_InterfaceDescription))
  		CHECK_BREAK(proxyBusObj->GetProperty(LAMPDETAILS_INTERFACE_NAME, "IncandescentEquivalent", arg))
  		t_IncandescentEquivalent = arg.v_variant.val->v_uint32;
  	} while (0);
  	delete proxyBusObj;
  	return status;
  }
  
  QStatus LampDetailsBusObject::GetMaxLumens(uint32_t& t_MaxLumens)
  {
  	QStatus status = ER_OK;
  
  	const ajn::InterfaceDescription* p_InterfaceDescription = m_BusAttachment->GetInterface(LAMPDETAILS_INTERFACE_NAME);
  	if (!p_InterfaceDescription) {
  		return ER_FAIL;
  	}
  
  	ajn::ProxyBusObject* proxyBusObj = new ajn::ProxyBusObject(*m_BusAttachment, m_BusName.c_str(), LAMPSERVICE_OBJECT_PATH, m_SessionId);
  	if (!proxyBusObj) {
  		return ER_FAIL;
  	}
  	do {
  		ajn::MsgArg arg;
  		CHECK_BREAK(proxyBusObj->AddInterface(*p_InterfaceDescription))
  		CHECK_BREAK(proxyBusObj->GetProperty(LAMPDETAILS_INTERFACE_NAME, "MaxLumens", arg))
  		t_MaxLumens = arg.v_variant.val->v_uint32;
  	} while (0);
  	delete proxyBusObj;
  	return status;
  }
  
  QStatus LampDetailsBusObject::GetMinTemperature(uint32_t& t_MinTemperature)
  {
  	QStatus status = ER_OK;
  
  	const ajn::InterfaceDescription* p_InterfaceDescription = m_BusAttachment->GetInterface(LAMPDETAILS_INTERFACE_NAME);
  	if (!p_InterfaceDescription) {
  		return ER_FAIL;
  	}
  
  	ajn::ProxyBusObject* proxyBusObj = new ajn::ProxyBusObject(*m_BusAttachment, m_BusName.c_str(), LAMPSERVICE_OBJECT_PATH, m_SessionId);
  	if (!proxyBusObj) {
  		return ER_FAIL;
  	}
  	do {
  		ajn::MsgArg arg;
  		CHECK_BREAK(proxyBusObj->AddInterface(*p_InterfaceDescription))
  		CHECK_BREAK(proxyBusObj->GetProperty(LAMPDETAILS_INTERFACE_NAME, "MinTemperature", arg))
  		t_MinTemperature = arg.v_variant.val->v_uint32;
  	} while (0);
  	delete proxyBusObj;
  	return status;
  }
  
  QStatus LampDetailsBusObject::GetMaxTemperature(uint32_t& t_MaxTemperature)
  {
  	QStatus status = ER_OK;
  
  	const ajn::InterfaceDescription* p_InterfaceDescription = m_BusAttachment->GetInterface(LAMPDETAILS_INTERFACE_NAME);
  	if (!p_InterfaceDescription) {
  		return ER_FAIL;
  	}
  
  	ajn::ProxyBusObject* proxyBusObj = new ajn::ProxyBusObject(*m_BusAttachment, m_BusName.c_str(), LAMPSERVICE_OBJECT_PATH, m_SessionId);
  	if (!proxyBusObj) {
  		return ER_FAIL;
  	}
  	do {
  		ajn::MsgArg arg;
  		CHECK_BREAK(proxyBusObj->AddInterface(*p_InterfaceDescription))
  		CHECK_BREAK(proxyBusObj->GetProperty(LAMPDETAILS_INTERFACE_NAME, "MaxTemperature", arg))
  		t_MaxTemperature = arg.v_variant.val->v_uint32;
  	} while (0);
  	delete proxyBusObj;
  	return status;
  }
  
  QStatus LampDetailsBusObject::GetColorRenderingIndex(uint32_t& t_ColorRenderingIndex)
  {
  	QStatus status = ER_OK;
  
  	const ajn::InterfaceDescription* p_InterfaceDescription = m_BusAttachment->GetInterface(LAMPDETAILS_INTERFACE_NAME);
  	if (!p_InterfaceDescription) {
  		return ER_FAIL;
  	}
  
  	ajn::ProxyBusObject* proxyBusObj = new ajn::ProxyBusObject(*m_BusAttachment, m_BusName.c_str(), LAMPSERVICE_OBJECT_PATH, m_SessionId);
  	if (!proxyBusObj) {
  		return ER_FAIL;
  	}
  	do {
  		ajn::MsgArg arg;
  		CHECK_BREAK(proxyBusObj->AddInterface(*p_InterfaceDescription))
  		CHECK_BREAK(proxyBusObj->GetProperty(LAMPDETAILS_INTERFACE_NAME, "ColorRenderingIndex", arg))
  		t_ColorRenderingIndex = arg.v_variant.val->v_uint32;
  	} while (0);
  	delete proxyBusObj;
  	return status;
  }
  
  QStatus LampDetailsBusObject::GetLampID(qcc::String& t_LampID)
  {
  	QStatus status = ER_OK;
  
  	const ajn::InterfaceDescription* p_InterfaceDescription = m_BusAttachment->GetInterface(LAMPDETAILS_INTERFACE_NAME);
  	if (!p_InterfaceDescription) {
  		return ER_FAIL;
  	}
  
  	ajn::ProxyBusObject* proxyBusObj = new ajn::ProxyBusObject(*m_BusAttachment, m_BusName.c_str(), LAMPSERVICE_OBJECT_PATH, m_SessionId);
  	if (!proxyBusObj) {
  		return ER_FAIL;
  	}
  	do {
  		ajn::MsgArg arg;
  		CHECK_BREAK(proxyBusObj->AddInterface(*p_InterfaceDescription))
  		CHECK_BREAK(proxyBusObj->GetProperty(LAMPDETAILS_INTERFACE_NAME, "LampID", arg))
  		t_LampID = qcc::String(arg.v_variant.val->v_string.str);
  	} while (0);
  	delete proxyBusObj;
  	return status;
  }