Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
Hi, Changing the session properties on the fly is very important in debugging systems especially hardware; for example, in a serial session, being able to change baud rate dynamically in the script is very useful e.g you don't know the target system's baud rate and you want to sweep all the possible baud rates; or as another example, as a common practice, you multiplex one serial port to two; one is high speed and the other is low speed; so you want to switch to different rates on the fly. Does anyone has any idea how to do this in script?
Currently, IAS (in-app-script) can only control the underlying session via:
connect()
disconnect()
transmit(p, size)
Fine-tuning of the sessions configuration is currently not possible from IAS. But we plan to add this capability in the near future.
Each session class will export a public IAS interface (e.g., a serial session will have properties to query and control baud rate, parity, status lines, etc.) Then, IAS should be able to access this interface via a global constant g_session (or something like that).
g_session
@vladimir Thank you very much for adding such a useful capability to the IAS. Eagerly waiting for it.
@Mohammad, sorry for the late update, but now we have what you asked for.
Starting with ioninja-5.1.2, the serial session exports the g_session object accessible from the "Script" pane. This allows you to control all parameters of a serial port with your script. For example:
// configure the port... g_session.open("COM1"); g_session.m_baudRate = 115200; g_session.m_dataBits = 8; g_session.m_stopBits = io.SerialStopBits._1; g_session.m_parity = io.SerialParity.None; g_session.m_dtr = true; // work with the device... transmit("\x02INIT\r");
Let me know what you think!
@vladimir Thank you so much for adding this. This works very well both for serial sessions and also serial Tap. However, for serial Tap, properties such as DTR and open "COMx" would not work which is quite normal and makes sense.