Click here to Skip to main content
15,922,145 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm working on a project that requires the use of smart card reader. The data on the smart card is encoded in type, length, and value format, in which the type defines the nature of the data, the length tells the length of the data, and the value is the data itself which in turn another encoded data.

Briefly, the smart card will contain an electricity meter instruction(s). When the card is placed on the meter the meter should reads the card content, finds the requests and executes them, and writes down the results of executing these requests. The structure of the data that will be written on the card will include what is so-called metadata in which there will be a piece of data, a pointer, indicates the start address where the responses exist.

I need to read that metadata, which is always written at the beginning of the card, until I reach the response pointer, then seek to that location to start the process of reading the responses, decoding them, extract the value part and stores them on a list ,and pass them to another decoder.

Honestly I do not know how to program that solution and I need advises.

What I have tried:

I am trying to read about Stream(s) and I/O. I already implemented the encode and decode algorithm for the type, length, and value format.
Posted
Updated 6-Mar-18 0:35am
Comments
CHill60 23-Feb-18 16:09pm    
My advice would be to contact the vendor of the device first
Amr Mohammad Rashad 23-Feb-18 16:25pm    
I already encoded the data and I wrote them on the card using the reader API but I do not know how to read them back what approach to use! I can read all the data but the approach of processing these data, read to get certain part, the response start address and seeking to this location etc. is what I do not know how to do it!
CHill60 23-Feb-18 16:42pm    
My advice still stands. If there is an API to write to the card then there is probably an API to read from it. The company who supply the card are best placed to tell you how to use that API

Consult the documentation on the API you're using. If you don't have any documentation, contact the vendor of the device for it or any supporting documentation on the API.

There is no generic "one method works with all devices" to do this.
 
Share this answer
 
I finished the work by creating a decode algorithm that accepts the file and process it and gives me back the information I need.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900