long GSkipDevice::WriteSensorDDSMemory( unsigned char *pBuf, unsigned long ddsAddr, unsigned long nBytesToWrite, long nTimeoutMs /* = 1000 */, bool *pExitFlag /* = NULL */) { return WriteNonVolatileMemory(false, pBuf, ddsAddr, nBytesToWrite, nTimeoutMs, pExitFlag); }
int GUSBDirectTempDevice::WriteSensorDDSMemory( unsigned char *pBuf, unsigned int ddsAddr, unsigned int nBytesToWrite, int nTimeoutMs /* = 1000 */, bool *pExitFlag /* = NULL */) { return WriteNonVolatileMemory(true, pBuf, ddsAddr, nBytesToWrite, nTimeoutMs, pExitFlag); }
long GSkipDevice::WriteSkipFlashRecord( const GSkipFlashMemoryRecord &flashRec, //[i] The numeric fields in this record are stored on Skip //in big endian format. This routine converts the numbers from the //endian format that is native to the current CPU into big endian //before writing them to Skip. long nTimeoutMs) { //Convert numeric fields in flashRec to big endian format. GSkipFlashMemoryRecord bigEndianFlashRec = flashRec; unsigned char * pLSB; unsigned char * pLMidB; unsigned char * pMMidB; unsigned char * pMSB; pMSB = (unsigned char *) &bigEndianFlashRec.vinOffset; pLSB = pMSB + 1; GUtils::OSConvertShortToBytes(flashRec.vinOffset, pLSB, pMSB); pMSB = (unsigned char *) &bigEndianFlashRec.vinLowOffset; pLSB = pMSB + 1; GUtils::OSConvertShortToBytes(flashRec.vinLowOffset, pLSB, pMSB); pMSB = (unsigned char *) &bigEndianFlashRec.vinSlope; pMMidB = pMSB + 1; pLMidB = pMMidB + 1; pLSB = pLMidB + 1; GUtils::OSConvertFloatToBytes(flashRec.vinSlope, pLSB, pLMidB, pMMidB, pMSB); pMSB = (unsigned char *) &bigEndianFlashRec.vinLowSlope; pMMidB = pMSB + 1; pLMidB = pMMidB + 1; pLSB = pLMidB + 1; GUtils::OSConvertFloatToBytes(flashRec.vinLowSlope, pLSB, pLMidB, pMMidB, pMSB); long nResult = WriteNonVolatileMemory(true, &bigEndianFlashRec, 0, sizeof(bigEndianFlashRec), nTimeoutMs); return nResult; }