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

Method hexstr

GPRS/ByteVector.cpp:371–387  ·  view source on GitHub ↗

This function returns just the payload part as a hex string. Also works if the ByteVector is encoded as BCD. Probably not efficient, but we are using C++.

Source from the content-addressed store, hash-verified

369// Also works if the ByteVector is encoded as BCD.
370// Probably not efficient, but we are using C++.
371std::string ByteVector::hexstr() const
372{
373 int b = 0, numBits = (int) sizeBits(); // Must be int, not unsigned
374 std::string ss;
375 while (numBits > 0) {
376 char ch = getNibble(b,1);
377 ss.push_back(ch + (ch > 9 ? ('A'-10) : '0'));
378 numBits -= 4;
379 if (numBits >= 4) {
380 ch = getNibble(b,0);
381 ss.push_back(ch + (ch > 9 ? ('A'-10) : '0'));
382 }
383 b++;
384 numBits -= 4;
385 }
386 return ss;
387}
388
389// This function returns "ByteVector(size=... data:...)"
390std::string ByteVector::str() const

Callers 15

addUpPDUMethod · 0.80
sendPDUMethod · 0.80
engineUpAdvanceWindowMethod · 0.80
engineWriteHighSideMethod · 0.80
engineFillBlockMethod · 0.80
gmParseIEsMethod · 0.80
getAsBcdMethod · 0.80
textMethod · 0.80
addShellRequestFunction · 0.80
handleXidFunction · 0.80
Sgsn.cppFile · 0.80
handleAttachStepFunction · 0.80

Calls 1

push_backMethod · 0.80

Tested by

no test coverage detected