CCommandPacket (Windows Embedded CE 6.0)
1/6/2010
This class is used as an interface to command data for the device component of a remote tool.
Note
Commands can not grow to more than 320k in size.
Public Enumerations
Enumeration | Description |
---|---|
CCommandPacket::DATATYPE |
Enumerations for the data type for a parameter in the command packet. |
enum DATATYPE {
DATATYPE_BYTES = 0,
DATATYPE_WORD = 2,
DATATYPE_DWORD = 3,
DATATYPE_WSTR = 5,
DATATYPE_END = 6
}
Enumerator | Description |
---|---|
DATATYPE_BYTES |
The data type for the parameter is a BYTE array. |
DATATYPE_WORD |
The data type for the parameter is a WORD. |
DATATYPE_DWORD |
The data type for the parameter is a DWORD |
DATATYPE_WSTR |
The data type for the parameter is a WCHAR array (Unicode string). |
DATATYPE_END |
There are no more parameters left in the command packet. |
Public Member Functions
Member | Description |
---|---|
AddParameterDWORD |
Adds a DWORD value to the command packet. |
AddParameterWORD |
Adds a WORD value to the command packet. |
AddParameterBytes |
Adds an array of BYTES to the command. The command will make a copy of the byte array so you can free the pData argument after calling this function |
AddParameterString |
Adds a WCHAR array (Unicode string) to the command. The command will make a copy of the string so you can free the szData argument after calling this function. |
GetParameterDWORD |
Gets the next DWORD value from the command. If the next value is not a DWORD, this method will return FALSE. |
GetParameterWORD |
Gets the next WORD value from the command. If the next value is not a WORD, this method will return FALSE. |
GetParameterBytes |
Gets the next value from the command. If the next value is not a BYTE array, this method will return FALSE. You need to allocate the BYTE array to hold cbData bytes before calling GetParameterBytes. If you don’t know how big it will be, call GetNextParameterType first. |
GetParameterString |
Gets the next WCHAR array (Unicode string) value from the command. If the next value is not a string, this method will return FALSE. GetParameterString will allocate the string for you. You must call FreeString when you are done with the data. |
GetNextParameterType |
Gets the next data type from the command. If there is no more data, the pType returned is DATATYPE_END. |
FreeString |
Frees a string allocated by CCommandPacket::GetParameterString. |
Reset |
Resets a command. All data added will be released. This function can be used to reuse a CCommandPacket object. |
SetAllocatedSize |
Calling this method sets the parameter data size for a command packet. |
GetAvailableDataSize |
Retrieves the amount of bytes left in the command packet. This value is accurate for the next parameter you will add to the packet and accounts for any headers required by the Remote Tools Framework. |
Member Function Details
AddParameterDWORD
virtual void CCommandPacket::AddParameterDWORD(
DWORD dwData
) [pure virtual]
dwData - [in] The DWORD value to add to the command packet.
AddParameterWORD
virtual void CCommandPacket::AddParameterWORD(
WORD wData
) [pure virtual]
wData - [in] The WORD value to add to the command packet.
AddParameterBytes
virtual void CCommandPacket::AddParameterBytes(
BYTE *pData,
DWORD cbData
)[pure virtual]
pData - [in] The BYTE array to add to the command packet.
cbData - [in] The length of the BYTE array (in bytes).
AddParameterString
virtual void CCommandPacket::AddParameterString(
WCHAR *szData
) [pure virtual]
szData - [in] The WCHAR array (Unicode string) to add to the command packet.
GetParameterDWORD
virtual BOOL CCommandPacket::GetParameterDWORD(
DWORD *pdwData
) const [pure virtual]
pdwData - [in] A pointer to a DWORD value.
GetParameterWORD
virtual BOOL CCommandPacket::GetParameterWORD(
WORD *pwData
) const [pure virtual]
pwData - [in] A pointer to a WORD value.
GetParameterBytes
virtual BOOL CCommandPacket::GetParameterBytes(
BYTE *pData,
DWORD cbData
) const [pure virtual]
pData - [out] A pointer to a BYTE array of at least cbData bytes.
cbData - [in] The size of the BYTE array pData in bytes.
GetParameterString
virtual BOOL CCommandPacket::GetParameterString(
WCHAR **ppszData
) const [pure virtual]
ppszData - [out] A pointer to a WCHAR array (Unicode string).
GetNextParameterType
virtual BOOL CCommandPacket::GetNextParameterType(
DATATYPE *pType,
DWORD *pSize
) const [pure virtual]
pType - [out] The type of the next parameter.
pSize - [out] The size of the next parameter, in bytes.
FreeString
virtual void CCommandPacket::FreeString(
WCHAR *pszData
) const [pure virtual]
pszData - [in] The WCHAR array (Unicode string) allocated by CCommandPacket::GetParameterString.
Reset
virtual void CCommandPacket::Reset ( ) [pure virtual]
SetAllocatedSize
virtual BOOL CCommandPacket::SetAllocatedSize(
DWORD dwBytesRequested,
DWORD *pBytesAllocated
) [pure virtual]
dwBytesRequested - [in] The size of the parameter data buffer to reserve.
pBytesAllocated - [out] The actual number of bytes allocated for the parameter data buffer.
GetAvailableDataSize
virtual BOOL CCommandPacket::GetAvailableDataSize(
DWORD *pdwAvailable
) [pure virtual]
pdwAvailable - [out] The number of bytes left in the command packet to be filled.
Requirements
Header | cecorecon.h |
Platform Builder | Windows Embedded CE 6.0 Platform Builder Service Pack 1 and later |
See Also
Reference
Remote Tools Framework Classes
Remote Tools Framework Reference