Cisco Packet Tracer Extensions API 8.1.0
API for communication between Cisco Packet Tracer application and its extension applications and modules.
Public Member Functions | List of all members
IpcManager Class Reference

IpcManager serves as the entry point for the IPC and manages ExApps and Script Modules. More...

Public Member Functions

int getListeningPort ()
 Returns the listening port for IPC. More...
 
bool launchCep (string)
 Launches the ExApp with the specified ID. More...
 
bool setExclusive (bool)
 Disconnects all other external processes and locks new connections to this external process' ID only. More...
 
bool putSaveData (uuid, QString)
 Saves data with the specified UUID. More...
 
QString getOpenData (uuid)
 Returns the save data with the specified UUID. More...
 
CepInstance thisInstance ()
 Returns the CepInstance object for this instance. More...
 
bool sendMessageTo (string, QString)
 Sends a message to the local instance with the specified ID. More...
 
bool sendMessageToInstance (uuid, QString)
 Sends a message to the local instance with the specified UUID. More...
 
bool sendMessageToAll (QString)
 Sends a message to all instances. More...
 
bool sendMessageToRemote (string, QString)
 Sends a message to the remote instance with the specified ID. More...
 
bool sendMessageToRemoteInstance (uuid, QString)
 Sends a message to the remote instance with the specified UUID. More...
 
void onSave (uuid)
 This event is emitted when data is saved. More...
 
void onOpen (uuid, QString)
 This event is emitted when data is opened. More...
 
void onOpening (uuid, QString)
 This event is emitted when file is being opened. The ExApp or script module has access to the data at this point but should wait til the onOpen event for the file to be opened completely. More...
 
bool registerOpenFileType (QString)
 Register a file extension to be opened by this CEP instance if the file is opened from PT GUI or OS. More...
 
bool unregisterOpenFileType (QString)
 Unregister a file extension to be opened by this CEP instance if the file is opened from PT GUI or OS. More...
 

Detailed Description

IpcManager serves as the entry point for the IPC and manages ExApps and Script Modules.

Member Function Documentation

◆ getListeningPort()

int IpcManager::getListeningPort ( )

Returns the listening port for IPC.

Returns
int, the listening port for IPC.

◆ getOpenData()

QString IpcManager::getOpenData ( uuid  )

Returns the save data with the specified UUID.

Parameters
openId,theUUID of the save data.
Returns
QString, the save data with the specified UUID.

◆ launchCep()

bool IpcManager::launchCep ( string  )

Launches the ExApp with the specified ID.

Parameters
cepId,theID of the external process.
Returns
bool, true if successful, otherwise false.

◆ onOpen()

void IpcManager::onOpen ( uuid  ,
QString   
)

This event is emitted when data is opened.

  • openId, the UUID of the data.
  • openData, the data.

IPC event.

◆ onOpening()

void IpcManager::onOpening ( uuid  ,
QString   
)

This event is emitted when file is being opened. The ExApp or script module has access to the data at this point but should wait til the onOpen event for the file to be opened completely.

  • openId, the UUID of the data.
  • openData, the data.

IPC event.

◆ onSave()

void IpcManager::onSave ( uuid  )

This event is emitted when data is saved.

  • saveId, the UUID of the data.

IPC event.

◆ putSaveData()

bool IpcManager::putSaveData ( uuid  ,
QString   
)

Saves data with the specified UUID.

Parameters
saveId,theUUID of the save data.
saveData,thedata to save.
Returns
bool, true if successful, otherwise false.

◆ registerOpenFileType()

bool IpcManager::registerOpenFileType ( QString  )

Register a file extension to be opened by this CEP instance if the file is opened from PT GUI or OS.

  • fileExtension, the extenstion to register
Returns
bool, true if successful, otherwise false.

◆ sendMessageTo()

bool IpcManager::sendMessageTo ( string  ,
QString   
)

Sends a message to the local instance with the specified ID.

\paran cepId, the ID of the local instance. \paran msg, the message to send.

Returns
bool, true if successful, otherwise false.

◆ sendMessageToAll()

bool IpcManager::sendMessageToAll ( QString  )

Sends a message to all instances.

\paran msg, the message to send.

Returns
bool, true if successful, otherwise false.

◆ sendMessageToInstance()

bool IpcManager::sendMessageToInstance ( uuid  ,
QString   
)

Sends a message to the local instance with the specified UUID.

\paran cepInstanceId, the UUID of the local instance. \paran msg, the message to send.

Returns
bool, true if successful, otherwise false.

◆ sendMessageToRemote()

bool IpcManager::sendMessageToRemote ( string  ,
QString   
)

Sends a message to the remote instance with the specified ID.

Parameters
cepId,theID of the remote instance. \paran msg, the message to send.
Returns
bool, true if successful, otherwise false.

◆ sendMessageToRemoteInstance()

bool IpcManager::sendMessageToRemoteInstance ( uuid  ,
QString   
)

Sends a message to the remote instance with the specified UUID.

Parameters
cepInstanceId,theUUID of the remote instance. \paran msg, the message to send.
Returns
bool, true if successful, otherwise false.

◆ setExclusive()

bool IpcManager::setExclusive ( bool  )

Disconnects all other external processes and locks new connections to this external process' ID only.

Parameters
exclusive,trueto disconnect all external processes of different IDs, false to allow new connections from other external processes.
Returns
bool, true if successful, otherwise false.

◆ thisInstance()

CepInstance IpcManager::thisInstance ( )

Returns the CepInstance object for this instance.

Returns
CepInstance, the CepInstance object for this instance.

◆ unregisterOpenFileType()

bool IpcManager::unregisterOpenFileType ( QString  )

Unregister a file extension to be opened by this CEP instance if the file is opened from PT GUI or OS.

  • fileExtension, the extenstion to unregister
Returns
bool, true if successful, otherwise false.

The documentation for this class was generated from the following file: