Salut a tous, j ai realise un programme permettant de changer, d incrementer ou de decrementer une variable "Volume"
J arrive a Convertir "Volume" en string, mais je n arrive pas a l envoyer via le port com, car ma fonction Writecom attend que l utilisateur tape quelquechose, moi j aimerais qu elle envoie directement "Volume" en string.
Code :
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <windows.h>
#include <commdlg.h>
#include <math.h>
#include <conio.h>
HANDLE g_hCOM = NULL;
DCB g_dcb =
{
sizeof(DCB), /* DCBlength */
9600, // BaudRate */
TRUE, /* fBinary */
FALSE, /* fParity */
FALSE, /* fOutxCtsFlow */
FALSE, /* fOutxDsrFlow */
DTR_CONTROL_ENABLE, /* fDtrControl */
FALSE, /* fDsrSensitivity */
FALSE, /* fTXContinueOnXoff */
FALSE, /* fOutX */
FALSE, /* fInX */
FALSE, /* fErrorChar */
FALSE, /* fNull */
RTS_CONTROL_ENABLE, /* fRtsControl */
FALSE, /* fAbortOnError */
0, /* fDummy2 */
0, /* wReserved */
0x100, /* XonLim */
0x100, /* XoffLim */
8, /* ByteSize */
NOPARITY, /* Parity */
ONESTOPBIT, /* StopBits */
0x11, /* XonChar */
0x13, /* XoffChar */
'?', /* ErrorChar */
0x1A, /* EofChar */
0x10 /* EvtChar */
};
BOOL OpenCom (int fd);
BOOL CloseCom ();
BOOL ReadCom (void* buffer, int nBytesToRead, int* pBytesRead);
BOOL WriteCom (void* buffer, int nBytesToWritten, int* pBytesWritten);