Doorbell Interface
funkyskier
Posts: 48
We are having problems with a the Precis 8x8 utilizing a doorbell interface. Using the CFSound module we are sending the doorbell sound to the precis. Our problem is that there does not seem to be a clean way to return the precis to its previous state. Basically I need to know the state of the switcher (input and output) so after I ring the the doorbell through the audio system I can get everybody listening to what they were. Being able to set a preset and then recall the preset would be nice. (like with the extron) Any example code would be appreciated. We have it working (sort of) but its nasty.
Thanks
Thanks
0
Comments
Automagical actions often seem to bite you later, so I fight against them when I can.
However this seems straightforward.
First you need to track the state of the switcher. That's a given in all systems for all devices like this.
The state is an array with 8 elements, one for each output, representing which input is being sent to that output - values 0..8 where 0 is no input.
It seems unnatural to hold an array of output states rather than input states, but it's necessary. You have to "think backwards" when writing the driver - I always have to double check - but you only have to write the driver once.
You need to duplicate the state array for both "Desired" and "Sent" versions. "Desired" is what you want the switcher to do and "Sent" is what you've told the switcher to do so far.
It's best to code your driver so that it doesn't send a command to the switcher to reassert switcher state if it is already good. That's easy when you know the state. Compare "Desired" and "Sent" for a given output to see if a command is required; if it is, queue the command and copy "Desired" to "Sent" for that output.
At the start of the interruption, copy the "Desired" state array to another similar variable to save it for later.
Now make your doorbell changes by changing the "Desired" array, while your driver code works independently to send out the differences from the "Sent" array.
At the end of the interruption, copy back the saved "Desired" state.
Remember, you have to account for varied initial volume states, too, when you are integrating with a DA system. You may also want to add "private zones" or "do not disturb" zones for the user to activate.
I'm betting there would be a more elegant way to use a for loop to do the reset!
I am confident that the Autopatch group at AMX will be updating the Precis LT with DSP to support this and other common DA system features out of the box before long, especially with the announcement of the new Metreau Entry Communicators.