commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r10004 - openbts/branches/developers/dburgess00/trunk/


From: dburgess00
Subject: [Commit-gnuradio] r10004 - openbts/branches/developers/dburgess00/trunk/Control
Date: Sun, 16 Nov 2008 21:40:39 -0700 (MST)

Author: dburgess00
Date: 2008-11-16 21:40:38 -0700 (Sun, 16 Nov 2008)
New Revision: 10004

Modified:
   openbts/branches/developers/dburgess00/trunk/Control/ControlCommon.cpp
   openbts/branches/developers/dburgess00/trunk/Control/ControlCommon.h
Log:
Added ostream operator<< for TransactionEntry.


Modified: openbts/branches/developers/dburgess00/trunk/Control/ControlCommon.cpp
===================================================================
--- openbts/branches/developers/dburgess00/trunk/Control/ControlCommon.cpp      
2008-11-17 02:38:41 UTC (rev 10003)
+++ openbts/branches/developers/dburgess00/trunk/Control/ControlCommon.cpp      
2008-11-17 04:40:38 UTC (rev 10004)
@@ -101,7 +101,7 @@
 {
        switch (state) {
                case TransactionEntry::NullState: os << "null"; break;
-               case TransactionEntry::Paging: os << "paging"; break;
+               case TransactionEntry::Paging: os << "MTC paging"; break;
                case TransactionEntry::MOCInitiated: os << "MOC initiated"; 
break;
                case TransactionEntry::MOCProceeding: os << "MOC proceeding"; 
break;
                case TransactionEntry::MTCConfirmed: os << "MTC confirmed"; 
break;
@@ -116,13 +116,22 @@
        return os;
 }
 
+ostream& Control::operator<<(ostream& os, const TransactionEntry& entry)
+{
+       os << "ID=" << entry.ID();
+       os << " TI=(" << entry.TIFlag() << "," << entry.TIValue() << ")";
+       os << " Q.931State=" << entry.Q931State();
+       return os;
+}
 
+
 unsigned TransactionTable::add(TransactionEntry& value)
 {
        clearDeadEntries();
        mLock.lock();
        unsigned key = mIDCounter++;
        value.ID(key);
+       TransactionMap::iterator iter = mTable.find(value.ID());
        mTable[key]=value;
        mLock.unlock();
        return key;
@@ -131,9 +140,16 @@
 
 void TransactionTable::update(const TransactionEntry& value)
 {
+       // ID==0 is a non-valid special case.
        assert(value.ID());
        mLock.lock();
-       mTable[value.ID()]=value;
+       TransactionMap::iterator iter = mTable.find(value.ID());
+       if (iter==mTable.end()) {
+               CERR("WARNING -- attempt to update non-existent transaction 
entry with key " << value.ID());
+               mLock.unlock();
+               return;
+       }
+       iter->second = value;
        mLock.unlock();
 }
 
@@ -253,7 +269,7 @@
 
 L3Message* Control::getMessage(LogicalChannel *LCH)
 {
-       unsigned timeout_ms = LCH->N200() * T200ms;
+       //unsigned timeout_ms = LCH->N200() * T200ms;
        L3Frame *rcv = LCH->recv(LCH->N200() * T200ms);
        if (rcv==NULL) {
                CERR("NOTICE -- getMessage timed out");
@@ -328,7 +344,7 @@
 */
 void Control::abortCall(TransactionEntry& transaction, LogicalChannel *LCH, 
const L3Cause& cause)
 {
-       CLDCOUT("abortCall");
+       CLDCOUT("abortCall transction: " << transaction);
        forceGSMClearing(transaction,LCH,cause);
        forceSIPClearing(transaction);
        gTransactionTable.update(transaction);

Modified: openbts/branches/developers/dburgess00/trunk/Control/ControlCommon.h
===================================================================
--- openbts/branches/developers/dburgess00/trunk/Control/ControlCommon.h        
2008-11-17 02:38:41 UTC (rev 10003)
+++ openbts/branches/developers/dburgess00/trunk/Control/ControlCommon.h        
2008-11-17 04:40:38 UTC (rev 10004)
@@ -198,6 +198,7 @@
 
        private:
 
+       // FIXME -- We need to support channel type.  See tracker item #316.
        GSM::L3MobileIdentity mID;              ///< The mobile ID.
        Timeval mExpiration;                    ///< The expiration time for 
this entry.
 
@@ -302,12 +303,12 @@
 
        private:
 
-       unsigned mID;                                                           
///< the internal transaction ID, assigned by a TransactionTable
+       unsigned mID;                                                   ///< 
the internal transaction ID, assigned by a TransactionTable
 
        GSM::L3MobileIdentity mSubscriber;              ///< some kind of 
subscriber ID, preferably IMSI
        GSM::L3CMServiceType mService;                  ///< the associated 
service type
-       unsigned mTIFlag;                                                       
///< "0" for originating party ,"1" for terminating
-       unsigned mTIValue;                                                      
///< the L3 short transaction ID set by the MS
+       unsigned mTIFlag;                                               ///< 
"0" for originating party ,"1" for terminating
+       unsigned mTIValue;                                              ///< 
the L3 short transaction ID set by the MS
        GSM::L3CalledPartyBCDNumber mCalled;    ///< the associated called 
party number, if known
        GSM::L3CallingPartyBCDNumber mCalling;  ///< the associated calling 
party number, if known
 
@@ -444,6 +445,7 @@
 };
 
 
+std::ostream& operator<<(std::ostream& os, const TransactionEntry&);
 std::ostream& operator<<(std::ostream& os, TransactionEntry::Q931CallState);
 
 
@@ -473,7 +475,8 @@
 
        /**
                Insert a new entry into the table.
-               Also assigns a transaction ID to the argument.
+               Also assigns a transaction ID to the argument
+               so that it will be identical to the copy in the table.
                @param value The entry to copy into the table.
                @return The assigned transaction ID.
        */





reply via email to

[Prev in Thread] Current Thread [Next in Thread]