From: Jason Green To: "Mr Big" Cc: djgpp AT delorie DOT com Subject: Re: hex bytes thru BCSerio Date: Wed, 01 Aug 2001 11:38:10 +0100 Message-ID: References: In-Reply-To: X-Mailer: Forte Agent 1.7/32.534 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id GAA29444 Reply-To: djgpp AT delorie DOT com [cc'd back to djgpp AT delorie DOT com] On Tue, 31 Jul 2001 13:37:46 +0000, you wrote: > >I haven't used the BCSerio library myself, but it sounds like you are > >looking for unsigned char. That gives you the range 0x00-0xff and is, > >generally speaking, what you want for serial comms. > hum. so you're saying instead of sending > a char as in the ascii characters i normally think of, > i can probably do something like this: > > unsigned char uc; > uc = 0xf3 > serial_putchar(uc); That's what I'm saying, yes. But also check what serial_putchar() takes as a parameter. If it's an unsigned char then use unsigned char, if it's an int then use int. ;) There are clear rules about signed/unsigned conversions, which I never can (be bothered to) remember. When dealing with bit patterns though, (0xf3 is an example of that) then usually an unsigned type is best.