Error codes OpenDevice()

3 posts / 0 new
Last post
OldFart
OldFart's picture
Offline
Last seen: 3 months 3 weeks ago
Joined: 2010-11-30 14:09
Error codes OpenDevice()

Hi,

Does there excist a list of errorcodes (and their meaning of course) as returned by OpenDevice()?

I know that 0 means OK, but what about 32, 44 and 255 (or -1)?

Thank you,
OldFart

jabirulo
jabirulo's picture
Offline
Last seen: 1 month 2 days ago
Joined: 2013-05-30 00:53
Re: Error codes OpenDevice()

maybe looking in printer.h or serial.h or... whatever your're opening can help with errors.

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

msteed
msteed's picture
Offline
Last seen: 4 months 1 week ago
Joined: 2022-01-18 08:34
Re: Error codes OpenDevice()

exec/errors.h has a small list of "Standard Device IO Errors (returned in io_Error)":

enum enDeviceIOErrors { IOERR_SUCCESS = ( 0), /* no error */ IOERR_OPENFAIL = (-1), /* device/unit failed to open */ IOERR_ABORTED = (-2), /* request terminated early [after AbortIO()] */ IOERR_NOCMD = (-3), /* command not supported by device */ IOERR_BADLENGTH = (-4), /* not a valid length (usually IO_LENGTH) */ IOERR_BADADDRESS = (-5), /* invalid address (misaligned or bad range) */ IOERR_UNITBUSY = (-6), /* device opens ok, but requested unit is busy */ IOERR_SELFTEST = (-7) /* hardware failed self-test */ };

As you might guess, -1 is a generic failure. There's nothing like 32, 44, or 255, so those are probably specific to that particular device.

Log in or register to post comments