当前位置: 首页>>代码示例>>C++>>正文


C++ TDes8::FillZ方法代码示例

本文整理汇总了C++中TDes8::FillZ方法的典型用法代码示例。如果您正苦于以下问题:C++ TDes8::FillZ方法的具体用法?C++ TDes8::FillZ怎么用?C++ TDes8::FillZ使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TDes8的用法示例。


在下文中一共展示了TDes8::FillZ方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetCaps

/**
  Returns the drivers capabilities. This is not used by the Symbian OS device driver framework
  but may be useful for the LDD to use.

  @param aDes Descriptor to write capabilities information into
*/
void DZeroCopyLoopbackPddFactory::GetCaps(TDes8& aDes) const
	{
	// Create a capabilities object
	DZeroCopyLoopback::TCaps caps;
	caps.iVersion = iVersion;
	// Zero the buffer
	TInt maxLen = aDes.MaxLength();
	aDes.FillZ(maxLen);
	// Copy cpabilities
	TInt size=sizeof(caps);
	if(size>maxLen)
		size=maxLen;
	aDes.Copy((TUint8*)&caps,size);
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:20,代码来源:pdd.cpp

示例2: Caps

void DMediaDriverTest::Caps(TDes8& aCapsBuf)
//
// Return the capabilities of the media
	{

	TLocalDriveCapsV2 caps;
	caps.iType=EMediaRam;
	caps.iConnectionBusType=EConnectionBusInternal;
	caps.iDriveAtt=KDriveAttLocal|KDriveAttRemovable;
	caps.iMediaAtt=KMediaAttFormattable;
	caps.iFileSystemId=KDriveFileSysFAT;
	caps.iHiddenSectors=0;
	aCapsBuf.FillZ(aCapsBuf.MaxLength());
	aCapsBuf.Copy((TUint8 *)&caps,Min(aCapsBuf.MaxLength(),sizeof(caps)));
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:15,代码来源:d_medt1.cpp

示例3: GetCaps

/** 
 Get the capabilities of the device. This function is not called by the 
 Symbian OS. However can be used by the LDD to get the capabilities from 
 the device/hardware. There is no definition for encoding capabilities, 
 and is a matter of convention between the LDD and the PDD.
 
 @param	aDes
 		descriptor returned after filling with capabilities 
 */ 
void DExDriverPhysicalDevice::GetCaps(TDes8& aDes) const
	{    
	// Package buffer of TCommCapsV03. This creates a descriptor
	// for the commcaps structure, and provide compatibility
	// to use with API using descriptors
	//
    TCommCaps3 capsBuf;
    
    // Retrieves the data structure from the package buffer
    //
	TCommCapsV03 &caps=capsBuf();
	
	// Baud rates supported by the UART device. However, channel may
	// be designed to support a subset of them as choice (applies to
	// other configurations as well).
	//
	caps.iRate=KCapsBps110|KCapsBps150|KCapsBps300|KCapsBps600\
		|KCapsBps1200|KCapsBps2400|KCapsBps4800|KCapsBps9600\
		|KCapsBps19200|KCapsBps38400|KCapsBps57600|KCapsBps115200;		
	
	// Databit size	
	caps.iDataBits=KCapsData5|KCapsData6|KCapsData7|KCapsData8;
	// Stop bits size supported
	caps.iStopBits=KCapsStop1|KCapsStop2;
	// Parity supported
	caps.iParity=KCapsParityNone|KCapsParityEven|KCapsParityOdd|KCapsParityMark|KCapsParitySpace;
	// Handshaking protocol supported by device
	caps.iHandshake=KCapsObeyXoffSupported|KCapsSendXoffSupported|
					KCapsObeyCTSSupported|KCapsFailCTSSupported|
					KCapsObeyDSRSupported|KCapsFailDSRSupported|
					KCapsObeyDCDSupported|KCapsFailDCDSupported|
					KCapsFreeRTSSupported|KCapsFreeDTRSupported;
	// Infrared mode
	caps.iSIR=1;
	// Signals supported
	caps.iSignals=KCapsSignalCTSSupported|KCapsSignalRTSSupported|KCapsSignalDTRSupported|
						KCapsSignalDSRSupported|KCapsSignalDCDSupported|KCapsSignalRNGSupported;
	// FIFO enable/disable					
	caps.iFifo=KCapsHasFifo;
	// Notifications supported
	caps.iNotificationCaps=KNotifyDataAvailableSupported|KNotifySignalsChangeSupported;
	caps.iRoleCaps=0;
	caps.iFlowControlCaps=0;
	// Break supported
	caps.iBreakSupported=ETrue;

	// [TDes8::MaxLength()] - Get the descriptor's length.
	TInt len = aDes.MaxLength();
	
	// [TDes8::FillZ(len)] -Fill the descriptor's data area with binary 
	// zeroes, replacing any existing data and change its length. 
	aDes.FillZ(len);
	
    TInt size = sizeof(caps);
    if (size>len)
    	size=len;
    
    // [TDes8::Copy()] - Copy the data of length (size) into aDes descriptor
    //  replacing any existing data in the descriptor.
    aDes.Copy((TUint8*)&caps, size);
        	
	aDes=capsBuf.Left(Min(capsBuf.Length(),aDes.MaxLength()));	
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:72,代码来源:d_expio_pdd.cpp


注:本文中的TDes8::FillZ方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。