Switch to unified view

a/src/ohproduct.cxx b/src/ohproduct.cxx
...
...
105
            "  </Source>\n";
105
            "  </Source>\n";
106
    }
106
    }
107
    csxml += string("</SourceList>\n");
107
    csxml += string("</SourceList>\n");
108
    LOGDEB("OHProduct::OHProduct: sources: " << csxml << endl);
108
    LOGDEB("OHProduct::OHProduct: sources: " << csxml << endl);
109
109
110
    g_config->get("onstandby", m_standbycmd);
111
    if (!m_standbycmd.empty()) {
112
        string out;
113
        if (ExecCmd::backtick(vector<string>{m_standbycmd}, out)) {
114
            m_standby = atoi(out.c_str());
115
            LOGDEB("OHProduct: standby is " << m_standby << endl);
116
        }
117
    }
118
    
110
    dev->addActionMapping(this, "Manufacturer", 
119
    dev->addActionMapping(this, "Manufacturer", 
111
                          bind(&OHProduct::manufacturer, this, _1, _2));
120
                          bind(&OHProduct::manufacturer, this, _1, _2));
112
    dev->addActionMapping(this, "Model", bind(&OHProduct::model, this, _1, _2));
121
    dev->addActionMapping(this, "Model", bind(&OHProduct::model, this, _1, _2));
113
    dev->addActionMapping(this, "Product", 
122
    dev->addActionMapping(this, "Product", 
114
                          bind(&OHProduct::product, this, _1, _2));
123
                          bind(&OHProduct::product, this, _1, _2));
...
...
196
}
205
}
197
206
198
int OHProduct::standby(const SoapIncoming& sc, SoapOutgoing& data)
207
int OHProduct::standby(const SoapIncoming& sc, SoapOutgoing& data)
199
{
208
{
200
    LOGDEB("OHProduct::standby" << endl);
209
    LOGDEB("OHProduct::standby" << endl);
201
    data.addarg("Value", "0");
210
    data.addarg("Value", SoapHelp::i2s(m_standby));
202
    return UPNP_E_SUCCESS;
211
    return UPNP_E_SUCCESS;
203
}
212
}
204
213
205
int OHProduct::setStandby(const SoapIncoming& sc, SoapOutgoing& data)
214
int OHProduct::setStandby(const SoapIncoming& sc, SoapOutgoing& data)
206
{
215
{
207
    LOGDEB("OHProduct::setStandby" << endl);
216
    LOGDEB("OHProduct::setStandby" << endl);
208
    if (!sc.get("Value", &m_standby)) {
217
    if (!sc.get("Value", &m_standby)) {
209
        return UPNP_E_INVALID_PARAM;
218
        return UPNP_E_INVALID_PARAM;
219
    }
220
    if (!m_standbycmd.empty()) {
221
        string out;
222
        if (ExecCmd::backtick(vector<string>{m_standbycmd,
223
                        SoapHelp::i2s(m_standby)}, out)) {
224
            m_standby = atoi(out.c_str());
225
            LOGDEB("OHProduct: standby is " << m_standby << endl);
226
        }
210
    }
227
    }
211
    m_dev->loopWakeup();
228
    m_dev->loopWakeup();
212
    return UPNP_E_SUCCESS;
229
    return UPNP_E_SUCCESS;
213
}
230
}
214
231