(25.10.2017, 13:28)Erwin van der Zwart Wrote: Γεια σας,
Δεν μπορείτε να καλέσετε σαφή την ουρά ξεχωριστά, η εντολή είναι εσωτερική διαθέσιμη κατά την εναλλαγή μεταξύ των λιστών, αλλά δεν υπάρχει τρόπος να ενεργοποιηθεί από το API αυτή τη στιγμή.
Εάν το χρειάζεστε πραγματικά, θα μπορούσατε να το χρησιμοποιήσετε ως εντολή σεναρίου για upnpcmd αντί: BR, Erwin
Code:1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253function upnpavcmd(host, port, cmd, param) local client, soap, reqs, service, res, err require('socket') client = socket.tcp() client:settimeout(3) -- try connecting to upnp endpoint res, err = client:connect(host, port) if not res then return nil, err end -- guess service name based on command if cmd =='SetGroupVolume' or cmd == 'SetGroupMute' or cmd == 'SnapshotGroupVolume' then service = 'GroupRenderingControl' elseif cmd == 'SetVolume' or cmd == 'GetVolume' or cmd == 'SetMute' or cmd == 'GetMute' then service = 'RenderingControl' else service = 'AVTransport' end -- soap envelope soap = '<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">' .. '<s:Body>' .. '<u:' .. cmd .. ' xmlns:u="urn:schemas-upnp-org:service:' .. service .. ':1">' .. '<InstanceID>0</InstanceID>' .. (param or '') .. '</u:' .. cmd .. '>' .. '</s:Body>' .. '</s:Envelope>' -- http request reqs = 'POST /MediaRenderer/' .. service .. '/Control HTTP/1.1\r\n' .. 'CONNECTION: close\r\n' .. 'HOST: ' .. host .. ':' .. port .. '\r\n' .. 'CONTENT-LENGTH: ' .. soap:len() .. '\r\n' .. 'CONTENT-TYPE: text/xml; charset="utf-8"\r\n' .. 'SOAPACTION: "urn:schemas-upnp-org:service:' .. service .. ':1#' .. cmd .. '"\r\n' .. '\r\n' .. soap -- send http request res, err = client:send(reqs) if not res then return nil, err end -- get reply and close connection res, err = client:receive('*a') client:close() return res, err end
Code:1upnpavcmd('192.168.0.24', 1400, 'RemoveAllTracksFromQueue')
thx Erwin
i'll try it
Hi again Erwin ,
thx for help!!!... It works !!!!