Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Request not getting sent to Device.



Hi,

I tried to issue the open without the O_NONBLOCK, and
found that Open was not returning at all (waited for
almost > 10 min). Does that mean, that the program is
unable to open an interface with the device ?

Thanks,
Rafi SM

--- Steve Ehrenfried <email@hidden> wrote:

> Are you sure that the "open" worked? I notice that
> you're calling it with the "O_NONBLOCK" flag which
> means open could return without actually opening the
> file. Have you tried running it in a debugger? It's
> nearly impossible to debug it without more info,
> unless it's pointing out obvious errors which
> somebody
> else has already done.
> 
> -Steve
> 
> --- mohamed rafi <email@hidden> wrote:
> 
> > 
> > I had tried that one too.... Still no difference
> :-(
> > 
> > Regards
> > Rafi
> > 
> > > strlen() returns the length of zero-terminated C
> > > strings. Perhaps sizeof()
> > > would work better.
> > > 
> > > Steve
> > > 
> > > > From: mohamed rafi <email@hidden>
> > > > Date: Wed, 16 Feb 2005 15:52:05 -0800 (PST)
> > > > To: <email@hidden>
> > > > Subject: Request not getting sent to Device.
> > > > 
> > > > Hi,
> > > > 
> > > > I have a Serial Device, which I have connected
> > to
> > > my
> > > > Mac through a Keyspan. I am trying to do Baud
> > > > Synchronisation of the device, before sending
> > > > commands/requests to it. I am using C to do
> the
> > > same.
> > > > 
> > > > Following is the piece of code I am using for
> > > that:
> > > > 
> > > > DEVICENAME = "/dev/tty.USA19H1b1P1.1"
> > > > fd = open(DEVICENAME, O_RDWR | O_NONBLOCK);
> > > > ..
> > > >  unsigned char baudArray[] =
> > > >
> {0x01,0x00,0x96,0x00,0x02,0x95,0x4d,0x54,0x19};
> > > > 
> > > > k = write(fd, baudArray, strlen(baudArray));
> > > > 
> > > > How do I ensure that it gets transmitted to
> the
> > > > device, and how can I get the output from the
> > > device
> > > > for this ?
> > > > 
> > > > Thanks,
> > > > Rafi SM
> > > 
> > > 
> > >  _______________________________________________
> > > Do not post admin requests to the list. They
> will
> > be
> > > ignored.
> > > Usb mailing list      (email@hidden)
> > > Help/Unsubscribe/Update your Subscription:
> > >
> >
>
http://lists.apple.com/mailman/options/usb/email@hidden
> > > 
> > > This email sent to email@hidden
> > > 
> > 
> > 
> > 		
> > __________________________________ 
> > Do you Yahoo!? 
> > Meet the all-new My Yahoo! - Try it today! 
> > http://my.yahoo.com 
> >  
> > 
> >  _______________________________________________
> > Do not post admin requests to the list. They will
> be
> > ignored.
> > Usb mailing list      (email@hidden)
> > Help/Unsubscribe/Update your Subscription:
> >
>
http://lists.apple.com/mailman/options/usb/email@hidden
> > 
> > This email sent to email@hidden
> > 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> http://mail.yahoo.com 
> 


		
__________________________________ 
Do you Yahoo!? 
Meet the all-new My Yahoo! - Try it today! 
http://my.yahoo.com 
 

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Usb mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/usb/email@hidden

This email sent to email@hidden

References: 
 >Re: Request not getting sent to Device. (From: Steve Ehrenfried <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.