IPacket
Holds data and is used by objects that implement IDevicePacketStream to transfer data between a device agent application and a desktop computer.
IPacket : public IUnknown
Methods
Method |
Description |
---|---|
Gets the total number of data objects in the packet. |
|
Checks if the internal iterator has reached the end of the packet. |
|
Reads a Boolean value from the object and points the internal iterator to the next data object in the packet. |
|
Reads a byte from the object and points the internal iterator to the next data object in the packet. |
|
Reads an array of bytes from the object and points the internal iterator to the next data object in the packet. |
|
Reads an integer from the object and points the internal iterator to the next data object in the packet. |
|
Reads a character from the object and points the internal iterator to the next data object in the packet. |
|
Returns the data type of the current object in the packet as an enumeration value. |
|
Reads a string from the object and points the internal iterator to the next data object in the packet. |
|
Resets the packet's internal iterator to point to the first data object in the packet. The next read operation reads the first data object in the packet. |
|
Writes a Boolean value to the object. |
|
Writes a byte to the object. |
|
Writes an array of bytes to the object. |
|
Writes a character to the object. |
|
Writes an integer to the object. |
|
Writes a string to the object. |
Remarks
To get an object that implements this interface, use GetNewPacket.
Objects that implement this interface can only hold objects of type byte, byte[], string, int, and char. It is not extensible to read and write custom objects. However, users can still transfer custom objects across the stream by either splitting the custom data type into basic data types or serializing the custom data types into a byte array.
Example
The following example is a device agent application that writes one packet to the desktop and reads one packet from the desktop.
Managed Equivalent
Microsoft.SmartDevice.DeviceAgentTransport..::.IPacket
Requirements
DeviceAgentTransport.h