This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Debug Server Scripting(DSS) implement the onDisconnect() in the SessionEvents class

I am using the Debug Server Scripting(DSS) in javascript to try to implement the onDisconnect() in the SessionEvents class.

I’ve tried various implementations and  I’m struggling with how to implement it. I see in the example code you can get a scripting object by doing the following: var script = ScriptingEnvironment.instance();

However, I don’t see a comparable example for doing an event/listener, specially I’m struggling with the interfaces. Are there any examples on how to addListener() for an event and then handle the event?

  • Hi Brent,

    I have not actually used this before and taking a look at it know. The APi doc is quite light on details and I'm trying to figure this out myself. I'll let you know when I get this going.

    Thanks

    ki

  • There seem to be very little information on these APIs. I don't think they are commonly used... if at all. 

    What is your use case for it? Do you wish to register a callback when you disconnect the debugger from the target?

  • Ultimately, we have old test scripts that ran on CCS 3.0 and are trying to reuse them completely or as much as much as possible with new CCS. At the end of these test scripts, via a gel file it calls GEL_Disconnect();. Because all of these old test scripts do this disconnect I was hoping I could have a callback setup that could alert me the test is complete by telling me the debugger disconnected from the target. From reading the API it sounded like the onDisconnect() in the SessionEvents class would do this...but like you said, there isn't a lot of information in the API on this.

  • Were these old test scripts a bunch of GEL scripts? GEL has some callback functions - there is an OnTargetConnect() but not one for disconnect unfortunately. There is a DSS API where you can check to see if the target is connected or not, but that would require a type of polling, which is not as nice as a callback...