Add utility functions to print the FAPI messages contents Add dump functions for DL_TTI.request PDUs, remaining message structures to be finished Add file examples.md with some examples on how to use nfapi_hex_parser
10 KiB
10 KiB
Example runs of nfapi_hex_parser
1 - An invalid DL_TTI.request
./nfapi/open-nFAPI/utils/nfapi_hex_parser 0x00 0x00 0x00 0x80 0x00 0x00 0x01 0x7e 0x00 0x62 0x00 0x00 0x03 0x01 0x00 0x03 0x00 0x15 0x00 0x01 0x00 0x00 0x00 0x00 0x18 0x01 0x06 0x00 0x0d 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x34 0x01 0x11 0x00 0x00 0x00 0x00 0x00 0x02 0x00 0x00 0x00 0x00 0xe0 0x01 0x01 0x06 0x02 0x00 0x00 0x01 0x00 0x00 0x01 0xff 0xff 0x00 0x01 0x00 0x00 0x00 0x04 0x00 0x01 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x1c 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x71 0x00 0x00 0xff 0xff 0x00 0x00 0x01 0x11 0x00 0x00 0x00 0x00 0x01 0x01 0x34 0x02 0x04 0x00 0x00 0x00 0x00 0x00 0x7b 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01 0x01 0x00 0x00 0x00 0x04 0x00 0x00 0x01 0x00 0x01 0x00 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x2d 0x00 0x0e 0x00 0x03 0x0b 0x00 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
Parsed 382 bytes:
00 00 00 80 00 00 01 7e 00 62 00 00 03 01 00 03
00 15 00 01 00 00 00 00 18 01 06 00 0d 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 34 01 11 00 00 00 00 00 02 00
00 00 00 e0 01 01 06 02 00 00 01 00 00 01 ff ff
00 01 00 00 00 04 00 01 00 01 00 00 00 00 00 00
00 00 1c 00 00 00 80 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 01 00 71 00 00 ff ff
00 00 01 11 00 00 00 00 01 01 34 02 04 00 00 00
00 00 7b 00 00 00 00 00 00 00 00 00 00 00 01 01
00 00 00 04 00 00 01 00 01 00 01 01 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 2d 00 0e 00 03 0b 00 00 00 00 00 00 01 00 01
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00
Decoded message NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST message length 0x17e
Message ID = 0x80
Message Length = 0x17e
SFN = 98
Slot = 0
nPDUs = 3
nGroup = 1
PDU #0
PDUType = 0x03 (NFAPI_NR_DL_TTI_SSB_PDU_TYPE)
PDUSize = 0x15
physCellId = 1
BetaPss = 0
SSBBlockIndex = 0
SSBSubcarrierOffset = 0
SSBOffsetPointA = 24
bchPayloadFlag = 1
bchPayload = 6000d
numPRGs = 0
prgSize = 0
digBFInterfaces = 0
PDU #1
PDUType = 0x00 (NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE)
PDUSize = 0x00
BWPSize = 0
BWPStart = 0
Subcarrier Spacing = 0
Ciclic Prefix = 0
StartSymbolIndex = 0
DurationSymbols = 0
FrequencyDomainResource : 0 0 0 0 0 0
CCE Reg Mapping Type = 0
Reg Bundle Size = 0
Interleaver Size = 0
CoreSetType = 0
ShiftIndex = 0
precoderGranularity = 0
numDLDCI = 0
PDU #2
PDUType = 0x00 (NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE)
PDUSize = 0x00
BWPSize = 0
BWPStart = 0
Subcarrier Spacing = 0
Ciclic Prefix = 0
StartSymbolIndex = 0
DurationSymbols = 0
FrequencyDomainResource : 0 0 0 0 0 0
CCE Reg Mapping Type = 0
Reg Bundle Size = 0
Interleaver Size = 0
CoreSetType = 0
ShiftIndex = 0
precoderGranularity = 0
numDLDCI = 0
Group #0
nUe[0] = 0x00
2 - A valid ERROR.indication
./nfapi/open-nFAPI/utils/nfapi_hex_parser 0x00 0x00 0x00 0x07 0x00 0x00 0x00 0x06 0x00 0x0a 0x00 0x10 0x80 0x06
Parsed values:
00 00 00 07 00 00 00 06 00 0a 00 10 80 06
Processing message NFAPI_NR_PHY_MSG_TYPE_ERROR_INDICATION
Message ID = 0x07
Message Length = 0x06
SFN = 0x0a
Slot = 0x10
Message ID = 0x80
Error Code = 0x06 (NFAPI_NR_PHY_API_MSG_INVALID_SFN)
3 - A valid SLOT.indication
./nfapi/open-nFAPI/utils/nfapi_hex_parser 0x00 0x01 0x00 0x82 0x00 0x00 0x00 0x04 0x00 0x05 0x00 0x06
Parsed values:
00 01 00 82 00 00 00 04 00 05 00 06
Processing message NFAPI_NR_PHY_MSG_TYPE_SLOT_INDICATION
Message ID = 0x82
Message Length = 0x04
SFN = 5
Slot = 6
4 - A valid ERROR.indication, with diverging formats for the hexdump passed as a parameter
user@user-PC:~/nfapi_parser/cmake_targets/ran_build/build$ ./nfapi/open-nFAPI/utils/nfapi_hex_parser "00 0 0x00 7 0x00 0x00 0x00" 0x06 0x00 "a 0x00 0x10 0x80 7"
Parsed 14 bytes:
00 00 00 07 00 00 00 06 00 0a 00 10 80 07
Decoded message NFAPI_NR_PHY_MSG_TYPE_ERROR_INDICATION message length 0x06
Message ID = 0x07
Message Length = 0x06
SFN = 0x0a (10)
Slot = 0x10 (16)
Message ID = 0x80
Error Code = 0x07 (NFAPI_NR_PHY_API_MSG_UL_DCI_ERR)
5 - An invalid message, passing less bytes than the minimum required to encode a FAPI message header
user@user-PC:~/nfapi_parser/cmake_targets/ran_build/build$ ./nfapi/open-nFAPI/utils/nfapi_hex_parser 1
Parsed 1 bytes:
01
Assertion (byte_count >= sizeof(fapi_message_header_t)) failed!
In main() /home/user/nfapi_parser/nfapi/open-nFAPI/utils/nfapi_hex_parser.c:293
Read byte amount not enough to encode the header. Should have a minimum of 8 bytes, aborting...
Exiting execution
/home/user/nfapi_parser/nfapi/open-nFAPI/utils/nfapi_hex_parser.c:293 main() Exiting OAI (n)FAPI Hex Parser: _Assert_Exit_
Aborted (core dumped)
7 - A valid DL_TTI.request
./nfapi/open-nFAPI/utils/nfapi_hex_parser 0x00 0x01 0x00 0x80 0x00 0x00 0x00 0xc3 0x00 0x02 0x00 0x00 0x03 0x00 0x00 0x03 0x00 0x19 0x00 0x00 0x00 0x00 0x0c 0x00 0xfc 0x01 0x06 0xc6 0x01 0x00 0x00 0x01 0x01 0x13 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x31 0x00 0x30 0x00 0x6e 0x01 0x00 0x00 0x01 0xff 0x00 0x00 0x00 0x00 0x00 0x01 0x06 0x02 0x00 0x00 0x00 0x00 0x00 0x01 0xff 0xff 0x00 0x00 0x00 0x00 0x00 0x04 0x00 0x00 0x00 0x00 0x01 0x00 0x01 0x00 0x27 0x00 0x00 0x14 0x01 0x2d 0x00 0x01 0x00 0x61 0x00 0x00 0xff 0xff 0x00 0x00 0x00 0x30 0x00 0x6e 0x01 0x00 0x01 0x0e 0xce 0x02 0x05 0x00 0x00 0x00 0x00 0x00 0x81 0x00 0x00 0x01 0x00 0x01 0x02 0x44 0x00 0x00 0x00 0x00 0x02 0x00 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x10 0x00 0x02 0x0a 0x00 0x00 0x00 0x00 0x01 0x00 0x00 0x02 0x00 0x00 0xe0 0x20 0x10 0x29 0x00 0x01 0x62 0x00 0x00 0x00
Parsed 193 bytes:
00 01 00 80 00 00 00 c3 00 02 00 00 03 00 00 03
00 19 00 00 00 00 0c 00 fc 01 06 c6 01 00 00 01
01 13 01 00 00 00 00 00 00 00 31 00 30 00 6e 01
00 00 01 ff 00 00 00 00 00 01 06 02 00 00 00 00
00 01 ff ff 00 00 00 00 00 04 00 00 00 00 01 00
01 00 27 00 00 14 01 2d 00 01 00 61 00 00 ff ff
00 00 00 30 00 6e 01 00 01 0e ce 02 05 00 00 00
00 00 81 00 00 01 00 01 02 44 00 00 00 00 02 00
01 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 10 00 02 0a 00 00 00
00 01 00 00 02 00 00 e0 20 10 29 00 01 62 00 00
00
Decoded message NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST message length 0xc3
Message ID = 0x80
Message Length = 0xc3
SFN = 2
Slot = 0
nPDUs = 3
nGroup = 0
PDU #0
PDUType = 0x03 (NFAPI_NR_DL_TTI_SSB_PDU_TYPE)
PDUSize = 0x19
physCellId = 0
BetaPss = 0
SSBBlockIndex = 0
SSBSubcarrierOffset = 12
SSBOffsetPointA = 252
bchPayloadFlag = 1
bchPayload = 6c601
numPRGs = 1
prgSize = 275
digBFInterfaces = 1
PMIdx = 0
beamIDX = 0
PDU #1
PDUType = 0x00 (NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE)
PDUSize = 0x31
BWPSize = 48
BWPStart = 110
Subcarrier Spacing = 1
Ciclic Prefix = 0
StartSymbolIndex = 0
DurationSymbols = 1
FrequencyDomainResource : 255 0 0 0 0 0
CCE Reg Mapping Type = 1
Reg Bundle Size = 6
Interleaver Size = 2
CoreSetType = 0
ShiftIndex = 0
precoderGranularity = 0
numDLDCI = 1
RNTI = 0xffff
ScramblingId = 0
ScramblingRNTI = 0x0
CCEIndex = 0
AggregationLevel = 4
numPRGs = 0
prgSize = 0
digBFInterfaces = 1
beta_PDCCH_1_0 = 0
powerControlOffsetSS = 1
PayloadSizeBits = 39
Payload = 0x00 0x00 0x14 0x01 0x2d
PDU #2
PDUType = 0x01 (NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE)
PDUSize = 0x61
pduBitmap = 0
RNTI = ffff
pduIndex = 0
BWPSize = 48
BWPStart = 110
SubcarrierSpacing = 1
CyclicPrefix = 0
NrOfCodewords = 1
Codeword #0
targetCoderate = 3790
qamModOrder = 2
mcsIndex = 5
mcsTable = 0
rvIndex = 0
TBSize = 129
dataScramblingId = 0
nrOfLayers = 1
transmissionScheme = 0
refPoint = 1
dlDmrsSymbPos = 580
dmrsConfigType = 0
dlDmrsScramblingId = 0
SCID = 0
numDmrsCdmGrpsNoData = 2
dmrsPorts = 1
resourceAlloc = 1
rbBitmap = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
rbStart = 0
rbSize = 16
VRBtoPRBMapping = 0
StartSymbolIndex = 2
NrOfSymbols = 10
PTRSPortIndex = 0
PTRSTimeDensity = 0
PTRSFreqDensity = 0
PTRSReOffset = 0
nEpreRatioOfPDSCHToPTRS = 0
numPRGs = 0
prgSize = 0
digBFInterfaces = 1
powerControlOffset = 0
powerControlOffsetSS = 0
isLastCbPresent = 0
isInlineTbCrc = 0
dlTbCrc = 0