Dear visitor, welcome to Coder Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.
|
|
C/C++ Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
#include <windows.h> #include <stdio.h> #include <mmsystem.h> #include <cstdlib> #include <iostream> #include "Serial.h" using namespace std; CSerial COMPort; int main(int argc, char *argv[]) { COMPort.Open(5,19200); std::string str ("Hallo! Hoffe ihr koennt mir helfen!"); COMPort.SendData (str.c_str(), str.length()+1); printf("%s",str.c_str()); getchar(); COMPort.Close(); return EXIT_SUCCESS; } |
|
|
C/C++ Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
#include <windows.h> #include <stdio.h> #include <mmsystem.h> #include <cstdlib> #include <iostream> #include "Serial.h" using namespace std; CSerial COMPort; int main(int argc, char *argv[]) { COMPort.Open(5,19200); if (COMPort.Open(5, 19200)) { char* lpBuffer = new char[500]; int nBytesRead = COMPort.ReadData(lpBuffer, 500); printf("%d",nBytesRead); getchar(); // delete []lpBuffer; } } |
|
|
Source code |
1 2 |
#include <stdio.h> #include <cstdlib> |
|
|
Source code |
1 2 |
#include <cstdio> #include <cstdlib> |
|
|
Source code |
1 2 |
#include <stdio.h> #include <stdlib.h> |
|
|
Source code |
1 |
printf("%s",str.c_str());
|
|
|
Source code |
1 |
std::cout << str << std::endl; |
|
|
Source code |
1 2 |
char* lpBuffer = new char[500]; // delete []lpBuffer; |
|
|
Source code |
1 2 |
char lpBuffer[500]; int nBytesRead = COMPort.ReadData(lpBuffer, 500); |
Quoted
da steht aber nix davon drin!
|
|
Source code |
1 2 3 4 5 6 7 8 9 |
int main(int argc, char** argv)
{
while ( ProgrammLäuft )
{
ergebnis = ComPort.Listen();
if ( ergebnis )
std::cout << ergebnis;
}
}
|
|
|
C/C++ Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
#include <windows.h> #include <cstdio> #include <mmsystem.h> #include <cstdlib> #include <iostream> #include "Serial.h" using namespace std; CSerial COMPort; int main(int argc, char *argv[]) { int c=0; COMPort.Open(5,19200); if (COMPort.Open(5,19200)) { while(c<=100) { char* lpBuffer = new char[500]; int nBytesRead = COMPort.ReadData(lpBuffer, 500); if(nBytesRead > 0) { printf("%d",nBytesRead); getchar(); delete []lpBuffer; } } } } |
|
|
Source code |
1 2 |
COMPort.Open(5,19200);
if (COMPort.Open(5,19200))
|
|
|
Source code |
1 2 |
bool bRetValue = COMPort.Open( 5, 19200 ); if ( bRetValue ) |
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 |
while(c<=100)
{
char* lpBuffer = new char[500];
int nBytesRead = COMPort.ReadData(lpBuffer, 500);
if(nBytesRead > 0)
{
printf("%d",nBytesRead);
getchar();
delete []lpBuffer;
}
|
|
|
Source code |
1 2 3 4 5 6 7 8 9 |
while(c<=100)
{
char lpBuffer[500];
int nBytesRead = COMPort.ReadData(lpBuffer, 500);
if(nBytesRead > 0)
{
std::cout << "Anzahl Bytes gelesen: " << nBytesRead << std::endl;
getchar();
}
|
|
|
Source code |
1 |
#include <mmsystem.h> |