Skip to content
Snippets Groups Projects
Commit e6eaf475 authored by jkerdreu's avatar jkerdreu
Browse files

Added action (due to Duminy)

git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/trunk@1921 b32b6428-25c9-4566-ad07-03861ab6144f
parent a15baa43
Branches
No related tags found
No related merge requests found
......@@ -95,6 +95,21 @@ def get_device(addr):
return json.dumps(res,indent=4)
@get('/devices/<addr>/<action>')
def send_request(addr,action):
""" quick & dirty way to send request to device, no body accepted"""
dev=monitor.devices.get_with_addr(addr)
response.headers['Content-Type'] = 'application/json'
if dev:
monitor.engine.send_request(monitor.dev,[addr,],action)
res = {'address':dev.address}
else:
res = {'error':{'code':404,'message':'Unknow device'}}
response.status=404
return json.dumps(res,indent=4)
def run():
""" start the xAAL stack & launch the HTTP stuff"""
setup_xaal()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment