本文整理汇总了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);
}
示例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)));
}
示例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()));
}