LinuxMCE Forums
May 22, 2013, 08:27:44 pm GMT-1 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Rule #1 - Be Patient - Rule #2 - Don't ask when, if you don't contribute - Rule #3 - You have coding skills - LinuxMCE's small brother is available: http://www.agocontrol.com
 
   Home   Help Search Chat Login Register  
Pages: [1]
  Print  
Author Topic: Registering a Message Interceptor....  (Read 777 times)
derailed
Newbie
*
Posts: 10


View Profile
« on: February 15, 2009, 07:21:47 pm »

Hi,

   I am trying to register an exec to catch various events. I have put a shell script in /usr/pluto/bin and was hoping for this exec to be invoked when in this case lighting events occurs. I am following the post on the wiki to set up my interceptor, which was added as a child device (#43) of core with a generic#1 template.

   I register my interceptor using the following command:

MessageSend localhost 43 -1000 8 0 5 2 4 73 6 192

DCE log says

Device 43 registered Message interceptor 0/0/0/73/2/192 <0x6d8c7b90>

all good so far... ( I think ? )

Then I issue the following cmd to turn the light on

MessageSend localhost -r 0 42 1 192

Now the dce log says

The target device 43 (routed to 43) has not registered. <0x6d8c7b90>

Any ideas ?

The just of it: I would like to trap device events and have some custom code run when specific events take place. I am hoping I could register an interceptor to get callbacks when certain events get trigger on adhoc devices with some info for which device fired the event and which event occurred....

Is this achievable ? Is so can someone shed some light ?


Many Thanks !!
Logged
chrisbirkinshaw
Guru
****
Posts: 431


View Profile
« Reply #1 on: February 20, 2009, 06:26:46 pm »

You have registered an interceptor and then tried to send a command to it. This is not what interceptors are for. The idea is that you set up an interceptor to catch all lighting plugin messages, then when a message is sent to a light they are also sent to the target in your interceptor.

My wiki page may be of some use, as I hacked something together which does what you are trying to achieve.

http://wiki.linuxmce.org/index.php/User:Chrisbirkinshaw

BTW why do you want to do this? If you just want to run code on events then you can already do this through the web admin respond to events pages. If you have a case for which this does not work I am interested as I am trying to collect all such cases and propose some changes.

Chris
Logged
ddamron
Alumni
wants to work for LinuxMCE
*
Posts: 962



View Profile WWW
« Reply #2 on: February 24, 2009, 11:35:45 pm »

Agreed.

If you really are stuck, do a wiki search for some of my code.
Insteon, PLCBUS, and ThreadedRuby.

All of those implement Lighting.

Good Luck.

Dan
Logged

The only intuitive interface is the nipple.  After that it's all learned.
My other computer is your windows box.
I'm out of my mind.  Back in 5 minutes.
Q:  What's Red and smells like blue paint?

A:  Red Paint.
derailed
Newbie
*
Posts: 10


View Profile
« Reply #3 on: February 25, 2009, 01:37:13 am »

Hi Chris, Dan,

   Thanks so much for the response. Very useful insights....

-F
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!