2

I am trying to write an iOS application that connects to an OBD-II Interface over WiFi (specifically the OBDLink MX WiFi Scan Tool). I have written some basic socket code taken and I am able to open a socket to 192.168.0.10:35000. I receive the NSStreamEventOpenCompleted for both input and output streams.

The first event that fires shortly after is the NSStreamEventHasBytesAvailable. I attempt to read the stream, but the length comes back 0. My question is what is the flow of execution for communicating with these devices? I have tried to issue an ATZ\r command, but nothing is happening (no stream events are firing).

How do I know if if I am connected and the OBD-II interface is ready?

Clay
  • 635
  • 6
  • 19

2 Answers2

0

The usual command terminator is ˋ\r\nˋ, so first try sending ˋATZˋ with this command. Only send, after you have received the HasSpace notification from the ˋNSOutputStreamˋ.

DrMickeyLauer
  • 4,455
  • 3
  • 31
  • 67
0

Another alternative to communicate with this device would be this Car Diagnostics API, access to the API can be found on

https://github.com/HellaVentures/Car-Diagnostic-API

A.B
  • 1
  • _Links to external resources are encouraged, but please add context around the link so your fellow users will have some idea what it is and why it’s there. Always quote the most relevant part of an important link, in case the target site is unreachable or goes permanently offline._ – Bugs Jan 31 '17 at 11:03