(pat) This parses an incoming SMS message from the MS, called from
| 56 | |
| 57 | // (pat) This parses an incoming SMS message from the MS, called from |
| 58 | CPMessage * SMS::parseSMS( const GSM::L3Frame& frame ) |
| 59 | { |
| 60 | CPMessage::MessageType MTI = (CPMessage::MessageType)(frame.MTI()); |
| 61 | LOG(DEBUG) << "MTI="<<MTI; |
| 62 | |
| 63 | CPMessage * retVal = CPFactory(MTI); |
| 64 | if( retVal==NULL ) return NULL; |
| 65 | retVal->TI(frame.TI()); |
| 66 | // Documentation courtesy pat: |
| 67 | // The L3Message::CPMessage is a base class for CPData, CPAck, CPError, one of which is created by the CPFactory above. |
| 68 | // The below calls L3Message::parse which calls the parseBody from the derived class. |
| 69 | // For CPAck and CPError, parseBody is null (or worse, assert out - a former bug.) |
| 70 | // For CPData messages: calls CPData::parseBody which then calls L3ProtocolElement::parseLV which calls: |
| 71 | // CPUserData::parseV, which just copies the data into CPUserData::mRPDU; which is an L3Frame::RLFrame |
| 72 | retVal->parse(frame); |
| 73 | LOG(DEBUG) << *retVal; |
| 74 | return retVal; |
| 75 | } |
| 76 | |
| 77 | |
| 78 | RPData *SMS::hex2rpdata(const char *hexstring) |