So in the link I reference he was quoting from his blog entry on calling an external C app from within SQLite using a trigger and gives a tutorial. The only caveat I saw was the last line about the Trigger being a one time use only event.. but I wonder if it applies since we aren't looking to have a lot of different people connect.
http://freethinking.it/2011/01/08/sqlit ... functions/
I believe monitoring the database for changes is the way to go is because this abstracts all the different protocols from the different devices and makes it an easy to understand point of entry to hook into all the different attributes.[/quote]
Its not a one time use thing, its just not a permanent trigger but just on the connection you set it on, so your C program will start set up the trigger and you will get the callback as long as your program is running. Now here is the bad news, SQLite is not a real database server its a library so it can only monitor things within the same process, i.e. you can setup these types of callbacks and triggers if so different parts of your app can monitor changes, helps with DI or SOC type patterns where one part of the program doesn't and shouldn't know what something else is doing. But what this technique won't be able to do is to trigger a change event if another app changes a table. so this is a no go.
I have been running the aprontest periodically thing for a couple of weeks and not too happy with it, and its seems like too much work for monitoring changes, I might try monitoring with the tall messages thing
How does the Wink Hub do what it does? What's stored in the database? What does the aprond daemon do? what does aprontest communicate with? What is the ultimate question?
Who is online
Users browsing this forum: No registered users and 3 guests