• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Writing a 0xFE to the serial port
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Yap?
  • Next by Date: Re: Yap?
  • Previous by thread: Re: Yap?
  • Index(es):
    • Date
    • Thread