| |||||||||||
Respond to remote events Posted by asmall (asmall), 4 July 2007 I'm writing a Command Prompt based test tool in C that includes the TCL language. I'm overriding Tcl_AppINit and adding custom commands using Tcl_CreateObjCommand() and calling Tcl_Main from main().The system has two processor boards (A & B) that normally interact, and the test tool emulates one side (so we can test the other) by replacing board A with a PC. The original concept was that board A would send data and commands to B, but now it looks more complex. Now, some commands from A (e.g. dataavailable) result in B calling back to request blocks of data (e.g. getblock). This event arrives at the C program as a callback function. I need to allow the event to come back into the TCL script and respond appropriately depending on the parameter values in the callback. An idea is to define a TCL proc earlier in the script that can be called from within the C handler, somehow passing on the parameters. The parameters include a number of status flags, and a void pointer to "pDetails". Can TCL do this? Posted by admin (Graham Ellis), 6 July 2007 This is one of those questions that I went "oh help" at when I first read it ... and I'm still wallowing slightly - I'm away from home and all my reference books, and looking at Java / Tomcat stuff today which is a very different topic indeed. But I THINK the answer to your question is "Yes".Pleas do follow up further if you would like me to take a further look and see if I can came up with more certainty for that answer next week, when I'll be back in base Posted by asmall (asmall), 6 July 2007 Yes, still interested. Currently the callbacks are going to a printf statement so the developers are able to manually confirm the parameters and respond accordingly. This is OK for early development, but we'll need better automation for testing.This page is a thread posted to the opentalk forum
at www.opentalk.org.uk and
archived here for reference. To jump to the archive index please
follow this link.
|
| ||||||||||
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho |