Hi, 

I haven’t tried building for macOS, but I have managed to build and run IoTivity 1.3-rel branch on iOS. In order to build it I had to make a few modifications to the build system. I then manually added the generated .a files and relevant headers to my project.

I’ve attached a patch with the changes to this email and will submit the changes to the Gerrit review system. Additionally, I'll be happy to update the Wiki. My time is a little limited this week since I’m attended the OCF Plugfest.

One major issue that I encountered is that IoTivity would crash when the App is backgrounded and then returns to the foreground. This seems to be related to IoTivity assuming that the sockets it opens remain valid. However, iOS aggressively closes sockets soon after an App is backgrounded. The work-around that I implemented is to stop the IoTivity stack when the OS notifies that the App is being background and re-starting it when it is foregrounded.

After applying the patch, you should be able to build for 64-bit devices using the following command:

scons TARGET_OS=ios TARGET_ARCH=arm64 RELEASE=false SECURED=1

For 64 bit simulator builds replace arm64 with x86_64. For 32 bit device builds (e.g. for iPhone 5) replace arm64 with armv7.

I also have a very basic script put together by one of my colleagues that joins the various targets into combined .a files which I will be happy to share.

In the long term I’d ideally like to see the build system supporting bit-code and outputting a framework that can simply be dropped into people’s Xcode project.

Best regards,
Jonny

Attachment: ios-build-patch.diff
Description: Binary data



On Dec 4, 2017, at 4:23 PM, Mats Wichmann <[email protected]> wrote:

On 12/04/2017 03:18 PM, Gregg Reynolds wrote:
Last time I looked iotivity did not support nw monitoring for if address
changes for Mac. This is 1.3.x code.

I'm looking into adding such support.  Anybody wanna help?

afaik on the Mac you must use the System Config framework. Ok. Not terribly
hard. But it exposes a flaw in iotivity implementation, which conflates
monitoring the nw for data vs. change events. I think those are distinct
tasks and should not be glommed into CASelect etc. You can use select on
Linux to detect nw events via netlink sockets, but that won't do on a mac,
not to mention windows. So in short I think the code needs to be refactored.

Anybody else out there interested in macOS/iOS support?

There's already some factoring into target-specific code (linux,
android, tizen) in the only place I think this is used - the ip_adapter
chunk.   If it's still OS-dependent in an incorrect way, I can't see why
there would be an objection to fixing it.

As to "interested in"... there actually hasn't been enough interest, and
there's still no Mac/iOS maintainer, so the automated build instance got
dropped (for cost reasons, as I heard it).  It doesn't seem to be high
on most people's list...  there seem to be 3-4 people on the list who do
care at least a bit.

_______________________________________________
iotivity-dev mailing list
[email protected]
https://lists.iotivity.org/mailman/listinfo/iotivity-dev

_______________________________________________
iotivity-dev mailing list
[email protected]
https://lists.iotivity.org/mailman/listinfo/iotivity-dev

Reply via email to