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.