How to interface with obd ii elm327? - iphone

Do I have to purchase this in order to get all the PIDs and the full instruction set for communicating with the car's obd ii interface via an ELM327? I tried looking for some kind of api for the ELM327 connector, but couldn't find any documentation besides the actual chip's schematics.
The standards linked above seem to provide the instruction set for all current obd2 protocols, can anyone confirm this?

I've been trying to mess with it a bit, but I need a device to test on and I don't have one right now.
Here's a github repo that has an ELM327 library on it
https://github.com/FuzzyLuke/OBD2Kit
And here's the OBD2 codes: http://en.wikipedia.org/wiki/Table_of_OBD-II_Codes
Let me know if you have any luck getting it to work.
Cheers!

There's a high chance if you Google on the name of the file, you find the document.
The wikipedia version is very much complete for the OBD-II standard.
Here are the AT (ELM specific commands, for the ELM327 chip):
http://elmelectronics.com/ELM327/AT_Commands.pdf

Related

Internet connection change in Unity

Is there an event sent by Unity that notifies about internet connection changes?
Android has a BroadcastReceiver for that as detailed in this link.
In Unity I only found examples of manual connectivity tests, but I'm looking for something similar to Android.
As far as I'm aware, it is possible. I found a thread here on Unity answers.
I know this is old, most of the suggested solutions online are not really reliable nor correct. Pinging google is not allowed (By google itself) and Unity's Application.internetReachability does not always work as it was not designed for that puprose (as stated in the docs).
The proper way is to implement a technique called Captive Portal Detection, which is what all the major OS's use for their internet status detection. If implemented correctly, it can even detect when the network is restricted (hotels or airports) as it relies on HTTP requests of known content. Therefore it is far more reliable.
It is not that hard to implement. You need to make an HTTP request to a known "check page", and check whether the right content were returned.
However, if you want a complete, ready-to-use solution, you can check the asset Eazy NetChecker which I created for this purpose. It also has events and a custom editor. It is not free, but it is super cheap!

SMB/samba support on iOS?

