Saturday, July 23, 2016

A tryst with UDS Pt 1

UDS stands for Unified Diagnostic Standard. It's a diagnostic standard used for Vehicle diagnostic and is part of both Autosar architecture and OBD(OnBoard Diagnostics).
According to 7-layer ISO OSI networking stack, UDS application and transport layer is defined in ISO 14229 and 15765 documents. Integrating UDS in a firmware means you develop UDS transport and application layers over base transport layer like CAN/LIN/ FlexRay etc.
The first part of all this is understanding UDS layers. Lets assume underlying transport is CAN bus. In UDS transport layer over CAN, ISO 15765 standard defines the CAN frame timing and structure. In ISO 14229, UDS application layer over CAN, the UDS services are defined. These are 30+ services that operate on request-response basis. The services are defined by a 1-byte identifier like 0x22 ReadIdentifierByID or 0x2E WriteIdentifierByID.
A tyical UDS transaction looks like a request with service ID and respected data. To this request UDS server responds with response ID and response data.
There are couple of specific terms in use here. One is Tester or Diagnostic Tester. This is the UDS client. The UDS server component is integrated into the vehicle firmware. Lets call it the UDS Server.
A typical UDS transaction on CAN looks like:
Request: 03 22 F1 95
Response: 07 62 F1 95 04 03 02 01

Here this response is positive response. The four bytes after F1 95 is the response. First byte always contains the length of the UDS frame. For a positive frame the request service identifier is added 0x40 and sent in response.
This is basic of UDS. Lets take a deeper look in further posts.

Tuesday, July 19, 2016

VNC on android

Recently I wanted some task performed for an app which meant I had to type in quite a bit of data on my phone. Now using a real keyboard is always preferable. So I tried to share the screen of my android phone with my PC and tried performing some typing.
There are two ways for this: 1. USB Debugging connection 2. VNC
I tried to use USB Debugging first thinking it would give better (ala faster) experience. I even found couple of apps on play store. But was soon bogged down in details of supporting apps, rooting etc. So I discarded this approach for another day.
Next I tried a number of VNC servers. The problems is most VNC software in play store is VNC Clients. But finally I found Alpha VNC and this is a good vnc server. I started the program. It has a nice round button with Start as text. Tapping this started the VNC server and it showed the connection details. I have the mobile connected to my desktop via USB Tethering so they are on same network. Next I fired up Remmina on ubuntu and entered the VNC connection details(IP and port) and connected.
The connection was good, no stuttering etc with medium details. The problem was not with VNC but with android's heavy dependence on touch usage. I could use the keyboard quite proficiently but many touch gestures needed for navigation meant I had to reach to phone for app switch, notification access etc.
But it helped me quite a bit with the typing and I guess that's all I needed.
Quite an experience though.

Tuesday, July 12, 2016

Honor 5X experience

My wife needed a replacement for her aging xperia SP. It didn't have much internal storage and that caused her much pain. Since it was about three years old, I thought we should get a new one.
While checking out various phones I came across an exchange offer for Honor 5X and with exchange it was in our budget. So we got ₹1700/- off and got the phone for ₹11050/-.
It worked fine for three weeks and then the SD card slot died. Thankfully I had 30 days replacement and I ordered a replacement since it's otherwise a nice phone. Also couple lf my friends own Honor devices and they have had great experiences.
So the replacement is coming soon. Then maybe I'll do a thorough review for that.
Meanwhile my wife is using my old Are Blade C which has been my backup phone for last two years. It's battery gauge is shit, but otherwise it's a fine backup device.