Lines Matching defs:std

68 const std::u16string DESCRIPTOR = u"ohos.edm.IEnterpriseDeviceMgr";
93 usbHostManager_ = std::make_shared<UsbHostManager>(nullptr);
94 usbRightManager_ = std::make_shared<UsbRightManager>();
95 usbPortManager_ = std::make_shared<UsbPortManager>();
96 usbDeviceManager_ = std::make_shared<UsbDeviceManager>();
139 int32_t systemAbilityId, const std::string &deviceId)
147 int32_t systemAbilityId, const std::string &deviceId)
160 void UsbService::OnAddSystemAbility(int32_t systemAbilityId, const std::string &deviceId)
209 sptr<ISystemAbilityStatusChange> status = new (std::nothrow) SystemAbilityStatusChangeListener(usbdSubscriber_);
256 usbdSubscriber_ = new (std::nothrow) UsbServiceSubscriber();
357 std::string UsbService::GetDeviceVidPidSerialNumber(std::string deviceName)
359 std::string strDesc = "test";
360 std::lock_guard<std::mutex> guard(mutex_);
373 int32_t UsbService::GetDeviceVidPidSerialNumber(std::string deviceName, std::string& strDesc)
376 std::lock_guard<std::mutex> guard(mutex_);
392 std::string name = std::to_string(busNum) + "-" + std::to_string(devAddr);
402 bool UsbService::HasRight(std::string deviceName)
410 std::string deviceVidPidSerialNum = "";
421 std::string bundleName;
422 std::string tokenId;
439 int32_t UsbService::RequestRight(std::string deviceName)
446 std::string deviceVidPidSerialNum = "";
456 std::string bundleName;
457 std::string tokenId;
470 int32_t UsbService::RemoveRight(std::string deviceName)
476 std::string deviceVidPidSerialNum = "";
486 std::string bundleName;
487 std::string tokenId;
509 int32_t UsbService::GetDevices(std::vector<UsbDevice> &deviceList)
511 std::map<std::string, UsbDevice *> devices;
543 std::lock_guard<std::mutex> guard(functionMutex_);
572 std::lock_guard<std::mutex> guard(functionMutex_);
578 int32_t UsbService::UsbFunctionsFromString(std::string_view funcs)
593 std::string UsbService::UsbFunctionsToString(int32_t funcs)
608 int32_t UsbService::GetPorts(std::vector<UsbPort> &ports)
755 const UsbDev &devInfo, const UsbPipe &pipe, std::vector<uint8_t> &bufferData, int32_t timeOut)
775 int32_t length, std::vector<uint8_t> &bufferData, int32_t timeOut)
795 const UsbDev &dev, const UsbPipe &pipe, const std::vector<uint8_t> &bufferData, int32_t timeOut)
813 int32_t UsbService::ControlTransfer(const UsbDev &dev, const UsbCtrlTransfer &ctrl, std::vector<uint8_t> &bufferData)
818 std::lock_guard<std::mutex> guard(mutex_);
843 const UsbDev &dev, const UsbCtrlTransferParams &ctrlParams, std::vector<uint8_t> &bufferData)
849 std::lock_guard<std::mutex> guard(mutex_);
924 int32_t UsbService::GetRawDescriptor(uint8_t busNum, uint8_t devAddr, std::vector<uint8_t> &bufferData)
964 int32_t UsbService::RequestQueue(const UsbDev &dev, const UsbPipe &pipe, const std::vector<uint8_t> &clientData,
965 const std::vector<uint8_t> &bufferData)
985 const UsbDev &dev, int32_t timeOut, std::vector<uint8_t> &clientData, std::vector<uint8_t> &bufferData)
1037 std::string UsbService::GetDevStringValFromIdx(uint8_t busNum, uint8_t devAddr, uint8_t idx)
1040 std::vector<uint8_t> strV;
1041 std::string strDesc = " ";
1062 uint16_t *tbuf = new (std::nothrow) uint16_t[length + 1]();
1073 std::wstring wstr(reinterpret_cast<wchar_t *>(tbuf), wstrLen);
1074 strDesc = std::string(wstr.begin(), wstr.end());
1083 static std::string BcdToString(const std::vector<uint8_t> &bcd)
1085 std::string tstr;
1087 tstr += std::to_string((bcd[i] & BIT_HIGH_4) >> BIT_SHIFT_4);
1088 tstr += std::to_string((bcd[i] & BIT_LOW_4));
1104 const std::vector<uint8_t> bcdData {(bcdUsb & 0xff), ((bcdUsb >> offsetValue) & 0xff)};
1115 std::vector<USBConfig> configs;
1120 std::vector<UsbInterface> interfaces = it->GetInterfaces();
1135 int32_t UsbService::GetDeviceInfoDescriptor(const UsbDev &uDev, std::vector<uint8_t> &descriptor, UsbDevice &dev)
1156 dev.SetName(std::to_string(uDev.busNum) + "-" + std::to_string(uDev.devAddr));
1168 int32_t UsbService::GetConfigDescriptor(UsbDevice &dev, std::vector<uint8_t> &descriptor)
1170 std::vector<USBConfig> configs;
1187 std::vector<uint8_t> descriptor;
1253 int32_t UsbService::GetEdmStroageTypePolicy(sptr<IRemoteObject> remote, std::vector<UsbDeviceType> &disableType)
1289 int32_t UsbService::GetEdmTypePolicy(sptr<IRemoteObject> remote, std::vector<UsbDeviceType> &disableType)
1331 int32_t UsbService::GetEdmWhiteListPolicy(sptr<IRemoteObject> remote, std::vector<UsbDeviceId> &trustUsbDeviceIds)
1371 int32_t UsbService::GetEdmPolicy(bool &IsGlobalDisabled, std::vector<UsbDeviceType> &disableType,
1372 std::vector<UsbDeviceId> &trustUsbDeviceIds)
1409 int32_t UsbService::GetUsbPolicy(bool &IsGlobalDisabled, std::vector<UsbDeviceType> &disableType,
1410 std::vector<UsbDeviceId> &trustUsbDeviceIds)
1412 auto startTime = std::chrono::steady_clock::now();
1419 auto currentTime = std::chrono::steady_clock::now();
1420 auto elapsedTime = std::chrono::duration_cast<std::chrono::milliseconds>(currentTime - startTime).count();
1425 std::this_thread::sleep_for(std::chrono::milliseconds(MANAGE_INTERFACE_INTERVAL));
1436 int32_t UsbService::ExecuteManageInterfaceType(const std::vector<UsbDeviceType> &disableType, bool disable)
1438 std::map<std::string, UsbDevice *> devices;
1466 void UsbService::ExecuteManageDeviceType(const std::vector<UsbDeviceType> &disableType, bool disable,
1467 const std::unordered_map<InterfaceType, std::vector<int32_t>> &map, bool isDev)
1469 std::vector<InterfaceType> interfaceTypes;
1512 int32_t UsbService::ExecuteManageDevicePolicy(std::vector<UsbDeviceId> &whiteList)
1514 std::map<std::string, UsbDevice *> devices;
1531 std::this_thread::sleep_for(std::chrono::milliseconds(MANAGE_INTERFACE_INTERVAL));
1544 std::string edmParaValue = OHOS::system::GetParameter("persist.edm.edm_enable", "false");
1559 std::vector<UsbDeviceType> disableType{};
1560 std::vector<UsbDeviceId> trustUsbDeviceIds{};
1599 UsbDevice *devInfo = new (std::nothrow) UsbDevice();
1612 std::string name = std::to_string(busNum) + "-" + std::to_string(devAddr);
1613 std::string uniqueName = std::to_string(devInfo->GetVendorId()) + "-" + std::to_string(devInfo->GetProductId()) +
1617 std::lock_guard<std::mutex> guard(mutex_);
1618 deviceVidPidMap_.insert(std::pair<std::string, std::string>(name, uniqueName));
1646 std::string name = std::to_string(busNum) + "-" + std::to_string(devAddr);
1652 std::lock_guard<std::mutex> guard(mutex_);
1677 std::vector<std::string> devices;
1715 bool UsbService::GetBundleName(std::string &bundleName)
1747 bool UsbService::GetCallingInfo(std::string &bundleName, std::string &tokenId, int32_t &userId)
1758 tokenId = std::to_string((uint32_t)token);
1767 bool UsbService::GetBundleInfo(std::string &tokenId, int32_t &userId)
1793 std::lock_guard<std::mutex> guard(hdiCbMutex_);
1821 std::lock_guard<std::mutex> guard(hdiCbMutex_);
1899 int32_t UsbService::AddRight(const std::string &bundleName, const std::string &deviceName)
1905 std::string deviceVidPidSerialNum = "";
1914 std::string tokenId;
1933 int32_t UsbService::AddAccessRight(const std::string &tokenId, const std::string &deviceName)
1939 std::string deviceVidPidSerialNum = "";
1959 int UsbService::Dump(int fd, const std::vector<std::u16string> &args)
1966 std::vector<std::string> argList;
1967 std::transform(args.begin(), args.end(), std::back_inserter(argList), [](const std::u16string &arg) {
2046 std::map<std::string, UsbDevice *> devices;
2136 int32_t UsbService::ManageInterfaceType(const std::vector<UsbDeviceType> &disableType, bool disable)
2152 std::map<std::string, UsbDevice *> devices;
2173 std::vector<UsbInterface> interfaces = configs.GetInterfaces();
2176 std::this_thread::sleep_for(std::chrono::milliseconds(MANAGE_INTERFACE_INTERVAL));
2194 std::map<std::string, UsbDevice *> devices;
2216 std::vector<UsbInterface> interfaces = configs.GetInterfaces();
2219 std::this_thread::sleep_for(std::chrono::milliseconds(MANAGE_INTERFACE_INTERVAL));
2244 std::map<std::string, UsbDevice *> devices;
2258 std::vector<UsbInterface> interfaces = configs.GetInterfaces();
2269 std::this_thread::sleep_for(std::chrono::milliseconds(MANAGE_INTERFACE_INTERVAL));
2301 std::map<std::string, UsbDevice *> devices;
2311 std::this_thread::sleep_for(std::chrono::milliseconds(MANAGE_INTERFACE_INTERVAL));
2400 bool UsbService::GetDeviceProductName(const std::string &deviceName, std::string &productName)