Click here to Skip to main content
14,027,446 members

C / C++ / MFC

 
GeneralRe: What are the best mocking frameworks available on Linux? Pin
Hila Berger14-May-18 20:38
memberHila Berger14-May-18 20:38 
QuestionInvalid operands to binary expression Pin
Member 1380291228-Apr-18 7:03
memberMember 1380291228-Apr-18 7:03 
AnswerRe: Invalid operands to binary expression Pin
Richard MacCutchan28-Apr-18 22:18
protectorRichard MacCutchan28-Apr-18 22:18 
GeneralRe: Invalid operands to binary expression Pin
Member 1380291229-Apr-18 10:21
memberMember 1380291229-Apr-18 10:21 
GeneralRe: Invalid operands to binary expression Pin
Richard MacCutchan29-Apr-18 21:02
protectorRichard MacCutchan29-Apr-18 21:02 
QuestionData packet was cut when sending from Arduino Uno to Raspberry Pi 3 in C++ Pin
Ahmad ZULKIPLEE24-Apr-18 23:26
memberAhmad ZULKIPLEE24-Apr-18 23:26 
AnswerRe: Data packet was cut when sending from Arduino Uno to Raspberry Pi 3 in C++ Pin
Jochen Arndt25-Apr-18 0:17
mveJochen Arndt25-Apr-18 0:17 
GeneralRe: Data packet was cut when sending from Arduino Uno to Raspberry Pi 3 in C++ Pin
Ahmad ZULKIPLEE25-Apr-18 2:15
memberAhmad ZULKIPLEE25-Apr-18 2:15 
Jochen Arndt wrote:
That makes parsing much simpler (e.g. using scanf()) and you can wait for the known number of characters (11 + line feed):
const int CMD_LENGTH = 12; // Or whatever applies
while(n < CMD_LENGTH && i < 1000000);
By the way: what is the purpose of the undefined variable i here?


I don't really understand what you are doing here? Can you please explain it a bit more and detailed? And where do i need to put this code, is it after I received the data from Arduino (after printf to see how many data in the string?). By the way, i just started coding two months ago. I'm sorry if I asked a lot of questions.

do{
            n = RS232_PollComport(cport_nr, (unsigned char *) str_recv, (int)BUF_SIZE);
            i++;
          }while(n <= 0 && i < 1000000);

            if(n > 0){
              str_recv[n] = 0;
              printf("Received %i bytes: '%s'\n", n, str_recv);



Jochen Arndt wrote:
But when doing so you will run more into the already existing performance problem of using a polling loop. Waiting for the data wastes a lot of time (10 ms) that is not available for other tasks.

The solution is to put the receiving into an own thread and use the fine Qt signaling features. Because there are only two event data values, there is even no need to use shared variables.


Like you said, I would prefer to not use polling because the program needs to be really dynamic(10 ms).

When you said "put the receiving into an own thread", do you mean put the received data in another string?

I don't really know about the Qt signaling features. I just took a hold in this project two months ago and just started doing Qt 2 weeks ago. Would you give me a link that would help me to understand the features and why and how to use them?

Tqvm
GeneralRe: Data packet was cut when sending from Arduino Uno to Raspberry Pi 3 in C++ Pin
Jochen Arndt25-Apr-18 3:06
mveJochen Arndt25-Apr-18 3:06 
AnswerRe: Data packet was cut when sending from Arduino Uno to Raspberry Pi 3 in C++ Pin
Richard MacCutchan25-Apr-18 0:19
protectorRichard MacCutchan25-Apr-18 0:19 
AnswerRe: Data packet was cut when sending from Arduino Uno to Raspberry Pi 3 in C++ Pin
leon de boer25-Apr-18 15:05
memberleon de boer25-Apr-18 15:05 
QuestionFrom framebuffer to SPI via ioctl in Linux Pin
Vaclav_23-Apr-18 3:16
memberVaclav_23-Apr-18 3:16 
AnswerRe: From framebuffer to SPI via ioctl in Linux Pin
Jochen Arndt23-Apr-18 3:59
mveJochen Arndt23-Apr-18 3:59 
GeneralRe: From framebuffer to SPI via ioctl in Linux Pin
Vaclav_23-Apr-18 4:17
memberVaclav_23-Apr-18 4:17 
GeneralRe: From framebuffer to SPI via ioctl in Linux Pin
Jochen Arndt23-Apr-18 4:24
mveJochen Arndt23-Apr-18 4:24 
GeneralRe: From framebuffer to SPI via ioctl in Linux Pin
Vaclav_23-Apr-18 8:08
memberVaclav_23-Apr-18 8:08 
GeneralRe: From framebuffer to SPI via ioctl in Linux Pin
Jochen Arndt23-Apr-18 10:28
mveJochen Arndt23-Apr-18 10:28 
GeneralRe: From framebuffer to SPI via ioctl in Linux Pin
Vaclav_23-Apr-18 13:39
memberVaclav_23-Apr-18 13:39 
GeneralRe: From framebuffer to SPI via ioctl in Linux Pin
Jochen Arndt23-Apr-18 21:21
mveJochen Arndt23-Apr-18 21:21 
GeneralRe: From framebuffer to SPI via ioctl in Linux Pin
Vaclav_24-Apr-18 12:16
memberVaclav_24-Apr-18 12:16 
GeneralRe: From framebuffer to SPI via ioctl in Linux Pin
Jochen Arndt24-Apr-18 21:07
mveJochen Arndt24-Apr-18 21:07 
GeneralRe: From framebuffer to SPI via ioctl in Linux Pin
Vaclav_25-Apr-18 3:36
memberVaclav_25-Apr-18 3:36 
GeneralRe: From framebuffer to SPI via ioctl in Linux Pin
Jochen Arndt25-Apr-18 4:20
mveJochen Arndt25-Apr-18 4:20 
GeneralRe: From framebuffer to SPI via ioctl in Linux Pin
Vaclav_25-Apr-18 9:11
memberVaclav_25-Apr-18 9:11 
GeneralRe: From framebuffer to SPI via ioctl in Linux Pin
Vaclav_25-Apr-18 9:11
memberVaclav_25-Apr-18 9:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Cookies | Terms of Service
Web04 | 2.8.190419.4 | Last Updated 20 Apr 2019
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid