Esempio n. 1
0
void plugin::requestProperties(int sessionid) {
    Q_UNUSED(sessionid);

    {
        ServiceData sc = ServiceData::createNotification(PLUGIN_ID,  "pulse.version" );
        sc.setData("protocol", getProtocolVersion());
        sc.setData("server", getServerVersion());
		changeProperty(sc.getData());
    }
    {
        ServiceData sc = ServiceData::createModelReset( "pulse.channels", "sinkid" );
        changeProperty(sc.getData());
    }
    QList<PulseChannel> channels = getAllChannels();
    foreach(PulseChannel channel, channels) {
        ServiceData sc = ServiceData::createModelChangeItem( "pulse.channels" );
        sc.setData("sinkid", channel.sinkid);
        sc.setData("mute", channel.mute);
        sc.setData("volume", channel.volume);
        changeProperty(sc.getData());
    }
Esempio n. 2
0
void RpcLibClientBase::confirmConnection()
{
    ClockBase* clock = ClockFactory::get();

    // make sure we can talk to the DroneServer
    //std::cout << "Contacting DroneServer..." << std::flush;
    //command_context.client.ping();
    //std::cout << "DroneServer is responding." << std::endl;

    std::cout << "Waiting for connection - " << std::flush;
    const TTimeDelta pause_time = 1;
    while (getConnectionState() != RpcLibClientBase::ConnectionState::Connected)
    {
        std::cout << "X" << std::flush;
        clock->sleep_for(pause_time); 
    }
    std::cout << std::endl << "Connected!" << std::endl;

    auto server_ver = getServerVersion();
    auto client_ver = getClientVersion();
    auto server_min_ver = getMinRequiredServerVersion();
    auto client_min_ver = getMinRequiredClientVersion();
    
    std::string ver_info = Utils::stringf("Client Ver:%i (Min Req:%i), Server Ver:%i (Min Req:%i)",
        client_ver, client_min_ver, server_ver, server_min_ver);

    if (server_ver < server_min_ver) {
        std::cerr << std::endl << ver_info << std::endl;
        std::cerr << std::endl << "AirSim server is of older version and not supported by this client. Please upgrade!" << std::endl;
    }
    else if (client_ver < client_min_ver) {
        std::cerr << std::endl << ver_info << std::endl;
        std::cerr << std::endl << "AirSim client is of older version and not supported by this server. Please upgrade!" << std::endl;
    }
    else
        std::cout << std::endl << ver_info << std::endl;
}