I check iOS document and also google it for a while and get the impression that iOS does not support samba (although there is a samba app for jailbreak iPhone).
But then how do the app FileBrowser achieves that? Does that mean they implemented samba support by their own ?
I also find there is an open source library called tango that provides limited support for samba. So my question is that the best samba support I can get ?
I spent quite some time in implementing my own SMB client so I would like to share some experience here.
First do not use tango in your production code because once you become familiar with SMB you will realize that its implementation is problematic, e.g. it does not support unicode and in some several cases it is not correctly padding so you can't access the folder. And I also heard people said they can't connect window 7 with it.
Second, to summarize my experience I find jcifs guys had said the best: "anyone who wants to implement the CIFS needs to know one very important thing - the "official" CIFS documentation is not accurate
and does not reflect reality. There is NO specification. Do not believe anything you read in the IETF draft or the SNIA document (same document different formatting). Use it only as a hint. The definitive reference is whatever you see on the wire.
WireShark Rules!
... look at JCIFS for design inspiration such as how it puts the request and response into a map by MID and encodes and decodes frames.
Then implement the following commands:
SMB_COM_NEGOTIATE
SMB_COM_SESSION_SETUP_ANDX
SMB_COM_TREE_CONNECT_ANDX
SMB_COM_NT_CREATE_ANDX
SMB_COM_READ_ANDX
SMB_COM_WRITE_ANDX
SMB_COM_CLOSE
all responses for above
"
The only thing I can add is that , you also need to implement TRANS2_FIND_FIRST2 request/response to query the files inside a folder and if you want to find out how many shared folders the server exposes you need to implement NetShareEnum Request/Response.
I used libsmbclient from samba package (http://www.samba.org) for SMB operations on iOS.
You can look on my project https://github.com/kolyvan/kxsmb (objective-c wrapper on libsmbclient). For now it supports a limited set of SMB operations. It mostly was designed for browsing local net and retrieving files from SMB shares.
iOS doesn't give you access to a filesystem that you may be used to. You can read and write files inside your own App's private area, but that's all. You could potentially implement another file system in your application, but you won't be able to use normal file operations.
I'd bet FileBrowser implements the protocol inside their app and implements a file system like layer on top of that for access. I'd guess you could either try to port an existing samba library or roll your own.
iOS does not have any APIs to work with SMB. However, SMB is currently documented by Microsoft and implementing it is not impossible (although not easy too). I've created a freeware project which contains most of what you need to handle SMB. See
https://sourceforge.net/projects/smb4ios/

How can I restrict any developer from using my created static library?

I have created one static library in iPhone sdk, and I am worried that If I provide code to anyone in which static library is being used, then anyone can use static library. So Is there any way to restrict them by using library until they get license? I am new to licensing any library.
This is a problem you must solve by legal means, not by any technical solution.
Make sure to only give the library to people you trust, and if needed have them sign an agreement not to spread it.
Also ask yourself if it is worth the trouble. Is your code so unique that they can not find it elsewhere, or duplicate it themselves in a few days, using Google and stackoverflow alone?
As said by #PeyloW,
This is a problem you must solve by legal
means, not by any technical solution.
But there are some simple ways to "block the code": You can create a RAR or ZIP archive, encrypted with password, and after they get license, you can tell them the password.
If you want to "Bind" license to a "developer's computer", than you simply need something that you can bind. For example that can be the emulator's UDID.
you can generate a license for emulator's UDID, and only limit emulator development, while allowing unrestricted access for ARM code (on device)
so you can basically check for emulator UDID
check license file
if license file allows that UDID, run
if not then show a message etc
for development purposes, everybody needs emulator, so I guess limiting it is enough for you.
Personally, I would create a new static library, check your code coverage and copy in only the code used by the app consuming it. Or in other words, don't give away more than you need to.
Then, as someone mentioned in the comments, obfuscate the calls. Your library is going to be worthless without documentation if your calls have to be deciphered. Odds are that anyone that has the aptitude of deciphering what your calls mean probably has 80% of a white-room reverse-engineering of your code already done.
You can't really force a license upon your client at the final hour unless they agree to it. So even if you did try to force them to license your library, it might not even be valid to do so with the original agreement intact. I'd do damage control to the extent your time is worth and chalk this up as a learning experience. 5 months from now, you'll probably have that static library re-factored to something better anyway. And next time, you'll work that into your agreement.
If you provide the static library, no one can get back the code.
Do you have reservations in others using your static library also?

How to get user's current cellular provider?

Is it possible to get information about user's current mobile provider(not home carrier) - for example when he is using roaming?
I don't think so using public APIs at least. It seems too cut off from the rest of iOS to access. That being said, I haven't seen any documentation that confirms it one way or the other. The problem is that I don't know where to look for said information. That's your problem too :). Sorry I can't back it up with any tangible evidence, but it seems too separate based on my gut feeling.

Are there any open source cross platform NAT punch throughs?

Are there any open source cross platform NAT punch throughs?
I haven't seen one, but you'll find more information than you require here:
http://www.enchantedage.com/node/8
It's not terribly hard to implement, just a bit of work.
There is code on the page that demonstrates this that builds on unix and windows, including both the server portion (the introducer) and the client portions. It doesn't list a license, but the author indicates in the readme that the technique is free, and re-implementing it from the information on the page and the source code example appears to be relatively easy.
The author appears to be the owner of the website enchantedage, so you can probably contact them directly for more information.
The best I've seen is UDT, which is a reliable UDP library that also includes a "rendezvous" connect mode that helps take care of the NAT punching. All you have to do is figure out the external IP address and port and somehow get it to the other client (and vice versa). Once you know that information, you both connect and bind at the same time (with rendezvous mode set) and it'll do its best to figure out the rest.
I haven't got an answer here I'm afraid, but I do know that a couple of years ago there was some research done in area that ended up spawning some IETF documents. The curious reader might already be familiar with these:
https://datatracker.ietf.org/doc/html/draft-ietf-behave-rfc3489bis-18
https://datatracker.ietf.org/doc/html/draft-ietf-behave-turn-13
possibly https://datatracker.ietf.org/doc/html/draft-ietf-mmusic-ice-19
(...your-link-here: some research that I probably have missed)