Move check_nr_fapi_unpack_length to common FAPI lib
Add P7 message cases to check_nr_fapi_unpack_length Add SLOT.response vendor extension msg id to enum
This commit is contained in:
committed by
Robert Schmidt
parent
4e5b841a16
commit
f409b91768
@@ -213,73 +213,6 @@ int fapi_nr_p5_message_unpack(void *pMessageBuf,
|
||||
return result;
|
||||
}
|
||||
|
||||
int check_nr_fapi_unpack_length(nfapi_nr_phy_msg_type_e msgId, uint32_t unpackedBufLen)
|
||||
{
|
||||
int retLen = 0;
|
||||
/** NFAPI_NR_PHY_MSG_TYPE_PARAM_REQUEST= 0x00,
|
||||
NFAPI_NR_PHY_MSG_TYPE_PARAM_RESPONSE= 0x01,
|
||||
NFAPI_NR_PHY_MSG_TYPE_CONFIG_REQUEST= 0x02,
|
||||
NFAPI_NR_PHY_MSG_TYPE_CONFIG_RESPONSE=0X03,
|
||||
NFAPI_NR_PHY_MSG_TYPE_START_REQUEST= 0X04,
|
||||
NFAPI_NR_PHY_MSG_TYPE_STOP_REQUEST= 0X05,
|
||||
NFAPI_NR_PHY_MSG_TYPE_STOP_INDICATION=0X06,
|
||||
NFAPI_NR_PHY_MSG_TYPE_ERROR_INDICATION=0X07
|
||||
*/
|
||||
// check for size of nFAPI struct without the nFAPI specific parameters
|
||||
switch (msgId) {
|
||||
case NFAPI_NR_PHY_MSG_TYPE_PARAM_REQUEST:
|
||||
if (unpackedBufLen >= sizeof(nfapi_nr_param_request_scf_t) - sizeof(nfapi_vendor_extension_tlv_t))
|
||||
retLen = sizeof(fapi_message_header_t);
|
||||
|
||||
break;
|
||||
case NFAPI_NR_PHY_MSG_TYPE_PARAM_RESPONSE:
|
||||
if (unpackedBufLen >= sizeof(nfapi_nr_param_response_scf_t) - sizeof(nfapi_vendor_extension_tlv_t) - sizeof(nfapi_nr_nfapi_t))
|
||||
retLen = sizeof(nfapi_nr_param_request_scf_t);
|
||||
|
||||
break;
|
||||
case NFAPI_NR_PHY_MSG_TYPE_CONFIG_REQUEST:
|
||||
if (unpackedBufLen >= sizeof(nfapi_nr_config_request_scf_t) - sizeof(nfapi_vendor_extension_tlv_t) - sizeof(nfapi_nr_nfapi_t))
|
||||
retLen = sizeof(nfapi_nr_config_request_scf_t);
|
||||
|
||||
break;
|
||||
case NFAPI_NR_PHY_MSG_TYPE_CONFIG_RESPONSE:
|
||||
if (unpackedBufLen >= sizeof(nfapi_nr_config_response_scf_t) - sizeof(nfapi_vendor_extension_tlv_t))
|
||||
retLen = sizeof(nfapi_nr_config_response_scf_t);
|
||||
|
||||
break;
|
||||
case NFAPI_NR_PHY_MSG_TYPE_START_REQUEST:
|
||||
if (unpackedBufLen >= sizeof(nfapi_nr_start_request_scf_t) - sizeof(nfapi_vendor_extension_tlv_t))
|
||||
retLen = sizeof(fapi_message_header_t);
|
||||
|
||||
break;
|
||||
case NFAPI_NR_PHY_MSG_TYPE_START_RESPONSE:
|
||||
if (unpackedBufLen >= sizeof(nfapi_nr_start_response_scf_t) - sizeof(nfapi_vendor_extension_tlv_t))
|
||||
retLen = sizeof(fapi_message_header_t);
|
||||
|
||||
break;
|
||||
case NFAPI_NR_PHY_MSG_TYPE_STOP_REQUEST:
|
||||
if (unpackedBufLen >= sizeof(nfapi_nr_stop_request_scf_t) - sizeof(nfapi_vendor_extension_tlv_t))
|
||||
retLen = sizeof(fapi_message_header_t);
|
||||
|
||||
break;
|
||||
case NFAPI_NR_PHY_MSG_TYPE_STOP_INDICATION:
|
||||
if (unpackedBufLen >= sizeof(nfapi_nr_stop_indication_scf_t) - sizeof(nfapi_vendor_extension_tlv_t))
|
||||
retLen = sizeof(fapi_message_header_t);
|
||||
|
||||
break;
|
||||
case NFAPI_NR_PHY_MSG_TYPE_ERROR_INDICATION:
|
||||
if (unpackedBufLen >= sizeof(nfapi_nr_error_indication_scf_t) - sizeof(nfapi_vendor_extension_tlv_t))
|
||||
retLen = sizeof(fapi_message_header_t);
|
||||
|
||||
break;
|
||||
default:
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s Unknown message ID %d\n", __FUNCTION__, msgId);
|
||||
break;
|
||||
}
|
||||
|
||||
return retLen;
|
||||
}
|
||||
|
||||
uint8_t pack_nr_param_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t *config)
|
||||
{
|
||||
nfapi_nr_param_request_scf_t *pNfapiMsg = (nfapi_nr_param_request_scf_t *)msg;
|
||||
|
||||
Reference in New Issue
Block a user