MCPcopy Create free account
hub / github.com/RangeNetworks/openbts / hex2rpdata

Method hex2rpdata

SMS/SMSMessages.cpp:78–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76
77
78RPData *SMS::hex2rpdata(const char *hexstring)
79{
80 RPData *rp_data = NULL;
81
82 BitVector2 RPDUbits(strlen(hexstring)*4);
83 if (!RPDUbits.unhex(hexstring)) {
84 return false;
85 }
86 LOG(DEBUG) << "SMS RPDU bits: " << RPDUbits;
87
88 try {
89 RLFrame RPDU(RPDUbits);
90 LOG(DEBUG) << "SMS RPDU: " << RPDU;
91
92 rp_data = new RPData();
93 rp_data->parse(RPDU);
94 LOG(DEBUG) << "SMS RP-DATA " << *rp_data;
95 }
96 catch (SMSReadError) {
97 LOG(WARNING) << "SMS parsing failed (above L3)";
98 // TODO:: send error back to the phone
99 delete rp_data;
100 rp_data = NULL;
101 }
102 catch (L3ReadError) {
103 LOG(WARNING) << "SMS parsing failed (in L3)";
104 // TODO:: send error back to the phone
105 delete rp_data;
106 rp_data = NULL;
107 }
108
109 return rp_data;
110}
111
112TLMessage *SMS::parseTPDU(const TLFrame& TPDU, bool directionUplink)
113{

Callers

nothing calls this directly

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected