[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] C og seriel port (USB)



On Tue, Jan 25, 2011 at 00:20:09 +0100, Henrik Pedersen wrote:
> Jeg går ud fra tcgetattr og tcsetattr erstatter ioctl uden problemer.
> Har prøvet at koble nogle af díne settings på uden den store succes.
> Når jeg forsøger at læse fra porten med 
> byteCount = read(fdPort, buffer, 255);
> returnere read -1, og errno er 11, når jeg så fører et tag over skifter 
> errno til 14.
> Jeg kan dælme ikke hitte ud af hvad der går galt.
På mine Linux maskiner er errno 11 = EAGAIN, og errno 14 = EFAULT.

EAGAIN får man almindeligvis hvis man har en non-blocking fildescriptor
som man vil læse mere data fra end der er tilgængeligt. Det kunne godt
matche med at der ikke er noget data tilgængeligt fra læseren før du har
kørt tagget forbi?

EFAULT får man hvis den pointer man giver til read er uden for det
tilladte addresseområde. Er buffer-variablen allokeret, og peger på
noget fornuftigt? Er der plads til 255 bytes i den?

-- 
Med venlig hilsen
	Klaus S. Madsen


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2011-02-01, 02:01 CET [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *