[feature][T8TSK-4] Optimize the network module, provide state buffer variables 2, short the waiting time
Change-Id: Iea4a60a48352bd8502d1c9b259df10d378fa08dd
diff --git a/lib/liblynq-call/lynq_call.cpp b/lib/liblynq-call/lynq_call.cpp
index b0ba48a..c91bea3 100755
--- a/lib/liblynq-call/lynq_call.cpp
+++ b/lib/liblynq-call/lynq_call.cpp
@@ -237,11 +237,12 @@
*/
int g_lynq_call_init_flag = 0;
-int JumpHeader(Parcel &p,int *resp_type,int *request,int *slot_id,int *error)
+int JumpHeader(Parcel &p,int *resp_type,int* token,int *request,int *slot_id,int *error)
{
if(p.dataAvail() > 0)
{
p.readInt32(resp_type);
+ p.readInt32(token);
p.readInt32(request);
p.readInt32(slot_id);
p.readInt32(error);
@@ -294,6 +295,7 @@
Parcel p;
lynq_client_t client;
int resp_type = -1;
+ int token;
int request = -1;
int slot_id = -1;
int error = -1;
@@ -313,7 +315,7 @@
return -1;
}
get_response(lynq_call_client_sockfd,p);
- JumpHeader(p,&resp_type,&request,&slot_id,&error);
+ JumpHeader(p,&resp_type,&token,&request,&slot_id,&error);
LYINFLOG("resp_type=%d,request=%d,slot_id=%d,error_code=%d",resp_type,request,slot_id,error);
if(error == 0)
{
@@ -1135,6 +1137,7 @@
Parcel p;
lynq_client_t client;
int resp_type = -1;
+ int token;
int request = -1;
int slot_id = -1;
int error = -1;
@@ -1158,7 +1161,7 @@
}
if(get_response(lynq_call_client_sockfd,p)==0)
{
- JumpHeader(p,&resp_type,&request,&slot_id,&error);
+ JumpHeader(p,&resp_type,&token,&request,&slot_id,&error);
LYINFLOG("resp_type=%d,request=%d,slot_id=%d,error_code=%d",resp_type,request,slot_id,error);
}
return error;
@@ -1169,6 +1172,7 @@
Parcel p;
lynq_client_t client;
int resp_type = -1;
+ int token;
int request = -1;
int slot_id = -1;
int error = -1;
@@ -1189,7 +1193,7 @@
}
if(get_response(lynq_call_client_sockfd,p)==0)
{
- JumpHeader(p,&resp_type,&request,&slot_id,&error);
+ JumpHeader(p,&resp_type,&token,&request,&slot_id,&error);
p.readInt32(status);
LYINFLOG("resp_type=%d,request=%d,slot_id=%d,error_code=%d",resp_type,request,slot_id,error);
}
@@ -1205,6 +1209,7 @@
Parcel p;
lynq_client_t client;
int resp_type = -1;
+ int token;
int request = -1;
int slot_id = -1;
int error = -1;
@@ -1248,7 +1253,7 @@
}
get_response(lynq_call_client_sockfd,p);
pthread_mutex_unlock(&g_lynq_call_sendto_mutex);
- JumpHeader(p,&resp_type,&request,&slot_id,&error);
+ JumpHeader(p,&resp_type,&token,&request,&slot_id,&error);
LYINFLOG("resp_type=%d,request=%d,slot_id=%d,error_code=%d",resp_type,request,slot_id,error);
if(error==0)
{
@@ -1290,8 +1295,9 @@
Parcel p;
lynq_client_t client;
int resp_type = -1;
- int request = -1;
- int slot_id = -1;
+ int token;
+ int request = -1;
+ int slot_id = -1;
int error = -1;
client.uToken = Global_uToken_call;
client.request = 40;//RIL_REQUEST_DIAL
@@ -1306,7 +1312,7 @@
}
get_response(lynq_call_client_sockfd,p);
pthread_mutex_unlock(&g_lynq_call_sendto_mutex);
- JumpHeader(p,&resp_type,&request,&slot_id,&error);
+ JumpHeader(p,&resp_type,&token,&request,&slot_id,&error);
LYINFLOG("resp_type=%d,request=%d,slot_id=%d,error_code=%d",resp_type,request,slot_id,error);
return error;
}
@@ -1320,6 +1326,7 @@
lynq_client_t client;
int resp_type = -1;
int request = -1;
+ int token;
int slot_id = -1;
int error = -1;
int call_id = 0;
@@ -1344,7 +1351,7 @@
}
get_response(lynq_call_client_sockfd,p);
pthread_mutex_unlock(&g_lynq_call_sendto_mutex);
- JumpHeader(p,&resp_type,&request,&slot_id,&error);
+ JumpHeader(p,&resp_type,&token,&request,&slot_id,&error);
LYINFLOG("resp_type=%d,request=%d,slot_id=%d,error_code=%d",resp_type,request,slot_id,error);
if(error==0)
{
@@ -1365,6 +1372,7 @@
Parcel p;
lynq_client_t client;
int resp_type = -1;
+ int token=-1;
int request = -1;
int slot_id = -1;
int error = -1;
@@ -1381,7 +1389,7 @@
}
get_response(lynq_call_client_sockfd,p);
pthread_mutex_unlock(&g_lynq_call_sendto_mutex);
- JumpHeader(p,&resp_type,&request,&slot_id,&error);
+ JumpHeader(p,&resp_type,&token,&request,&slot_id,&error);
LYINFLOG("resp_type=%d,request=%d,slot_id=%d,error_code=%d",resp_type,request,slot_id,error);
return error;
}
@@ -1511,6 +1519,7 @@
Parcel p;
lynq_client_t client;
int resp_type = -1;
+ int token;
int request = -1;
int slot_id = -1;
int error = -1;
@@ -1527,7 +1536,7 @@
}
get_response(lynq_call_client_sockfd,p);
pthread_mutex_unlock(&g_lynq_call_sendto_mutex);
- JumpHeader(p,&resp_type,&request,&slot_id,&error);
+ JumpHeader(p,&resp_type,&token,&request,&slot_id,&error);
LYINFLOG("resp_type=%d,request=%d,slot_id=%d,error_code=%d",resp_type,request,slot_id,error);
return error;
}
@@ -1541,6 +1550,7 @@
Parcel p;
lynq_client_t client;
int resp_type = -1;
+ int token;
int request = -1;
int slot_id = -1;
int error = -1;
@@ -1557,7 +1567,7 @@
}
get_response(lynq_call_client_sockfd,p);
pthread_mutex_unlock(&g_lynq_call_sendto_mutex);
- JumpHeader(p,&resp_type,&request,&slot_id,&error);
+ JumpHeader(p,&resp_type,&token,&request,&slot_id,&error);
LYINFLOG("resp_type=%d,request=%d,slot_id=%d,error_code=%d",resp_type,request,slot_id,error);
return error;
}
@@ -1571,6 +1581,7 @@
Parcel p;
lynq_client_t client;
int resp_type = -1;
+ int token;
int request = -1;
int slot_id = -1;
int error = -1;
@@ -1587,7 +1598,7 @@
}
get_response(lynq_call_client_sockfd,p);
pthread_mutex_unlock(&g_lynq_call_sendto_mutex);
- JumpHeader(p,&resp_type,&request,&slot_id,&error);
+ JumpHeader(p,&resp_type,&token,&request,&slot_id,&error);
LYINFLOG("resp_type=%d,request=%d,slot_id=%d,error_code=%d",resp_type,request,slot_id,error);
return error;
}