Click here to Skip to main content
15,889,281 members
Home / Discussions / C#
   

C#

 
AnswerRe: Please help me understand serial communication Pin
Luc Pattyn13-Feb-12 3:10
sitebuilderLuc Pattyn13-Feb-12 3:10 
GeneralRe: Please help me understand serial communication Pin
turbosupramk313-Feb-12 3:18
turbosupramk313-Feb-12 3:18 
AnswerRe: Please help me understand serial communication Pin
Luc Pattyn13-Feb-12 3:31
sitebuilderLuc Pattyn13-Feb-12 3:31 
GeneralRe: Please help me understand serial communication Pin
turbosupramk313-Feb-12 4:00
turbosupramk313-Feb-12 4:00 
AnswerRe: Please help me understand serial communication Pin
Luc Pattyn13-Feb-12 4:12
sitebuilderLuc Pattyn13-Feb-12 4:12 
GeneralRe: Please help me understand serial communication Pin
turbosupramk313-Feb-12 4:18
turbosupramk313-Feb-12 4:18 
GeneralRe: Please help me understand serial communication Pin
turbosupramk317-Feb-12 11:52
turbosupramk317-Feb-12 11:52 
AnswerRe: Please help me understand serial communication Pin
Luc Pattyn17-Feb-12 17:36
sitebuilderLuc Pattyn17-Feb-12 17:36 
turbosupramk3 wrote:
What do you think?

I did not study that in any detail, it does look horrible, and I'm flabbergasted. IIRC all data is textual, so I was expecting something that reads one line (hence a string) at once (using SerialPort.ReadLine), then validates it and extracts data. Yours is fiddling with bytes, on and on, in incomprehensible ways; and it is not even complete, where is the serial port access itself?

It would have helped if you had shown an expected string.
It would have helped if your identifiers were shorter, how often does one need to see "read" or "readline"?
It also would have helped if your method had a meaningful name (normally one verb + one noun), I can only guess what produceParseConsumeSerial() is supposed to do, and I can't begin to imagine why it needs to return a string array. A functional comment on top would have been nice.
And I don't like that many nested if statements; it is too hard to understand, and it ruins the layout.

I suggest you scrap all of it, and come up with simple, clean code.

Frown | :(
Luc Pattyn [My Articles] Nil Volentibus Arduum

GeneralRe: Please help me understand serial communication Pin
turbosupramk317-Feb-12 18:33
turbosupramk317-Feb-12 18:33 
AnswerRe: Please help me understand serial communication Pin
Dan Mos12-Feb-12 2:11
Dan Mos12-Feb-12 2:11 
GeneralRe: Please help me understand serial communication Pin
turbosupramk312-Feb-12 4:21
turbosupramk312-Feb-12 4:21 
GeneralRe: Please help me understand serial communication Pin
Dan Mos12-Feb-12 5:44
Dan Mos12-Feb-12 5:44 
AnswerRe: Please help me understand serial communication Pin
turbosupramk312-Feb-12 7:44
turbosupramk312-Feb-12 7:44 
Questioncom add in excel2010 Pin
PozzaVecia11-Feb-12 0:19
PozzaVecia11-Feb-12 0:19 
AnswerRe: com add in excel2010 Pin
Eddy Vluggen11-Feb-12 3:29
professionalEddy Vluggen11-Feb-12 3:29 
GeneralRe: com add in excel2010 Pin
PozzaVecia11-Feb-12 6:18
PozzaVecia11-Feb-12 6:18 
AnswerRe: com add in excel2010 Pin
Abhinav S11-Feb-12 5:08
Abhinav S11-Feb-12 5:08 
GeneralRe: com add in excel2010 Pin
PozzaVecia11-Feb-12 5:31
PozzaVecia11-Feb-12 5:31 
GeneralRe: com add in excel2010 Pin
Abhinav S11-Feb-12 17:04
Abhinav S11-Feb-12 17:04 
GeneralRe: com add in excel2010 Pin
PozzaVecia11-Feb-12 6:09
PozzaVecia11-Feb-12 6:09 
Questionocr from japenese to english using c# with MODI Pin
udayakumard10-Feb-12 23:21
udayakumard10-Feb-12 23:21 
AnswerRe: ocr from japenese to english using c# with MODI Pin
Dave Kreskowiak11-Feb-12 2:08
mveDave Kreskowiak11-Feb-12 2:08 
QuestionAccess is denied Pin
jon-8010-Feb-12 22:29
professionaljon-8010-Feb-12 22:29 
AnswerRe: Access is denied Pin
fjdiewornncalwe11-Feb-12 5:40
professionalfjdiewornncalwe11-Feb-12 5:40 
QuestionWriting to an excel file Pin
JFRobertson10-Feb-12 20:12
JFRobertson10-Feb-12 20:12 

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.