#define CONV_JSON_DEVICE_NAME CONV_DEVICE_NAME
#define CONV_JSON_DEVICE_TYPE CONV_DEVICE_TYPE
#define CONV_JSON_DEVICE_ADDRESS "host_address"
+#define CONV_SMART_TV "Samsung SmartTV"
+#define CONV_DEVICE_TYPE_TV "TV"
+#define CONV_DEVICE_TYPE_MOBILE "MOBILE"
enum ApplicationState {
APP_COMM_STATE_NONE = 0,
jsonData->set(NULL, CONV_JSON_DEVICE_ID, device_info->getId());
jsonData->set(NULL, CONV_JSON_DEVICE_NAME, device_info->getName());
jsonData->set(NULL, CONV_JSON_DEVICE_ADDRESS, device_info->getAddress());
+ jsonData->set(NULL, CONV_JSON_DEVICE_TYPE, device_info->getType());
return CONV_ERROR_NONE;
}
virtual string getName() = 0;
virtual string getId() = 0;
virtual string getAddress() = 0;
+ virtual string getType() = 0;
virtual int setAddress(std::string host_address) = 0;
};
}
iotcon_attributes_add_str(attributes, CONV_JSON_DEVICE_NAME, deviceName);
#if defined(_TV_)
_D("device type : TV");
- string deviceTypeStr("TV");
+ string deviceTypeStr(CONV_DEVICE_TYPE_TV);
#else
_D("device type : MOBILE");
- string deviceTypeStr("MOBILE");
+ string deviceTypeStr(CONV_DEVICE_TYPE_MOBILE);
#endif
char* deviceType = new char[deviceTypeStr.size() + 1];
conv::SmartViewDevice* device_info = new(std::nothrow) conv::SmartViewDevice;
device_info->setId(serv_id);
device_info->setName(serv_name);
+ if ( !strcmp(CONV_SMART_TV, smartview_service->getType().c_str()) ) {
+ device_info->setType(CONV_DEVICE_TYPE_TV);
+ } else {
+ device_info->setType(CONV_DEVICE_TYPE_MOBILE);
+ }
return device_info;
}
return m_resource_h.getHostAddress();
}
+string conv::DeviceAdapter::getType()
+{
+ return m_resource_h.getDeviceType();
+}
+
int conv::DeviceAdapter::getServiceList(std::list<IService*> *list)
{
for (service_list_t::iterator iterPos = service_list.begin(); iterPos != service_list.end(); ++iterPos) {
string getName();
string getId();
string getAddress();
+ string getType();
int setAddress(std::string host_address);
private :
return ip_address;
}
+string conv::SmartViewDevice::getType()
+{
+ return type;
+}
+
int conv::SmartViewDevice::getServiceList(std::list<IService*> *list)
{
for (service_list_t::iterator iterPos = service_list.begin(); iterPos != service_list.end(); ++iterPos)
ip_address = id;
return CONV_ERROR_NONE;
}
+
+int conv::SmartViewDevice::setType(string deviceType)
+{
+ type = deviceType;
+ return CONV_ERROR_NONE;
+}
std::string getName();
std::string getId();
std::string getAddress();
+ std::string getType();
int setName(std::string name);
int setId(std::string id);
int setAddress(std::string host_address);
+ int setType(std::string type);
private:
service_list_t service_list;