[Bugfix][API-1547] Change RIL FWK broadcast addr to 127.255.255.255

Only Configure: No
Affected branch: LYNQ_PUBLIC master
Affected module: RIL
Is it affected on both ZXIC and MTK: only MTK
Self-test: Yes
Doc Update: No

Change-Id: I1538fed1ad6fccdee69b607423b97bb6598dfc5a
diff --git a/common_src/framework/lynq-ril-service/src/ril.cpp b/common_src/framework/lynq-ril-service/src/ril.cpp
index ef41d33..bf24c67 100755
--- a/common_src/framework/lynq-ril-service/src/ril.cpp
+++ b/common_src/framework/lynq-ril-service/src/ril.cpp
@@ -170,6 +170,12 @@
 #define LYNQ_SERVICE_PORT 8088
 #define LYNQ_AT_SERVICE_PORT 8087
 #define LYNQ_BRODCAST_PORT 8086
+#ifdef GSW_RIL_CFG 
+/*Interfaces lo net addr 127.0.0.1,mask 255.0.0.0,so lo broadcast addr is 127.255.255.255*/
+#define LYNQ_RIL_FWK_BROADCAST_IP "127.255.255.255" /*hong.liu change broadcast addr on 2024.2.18*/
+#else
+#define LYNQ_RIL_FWK_BROADCAST_IP "255.255.255.255"
+#endif
 #define LYNQ_SOCKET_BUFFER (1024*8+sizeof(int)*3+10)
 /*lei add*/
 #define LYNQ_AT_SOCKET_BUFFER 1024
@@ -6052,8 +6058,6 @@
         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)
@@ -6076,8 +6080,8 @@
     
     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");
+    urc_broadcast_addr.sin_addr.s_addr = inet_addr(LYNQ_RIL_FWK_BROADCAST_IP);/*hong.liu change broadcast addr on 2024.2.18*/
+    RLOGE("LYNQ_RIL_urcClientInit success!!!");
     return;
 }
 
diff --git a/common_src/lib/liblynq-call/lynq_module_socket.cpp b/common_src/lib/liblynq-call/lynq_module_socket.cpp
index 1539a91..b33dd68 100755
--- a/common_src/lib/liblynq-call/lynq_module_socket.cpp
+++ b/common_src/lib/liblynq-call/lynq_module_socket.cpp
@@ -20,7 +20,11 @@
 #define LYNQ_SERVICE_PORT 8088

 #define LYNQ_ADDRESS "127.0.0.1"

 #define LYNQ_URC_SERVICE_PORT 8086

+#ifdef GSW_RIL_CFG

+#define LYNQ_URC_ADDRESS "127.255.255.255" /*hong.liu change broadcast addr on 2024.2.18*/

+#else

 #define LYNQ_URC_ADDRESS "0.0.0.0"

+#endif

 #define LYNQ_REQUEST_PARAM_BUF 8192

 #define LYNQ_REC_BUF 8192

 

diff --git a/common_src/lib/liblynq-call/makefile b/common_src/lib/liblynq-call/makefile
index 40415dc..6073694 100755
--- a/common_src/lib/liblynq-call/makefile
+++ b/common_src/lib/liblynq-call/makefile
@@ -13,6 +13,9 @@
                 -fpermissive \
 
 
+ifeq ($(strip $(MOBILETEK_RIL_CFG)), GSW)
+    LOCAL_CFLAGS += -DGSW_RIL_CFG
+endif
 
 $(warning ################# lynq data demo ROOT: $(ROOT),includedir:$(includedir))
 LOCAL_PATH   = .
diff --git a/common_src/lib/liblynq-data/lynq_data_urc.cpp b/common_src/lib/liblynq-data/lynq_data_urc.cpp
index c3d95c6..45996e0 100755
--- a/common_src/lib/liblynq-data/lynq_data_urc.cpp
+++ b/common_src/lib/liblynq-data/lynq_data_urc.cpp
@@ -177,7 +177,7 @@
     }
     urc_local_addr.sin_family = AF_INET;
     urc_local_addr.sin_port = htons(LYNQ_URC_SERVICE_PORT);
-    urc_local_addr.sin_addr.s_addr = htons(INADDR_ANY);
+    urc_local_addr.sin_addr.s_addr = inet_addr(LYNQ_RIL_FWK_BROADCAST_IP);/*hong.liu change broadcast addr on 2024.2.18*/
     /* Set socket to allow reuse of address and port, SO_REUSEADDR value is 2*/
     rt = setsockopt(lynq_urc_sockfd,SOL_SOCKET,SO_REUSEADDR,&on,sizeof on);
     if(rt<0)
