Article View: borland.public.jbuilder.java.api
Article #355Re: work with hex...
From: Owen Green
Date: Fri, 03 Oct 2003 11:07
Date: Fri, 03 Oct 2003 11:07
24 lines
1609 bytes
1609 bytes
On Fri, 3 Oct 2003 01:42:49 -0400, Eliot wrote: > Hi...i need to sena and Hex data ..for example this "0x58 0x31 0x0D 0x0A" > but i dont know how define the variable and how to do to send this to the > serial port > can somebody tell me hoe to do that??? > if u can make an example i would be thank Any numeric primitive is 'hex', so I'm not sure what you mean here. You could simply do byte myByte = 0xFF; To send things to the serial port, you need to look at the JavaComm API http://java.sun.com/products/javacomm/ This uses OuputStreams for writing, which are geared around writing streams of bytes, which you can represent in hex. hth -- Owen
Technical Details
Message-ID:
<1vhhradl0le0h.5pnje1r9lsd6.dlg@40tude.net>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.news2me.com!newshosting.com!news-xfer1.atl.newshosting.com!newsfeed.wirehub.nl!news.kweb.on.ca!newsgroups.borland.com!not-for-mailReferences:
<3f7d0c10$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,cf36cd6df8a0e218 X-Google-Attributes: gid1089d0,public X-Google-ArrivalTime: 2003-10-03 04:32:03 PST From: Owen Green <o.t.green@ntlworld.com> Subject: Re: work with hex... Newsgroups: borland.public.jbuilder.java.api MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit References: <3f7d0c10$1@newsgroups.borland.com> Date: Fri, 3 Oct 2003 12:07:40 +0100 Message-ID: <1vhhradl0le0h.5pnje1r9lsd6.dlg@40tude.net> User-Agent: 40tude_Dialog/2.0.5.1 NNTP-Posting-Host: 80.1.205.234 X-Trace: newsgroups.borland.com 1065179550 80.1.205.234 (3 Oct 2003 04:12:30 -0700) Lines: 24 Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.news2me.com!newshosting.com!news-xfer1.atl.newshosting.com!newsfeed.wirehub.nl!news.kweb.on.ca!newsgroups.borland.com!not-for-mail