#include <DeviceRequest.h>
Inheritance diagram for cluster::DeviceRequest:


Public Methods | |
| DeviceRequest () | |
| DeviceRequest (const vpr::GUID &plugin_guid, const std::string &device_name) | |
| Create a DeviceRequest packet to request a remote device. More... | |
| void | serialize () |
| Serializes member variables into a data stream. More... | |
| virtual void | parse (vpr::BufferObjectReader *reader) |
| Parses the data stream into the local member variables. More... | |
| virtual void | printData (int debug_level) |
| Print the data to the screen in a readable form. More... | |
| std::string | getDeviceName () |
| Return the name of the remote device being requested. More... | |
Static Public Methods | |
| vpr::Uint16 | getPacketFactoryType () |
| Return the type of this packet. More... | |
|
|
Definition at line 52 of file DeviceRequest.h.
00053 {;}
|
|
||||||||||||
|
Create a DeviceRequest packet to request a remote device.
Definition at line 44 of file DeviceRequest.cpp. References cluster::Packet::mHeader, cluster::Packet::mPluginId, and serialize.
00045 {
00046 // Set the local member variables using the given values.
00047 mDeviceName = device_name;
00048 mPluginId = plugin_guid;
00049
00050 // Create a Header for this packet with the correect type and size.
00051 mHeader = new Header(Header::RIM_PACKET,
00052 Header::RIM_DEVICE_REQ,
00053 Header::RIM_PACKET_HEAD_SIZE
00054 + 16 /*Plugin GUID*/
00055 + 2 /*Size mDeviceName*/
00056 + mDeviceName.size(),
00057 0/*Field not curently used*/);
00058 // Serialize the given data.
00059 serialize();
00060 }
|
|
|
Serializes member variables into a data stream.
Definition at line 62 of file DeviceRequest.cpp. References cluster::Packet::mHeader, cluster::Packet::mPacketWriter, and cluster::Packet::mPluginId. Referenced by DeviceRequest.
00063 {
00064 // Clear the data stream.
00065 mPacketWriter->getData()->clear();
00066 mPacketWriter->setCurPos(0);
00067
00068 // Serialize the header.
00069 mHeader->serializeHeader();
00070
00071 // Serialize plugin GUID.
00072 mPluginId.writeObject(mPacketWriter);
00073
00074 // Serialize the name of the requested device.
00075 mPacketWriter->writeString(mDeviceName);
00076 }
|
|
|
Parses the data stream into the local member variables.
Implements cluster::Packet. Definition at line 77 of file DeviceRequest.cpp. References cluster::Packet::mPluginId.
00078 {
00079 // De-Serialize plugin GUID
00080 mPluginId.readObject(reader);
00081
00082 // De-Serialize the name of the requested device.
00083 mDeviceName = reader->readString();
00084 }
|
|
|
Print the data to the screen in a readable form.
Implements cluster::Packet. Definition at line 86 of file DeviceRequest.cpp. References gadgetDBG_RIM, and cluster::Packet::mPluginId.
00087 {
00088 vprDEBUG_BEGIN(gadgetDBG_RIM,debug_level)
00089 << clrOutBOLD(clrYELLOW,"==== Device Request Packet Data ====\n") << vprDEBUG_FLUSH;
00090
00091 Packet::printData(debug_level);
00092
00093 vprDEBUG(gadgetDBG_RIM,debug_level)
00094 << clrOutBOLD(clrYELLOW, "Plugin GUID: ") << mPluginId.toString()
00095 << std::endl << vprDEBUG_FLUSH;
00096 vprDEBUG(gadgetDBG_RIM,debug_level)
00097 << clrOutBOLD(clrYELLOW, "Device Name: ") << mDeviceName
00098 << std::endl << vprDEBUG_FLUSH;
00099
00100 vprDEBUG_END(gadgetDBG_RIM,debug_level)
00101 << clrOutBOLD(clrYELLOW,"====================================\n") << vprDEBUG_FLUSH;
00102 }
|
|
|
Return the type of this packet.
Definition at line 81 of file DeviceRequest.h.
00082 {
00083 return(Header::RIM_DEVICE_REQ);
00084 }
|
|
|
Return the name of the remote device being requested.
Definition at line 89 of file DeviceRequest.h.
00089 { return mDeviceName; }
|
1.2.14 written by Dimitri van Heesch,
© 1997-2002