Exemplo n.º 1
0
const char *CToolDemoFile::ReadConsoleCommand()
{
	static char cmdstring[1024];
	
	ReadRawData( cmdstring, sizeof(cmdstring) );

	return cmdstring;
}
Exemplo n.º 2
0
std::string BinaryFile::ReadLongString()
{
    unsigned length;
    length = ReadUnsignedInt();
    auto* tmp = new char[length];
    ReadRawData(tmp, length);
    std::string str = tmp;
    delete[] tmp;
    return str;
}
Exemplo n.º 3
0
//-----------------------------------------------------------------------------
// Purpose: 
// Input  : discard - 
//-----------------------------------------------------------------------------
int CToolDemoFile::ReadUserCmd( char *buffer, int &size )
{
	Assert( m_hDemoFile != FILESYSTEM_INVALID_HANDLE );

	int outgoing_sequence;
	
	g_pFileSystem->Read( &outgoing_sequence, sizeof( int ), m_hDemoFile );
	
	size = ReadRawData( buffer, size );

	return outgoing_sequence;
}
Exemplo n.º 4
0
/**
 * \brief Return the status register value.
 * \param pNorFlashInfo  Pointer to an struct NorFlashInfo instance.
 * \return Status value.
 */
uint8_t intel_ReadStatus(struct NorFlashInfo *pNorFlashInfo, uint32_t address)
{
    uint32_t status;
    uint8_t busWidth;
    uint32_t budAddress;
    busWidth = NorFlash_GetDataBusWidth(pNorFlashInfo);
    
    /* Issue the Read Status Register command at any address. */
    budAddress = NorFlash_GetAddressInChip(pNorFlashInfo, address), 
    WriteCommand(busWidth, budAddress, INTEL_CMD_READ_STATUS);
    ReadRawData(busWidth, budAddress, (uint8_t*)&status);
    return status;
}
Exemplo n.º 5
0
uint32_t intel_ReadIdentification(
    struct NorFlashInfo *pNorFlashInfo, 
    uint32_t offset)
{
    uint32_t data;
    uint8_t busWidth;
    uint32_t address;
    
    // Issue Read Array Command - just in case that the flash is not in Read Array mode 
    intel_Reset(pNorFlashInfo, 0);    
    busWidth = NorFlash_GetDataBusWidth(pNorFlashInfo);
    address = NorFlash_GetAddressInChip(pNorFlashInfo, offset);
    // Issue the Read Device Identifier command at specified address.
    WriteCommand(busWidth, address, INTEL_CMD_IDIN);
    ReadRawData(busWidth, address, (uint8_t*)&data);
    
    intel_Reset(pNorFlashInfo, 0);
    return data;
}
// The following funtion illustrates the steps in getting a full raw image report (report #20) by Function $54.
static int FullRawTest(struct synaptics_ts_data *ts, int mode)
{
	u8 data;

	TestPreparation(ts);

	LGTC_DBG("[Touch][%s] raw capacitance mode!\n", __FUNCTION__);

	data = 0x14;	//raw capacitance mode
	touch_i2c_write(ts->client, REPORT_TYPE_REG, 1, &data);

	//Set the GetReport bit to run the AutoScan
	data = 0x01;
	touch_i2c_write(ts->client, ANALOG_COMMAND_REG, 1, &data);
	msleep(WAIT_TIME);

	if (ReadRawData(ts))		//rawdata store mode
		return LGTC_FAIL;

	return LGTC_SUCCESS;
}
Exemplo n.º 7
0
BOOL ScenarioDataMgr::ReadInfo(CStdioFile &file)
{
	CString strTemp;
	CString strID;
	ScenarioInfo* pInfo = NULL;
	BOOL bEnd = file.ReadString(strTemp);
	
	while(bEnd)
	{
		if(!strTemp.IsEmpty())
		{
			if(ReadRawData(file,strTemp))
			{
				break;
			}

			strID = PickupID(strTemp);
			if(strID.IsEmpty())
			{
				pInfo = GetBase();
			}
			else
			{
				pInfo = Find(strID);
			}
			if(pInfo == NULL)
			{
				return FALSE;
			}
			else
			{
				pInfo->Read(file,strTemp);
			}
		}
		bEnd = file.ReadString(strTemp);
		
	}
	return TRUE;
}