Commit d7ca419c authored by Chenyu's avatar Chenyu

debuging

parent f3e448b1
...@@ -597,7 +597,12 @@ void *rrc_enb_process_msg(void *notUsed) { ...@@ -597,7 +597,12 @@ void *rrc_enb_process_msg(void *notUsed) {
} }
extern void tesths(void);
int main( int argc, char **argv ) { int main( int argc, char **argv ) {
//uint8_t beta_ACK=0,beta_RI=0,beta_CQI=2; //uint8_t beta_ACK=0,beta_RI=0,beta_CQI=2;
PHY_VARS_NR_UE *UE[MAX_NUM_CCs]; PHY_VARS_NR_UE *UE[MAX_NUM_CCs];
start_background_system(); start_background_system();
...@@ -657,6 +662,9 @@ int main( int argc, char **argv ) { ...@@ -657,6 +662,9 @@ int main( int argc, char **argv ) {
#endif #endif
#endif #endif
*/ */
printf("1111111");
tesths ();
printf("1111111");
NB_UE_INST=1; NB_UE_INST=1;
NB_INST=1; NB_INST=1;
......
...@@ -56,7 +56,7 @@ void *nas_ue_task(void *args_p) ...@@ -56,7 +56,7 @@ void *nas_ue_task(void *args_p)
unsigned int Mod_id; unsigned int Mod_id;
int result; int result;
nas_user_container_t *users=args_p; nas_user_container_t *users=args_p;
UENAS_msg * nrue_msg; UENAS_msg nrue_msg;
itti_mark_task_ready (TASK_NAS_UE); itti_mark_task_ready (TASK_NAS_UE);
MSC_START_USE(); MSC_START_USE();
...@@ -132,7 +132,7 @@ void *nas_ue_task(void *args_p) ...@@ -132,7 +132,7 @@ void *nas_ue_task(void *args_p)
case NAS_DOWNLINK_DATA_IND: //CUC:NAS_DOWNLINK_DATA_IND √ case NAS_DOWNLINK_DATA_IND: //CUC:NAS_DOWNLINK_DATA_IND √
LOG_I(NAS, "[UE %d] Received %s: UEid %u, length %u\n", Mod_id, ITTI_MSG_NAME (msg_p), LOG_I(NAS, "[UE %d] Received %s: UEid %u, length %u\n", Mod_id, ITTI_MSG_NAME (msg_p),
NAS_DOWNLINK_DATA_IND (msg_p).UEid, NAS_DOWNLINK_DATA_IND (msg_p).nasMsg.length); NAS_DOWNLINK_DATA_IND (msg_p).UEid, NAS_DOWNLINK_DATA_IND (msg_p).nasMsg.length);
nr_nas_proc_dl_transfer_ind (nrue_msg, NAS_DOWNLINK_DATA_IND(msg_p).nasMsg.data, NAS_DOWNLINK_DATA_IND(msg_p).nasMsg.length); //handle dl info NAS mesaages. nr_nas_proc_dl_transfer_ind (&nrue_msg, NAS_DOWNLINK_DATA_IND(msg_p).nasMsg.data, NAS_DOWNLINK_DATA_IND(msg_p).nasMsg.length); //handle dl info NAS mesaages.
break; break;
default: default:
...@@ -153,7 +153,7 @@ void *nas_ue_task(void *args_p) ...@@ -153,7 +153,7 @@ void *nas_ue_task(void *args_p)
} }
void nr_nas_proc_dl_transfer_ind (UENAS_msg *msg, Byte_t *data, uint32_t len) { //QUES: 解出的msg干什么 void nr_nas_proc_dl_transfer_ind (UENAS_msg *msg, Byte_t *data, uint32_t len) { //QUES: 解出的msg干什么
uint8_t *buffer; uint8_t buffer[100];
UENAS_msg *msg1; UENAS_msg *msg1;
uint32_t len1=0; uint32_t len1=0;
nr_user_nas_t UErrc= {0};//QUES:user nr_user_nas_t UErrc= {0};//QUES:user
...@@ -193,14 +193,48 @@ void nr_nas_proc_dl_transfer_ind (UENAS_msg *msg, Byte_t *data, uint32_t len) { ...@@ -193,14 +193,48 @@ void nr_nas_proc_dl_transfer_ind (UENAS_msg *msg, Byte_t *data, uint32_t len) {
break; break;
} }
}
printf("aaaaaaaaaaaaa: ");
printf("%d\n",size);
for (int i = 0; i < size; i++) for (int i = 0; i < size; i++)
{ {
printf("aaaaaaaaaaaaa%x",*(buffer+i)); printf("%02x ",*(buffer+i));
} }
printf("aaaaaaaaaaaaa \n ");
}
#define CHAR_TO_UINT8(input) ((input & 0xf) + 9*(input>>6))
//function to convert string to byte array
int string2ByteArray(char* input,uint8_t* output)
{
int loop;
int i;
loop = 0;
i = 0;
while(input[loop] != '\0')
{
output[i++] = (CHAR_TO_UINT8(input[loop]))<<4 | CHAR_TO_UINT8(input[loop+1]);
loop += 2;
} }
return i;
} }
void tesths(void)
{
UENAS_msg msg;
char name[] = "7e005601020000217d003b4a2e3bb80403de19020f57b16a2010583f0d352eb89001539b2cb2cbf1da5c";
uint32_t len=42;
Byte_t *data= (uint8_t *)malloc(sizeof(uint8_t)*len);
string2ByteArray(name, data);
nr_nas_proc_dl_transfer_ind(&msg,data,len);
}
int decodeNasMsg(UENAS_msg *msg, uint8_t *buffer, uint32_t len) { int decodeNasMsg(UENAS_msg *msg, uint8_t *buffer, uint32_t len) {
int header_result; int header_result;
int decode_result=0; int decode_result=0;
......
...@@ -83,4 +83,7 @@ int encode_registration_complete5g(registrationcomplete_t *registrationcomplete, ...@@ -83,4 +83,7 @@ int encode_registration_complete5g(registrationcomplete_t *registrationcomplete,
int securityModeComplete5g(void **msg); int securityModeComplete5g(void **msg);
int registrationComplete5g(void **msg); int registrationComplete5g(void **msg);
int string2ByteArray(char* input,uint8_t* output);
void tesths(void);
#endif /* NAS_TASK_H_ */ #endif /* NAS_TASK_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment