Abhishek, I suggest you look at patch 1822. If you have a method of interface change notification in tizen, you should be able to copy android/caipnwmonitor.c into tizen/caipnwmonitor and replace the JNI notification with the tizen notification method. John
From: Abhishek Sharma [mailto:[email protected]] Sent: Friday, July 24, 2015 6:45 AM To: Light, John J Cc: Koushik Girijala; iotivity-dev at lists.iotivity.org Subject: Re: [dev] CAGetNetworkInformation() function does not work Hi John We are debugging this with the help of Tizen team, no break-through so far. >> Find a Tizen API that will provide notification when a network interface has >> changed state. Note ... is what was already happening in existing network monitors for Tizen. It didn't had any extra thread and was only registering with Tizen system service to get network change callbacks. >> (This is the solution used in the new Android caipnwmonitor.c JNI provides >> notification that a network interface has changed....) is exactly what existing android network monitor was doing. Can you summarize how new change will be different from existing implementations ? One more thing to check, have you verified your changes with frequent network addition and removal + multiple interface availability ? On Tizen we are blocked now as it is failing to start IP server because of NETLINK socket issue. Will verify other sending / receiving scenarios once this is resolved. Regards Abhishek Sharma ------- Original Message ------- Sender : Light, John J<john.j.light at intel.com<mailto:john.j.light at intel.com>> Date : Jul 23, 2015 21:11 (GMT+05:30) Title : Re: [dev] CAGetNetworkInformation() function does not work Koushik, Thiago answered in another message that the most likely cause of the looping is the absence of AF_NETLINK address family from Tizen, and I agree. It is unfortunate that Android and Tizen dropped this Linux capability, but there are ways to work around it. I propose two solutions for this issue: ? Find a Tizen API that will provide notification when a network interface has changed state. Note that the notification doesn?t need to say what interface has change (or even how it has changed.) This is the solution used in the new Android caipnwmonitor.c JNI provides notification that a network interface has changed, and the Android caipnwmonitor.c figures out by examining the interfaces which one changed. This solution is coded and pushed, but not yet tested, and I hope to have it merged next week. You can examine it in Change 1822. ? Resume polling to look for changes. This is an inferior solution, especially for constrained devices, including mobile. Polling keeps constrained devices from sleeping, which is how they conserve battery usage. Admittedly, there are some other polling loops in IoTivity, but we should all work hard to eliminate them. If polling is deemed necessary, I am including in Change 1822 the infrastructure needed to poll for network interface changes without using another thread. If it isn?t obvious to you, I can walk you through it. I am disappointed that I was unable to provide a solution for Tizen network monitoring with IP Adapter. After you determine which of the above solutions is applicable to Tizen, I will be glad to work with you to fill that gap. John Light Intel OTC OIC Development From: Koushik Girijala [mailto:[email protected]] Sent: Thursday, July 23, 2015 3:09 AM To: Light, John J; iotivity-dev at lists.iotivity.org<mailto:iotivity-dev at lists.iotivity.org> Subject: Re: RE: [dev] CAGetNetworkInformation() function does not work Hi John, Verified "ifgetaddrs()" function with tizen casample and found that it is not working properly . When ifgetaddrs api is called by CAIPGetInterfaceInformation , found it is looping inside the function netlink_recv() i.e recvmsg() is not working for tizen, because of which we are not able to get network information of device. Can you suggest any solution for this problem . Regards, Koushik ------- Original Message ------- Sender : Light, John J<john.j.light at intel.com<mailto:john.j.light at intel.com>> Date : Jul 20, 2015 21:31 (GMT+05:30) Title : RE: [dev] CAGetNetworkInformation() function does not work Koushik, I wrote what I believed would work on Tizen, but I was unable to verify it because I have no Tizen build environment and no Tizen build environment. Apparently there is a bug in my Network Information code for Tizen. I sincerely apologize for that. It was certainly not my intention. I?m sure there is a relatively simple fix for the Tizen code I provided. I hope you see that reintroducing all the complexity of the old NetworkMonitor (extra thread, polling loop, multiple mutexes, many mutex calls, etc.) is not necessary. I will be glad to work with you to find an acceptable solution. John Light Intel OTC OIC Development From: Koushik Girijala [mailto:[email protected]] Sent: Monday, July 20, 2015 7:38 AM To: Light, John J; iotivity-dev at lists.iotivity.org<mailto:iotivity-dev at lists.iotivity.org> Cc: hyuna jo Subject: Re: [dev] CAGetNetworkInformation() function does not work Hi John, I verified CA SAMPLE on Tizen, found that CAIPGetInterfaceInformation is blocking the flow. It seems like getifaddrs() api is not working for Tizen. As suggested by Abhishek Sharma, would have used network monitor for Tizen. Regards, Koushik ------- Original Message ------- Sender : hyuna jo<hyuna0213.jo at samsung.com<mailto:hyuna0213.jo at samsung.com>> S3/Assistant Engineer/IoT Solution Lab./Samsung Electronics Date : Jul 20, 2015 16:22 (GMT+05:30) Title : [dev] CAGetNetworkInformation() function does not work Hi, John Light I have taken the latest master code but I have some problems runnings the CA sample. I'm trying to use CAGetNetworkInformation() function to get local network information. but it looks like that it does not work well. I cannot get the ip address and port information from CAGetNetworkInformation function. currently, CAGetNetworkInformation function returns network interface name only. why did you change the code to return interface name instead of address and fixed the port number with 0? Without the ip address and port number information, ca sample can not be executed well on Linux/Tizen/Android/Arduino platform. Please help me to resolve this issues. Regards, Hyuna Jo [Image removed by sender.] [cid:image002.gif at 01D0C5E5.A8471DC0] [http://ext.samsung.net/mailcheck/SeenTimeChecker?do=0fa18573320d62115276e228f15177fc727158f0d66dffd60afd4d5ab3290520a0d230ab136794643256a73227592257c7b41e955949e5c8a728c55b39cc59eacf878f9a26ce15a0] -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20150724/fd416be0/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 823 bytes Desc: image001.jpg URL: <http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20150724/fd416be0/attachment.jpg> -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.gif Type: image/gif Size: 13168 bytes Desc: image002.gif URL: <http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20150724/fd416be0/attachment.gif>
