String CmdPaymentReq::getTopic() { String str = "/controller/"; str += FACILITY_ID; str += "/"; str += CMD_HINT_PAYMENT_REQ; str += "/"; str += getTopicId(); return str; }
uint16_t Topics::createTopic(string* topic){ if (!getTopic(topic)){ if ( _cnt < MAX_TOPIC_COUNT){ Topic* tp = new Topic(); tp->setTopicName(*topic); if(tp->getTopicLength() == 2){ uint16_t id = getUint16((uint8_t*)tp->getTopicName()); tp->setTopicId(id); }else{ tp->setTopicId(getNextTopicId()); } _topics.push_back(tp); _cnt++; return _nextTopicId; }else{ return 0; } }else{ return getTopicId(topic); } }