diff --git a/common_src/lib/liblynq-data/lynq_data_urc.h b/common_src/lib/liblynq-data/lynq_data_urc.h
index 59f9f9d..11aeb08 100755
--- a/common_src/lib/liblynq-data/lynq_data_urc.h
+++ b/common_src/lib/liblynq-data/lynq_data_urc.h
@@ -4,6 +4,11 @@
 using ::android::Parcel;
 
 #define LYNQ_URC_SERVICE_PORT 8086
+#ifdef GSW_RIL_CFG
+#define LYNQ_RIL_FWK_BROADCAST_IP "127.255.255.255" /*hong.liu change broadcast addr on 2024.2.18*/
+#else
+#define LYNQ_RIL_FWK_BROADCAST_IP "0.0.0.0"
+#endif
 
 /*the same with lynq_interface.h begin*/
 #define LYNQ_REQUEST_VENDOR_BASE 8000
diff --git a/common_src/lib/liblynq-network/lynq_module_socket.cpp b/common_src/lib/liblynq-network/lynq_module_socket.cpp
index 8ab8f34..35dd9d6 100755
--- a/common_src/lib/liblynq-network/lynq_module_socket.cpp
+++ b/common_src/lib/liblynq-network/lynq_module_socket.cpp
@@ -20,7 +20,11 @@
 #define LYNQ_SERVICE_PORT 8088

 #define LYNQ_ADDRESS "127.0.0.1"

 #define LYNQ_URC_SERVICE_PORT 8086

+#ifdef GSW_RIL_CFG

+#define LYNQ_URC_ADDRESS "127.255.255.255" /*hong.liu change broadcast addr on 2024.2.18*/

+#else

 #define LYNQ_URC_ADDRESS "0.0.0.0"

+#endif

 #define LYNQ_REQUEST_PARAM_BUF 8192

 #define LYNQ_REC_BUF 8192

 

diff --git a/common_src/lib/liblynq-network/makefile b/common_src/lib/liblynq-network/makefile
index 0ae6805..044d7f5 100755
--- a/common_src/lib/liblynq-network/makefile
+++ b/common_src/lib/liblynq-network/makefile
@@ -10,7 +10,9 @@
                 -DKEEP_ALIVE \
                 -DECALL_SUPPORT
 
-
+ifeq ($(strip $(MOBILETEK_RIL_CFG)), GSW)
+    LOCAL_CFLAGS += -DGSW_RIL_CFG
+endif
 
 $(warning ################# lynq network demo ROOT: $(ROOT),includedir:$(includedir))
 LOCAL_PATH   = .
diff --git a/common_src/lib/liblynq-sms/lynq_module_socket.cpp b/common_src/lib/liblynq-sms/lynq_module_socket.cpp
index d7c654e..dae9b5c 100755
--- a/common_src/lib/liblynq-sms/lynq_module_socket.cpp
+++ b/common_src/lib/liblynq-sms/lynq_module_socket.cpp
@@ -20,7 +20,11 @@
 #define LYNQ_SERVICE_PORT 8088

 #define LYNQ_ADDRESS "127.0.0.1"

 #define LYNQ_URC_SERVICE_PORT 8086

+#ifdef GSW_RIL_CFG

+#define LYNQ_URC_ADDRESS "127.255.255.255" /*hong.liu change broadcast addr on 2024.2.18*/

+#else

 #define LYNQ_URC_ADDRESS "0.0.0.0"

+#endif

 #define LYNQ_REQUEST_PARAM_BUF 8192

 #define LYNQ_REC_BUF 8192

 

diff --git a/common_src/lib/liblynq-sms/makefile b/common_src/lib/liblynq-sms/makefile
index e5dedab..e7abb27 100755
--- a/common_src/lib/liblynq-sms/makefile
+++ b/common_src/lib/liblynq-sms/makefile
@@ -12,7 +12,9 @@
                 -DECALL_SUPPORT \
                 -fpermissive \
 
-
+ifeq ($(strip $(MOBILETEK_RIL_CFG)), GSW)
+    LOCAL_CFLAGS += -DGSW_RIL_CFG
+endif
 
 $(warning ################# lynq data demo ROOT: $(ROOT),includedir:$(includedir))
 LOCAL_PATH   = .