detection of failing nodes in the WSN using cooja - contiki

I want to create a project on contiki cooja for the detection of failing nodes in WSN which files I must use to create it.

You may implement your logic in udp-client.c and udp-server.c files of rpl-udp project under contiki/examples/. You just need to include desired header files and use them.

Related

Is there a way to add native rules to Bazel?

I would like a set of rules from my_package.bzl to be accessible to all BUILD files of a workspace without having to load my_package.bzl in the BUILD files. Basically I want the rules in the package to look like native rules. How can I achieve this?
I was thinking maybe there's a line I could add to one of the .bazelrcs or to the WORKSPACE file of the the project.
This can be achieved by adding a prelude_bazel file at //tools/build_rules:prelude_bazel (this must be a package, so tools/build_rules must contain a BUILD file).
This will be loaded and prepended to all BUILD files loaded by Bazel.
However, there are a few things to consider before going this route. It's currently undocumented, and while doing some searching to find any info on this feature, it's unclear if it will remain a part of Bazel.
It may also have performance / scaling problems. If the prelude were to change (or any of its dependencies), every BUILD file would have to be reloaded, and this may take some time depending on the size of the build graph.

Xcode: Run tests twice with different options

I wrote my own ORM framework (something along the lines of CoreData or Realm), and also wrote quite a few tests in Xcode for it.
Now I want to introduce an additional encoding format used for storing data on disk, but I also want to keep supporting the original encoding format.
Is there a good strategy to run my all my existing -test* methods for both encoding formats without duplicating the existing test code?
The easiest way I have found is to just create a new test target and add all the same test classes to it. If you want them run in one go, create a target that has both of these test targets as dependencies (or just runs them manually).
How you parametrize for your different targets is up to you, we've successfully used two implementations of a category that has the definition that varies.

How can I tailer GPUImage2 to use only a few filters?

I want to use only a few filters within GPUImage2 in my swift project, how can I tailor GPUImage2 to only a few filters that I need?
I am not familiar with the code base, and I don't see any documentation on this.
P.S. My concern is mostly about app size, if including everything doesn't bloat the app size, I am OK with importing GPUImage as a whole.
This is a common question for people who want to shrink their binary size by only bringing over the operations they need, so I'll see if I can provide a canonical reference.
The easiest way to do this is to remove the dependency on GPUImage from your project and instead manually copy into your project just the files necessary to build the core components of the framework. The platform-independent core files are these:
CameraConversion.swift
SerialDispatch.swift
BasicOperation.swift
Color.swift
FillMode.swift
Matrix.swift
OpenGLContext_Shared.swift
Timestamp.swift
OpenGLRendering.swift
ShaderProgram.swift
ShaderUniformSettings.swift
Framebuffer.swift
FramebufferCache.swift
Position.swift
Size.swift
Pipeline.swift
ImageOrientation.swift
The following files also need to come over, but they have platform-specific (Mac, iOS, or Linux) variants, so you'll either need to choose the ones for your specific platform target or selectively include them to each of your various targets:
PictureInput.swift
PictureOutput.swift
MovieInput.swift
MovieOutput.swift
Camera.swift
OpenGLContext.swift
RenderView.swift
With those files, you should be able to build a project that can perform image processing in the same manner as GPUImage, but without the long list of operations. If you have one or two operations you want to bring over, you can selectively copy those files into your project. You might need to copy over one or two dependencies if they are subclassed from another operation.

Create Framework / Library / Module of Swift Objects in Xcode

I am a (very) novice iOS/Swift programmer with a basic question about moving reusable software objects to their own ... something.
I am developing three iPhone apps that present information from three distinct data sets. Those data sets contain unique information but are structurally similar. As such, the apps share some Swift classes that are identical, specifically the classes that model the data. As I continually refactor the code, I find that when I tweak a class in one app's project, I have to remember to go to the other two projects and make the same tweaks to the same classes for those apps. It's getting to be a big headache.
What I would like to do is have one class definition in its own ... something that I can share, link, import, or attach to/from each app's project. From my online research, I suspect that the ... something is a library? or maybe it's a framework? or a module? I have found all three terms are used, but I am not sure how they relate to each other.
Given that all of the software I am writing is in Swift, does Xcode support what I am trying to do? Thank you!
It seems you have the issue of needing the same Swift class in multiple projects. You could build a Framework (aka Module) for this class then copy it in to each project. This is probably the formally correct approach but it is a bit of overkill for just a single class.
Instead, you could just make the file in the Navigator panel a reference in each project to the one actual file.
You could also make a Workspace and then put each project into the workspace and just have the file at the top level (but this may introduce some build complexity).

Create similar iOS apps reusing almost everything (with Xcode)

I want to make multiple apps which share the same structure and code, but have different images, fonts, names and urls.
I would like a simple way to make this apps without replicating the whole project, so that when I find a bug I'll have to correct it only once.
Thank you.
PS: It isn't important the language (Objective-C or Swift)
Create multiple targets within the same project. You can then include or exclude asset catalogues, configuration JSON files etc. on a per-target basis. If you're consistent with the names this should get you most of the way there. You can also look at target-specific build flags or constants.

Resources