Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Thread: Control Sony BDV-T58

  1. #11
    Join Date
    Mar 2005
    Posts
    726

    Default

    I have been changing the lines one by one but I will go ahead and change the all and try it again. Oki just looked again I see what you are talking about I changed one line in the code but not the other I will test it in a few

    Thanks,
    yonu

  2. #12
    Join Date
    Mar 2005
    Posts
    726

    Default

    ok I may have found issue but I am alittle confused on how to write the line for this section

    Unmute = function (self)
    return Mute.methods.SetMute:execute(true)
    end,

    based on devicespy I have several variables to pass here is the table from SetMute

    Action name SetMute
    Argument 1 (ui4) InstanceID
    Argument 1 ASV A_ARG_TYPE_InstanceID
    Argument 2 (string) Channel
    Argument 2 ASV A_ARG_TYPE_Channel
    Argument 3 (boolean) DesiredMute
    Argument 3 ASV Mute
    Return argument <none>


    Sorry to be a pain.,
    yonu

  3. #13
    Join Date
    Jul 2007
    Location
    Netherlands
    Posts
    370

    Default

    can you post the service xml? (in devicespy right-click the service and pick the right option)
    Using: Win7 MCE, Girder, xPL, RFXcom, HomeEasy

    http://www.thijsschreijer.nl

  4. #14
    Join Date
    Mar 2005
    Posts
    726

    Default

    sure here it is

    <?xml version="1.0" ?>
    - <scpd xmlns="urn:schemas-upnp-org:service-1-0">
    - <specVersion>
    <major>1</major>
    <minor>0</minor>
    </specVersion>
    + <actionList>
    - <action>
    <name>ListPresets</name>
    - <argumentList>
    - <argument>
    <name>InstanceID</name>
    <relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable>
    <direction>in</direction>
    </argument>
    - <argument>
    <name>CurrentPresetNameList</name>
    <relatedStateVariable>PresetNameList</relatedStateVariable>
    <direction>out</direction>
    </argument>
    </argumentList>
    </action>
    - <action>
    <name>SelectPreset</name>
    - <argumentList>
    - <argument>
    <name>InstanceID</name>
    <relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable>
    <direction>in</direction>
    </argument>
    - <argument>
    <name>PresetName</name>
    <relatedStateVariable>A_ARG_TYPE_PresetName</relatedStateVariable>
    <direction>in</direction>
    </argument>
    </argumentList>
    </action>
    - <action>
    <name>GetMute</name>
    - <argumentList>
    - <argument>
    <name>InstanceID</name>
    <direction>in</direction>
    <relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable>
    </argument>
    - <argument>
    <name>Channel</name>
    <direction>in</direction>
    <relatedStateVariable>A_ARG_TYPE_Channel</relatedStateVariable>
    </argument>
    - <argument>
    <name>CurrentMute</name>
    <direction>out</direction>
    <relatedStateVariable>Mute</relatedStateVariable>
    </argument>
    </argumentList>
    </action>
    - <action>
    <name>SetMute</name>
    - <argumentList>
    - <argument>
    <name>InstanceID</name>
    <direction>in</direction>
    <relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable>
    </argument>
    - <argument>
    <name>Channel</name>
    <direction>in</direction>
    <relatedStateVariable>A_ARG_TYPE_Channel</relatedStateVariable>
    </argument>
    - <argument>
    <name>DesiredMute</name>
    <direction>in</direction>
    <relatedStateVariable>Mute</relatedStateVariable>
    </argument>
    </argumentList>
    </action>
    - <action>
    <name>GetVolume</name>
    - <argumentList>
    - <argument>
    <name>InstanceID</name>
    <direction>in</direction>
    <relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable>
    </argument>
    - <argument>
    <name>Channel</name>
    <direction>in</direction>
    <relatedStateVariable>A_ARG_TYPE_Channel</relatedStateVariable>
    </argument>
    - <argument>
    <name>CurrentVolume</name>
    <direction>out</direction>
    <relatedStateVariable>Volume</relatedStateVariable>
    </argument>
    </argumentList>
    </action>
    - <action>
    <name>SetVolume</name>
    - <argumentList>
    - <argument>
    <name>InstanceID</name>
    <direction>in</direction>
    <relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable>
    </argument>
    - <argument>
    <name>Channel</name>
    <direction>in</direction>
    <relatedStateVariable>A_ARG_TYPE_Channel</relatedStateVariable>
    </argument>
    - <argument>
    <name>DesiredVolume</name>
    <direction>in</direction>
    <relatedStateVariable>Volume</relatedStateVariable>
    </argument>
    </argumentList>
    </action>
    </actionList>
    - <serviceStateTable>
    - <stateVariable sendEvents="yes">
    <name>LastChange</name>
    <dataType>string</dataType>
    </stateVariable>
    - <stateVariable sendEvents="no">
    <name>PresetNameList</name>
    <dataType>string</dataType>
    </stateVariable>
    - <stateVariable sendEvents="no">
    <name>A_ARG_TYPE_Channel</name>
    <dataType>string</dataType>
    - <allowedValueList>
    <allowedValue>Master</allowedValue>
    </allowedValueList>
    </stateVariable>
    - <stateVariable sendEvents="no">
    <name>Mute</name>
    <dataType>boolean</dataType>
    </stateVariable>
    - <stateVariable sendEvents="no">
    <name>Volume</name>
    <dataType>ui2</dataType>
    - <allowedValueRange>
    <minimum>0</minimum>
    <maximum>100</maximum>
    <step>1</step>
    </allowedValueRange>
    </stateVariable>
    - <stateVariable sendEvents="no">
    <name>A_ARG_TYPE_InstanceID</name>
    <dataType>ui4</dataType>
    </stateVariable>
    - <stateVariable sendEvents="no">
    <name>A_ARG_TYPE_PresetName</name>
    <dataType>string</dataType>
    - <allowedValueList>
    <allowedValue>FactoryDefaults</allowedValue>
    </allowedValueList>
    </stateVariable>
    </serviceStateTable>
    </scpd>

  5. #15
    Join Date
    Jul 2007
    Location
    Netherlands
    Posts
    370

    Default

    Quote Originally Posted by yonu View Post
    ok I may have found issue but I am alittle confused on how to write the line for this section
    Unmute = function (self)
    return Mute.methods.SetMute:execute(true)
    end,
    based on devicespy I have several variables to pass here is the table from SetMute
    Code:
    Action name SetMute
    Argument 1 (ui4) InstanceID
    Argument 1 ASV A_ARG_TYPE_InstanceID
    Unsigned Integer value, I haven't read the DCP for the mediarenderer lately, but I think the default for the instance ID is '0' (the instance ID is relevant for devices with multiple renderers, eg. a TV set with a picture-in-picture control)
    Quote Originally Posted by yonu View Post
    Code:
    Argument 2 (string) Channel
    Argument 2 ASV A_ARG_TYPE_Channel
    The xml states:
    Code:
    <allowedValueList>
      <allowedValue>Master</allowedValue> 
    </allowedValueList>
    so that's easy; "Master" is the only possible value
    Quote Originally Posted by yonu View Post
    Code:
    Argument 3 (boolean) DesiredMute
    Argument 3 ASV Mute
    This is a boolean, which can be sent as a Lua boolean; true
    Quote Originally Posted by yonu View Post
    Return argument <none>

    Sorry to be a pain.,
    yonu
    so try this;
    Code:
    Unmute = function (self)
        return Mute.methods.SetMute:execute(0, "Master", true)
    end,
    Using: Win7 MCE, Girder, xPL, RFXcom, HomeEasy

    http://www.thijsschreijer.nl

  6. #16
    Join Date
    Mar 2005
    Posts
    726

    Default

    ok here is what I have in the scrpting block I get the found lines in the console for the first part but when I run the lines for unmute that you just sent I get this error [string "Interactive"]:1: `=' expected near `Unmute'

    here is the code
    -- Setup persistent device and service IDs
    if not UPnP then
    print("UPnP global table not found")
    return
    end
    if not UPnP.devices then
    print("UPnP device list not found")
    return
    end
    local BVDT58 = UPnP.devices["00000000-0000-1010-8000-f0bf97fcad4c"]
    if not BVDT58 then
    print("UPnP device BVDT58 not found")
    return
    else
    print ("UPNP device BVDT58 found")
    end
    if not BVDT58.services then
    print("UPnP device BVDT58 has no services defined")
    return
    end
    local T58 = BVDT58.services["urn_upnp-org_serviceId_RenderingControl"]
    if not T58 then
    print("UPnP device BVDT58 RenderingControl not found")
    return
    else
    print ("UPNP device BVDT58 RenderingControl found")
    end

    -- define global and methods to export
    BVDT58 = {

    Unmute = function (self)
    return T58.methods.SetMute:execute(0, "Master", true)
    end,

    }

    Thanks and yes I am a pain,
    yonu

  7. #17
    Join Date
    Jul 2007
    Location
    Netherlands
    Posts
    370

    Default

    Try this;
    Code:
    -- Setup persistent device and service IDs if not UPnP then
    print("UPnP global table not found")
        return
    end
    
    if not UPnP.devices then
        print("UPnP device list not found")
        return
    end
    
    local MyDevice = UPnP.devices["00000000-0000-1010-8000-f0bf97fcad4c"]
    
    if not MyDevice then
        print("UPnP device BVDT58 not found")
        return
    else
        print ("UPNP device BVDT58 found")
    end
    
    if not MyDevice.services then
        print("UPnP device BVDT58 has no services defined")
        return
    end
    
    local MyService = MyDevice.services["urn_upnp-org_serviceId_RenderingControl"]
    
    if not MyService then
        print("UPnP device BVDT58 RenderingControl not found")
        return
    else
        print ("UPNP device BVDT58 RenderingControl found")
    end
    
    -- define global and methods to export
    BVDT58 = {
    
        Unmute = function (self)
            return MyService.methods.SetMute:execute(0, "Master", true)
        end,
    
    }
    I think the names where messed up. Run this script first, that will create the global. Then from the console execute; BVDT58.Unmute()
    Using: Win7 MCE, Girder, xPL, RFXcom, HomeEasy

    http://www.thijsschreijer.nl

  8. #18
    Join Date
    Mar 2005
    Posts
    726

    Default

    hey thanks that code did exactly what I need and you wee right I have my names screwy I set and looked over what I posted


    ok I need to ask a simple question I have this block of code so that it should work but I have a slight issue but it isn't the code persay what is is is the return from the variable vd. here is the code
    Voldown = function (self)
    vd = MyService.methods.GetVolume:execute(0, "Master", 0)
    print (vd)
    if vd<0 then
    nvd = vd - 5
    print (nvd)
    MyService.methods.SetVolume:execute(0, "Master", nvd)
    return
    else
    end

    based on what is showing in the xpl gateway window it is returning more than the volume valure here is the text from the gateway window however all I need is the 47 I just can't seem to get it I am getting returned true or false

    21:55:18.013 Received MethodCall command from tieske-girder.pvr
    21:55:18.015 Method: GetVolume, unique id: 13
    21:55:18.253 Returned:
    21:55:18.255 CurrentVolume = 47

    Thanks,
    yonu

  9. #19
    Join Date
    Jul 2007
    Location
    Netherlands
    Posts
    370

    Default

    Just top of my head; the first return value (Lua can have multiple return values!!) is true/false indicating success or failure of the action, use a print statement to check this;
    Code:
    print( MyService.methods.GetVolume:execute(0, "Master", 0))
    Then to get the volume (depending on the outcome of the print statement) use something like this;
    Code:
    -- success will be true/false
    -- vd will have the returned volume, or possible an error if success is false
    succes, vd =  MyService.methods.GetVolume:execute(0, "Master", 0)
    Use the print statement first, I'm not sure about the return values ...
    Using: Win7 MCE, Girder, xPL, RFXcom, HomeEasy

    http://www.thijsschreijer.nl

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •