std::string Device::getSerialNumber() { LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); char serialNumStr[NVM_SERIALSTR_LEN]; SERIAL_NUMBER_TO_STRING(getDiscovery().serial_number, serialNumStr); return std::string(serialNumStr); }
int CGestionProxy::InitializeProxy(int trace, CString idDisp, CString ipHDHR) { m_initializedProxy = 1; //Traces are activated to save in log m_Traces->InitializeTrace(trace); if (m_Traces->IsLevelWriteable(LEVEL_TRZ_1)) { char nvl[500]; memset(nvl, 0, 500); _snprintf(nvl, 500 - 2, "Trace Level: %d\n", trace); m_Traces->WriteTrace(nvl, LEVEL_TRZ_1); m_Traces->WriteTrace("******************* Start HDHR IPTV Proxy *******************\n", LEVEL_TRZ_1); m_Traces->WriteTrace("*** Version HDHRProxyIPTV Application: v1.0.4\n", LEVEL_TRZ_1); CStringA idDispTmp(idDisp); CStringA ipHDHRTmp(ipHDHR); _snprintf(nvl, 500 - 2, "*** Device ID: %s\n", idDispTmp); m_Traces->WriteTrace(nvl, LEVEL_TRZ_1); _snprintf(nvl, 500 - 2, "*** Server IP: %s\n", ipHDHRTmp); m_Traces->WriteTrace(nvl, LEVEL_TRZ_1); _snprintf(nvl, 500 - 2, "*** Server IP: %d\n", getDiscovery()->ObtainHDHRServPort()); m_Traces->WriteTrace(nvl, LEVEL_TRZ_1); _snprintf(nvl, 500 - 2, "*** Number of Tuners configured: %d\n", m_cfgProxy->getTunersNumber()); m_Traces->WriteTrace(nvl, LEVEL_TRZ_1); _snprintf(nvl, 500 - 2, "*** Lock configured: %d\n", m_cfgProxy->getLock()); m_Traces->WriteTrace(nvl, LEVEL_TRZ_1); TCHAR sDirActual[200]; GetCurrentDirectory(200, sDirActual); CString path; path.Format(L"%s\\%s", sDirActual, _T(NAME_FILE_MAPLIST)); _snprintf(nvl, 500 - 2, "*** Mapping List File: %s\n", CStringA(path)); m_Traces->WriteTrace(nvl, LEVEL_TRZ_1); CString chans,ch; chans.Format(L"["); for (int i=0; i < m_cfgProxy->m_numChannels; i++) { ch.Format(L"%d", m_cfgProxy->m_infoChannels[i].channel); chans.Append(ch); if (i<m_cfgProxy->m_numChannels - 1) chans.Append(L";"); } chans.Append(L"]"); _snprintf(nvl, 500- 2, "*** Number of channels in Mapping List File: %d %s\n", m_cfgProxy->m_numChannels, CStringA(chans)); m_Traces->WriteTrace(nvl, LEVEL_TRZ_1); } //The first is to start phase Discovery if (!StartDiscovery(trace, idDisp, ipHDHR)) return 0; /* Control */ StartControl(trace, idDisp, ipHDHR); return 1; }
bool Device::isManufacturingInfoValid() { LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); if (getDiscovery().manufacturing_info_valid == 0) { return false; } else { return true; } }
std::string Device::getManufacturer() { LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); std::string result; char manufacturerStr[NVM_MANUFACTURERSTR_LEN]; if (lookup_jedec_jep106_manufacturer( getDiscovery().manufacturer, NVM_MANUFACTURER_LEN, manufacturerStr, NVM_MANUFACTURERSTR_LEN) == COMMON_SUCCESS) { result = std::string(manufacturerStr); } return result; }
std::vector<NVM_UINT16> Device::getInterfaceFormatCodes() { LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); std::vector<NVM_UINT16> interfaceFormatCodes; for (int i = 0; i < NVM_MAX_IFCS_PER_DIMM; i++) { NVM_UINT16 ifc = getDiscovery().interface_format_codes[i]; if (ifc != FORMAT_NONE) { interfaceFormatCodes.push_back(ifc); } } return interfaceFormatCodes; }
const std::vector<event> &Device::getEvents() { LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); if (m_pActionRequiredEvents == NULL) { m_pActionRequiredEvents = new std::vector<event>(); event_filter filter; memset(&filter, 0, sizeof(filter)); filter.filter_mask = NVM_FILTER_ON_AR | NVM_FILTER_ON_UID; filter.action_required = 1; memmove(filter.uid, getDiscovery().uid, sizeof(filter.uid)); try { *m_pActionRequiredEvents = m_lib.getEvents(filter); } catch (core::LibraryException &) { // don't throw } } return *m_pActionRequiredEvents; }
enum lock_state Device::getLockState() { LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); return getDiscovery().lock_state; }
std::string Device::getFwApiVersion() { LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); return getDiscovery().fw_api_version; }
NVM_UINT64 Device::getRawCapacity() { LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); return getDiscovery().capacity; }
NVM_UINT32 Device::getSku() { LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); return getDiscovery().dimm_sku; }
NVM_UINT16 Device::getRevisionId() { LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); return getDiscovery().revision_id; }
bool Device::isEraseCryptoCapable() { LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); return getDiscovery().security_capabilities.erase_crypto_capable; }
bool Device::isAppDirectModeCapable() { LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); return getDiscovery().device_capabilities.app_direct_mode_capable; }
NVM_UINT32 Device::getChannelId() { LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); return getDiscovery().device_handle.parts.mem_channel_id; }
NVM_UINT8 Device::getManufacturingLoc() { LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); return getDiscovery().manufacturing_location; }
NVM_UINT16 Device::getSubsystemVendor() { LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); return getDiscovery().subsystem_vendor_id; }
NVM_UINT16 Device::getSubsystemRevision() { LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); return getDiscovery().subsystem_revision_id; }
NVM_UINT16 Device::getPhysicalId() { LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); return getDiscovery().physical_id; }
NVM_UINT16 Device::getNodeControllerId() { LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); return getDiscovery().node_controller_id; }
NVM_UINT16 Device::getSocketId() { LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); return getDiscovery().socket_id; }
bool Device::isPassphraseCapable() { LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); return getDiscovery().security_capabilities.passphrase_capable; }
enum memory_type Device::getMemoryType() { LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); return getDiscovery().memory_type; }
bool Device::isUnlockDeviceCapable() { LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); return getDiscovery().security_capabilities.unlock_device_capable; }
NVM_UINT32 Device::getDeviceHandle() { LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); return getDiscovery().device_handle.handle; }
bool Device::isDieSparingCapable() { LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); return getDiscovery().device_capabilities.die_sparing_capable; }
NVM_UINT16 Device::getManufacturerId() { LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); return MANUFACTURER_TO_UINT(getDiscovery().manufacturer); }
bool Device::isStorageModeCapable() { LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); return getDiscovery().device_capabilities.storage_mode_capable; }
std::string Device::getModelNumber() { LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); return getDiscovery().model_number; }
NVM_UINT16 Device::getManufacturingDate() { LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); return getDiscovery().manufacturing_date; }
NVM_UINT16 Device::getVendorId() { LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); return getDiscovery().vendor_id; }