Command from and to duet
erwinm
Posts: 6
Hi,
Just a quick question about using duet modules. I'm pretty new at AMX programming and want to use the duet modules with SNAPI as intended.
I learned to implement modules by using SEND_COMMMAND to control the devices through virtual devices, and use SEND_STRING in the modules for feedback.
But... for Duet modules SEND_COMMAND are used for controlling, but i also get COMMANDS back from the duet modules. How do i know (or how do my modules know) where the command originated? Is it from my code or is it coming form the Duet module? I guess my DATA_EVENT will fire in both situations. Or am i wrong?
Greetz,
Erwin van Maasakkers
Just a quick question about using duet modules. I'm pretty new at AMX programming and want to use the duet modules with SNAPI as intended.
I learned to implement modules by using SEND_COMMMAND to control the devices through virtual devices, and use SEND_STRING in the modules for feedback.
But... for Duet modules SEND_COMMAND are used for controlling, but i also get COMMANDS back from the duet modules. How do i know (or how do my modules know) where the command originated? Is it from my code or is it coming form the Duet module? I guess my DATA_EVENT will fire in both situations. Or am i wrong?
Greetz,
Erwin van Maasakkers
0
Comments
DUET is different, your send commands will not trigger your data event. Only messages from the DUET module will.
I still don't quite understand...
lets say i have a real device and a virtual device, of that real device.
Then i have a module, define_module 'mdlAcmeLcdDisplay' modLcd(vdvCD, dvCD) <-this would be the jar file)
and a UI module, define_module 'mdlLcdDisp_UI' modLcd_UI(vdvCD,dvCD)
When i do a SEND_COMMAND from the modLcd_UI, let's say "ASPECT=NORMAL", a response from the DUET would be a COMMAND "ASPECT=NORMAL". If i catch this response with a DATA_EVENT COMMAND:, wouldn't my command that i did send in the first place trip that same catch?
(i'm dutch, excuse me for my poor english)
Erwin