ProcessorNode::ProcessorNode(const ProcessorNode &other) : processor_(other.processor_), Connectable(other.getName(), 0) { uuid_t copy; processor_->getUUID(copy); setUUID(copy); }
ProcessorNode::ProcessorNode(const std::shared_ptr<Connectable> &processor) : processor_(processor), Connectable(processor->getName(), 0), ConfigurableComponent() { uuid_t copy; processor->getUUID(copy); setUUID(copy); }
bool MACHFile::setUUIDFromString(QString sUUID) { QByteArray baUUID(sUUID.toAscii().data(),sUUID.size()); baUUID=QByteArray::fromHex(baUUID); return setUUID(baUUID); }
std::string UUID_TFXD::toPrettyString(uint32_t indent) { std::stringstream r; setUUID((std::string)"6d1d9b05-42d5-44e6-80e2-141daff757b2"); r << std::string(indent, ' ') << "[6d1d9b05-42d5-44e6-80e2-141daff757b2] TFXD Box (" << boxedSize() << ")" << std::endl; r << std::string(indent + 1, ' ') << "Version: " << getVersion() << std::endl; r << std::string(indent + 1, ' ') << "Time = " << getTime() << std::endl; r << std::string(indent + 1, ' ') << "Duration = " << getDuration() << std::endl; return r.str(); }
IBeacon::IBeacon(ble_uuid128_t uuid, uint16_t major, uint16_t minor, int8_t rssi) { //! advertisement indicator for an iBeacon is defined as 0x0215 _params.adv_indicator = BLEutil::convertEndian16(0x0215); setUUID(uuid); setMajor(major); setMinor(minor); setTxPower(rssi); }
// Constructor sets name, allocate characteristic, sets UUID, and sets default value. BatteryService(): GenericService() { setUUID(UUID(BLE_UUID_BATTERY_SERVICE)); setName(BLE_SERVICE_BATTERY); _characteristic = new Characteristic<uint8_t>(); addCharacteristic(_characteristic); _characteristic->setUUID(UUID(BLE_UUID_BATTERY_LEVEL_CHAR)); _characteristic->setName(BLE_CHAR_BATTERY); _characteristic->setDefaultValue(100); }
void luks::loadInnerFileSystem(const QString& mapperNode) { Q_ASSERT(!m_innerFs); FileSystem::Type innerFsType = detectFileSystem(mapperNode); m_innerFs = FileSystemFactory::cloneWithNewType(innerFsType, *this); setLabel(m_innerFs->readLabel(mapperNode)); setUUID(m_innerFs->readUUID(mapperNode)); if (m_innerFs->supportGetUsed() == FileSystem::cmdSupportFileSystem) setSectorsUsed((m_innerFs->readUsedCapacity(mapperNode) + payloadOffset()) / m_logicalSectorSize ); m_innerFs->scan(mapperNode); }
IndoorLocalizationService::IndoorLocalizationService() : EventListener(), _rssiCharac(NULL), _scannedDeviceListCharac(NULL), _trackedDeviceListCharac(NULL), _trackedDeviceCharac(NULL) { //#if (NORDIC_SDK_VERSION >= 11) // _appTimerData = { {0} }; // _appTimerId = &_appTimerData; //#endif EventDispatcher::getInstance().addListener(this); setUUID(UUID(INDOORLOCALISATION_UUID)); setName(BLE_SERVICE_INDOOR_LOCALIZATION); }
void Profile::processDataServerResponse(const QString& userString, const QStringList& keyList, const QStringList& valueList) { for (int i = 0; i < keyList.size(); i++) { if (valueList[i] != " ") { if (keyList[i] == DataServerKey::Domain && keyList[i + 1] == DataServerKey::Position && keyList[i + 2] == DataServerKey::Orientation && valueList[i] != " " && valueList[i + 1] != " " && valueList[i + 2] != " ") { QStringList coordinateItems = valueList[i + 1].split(','); QStringList orientationItems = valueList[i + 2].split(','); if (coordinateItems.size() == 3 && orientationItems.size() == 3) { // send a node kill request, indicating to other clients that they should play the "disappeared" effect MyAvatar::sendKillAvatar(); qDebug() << "Changing domain to" << valueList[i].toLocal8Bit().constData() << ", position to" << valueList[i + 1].toLocal8Bit().constData() << ", and orientation to" << valueList[i + 2].toLocal8Bit().constData() << "to go to" << userString; NodeList::getInstance()->setDomainHostname(valueList[i]); // orient the user to face the target glm::quat newOrientation = glm::quat(glm::radians(glm::vec3(orientationItems[0].toFloat(), orientationItems[1].toFloat(), orientationItems[2].toFloat()))) * glm::angleAxis(180.0f, 0.0f, 1.0f, 0.0f); Application::getInstance()->getAvatar()->setOrientation(newOrientation); // move the user a couple units away const float DISTANCE_TO_USER = 2.0f; glm::vec3 newPosition = glm::vec3(coordinateItems[0].toFloat(), coordinateItems[1].toFloat(), coordinateItems[2].toFloat() ) - newOrientation * IDENTITY_FRONT * DISTANCE_TO_USER; Application::getInstance()->getAvatar()->setPosition(newPosition); } } else if (keyList[i] == DataServerKey::UUID) { // this is the user's UUID - set it on the profile setUUID(QUuid(valueList[i])); } } } }
bool luks::cryptClose(const QString& deviceNode) { if (!m_isCryptOpen) { qWarning() << "Cannot close LUKS device" << deviceNode << "because it's not open."; return false; } if (m_isMounted) { qWarning() << "Cannot close LUKS device" << deviceNode << "because the filesystem is mounted."; return false; } ExternalCommand cmd(QStringLiteral("cryptsetup"), { QStringLiteral("close"), mapperName() }); if (!(cmd.run(-1) && cmd.exitCode() == 0)) return false; delete m_innerFs; m_innerFs = nullptr; m_passphrase.clear(); setLabel({}); setUUID(readUUID(deviceNode)); setSectorsUsed(-1); m_isCryptOpen = (m_innerFs != nullptr); for (auto &p : LVM::pvList) // FIXME: qAsConst if (!p.isLuks() && p.partition()->deviceNode() == deviceNode) p.setLuks(true); return true; }
void LLInventoryItem::unpackBinaryBucket(U8* bin_bucket, S32 bin_bucket_size) { // Early exit on an empty binary bucket. if (bin_bucket_size <= 1) return; // Convert the bin_bucket into a string. char* item_buffer = new char[bin_bucket_size+1]; if ((item_buffer != NULL) && (bin_bucket != NULL)) { memcpy(item_buffer, bin_bucket, bin_bucket_size); /* Flawfinder: ignore */ } else { llerrs << "unpackBinaryBucket failed. item_buffer or bin_bucket is Null." << llendl; delete[] item_buffer; return; } item_buffer[bin_bucket_size] = '\0'; std::string str(item_buffer); lldebugs << "item buffer: " << item_buffer << llendl; delete[] item_buffer; // Tokenize the string. typedef boost::tokenizer<boost::char_separator<char> > tokenizer; boost::char_separator<char> sep("|", "", boost::keep_empty_tokens); tokenizer tokens(str, sep); tokenizer::iterator iter = tokens.begin(); // Extract all values. LLUUID item_id; item_id.generate(); setUUID(item_id); LLAssetType::EType type; type = (LLAssetType::EType)(atoi((*(iter++)).c_str())); setType( type ); LLInventoryType::EType inv_type; inv_type = (LLInventoryType::EType)(atoi((*(iter++)).c_str())); setInventoryType( inv_type ); std::string name((*(iter++)).c_str()); rename( name ); LLUUID creator_id((*(iter++)).c_str()); LLUUID owner_id((*(iter++)).c_str()); LLUUID last_owner_id((*(iter++)).c_str()); LLUUID group_id((*(iter++)).c_str()); PermissionMask mask_base = strtoul((*(iter++)).c_str(), NULL, 16); PermissionMask mask_owner = strtoul((*(iter++)).c_str(), NULL, 16); PermissionMask mask_group = strtoul((*(iter++)).c_str(), NULL, 16); PermissionMask mask_every = strtoul((*(iter++)).c_str(), NULL, 16); PermissionMask mask_next = strtoul((*(iter++)).c_str(), NULL, 16); LLPermissions perm; perm.init(creator_id, owner_id, last_owner_id, group_id); perm.initMasks(mask_base, mask_owner, mask_group, mask_every, mask_next); setPermissions(perm); //lldebugs << "perm: " << perm << llendl; LLUUID asset_id((*(iter++)).c_str()); setAssetUUID(asset_id); std::string desc((*(iter++)).c_str()); setDescription(desc); LLSaleInfo::EForSale sale_type; sale_type = (LLSaleInfo::EForSale)(atoi((*(iter++)).c_str())); S32 price = atoi((*(iter++)).c_str()); LLSaleInfo sale_info(sale_type, price); setSaleInfo(sale_info); U32 flags = strtoul((*(iter++)).c_str(), NULL, 16); setFlags(flags); time_t now = time(NULL); setCreationDate(now); }
void LLInventoryItem::unpackBinaryBucket(U8* bin_bucket, S32 bin_bucket_size) { // Early exit on an empty binary bucket. if (bin_bucket_size <= 1) return; if (NULL == bin_bucket) { LL_ERRS() << "unpackBinaryBucket failed. bin_bucket is NULL." << LL_ENDL; return; } // Convert the bin_bucket into a string. std::vector<char> item_buffer(bin_bucket_size+1); memcpy(&item_buffer[0], bin_bucket, bin_bucket_size); /* Flawfinder: ignore */ item_buffer[bin_bucket_size] = '\0'; std::string str(&item_buffer[0]); LL_DEBUGS() << "item buffer: " << str << LL_ENDL; // Tokenize the string. typedef boost::tokenizer<boost::char_separator<char> > tokenizer; boost::char_separator<char> sep("|", "", boost::keep_empty_tokens); tokenizer tokens(str, sep); tokenizer::iterator iter = tokens.begin(); // Extract all values. LLUUID item_id; item_id.generate(); setUUID(item_id); LLAssetType::EType type; type = static_cast<LLAssetType::EType>(std::stoi((*(iter++)))); setType( type ); LLInventoryType::EType inv_type; inv_type = static_cast<LLInventoryType::EType>(std::stoi((*(iter++)))); setInventoryType( inv_type ); std::string name((*(iter++)).c_str()); rename( name ); LLUUID creator_id((*(iter++)).c_str()); LLUUID owner_id((*(iter++)).c_str()); LLUUID last_owner_id((*(iter++)).c_str()); LLUUID group_id((*(iter++)).c_str()); PermissionMask mask_base = strtoul((*(iter++)).c_str(), NULL, 16); PermissionMask mask_owner = strtoul((*(iter++)).c_str(), NULL, 16); PermissionMask mask_group = strtoul((*(iter++)).c_str(), NULL, 16); PermissionMask mask_every = strtoul((*(iter++)).c_str(), NULL, 16); PermissionMask mask_next = strtoul((*(iter++)).c_str(), NULL, 16); LLPermissions perm; perm.init(creator_id, owner_id, last_owner_id, group_id); perm.initMasks(mask_base, mask_owner, mask_group, mask_every, mask_next); setPermissions(perm); //LL_DEBUGS() << "perm: " << perm << LL_ENDL; LLUUID asset_id((*(iter++)).c_str()); setAssetUUID(asset_id); std::string desc((*(iter++)).c_str()); setDescription(desc); LLSaleInfo::EForSale sale_type; sale_type = static_cast<LLSaleInfo::EForSale>(std::stoi((*(iter++)))); S32 price = std::stoi(*(iter++)); LLSaleInfo sale_info(sale_type, price); setSaleInfo(sale_info); U32 flags = strtoul((*(iter++)).c_str(), NULL, 16); setFlags(flags); time_t now = time(NULL); setCreationDate(now); }
UUID_TFXD::UUID_TFXD() { setUUID((std::string)"6d1d9b05-42d5-44e6-80e2-141daff757b2"); setVersion(0); setFlags(0); }
UUID_TrackFragmentReference::UUID_TrackFragmentReference() { setUUID((std::string)"d4807ef2-ca39-4695-8e54-26cb9e46a79f"); }