use TCP to connect to mbed connector
Fork of mbedConnectorInterfaceWithDM by
Diff: mbed-connector-interface/Resource.h
- Revision:
- 45:db754b994deb
- Parent:
- 33:1d0b855df5a5
- Child:
- 47:ab0a62cf8d85
diff -r 7c73baf9f4c1 -r db754b994deb mbed-connector-interface/Resource.h --- a/mbed-connector-interface/Resource.h Wed Jun 15 19:40:08 2016 +0000 +++ b/mbed-connector-interface/Resource.h Wed Jun 15 20:51:13 2016 +0000 @@ -67,6 +67,7 @@ this->m_res_name = res_name; this->m_value = value; this->m_implements_observation = false; + this->m_instance_number = 0; } /** @@ -80,6 +81,7 @@ this->m_res_name = resource.m_res_name; this->m_value = resource.m_value; this->m_implements_observation = resource.m_implements_observation; + this->m_instance_number = resource.m_instance_number; } /** @@ -96,7 +98,7 @@ return this->m_obj_name; } - /** + /** Get the Resource name @return the name of the resource */ @@ -104,12 +106,15 @@ return this->m_res_name; } - /** + /** Get the Full name @return the name of the object */ string getFullName() { - return this->m_obj_name + "/*/" + this->m_res_name; + char buf[5]; + memset(buf,0,5); + sprintf(buf,"/%d/",this->m_instance_number); + return this->m_obj_name + buf + this->m_res_name; } /** @@ -163,6 +168,18 @@ // this resource implements its own observation handler bool implementsObservation() { return this->m_implements_observation; } + + /** + Get our Instance Number + @return our instance number + */ + int getInstanceNumber() { retrn this->m_instance_number; } + + /** + Set our Instance Number + @param instance_number input our designated instance number + */ + void setInstanceNumber(int instance_number) { this->m_instance_number = instance_number; } protected: // initialize internals to Resource @@ -172,6 +189,7 @@ this->m_obj_name = ""; this->m_res_name = ""; this->m_value = ""; + this->m_instance_number = 0; } // get our options @@ -186,6 +204,7 @@ InnerType m_value; bool m_implements_observation; void *m_options; + int m_instance_number; }; #endif // __RESOURCE_H__