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

Method parseV

GSM/GSML3CCElements.cpp:47–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45
46
47void L3BearerCapability::parseV( const L3Frame& src, size_t &rp, size_t expectedLength )
48{
49 mPresent = true;
50 // See GSM 10.5.4.5.
51 // This is a hell of a complex element, inherited from ISDN.
52 // (pat) If the bearer capability is not for speech, we dont save it.
53 // Bits 1-3 of octet3 == 0 are the indicator, but the caller already lopped off the IEI and length
54 // so it is in the first byte.
55 if (expectedLength == 0) {return;} // Bad IE. Toss it.
56 size_t end = rp + 8*expectedLength;
57 unsigned octet3 = src.readField(rp,8);
58 LOG(DEBUG) "BearerCapability"<<LOGVAR(expectedLength);
59 if ((octet3 & 7) == 0) {
60 // This IE is is for speech, we will save it.
61 mOctet3 = octet3;
62 // Get the multiple octet3a. There may be none.
63 for (mNumOctet3a = 0; rp < end && mNumOctet3a < sizeof(mOctet3a); mNumOctet3a++) {
64 mOctet3a[mNumOctet3a] = src.readField(rp,8);
65 LOG(DEBUG) "Add BearerCapability"<<LOGVAR(mNumOctet3a)<<LOGVAR(mOctet3a[mNumOctet3a]);
66 }
67 }
68
69 // Just move the read index and return.
70 rp = end;
71}
72
73// Convert the L3BearerCapability Speech Version IE into a CodecType.
74// Using 24.008 5.4.5 table 10.5.103 interpolated via meanings in 48.008 3.2.2.11 into 26.103 6.2. Gotta love this stuff.

Callers

nothing calls this directly

Calls 2

readFieldMethod · 0.80
parseMethod · 0.45

Tested by

no test coverage detected