Subversion Repositories tpanel

Rev

Rev 457 | Rev 462 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 457 Rev 458
Line 11560... Line 11560...
11560
 * 0 (listen) is assumed. Please note, however, that no data packets will
11560
 * 0 (listen) is assumed. Please note, however, that no data packets will
11561
 * actually flow until the intercom modify command is sent to the panel.
11561
 * actually flow until the intercom modify command is sent to the panel.
11562
 */
11562
 */
11563
void TPageManager::doICS(int, vector<int>&, vector<string>& pars)
11563
void TPageManager::doICS(int, vector<int>&, vector<string>& pars)
11564
{
11564
{
-
 
11565
    DECL_TRACER("TPageManager::doICS(int, vector<int>&, vector<string>& pars)");
-
 
11566
 
11565
    if (pars.size() < 3)
11567
    if (pars.size() < 3)
11566
    {
11568
    {
11567
        MSG_ERROR("Command ICS expects 3 parameters but got only " << pars.size());
11569
        MSG_ERROR("Command ICS expects 3 parameters but got only " << pars.size());
11568
        return;
11570
        return;
11569
    }
11571
    }
11570
 
11572
 
-
 
11573
    INTERCOM_t ic;
11571
    string ip = pars[0];
11574
    ic.ip = pars[0];
11572
    int txPort = atoi(pars[1].c_str());
11575
    ic.txPort = atoi(pars[1].c_str());
11573
    int rxPort = atoi(pars[2].c_str());
11576
    ic.rxPort = atoi(pars[2].c_str());
11574
    int mode = 0;
11577
    ic.mode = 0;
11575
 
11578
 
11576
    if (pars.size() >= 4)
11579
    if (pars.size() >= 4)
11577
        mode = atoi(pars[3].c_str());
11580
        ic.mode = atoi(pars[3].c_str());
11578
 
11581
 
-
 
11582
    if (getInitializeIntercom())
11579
    // TODO: Add code to initialize the communication
11583
        getInitializeIntercom()(ic);
11580
}
11584
}
11581
 
11585
 
11582
/**
11586
/**
11583
 * @brief Intercom end.
11587
 * @brief Intercom end.
11584
 * This terminates an intercom call/connection.
11588
 * This terminates an intercom call/connection.
11585
 */
11589
 */
11586
void TPageManager::doICE(int, vector<int>&, vector<string>&)
11590
void TPageManager::doICE(int, vector<int>&, vector<string>&)
11587
{
11591
{
-
 
11592
    DECL_TRACER("TPageManager::doICE(int, vector<int>&, vector<string>&)");
-
 
11593
 
-
 
11594
    if (_intercomStop)
11588
    //TODO: Add call to stop communication
11595
        _intercomStop();
11589
}
11596
}
11590
 
11597
 
11591
/**
11598
/**
11592
 * Intercom modify command.
11599
 * Intercom modify command.
11593
 */
11600
 */
11594
void TPageManager::doICM(int, vector<int>&, vector<string>& pars)
11601
void TPageManager::doICM(int, vector<int>&, vector<string>& pars)
11595
{
11602
{
11596
    if (pars.empty() || pars[0] == "TALK" || pars[0] == "LISTEN")
11603
    if (pars.empty() || pars[0] == "TALK" || pars[0] == "LISTEN")
11597
    {
11604
    {
-
 
11605
        if (_intercomStart)
11598
        // TODO: Add call to start communication as initialized
11606
            _intercomStart();
11599
    }
11607
    }
11600
    else if (pars[0] == "MICLEVEL" && pars.size() >= 2)
11608
    else if (pars[0] == "MICLEVEL" && pars.size() >= 2)
11601
    {
11609
    {
11602
        int micLevel = atoi(pars[1].c_str());
11610
        int micLevel = atoi(pars[1].c_str());
11603
 
11611
 
Line 11606... Line 11614...
11606
            MSG_WARNING("Microphon level is out of range [0 ... 100]: " << micLevel);
11614
            MSG_WARNING("Microphon level is out of range [0 ... 100]: " << micLevel);
11607
            return;
11615
            return;
11608
        }
11616
        }
11609
 
11617
 
11610
        TConfig::saveSystemGain(micLevel);
11618
        TConfig::saveSystemGain(micLevel);
-
 
11619
 
-
 
11620
        if (_intercomMicLevel)
11611
        // TODO: Add code to set the microphon level
11621
            _intercomMicLevel(micLevel);
11612
    }
11622
    }
11613
    else if (pars[0] == "MUTEMIC" && pars.size() >= 2)
11623
    else if (pars[0] == "MUTEMIC" && pars.size() >= 2)
11614
    {
11624
    {
11615
        int mute = atoi(pars[1].c_str());
11625
        int mute = atoi(pars[1].c_str());
11616
        bool bmute = mute == 0 ? false : true;
11626
        bool bmute = mute == 0 ? false : true;
-
 
11627
 
-
 
11628
        if (_intercomMute)
11617
        // TODO: Add code to set mute microphone
11629
            _intercomMute(bmute);
11618
    }
11630
    }
11619
    else if (pars[0] == "SPEAKERLEVEL" && pars.size() >= 2)
11631
    else if (pars[0] == "SPEAKERLEVEL" && pars.size() >= 2)
11620
    {
11632
    {
11621
        int speakerLevel = atoi(pars[1].c_str());
11633
        int speakerLevel = atoi(pars[1].c_str());
11622
 
11634
 
Line 11625... Line 11637...
11625
            MSG_WARNING("Speaker level is out of range [0 ... 100]: " << speakerLevel);
11637
            MSG_WARNING("Speaker level is out of range [0 ... 100]: " << speakerLevel);
11626
            return;
11638
            return;
11627
        }
11639
        }
11628
 
11640
 
11629
        TConfig::saveSystemVolume(speakerLevel);
11641
        TConfig::saveSystemVolume(speakerLevel);
-
 
11642
 
-
 
11643
        if (_intercomSpkLevel)
11630
        // TODO: Add code to set the speaker level
11644
            _intercomSpkLevel(speakerLevel);
11631
    }
11645
    }
11632
}
11646
}
11633
 
11647
 
11634
#ifndef _NOSIP_
11648
#ifndef _NOSIP_
11635
void TPageManager::sendPHN(vector<string>& cmds)
11649
void TPageManager::sendPHN(vector<string>& cmds)