Basically, I have a program that captures data from the serial port of the computer and saves it as a binary file whose output if opened in notepad is something like this:
ÿbýýýbýýýbýýýbýýýbýýýbýýýbýýý"ýýýbýýý"ýýý"ýýý"ýýý"ýýý"ýýý"ýýý"ýýý"ýýý"ýýý"ýýý"ýýý"ýýý"ýýý"ýýý"ýýý"ýýý"ýýý"ýýý"ýýý"ýýý"ýýý"ýýý"ýýý"ýýý"ýýý"ýýý"ýýýbýýýbýýýbýý....
Now, I want to be able to open this file and actually read the bits sequentially. there are important patterns that I need to determine for a project that I am working on. Now, I know that a binary file could be open as someone posted the code in these forums, which I've edited to my purposes as:
Now, the problem is that the data that I've just read and out put in the file output.txt is the exact same. I can't understand it. What I require is an output files either containing 0's and 1's or HEX representation. I need this and can't do it through a HEX converter/viewer etc. because I have to search for patterns and stuff like that. Any help will be highly appreciated. Thanks!
I didn't understand the issue here. Isn't each char comprised of 8 bits. So the array of chars that you have read already has the bits, all you need to do is to scan each char bit by bit.
Hello!
What I mean is that whatever data that I store in the char bindata, I want to be able to output in a text file as a character or integer sequence if one's and zero's