diff --git a/nfapi/open-nFAPI/pnf/inc/pnf_p7.h b/nfapi/open-nFAPI/pnf/inc/pnf_p7.h index 0c14fcebef..0325c8c242 100644 --- a/nfapi/open-nFAPI/pnf/inc/pnf_p7.h +++ b/nfapi/open-nFAPI/pnf/inc/pnf_p7.h @@ -57,7 +57,7 @@ typedef struct { typedef struct { uint8_t* buffer; - uint16_t length; + uint32_t length; } pnf_p7_rx_message_segment_t; typedef struct pnf_p7_rx_message pnf_p7_rx_message_t; diff --git a/nfapi/open-nFAPI/pnf/public_inc/nfapi_pnf_interface.h b/nfapi/open-nFAPI/pnf/public_inc/nfapi_pnf_interface.h index 5e964f10fa..7403bd7169 100644 --- a/nfapi/open-nFAPI/pnf/public_inc/nfapi_pnf_interface.h +++ b/nfapi/open-nFAPI/pnf/public_inc/nfapi_pnf_interface.h @@ -629,8 +629,8 @@ typedef struct nfapi_pnf_p7_config uint8_t checksum_enabled; /*! The maxium size of a P7 segement. If a message is large that this it - * will be segemented */ - uint16_t segment_size; + * will be segmented. Note: u32 to cover 4G and 5G */ + uint32_t segment_size; /*! The dummy subframe buffer structure that should be used in case there * are no 'valid' subframe messages */ diff --git a/nfapi/open-nFAPI/pnf/src/pnf_p7.c b/nfapi/open-nFAPI/pnf/src/pnf_p7.c index 4fdb4ae01f..bdc1634ef5 100644 --- a/nfapi/open-nFAPI/pnf/src/pnf_p7.c +++ b/nfapi/open-nFAPI/pnf/src/pnf_p7.c @@ -602,18 +602,20 @@ int pnf_nr_p7_pack_and_send_p7_message(pnf_p7_t* pnf_p7, nfapi_nr_p7_message_hea uint8_t buffer[pnf_p7->_public.segment_size]; for (segment = 0; segment < segment_count; ++segment) { uint8_t last = 0; - uint16_t size = pnf_p7->_public.segment_size - NFAPI_NR_P7_HEADER_LENGTH; + uint32_t size = pnf_p7->_public.segment_size - NFAPI_NR_P7_HEADER_LENGTH; if (segment + 1 == segment_count) { last = 1; size = (msg_body_len) - (seg_body_len * segment); } - uint16_t segment_size = size + NFAPI_NR_P7_HEADER_LENGTH; + uint32_t segment_size = size + NFAPI_NR_P7_HEADER_LENGTH; // Update the header with the m and segement memcpy(&buffer[0], tx_buf, NFAPI_NR_P7_HEADER_LENGTH); // set the segment length + buffer[4] = (segment_size & 0xFF000000) >> 24; + buffer[5] = (segment_size & 0xFF0000) >> 16; buffer[6] = (segment_size & 0xFF00) >> 8; buffer[7] = (segment_size & 0xFF);