Revert "[Feature][T8TSK-189] chang urc report address to 127.0.0.1 (missing file)"
This reverts commit b85e0cb49826127f6320409e18023aec886e4c7d.
Reason for revert: <INSERT REASONING HERE>
Change-Id: I7b6e86fff07bb720e67f0bb5e63c934c64d3b135
diff --git a/framework/lynq-ril-service/src/ril.cpp b/framework/lynq-ril-service/src/ril.cpp
index b52d764..ffcd658 100755
--- a/framework/lynq-ril-service/src/ril.cpp
+++ b/framework/lynq-ril-service/src/ril.cpp
@@ -95,7 +95,6 @@
#include "led.h"
#endif
#include "lynq_shm.h"
-#include "lynq_urc_socket.h"
#define LOG_TAG "DEMO_RIL"
#define WAIT_TIME_FOR_SIM_SWITCH 30
@@ -167,7 +166,7 @@
#define LYNQ_SOCKET_ENVNT_FD_MAX 100
#define LYNQ_SERVICE_PORT 8088
#define LYNQ_AT_SERVICE_PORT 8087
-//#define LYNQ_BRODCAST_PORT 8086
+#define LYNQ_BRODCAST_PORT 8086
#define LYNQ_SOCKET_BUFFER (1024*8+sizeof(int)*3+10)
/*lei add*/
#define DSET_IP_ADDRESS "127.0.0.1"
@@ -182,7 +181,7 @@
#define SHM_BUFFER_SIZE_OFFSET 16
#define urc_broadcase_shm_size_limit 20
-//int lynq_urc_socket_fd = 0;
+int lynq_urc_socket_fd = 0;
struct sockaddr_in urc_broadcast_addr;
/*Warren add for t800 RIL service 2021_12_10 end*/
@@ -5859,33 +5858,28 @@
}
void LYNQ_RIL_urcClientInit()
{
-// int len = 0;
-// int on=1;
-// int ret = 0;
-// lynq_urc_socket_fd = socket(AF_INET,SOCK_DGRAM,0);
-// if(lynq_urc_socket_fd < 0)
-// {
-// perror("creaet socket for udp fail");
-// return;
-// }
-// /* 设置socket允许重复使用地址与端口,SO_REUSEADDR值为2 */
-// //setsockopt(socket_fd,SOL_SOCKET,SO_REUSEADDR,&on,sizeof on);
-// /* 使能广播功能,SO_BROADCAST值为6 */
-// ret= setsockopt(lynq_urc_socket_fd,SOL_SOCKET,SO_BROADCAST,&on,sizeof(on));
-// if(ret<0)
-// {
-// RLOGD("set broadcast fail!!!\n");
-// exit(1);
-// }
-// urc_broadcast_addr.sin_family = AF_INET; //IPv4
-// urc_broadcast_addr.sin_port = htons(LYNQ_BRODCAST_PORT);
-// urc_broadcast_addr.sin_addr.s_addr = inet_addr("255.255.255.255" );//255.255.255.255 broadcast addrress.
-// printf("LYNQ_RIL_urcClientInit success!!!\n");
- int ret = lynq_open_broadcast_urc_socket();
- if (ret == 0)
- printf("lynq_open_broadcast_urc_socket success!!!\n");
- else
- printf("lynq_open_broadcast_urc_socket fail!!!\n");
+ int len = 0;
+ int on=1;
+ int ret = 0;
+ lynq_urc_socket_fd = socket(AF_INET,SOCK_DGRAM,0);
+ if(lynq_urc_socket_fd < 0)
+ {
+ perror("creaet socket for udp fail");
+ return;
+ }
+ /* 设置socket允许重复使用地址与端口,SO_REUSEADDR值为2 */
+ //setsockopt(socket_fd,SOL_SOCKET,SO_REUSEADDR,&on,sizeof on);
+ /* 使能广播功能,SO_BROADCAST值为6 */
+ ret= setsockopt(lynq_urc_socket_fd,SOL_SOCKET,SO_BROADCAST,&on,sizeof(on));
+ if(ret<0)
+ {
+ RLOGD("set broadcast fail!!!\n");
+ exit(1);
+ }
+ urc_broadcast_addr.sin_family = AF_INET; //IPv4
+ urc_broadcast_addr.sin_port = htons(LYNQ_BRODCAST_PORT);
+ urc_broadcast_addr.sin_addr.s_addr = inet_addr("255.255.255.255" );//255.255.255.255 broadcast addrress.
+ printf("LYNQ_RIL_urcClientInit success!!!\n");
return;
/*
while(1)
@@ -6218,12 +6212,11 @@
RLOGD("LYNQ_RIL_urcBroadcast use share mem level is %d, index is %d,pointer is %p",level,index,p_shm_buffer);
}
}
- //sent = sendto(lynq_urc_socket_fd, data, dataSize, 0, (struct sockaddr *)&urc_broadcast_addr, sizeof(urc_broadcast_addr));
- sent = lynq_broadcast_urc_msg((void*)data, dataSize);
+ sent = sendto(lynq_urc_socket_fd, data, dataSize, 0, (struct sockaddr *)&urc_broadcast_addr, sizeof(urc_broadcast_addr));
if( sent < 0 )
{
RLOGE("LYNQ_RIL_urcBroadcast send datalen fail (sent=%d, sendFD=%d, dataSize=%d)",
- sent,0, dataSize);
+ sent,lynq_urc_socket_fd, dataSize);
return -1;
}