-std::string getIPAddrTBServer(OCClientResponse * clientResponse) {
- if(!clientResponse) return "";
- if(!clientResponse->addr) return "";
- uint8_t a, b, c, d = 0;
- if(0 != OCDevAddrToIPv4Addr(clientResponse->addr, &a, &b, &c, &d) ) return "";
-
- char ipaddr[16] = {'\0'};
- snprintf(ipaddr, sizeof(ipaddr), "%d.%d.%d.%d", a,b,c,d); // ostringstream not working correctly here, hence snprintf
- //printf("IP address string of the TB server = %s\n", *out_ipaddr);
- return std::string (ipaddr);
-}
-
-
-std::string getPortTBServer(OCClientResponse * clientResponse){
- if(!clientResponse) return "";
- if(!clientResponse->addr) return "";
- uint16_t p = 0;
- if(0 != OCDevAddrToPort(clientResponse->addr, &p) ) return "";
- std::ostringstream ss;
- ss << p;
- return ss.str();
-}
-
-std::string getQueryStrForGetPut(unsigned const char * responsePayload){
-
- std::string jsonPayload(reinterpret_cast<char*>(const_cast<unsigned char*>(responsePayload)));
-