My name is Daniele (italy) and I'm using the tuoprogetto "wiringpi" on my raspeberry, I have an application that acts as a proxy for Siri.
thanks for the availability in your holidays.
Unfortunately, if I include the "wiringpi" proxy siri does not work anymore.
no longer responds to the questions, but if you comment "require 'wiringpi'" back to work, but of course the variables are not able to work .. tell me where you knew mistake?
compliments for the job.
the program is that:
My name is Daniele (italy) and I'm using the tuoprogetto "wiringpi" on my raspeberry, I have an application that acts as a proxy for Siri. thanks for the availability in your holidays. Unfortunately, if I include the "wiringpi" proxy siri does not work anymore. no longer responds to the questions, but if you comment "require 'wiringpi'" back to work, but of course the variables are not able to work .. tell me where you knew mistake? compliments for the job. the program is that:
require 'cora' require 'siri_objects' require 'pp'
require 'wiringpi'
class SiriProxy::Plugin::Example < SiriProxy::Plugin def initialize(config) sensore=0 end
filter "SetRequestOrigin", direction: :from_iphone do |object| puts "[Info - User Location] lat: #{object["properties"]["latitude"]}, long: #{object["properties"]["longitude"]}"
end
listen_for /Dove sono/i do say "Ti Trovi: #{location.address}" end
listen_for /test siri proxy/i do say "Siri Proxy attivo!" #say something to the user!
request_completed #always complete your request! Otherwise the phone will "spin" at the user! end
listen_for /movimento/i do
say "Vado!" #say something to the user!
io = WiringPi::GPIO.new sensore=io.read(1) puts sensore if sensore == true
say "Chi va la?!" else say "Nessuno in vista!" end request_completed # puts sensore end
demonstrate capturing data from the user (e.x. "Siri proxy number 15")
listen_for /siri proxy numero ([0-9,]*[0-9])/i do |number| say "Hai detto: #{number}"
request_completed #always complete your request! Otherwise the phone will "spin" at the user! end
demonstrate injection of more complex objects without shortcut methods.
listen_for /test mappa/i do add_views = SiriAddViews.new add_views.make_root(last_ref_id) map_snippet = SiriMapItemSnippet.new map_snippet.items << SiriMapItem.new utterance = SiriAssistantUtteranceView.new("Test mappa ok!") add_views.views << utterance add_views.views << map_snippet
you can also do "send_object object, target: :guzzoni" in order to send an object to guzzoni
send_object add_views #send_object takes a hash or a SiriObject object
request_completed #always complete your request! Otherwise the phone will "spin" at the user! end end