Showing posts with label Windows Programming. Show all posts
Showing posts with label Windows Programming. Show all posts

Tuesday, August 9, 2011

Using Scp under windows.

[1] WinScp
[2] scp that come with putty, which is not working with DropBear SSH server.

Tuesday, July 20, 2010

FW: Six Popular IDEs For Developing Software in C/C++ on Windows Platform

http://beans.seartipy.com/2006/12/31/six-popular-ides-for-developing-software-in-cc-on-windows-platform/


Six Popular IDEs For Developing Software in C/C++ on Windows Platform

Tuesday, October 20, 2009

Convert binary file to ASCII file

/************************************************/
/* Convert binary file to ASCII file */
/************************************************/


#include < D:/VC6Green/VC98/Include/math.h>
#include < D:/VC6Green/VC98/Include/stdio.h>
#include < D:/VC6Green/VC98/Include/string.h>



void __ConvertBinFile_To_ASCIIFile(void *ptrInRd, void *ptrOutWr)
{
unsigned char lcByteIn,i;
FILE *ptrRd,*ptrWr;

ptrRd=(FILE *)(ptrInRd);
ptrWr=(FILE *)(ptrOutWr);


i=0;

fprintf(ptrWr, " ");

while (1)
{
lcByteIn = fgetc(ptrRd);
if(feof(ptrRd)!=0)
break;
printf("%02X ",lcByteIn); /* O/P the character to the screen */
fprintf(ptrWr, "%02X ",lcByteIn);
i++;
if (i==16)
{
printf("\n");
fprintf(ptrWr, "\n ");
i=0;
}
}

fclose(ptrRd); /* Close the file. */
fclose(ptrWr); /* Close the file. */

printf("\n");
printf("////////////Done Bin To ASCII conversion //////////// \n");

}




main()
{
FILE *fileRdPtr, *fileWrtPtr;

/* Open Binary file for output. */
fileWrtPtr = fopen("Result.txt","w");
fileRdPtr = fopen("BinaryFile2Convert.bin", "rb");

if(fileRdPtr==NULL)
{
printf("Could not find input binary file: BinaryFile2Convert.bin \n");
return 0;
}

printf("Pls make sure binary input file is using file name: 'BinaryFile2Convert.bin'. Output file is: 'Result.txt'\n");


__ConvertBinFile_To_ASCIIFile(fileRdPtr,fileWrtPtr);

return 0;


}

Thursday, November 20, 2008

UART-Access-in-Windowns (General)

To use the serial port in Win32 you can use the CreateFile (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/createfile.asp) function to setup a handle to the hardware. Specify the port name in place of the file name (e.g. "COM1"). Then you need to use the DCB (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devio/base/dcb_str.asp) struct. The DCB struct has members for setting up the baud rate, flow control, parity....etc. Set all of the parameters you want in the DCB struct, or have dialogs that let the user select the ones they want, and then use the SetCommState (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devio/base/setcommstate.asp) function to configure the port with the parameters in the DCb struct. You will also need to set the timeouts for the port with the SetCommTimeouts (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devio/base/setcommtimeouts.asp). Also you'll need to set buffer sizes with the SetupComm (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devio/base/setupcomm.asp) function.

Once the port is opened (briefly outlined above) use the ReadFile and WriteFile functions to read and write from and to the port. To switch individual lines on the port (RTS, DTR..etc) use EscapeCommFunction (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devio/base/escapecommfunction.asp).

That is just a quick overview but the links provided should get you started.

TDM