Writing a 0xFE to the serial port
Writing a 0xFE to the serial port
- Subject: Writing a 0xFE to the serial port
- From: Chuck Rice <email@hidden>
- Date: Fri, 28 Feb 2003 21:41:26 -0800
This may be a really trivial question, but I am more of an assembler
programmer than a C programmer. The following code works, i.e., it
accomplishes sending the right string (a 0xFE) out to the serial
port, but I am unsure if it is the correct way to do it.
NSString * xFE;
char FE = 0xFE;
xFE = &FE; //Point the string at a Hex FE byte
numBytes = write(fileDescriptor, str, strlen(str)); //Write some
data to LCD
numBytes = write(fileDescriptor,xFE, 1); //Send
Command Escape byte
numBytes = write(fileDescriptor,"X", 1); //Send the
ClearScreen byte
Remedial lessons appreciated. -Chuck-
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.