long GSkipDevice::ReadSensorDDSMemory( unsigned char *pBuf, unsigned long ddsAddr, unsigned long nBytesToRead, long nTimeoutMs /* = 1000 */, bool *pExitFlag /* = NULL */) { return ReadNonVolatileMemory(false, pBuf, ddsAddr, nBytesToRead, nTimeoutMs, pExitFlag); }
int GUSBDirectTempDevice::ReadSensorDDSMemory( unsigned char *pBuf, unsigned int ddsAddr, unsigned int nBytesToRead, int nTimeoutMs /* = 1000 */, bool *pExitFlag /* = NULL */) { return ReadNonVolatileMemory(true, pBuf, ddsAddr, nBytesToRead, nTimeoutMs, pExitFlag); }
long GSkipDevice::ReadSkipFlashRecord( GSkipFlashMemoryRecord *pFlashRec, //[o] ptr to loc to store flash record. The numeric fields in this record //came from Skip in big endian format. This routine converts those fields to //the endian format that is native to the CPU currently running. long nTimeoutMs) { long nResult = ReadNonVolatileMemory(true, pFlashRec, 0, sizeof(GSkipFlashMemoryRecord), nTimeoutMs); if (kResponse_OK != nResult) pFlashRec->signature = 0;//flash rec is ignored until this = VALID_FLASH_SIGNATURE else if (SKIP_VALID_FLASH_SIGNATURE == pFlashRec->signature) { //Handle endian issues. unsigned char * pLSB; unsigned char * pLMidB; unsigned char * pMMidB; unsigned char * pMSB; pMSB = (unsigned char *) &(pFlashRec->vinOffset); pLSB = pMSB + 1; GUtils::OSConvertBytesToShort(*pLSB, *pMSB, &(pFlashRec->vinOffset)); pMSB = (unsigned char *) &(pFlashRec->vinLowOffset); pLSB = pMSB + 1; GUtils::OSConvertBytesToShort(*pLSB, *pMSB, &(pFlashRec->vinLowOffset)); pMSB = (unsigned char *) &(pFlashRec->vinSlope); pMMidB = pMSB + 1; pLMidB = pMMidB + 1; pLSB = pLMidB + 1; GUtils::OSConvertBytesToFloat(*pLSB, *pLMidB, *pMMidB, *pMSB, &(pFlashRec->vinSlope)); pMSB = (unsigned char *) &(pFlashRec->vinLowSlope); pMMidB = pMSB + 1; pLMidB = pMMidB + 1; pLSB = pLMidB + 1; GUtils::OSConvertBytesToFloat(*pLSB, *pLMidB, *pMMidB, *pMSB, &(pFlashRec->vinLowSlope)); } return nResult; }