#if !defined(__HR_ERRORS_H__)
#define __HR_ERRORS_H__
///////////////////////////////////////////////////////////////////////////////////////////////////
//
//  File:           HR_Errors.h
//
//                  Copyright 2005 Imaginant, Inc.
//
//  Source:         Original.
//
//  Description:    Enumeration and documentation of all error codes found in the library
//
//  Change History:
//          2005.02.09  Initial realease list set 
//
///////////////////////////////////////////////////////////////////////////////////////////////////
enum 
{
    /////////////////////////////////////////////////
    // General SDK Errors 0 to 999
    /////////////////////////////////////////////////
    HR_OK                         = 0, // Function call was successful
    HR_ERR_begin                  = 1, // Anything greater or equal to this is an error
    HR_ERR                        = 2, // Most generic error this is only for debug use

    HR_ERR_FEATURE_NOT_READY      = 100, // Planned feature is not yet implemented
    HR_ERR_MEM_ALLOC_FAILED       = 101, // Memory allocation failed.
    HR_ERR_INTERNAL_LOGIC         = 102, // Used internally only
    HR_ERR_INTERNAL_PTR_NULL      = 103, // Used internally only
    HR_ERR_INCALLBACK_PTR_NULL    = 104,
    HR_ERR_USERSDATA_PTR_NULL,


    /////////////////////////////////////////////////
    // Library Errors  (errors 1000 to 2999)
    /////////////////////////////////////////////////
    HR_ERR_LIB_begin              = 1000, // Librry error begin marker
    HR_ERR_LIB                    = 1001, // General error in the Library

    // Parameter argument Errors 
    HR_ERR_LIB_LIBRARY_NOT_OPEN   = 1002, // Library is not open, or has closed in error
    HR_ERR_LIB_OS_EXCEPTION       = 1003, // OS exception, probably memory access violation
    HR_ERR_LIB_MEM_ALLOC_FAILED   = 1004, // Ran out of memory to allocate
    HR_ERR_LIB_INHANDLE_ZERO      = 1005, // inHandle is not valid
    HR_ERR_LIB_INHANDLE_NOT_VALID = 1006, // inHandle is not valid
    HR_ERR_LIB_OUTINFO_NULL       = 1007, // outInfo pointer is NULL    
    HR_ERR_LIB_INBUFFERCOUNT_ZERO = 1008, // inBufferCount is zero
    HR_ERR_LIB_OUTAVAILCOUNT_NULL = 1009, // outAvailCount is NULL
    HR_ERR_LIB_OUTPVALUE_NULL     = 1010, // outpValue is NULL
    HR_ERR_LIB_INPVALUE_NULL      = 1011, // inpValue is NULL   
    HR_ERR_LIB_INTYPE_NOT_VALID   = 1012, // inType does not match ParamID
    HR_ERR_LIB_PARAM_READ_ONLY    = 1013, // Attempt to SetParam to a read-only param
    HR_ERR_LIB_INID_OUT_OF_RANGE  = 1014, // inID for a library parameter is out of the range of lib parameters
    HR_ERR_LIB_INID_NOT_VALID     = 1015, // inID for a library parameter is an invalid ID
    HR_ERR_LIB_INCOUNT_TOO_LOW    = 1016, // inCount is zero or otherwise too low
    HR_ERR_LIB_INCOUNT_TOO_HIGH   = 1017, // inCount is too high
    HR_ERR_LIB_VALUE_TOO_LOW      = 1018, // Param value is too low
    HR_ERR_LIB_VALUE_TOO_HIGH     = 1019, // Param value is too high
    HR_ERR_LIB_VALUE_NOT_VALID    = 1020, // Param value is not valid
    HR_ERR_LIB_INTERNAL_PTR_NULL  = 1021, // Internal pointer is NULL, please report this
    HR_ERR_LIB_INTERNAL_LOGIC     = 1022, // Internal logic err, please report this
    HR_ERR_LIB_OUT_EVENTS_NULL    = 1023, // outEvents is NULL    
    HR_ERR_LIB_POLL_EVENT_FLAG    = 1024, // inEventsFlags has one or more bad bits
    HR_ERR_LIB_INID_IS_FOR_CAM    = 1025, // inID is not valid, it is for the library
    HR_ERR_LIB_INID_IS_FOR_IMG    = 1026, // inID is not valid, it is for an image

    HR_ERR_LIB_OUTLIBHANDLE_NULL  = 1100, // outLibHandle is NULL
    HR_ERR_LIB_OUTIMGLIST_NULL    = 1101, // outImageList is NULL
    HR_ERR_LIB_OUTCAMERALIST_NULL = 1103, // outCamList is NULL
    HR_ERR_LIB_CAM_OS_EXCEPTION   = 1104, // OS exception in a Camera related call
    HR_ERR_LIB_IMG_OS_EXCEPTION   = 1105, // OS exception in a Image related call
    HR_ERR_LIB_IMG_PTR_NULL       = 1106, // Error finding image from image handle
    HR_ERR_LIB_HANDLE_TYPE_INVALID= 1107, // Invalid handle type found internally
    HR_ERR_LIB_POLL_EVENT_TYPE    = 1108, // inEventType for Poll error
    HR_ERR_LIB_LIB_NOT_FOUND      = 1110, // HR_Lib.dll or HR_Lib.so was not found
    HR_ERR_LIB_SUB_DLL_NOT_FOUND  = 1111, // Some other needed dynamic library was not found
    HR_ERR_LIB_UNUSED_OPTION_BIT  = 1112, // Unused option bits for OpenLibrary must be zero     
    HR_ERR_LIB_OPTION_DISABLED    = 1113, // Option was not enabled during OpenLibrary()
    HR_ERR_LIB_ALREADY_OPEN       = 1114, // The Library is already initialized.
    HR_ERR_LIB_OS_VERSION         = 1115, // Library does not run on this OS Version
    HR_ERR_LIB_NO_ETHERNET        = 1116, // Ethernet hardware or driver missing
    HR_ERR_LIB_NO_1394            = 1117, // IEEE 1394 (FireWire) hardware or driver missing
    HR_ERR_LIB_CAMERAS_OPEN       = 1118, // Camera handles had to be closed when Library closed
    HR_ERR_LIB_SOCKET_INIT        = 1119, // Socket Initilization Error
    HR_ERR_LIB_CREATE_LIB_FAILED  = 1120, // HR_Library object creation failed

    HR_ERR_LIB_GENERATE_CAMLIST_ERR          = 1151, // Error generating list of cameras
    HR_ERR_LIB_IMG_NOT_DELETED_IS_COLLECTING = 1152, // Image delete failed, image was collecting
    HR_ERR_LIB_IMG_NOT_DELETED_IS_OPEN       = 1153, // Image delete failed, image was open
    HR_ERR_LIB_IMAGE_NOT_OPEN                = 1154, // Attempt to use an image that is not open
    HR_ERR_LIB_OPEN_CAM_BY_HND_FAIL          = 1155, // OpenCamera by Handle failed


    HR_ERR_LIB_end  = 2999, //end marker of Library errors

    /////////////////////////////////////////////////
    // Camera Errors 3000 to 4999
    /////////////////////////////////////////////////
    HR_ERR_CAM_begin              = 3000, // Camera Error being marker
    HR_ERR_CAM                    = 3001, // General error in the camera object

    HR_ERR_CAM_LIBRARY_NOT_OPEN   = 3002, // the library is not open, or has closed in error
    HR_ERR_CAM_OS_EXCEPTION       = 3003, // OS exception, probably memory access violation
    HR_ERR_CAM_MEM_ALLOC_FAILED   = 3004, // ran out of memory to allocate
    HR_ERR_CAM_INHANDLE_ZERO      = 3005, // inHandle is not valid
    HR_ERR_CAM_INHANDLE_NOT_VALID = 3006, // inHandle is not valid
    HR_ERR_CAM_OUTINFO_NULL       = 3007, // outInfo pointer is NULL    
    HR_ERR_CAM_INBUFFERCOUNT_ZERO = 3008, // inBufferCount is zero
    HR_ERR_CAM_OUTAVAILCOUNT_NULL = 3009, // outAvailCount is NULL
    HR_ERR_CAM_OUTPVALUE_NULL     = 3010, // outpValue is NULL
    HR_ERR_CAM_INPVALUE_NULL      = 3011, // inpValue is NULL   
    HR_ERR_CAM_INTYPE_NOT_VALID   = 3012, // inType does not match ParamID
    HR_ERR_CAM_PARAM_READ_ONLY    = 3013, // attempt to SetParam to a read-only param
    HR_ERR_CAM_INID_OUT_OF_RANGE  = 3014, // Input ID is out of range for the camera
    HR_ERR_CAM_INID_NOT_VALID     = 3015, // Input ID is not at all valid
    HR_ERR_CAM_INCOUNT_TOO_LOW    = 3016, // inCount is zero or otherwise too low
    HR_ERR_CAM_INCOUNT_TOO_HIGH   = 3017, // inCount is too high
    HR_ERR_CAM_VALUE_TOO_LOW      = 3018, // a Param value is too low
    HR_ERR_CAM_VALUE_TOO_HIGH     = 3019, // a Param value is too high
    HR_ERR_CAM_VALUE_NOT_VALID    = 3020, // a Param value is not valid
    HR_ERR_CAM_INTERNAL_PTR_NULL  = 3021, // an internal pointer is NULL, please reprt this
    HR_ERR_CAM_INTERNAL_LOGIC     = 3022, // please report this
    HR_ERR_CAM_OUT_EVENTS_NULL    = 3023, // outEvents is NULL    
    HR_ERR_CAM_POLL_EVENT_FLAG    = 3024, // inEventsFlags has one or more bad bits
    HR_ERR_CAM_INID_IS_FOR_LIB    = 3025, // inID is not valid, it is for the library
    HR_ERR_CAM_INID_IS_FOR_IMG    = 3026, // inID is not valid, it is for an image
    HR_ERR_CAM_INSTRING_NULL      = 3027, // input String pointer is null
    HR_ERR_CAM_INSTRING_SIZE_ZERO = 3028, // input String is of size 0
    HR_ERR_CAM_INEVENTFLAG_INVALID= 3029, // inEventFlags were not valid on HR_Poll

    HR_ERR_CAM_IMAGES_OPEN          = 3050, // Image handles had to be closed when camera closed
    HR_ERR_CAM_OUTIMGLIST_NULL      = 3051, // pointer to the output image list is null
    HR_ERR_CAM_NOT_CONNECTED        = 3052, // Camera object & threads does not exist at this time
    HR_ERR_CAM_PARAM_TO_STRING_FAIL = 3053, // Generating a command string from a parameter failed
    HR_ERR_CAM_NULL_PARENT_HANDLE   = 3054, // Parent handle for this camera is null
    HR_ERR_CAM_IMAGE_CREATE_FAILED  = 3055, // Camera failed to create an image/image buffer
    HR_ERR_CAM_BAD_CLASSPTR         = 3056, // Cameras class type is NOT set to camera. 
    HR_ERR_CAM_BAD_PENDING_PARAM    = 3057, // pending parameter list is NULL
    HR_ERR_CAM_ZERO_SIZE_VECTOR     = 3058, // pending parameter vector is zero
    HR_ERR_CAM_PARAM_NOT_INITALIZED           = 3059, // Param was not intilized properly
    HR_ERR_CAM_REGISTER_HR_IMAGE_FAIL         = 3060, // Error adding image to image list
    HR_ERR_CAM_UNEXPECTED_UNINITALIZED_PARAM  = 3061, // Param has been 'de initilized' 
    HR_ERR_CAM_BAD_CLASS_TYPE                 = 3062, // camera has a bad class type
    HR_ERR_CAM_PARAM_SCRATCH_WRITE_FAILED     = 3063, // scratch var write failed

    HR_ERR_CAM_POST_SETPARAM_MSG_FAIL   = 3064, // Camera thread communication error
    HR_ERR_CAM_CCM_RETURN_CODE          = 3065, // Command error
    HR_ERR_CAM_CCM_PARSE_FAILED         = 3066, // Command parse error
    HR_ERR_CAM_FOCUS_GET_FAILED         = 3067, // Command eror
    HR_ERR_CAM_PENDING_PARAM_EMPTY      = 3068, // Thread communctation error
    HR_ERR_CAM_NO_PENDING_PARAM         = 3069, // There are no pending parameters avail.
    HR_ERR_CAM_BAD_DATATYPE             = 3070, // No case for this data in
    HR_ERR_CAM_REPLY_PARSE_ERROR        = 3071, // Error parsing data sent from camera
    HR_ERR_CAM_BAD_TYPE_PARSE           = 3072, // Unexpected data type for cur pending param

    HR_ERR_CAM_THREAD_PTR_NULL          = 3073, // thread pointer passed is null
    HR_ERR_CAM_PARAM_OUT_OF_SYNC        = 3074, // Camera thread communication error
    HR_ERR_CAM_PARAM_WILL_GET_ON_INIT   = 3075, // parameter get tried before cam started. param will get on init
    HR_ERR_CAM_ACCESS_NULL              = 3076, // Active param access is null
    HR_ERR_CAM_ILLEGAL_GET              = 3077, // Get param attempted on a write only variable
    HR_ERR_CAM_ILLEGAL_MODE             = 3078, // Active parameter has in illegal mode
    HR_ERR_CAM_GET_OUT_OF_SYNC          = 3079, // returned value from get is out of sync with camera
    HR_ERR_CAM_DISCONNECTED_PARAM_INVALID = 3080, // returned value from get is out of sync, from a disconnected camera

    HR_ERR_CAM_DATA_READ_FAILED         = 3100, // Error in a data read from the camera
    HR_ERR_CAM_PARSE_FAIL               = 3101, // Failed during a string parse
    HR_ERR_CAM_BAD_CAPTURE_FILE_TYPE    = 3102, // User attempted to set a bad file type
    HR_ERR_CAM_DEFAULT_LAST_PARAM_ERROR = 3103, // default 'last param error' error

    HR_ERR_CAM_TRIGGER_IS_DISABLED = 3104, // this camera function is illegal while triggers are disabled
    HR_ERR_CAM_TRIGGER_IS_ENABLED  = 3105, // this camera function is illegal while triggers are enabled
    HR_ERR_CAM_RUN_PREVIEW_IS_ON   = 3106, // DisableTriggers set attempt illegal while preview is running
    HR_ERR_CAM_EVENT_CHECK_FAILED  = 3107,
    
    HR_ERR_CAM_INITALIZING_NOT_DONE, // This error is returned for cameras listed which have not completed their initilization steps

    HR_ERR_CAM_end      = 4999,  // End of the Camera errorst


    /////////////////////////////////////////////////
    // Image Errors 5000 to 6999
    /////////////////////////////////////////////////
    HR_ERR_IMG_begin              = 5000, // Image error begin marker
    HR_ERR_IMG                    = 5001, // General Image error

    HR_ERR_IMG_LIBRARY_NOT_OPEN   = 5002, // Library is not open, or has closed in error
    HR_ERR_IMG_OS_EXCEPTION       = 5003, // OS exception, probably memory access violation
    HR_ERR_IMG_MEM_ALLOC_FAILED   = 5004, // Out of memory to allocate
    HR_ERR_IMG_INHANDLE_ZERO      = 5005, // inHandle is not valid
    HR_ERR_IMG_INHANDLE_NOT_VALID = 5006, // inHandle is not valid
    HR_ERR_IMG_OUTINFO_NULL       = 5007, // outInfo pointer is NULL    
    HR_ERR_IMG_INBUFFERCOUNT_ZERO = 5008, // inBufferCount is zero
    HR_ERR_IMG_OUTAVAILCOUNT_NULL = 5009, // outAvailCount is NULL
    HR_ERR_IMG_OUTPVALUE_NULL     = 5010, // outpValue is NULL
    HR_ERR_IMG_INPVALUE_NULL      = 5011, // inpValue is NULL   
    HR_ERR_IMG_INTYPE_NOT_VALID   = 5012, // inType does not match ParamID
    HR_ERR_IMG_PARAM_READ_ONLY    = 5013, // attempt to SetParam to a read-only param
    HR_ERR_IMG_INID_OUT_OF_RANGE  = 5014, // inID out of range for a camera parameter
    HR_ERR_IMG_INID_NOT_VALID     = 5015, // inID is not a valid ID value
    HR_ERR_IMG_INCOUNT_TOO_LOW    = 5016, // inCount is zero or otherwise too low
    HR_ERR_IMG_INCOUNT_TOO_HIGH   = 5017, // inCount is too high
    HR_ERR_IMG_VALUE_TOO_LOW      = 5018, // Param value is too low
    HR_ERR_IMG_VALUE_TOO_HIGH     = 5019, // Param value is too high
    HR_ERR_IMG_VALUE_NOT_VALID    = 5020, // Param value is not valid
    HR_ERR_IMG_INTERNAL_PTR_NULL  = 5021, // Internal pointer is NULL, please reprt this
    HR_ERR_IMG_INTERNAL_LOGIC     = 5022, // Internal logic error, please report
    HR_ERR_IMG_OUT_EVENTS_NULL    = 5023, // outEvents is NULL    
    HR_ERR_IMG_POLL_EVENT_FLAG    = 5024, // inEventsFlags has one or more bad bits
    HR_ERR_IMG_INID_IS_FOR_LIB    = 5025, // inID is not valid, it is for the library
    HR_ERR_IMG_INID_IS_FOR_CAM    = 5026, // inID is not valid, it is for an image
     
    HR_ERR_IMG_CAMERA_NOT_OPEN    = 5050, // Attempt to access an image when camera is not open
    HR_ERR_IMG_NOT_AVAILABLE      = 5051, // Image linked to the handle is not available
    HR_ERR_IMG_DELETED_OPEN_IMG   = 5052, // DeleteImage() was done to an open image. It was deleted. 
    HR_ERR_IMG_NOT_OPEN           = 5053, // Image must be opened before calling this function
    HR_ERR_IMG_OPEN               = 5054, // Image must be closed before calling this function
    HR_ERR_IMG_DATA_NOT_READY     = 5055, // Data isn't ready yet, try again after a time delay
    HR_ERR_IMG_STATE_ERROR        = 5056, // Image collection state problem
    HR_ERR_IMG_DELETE_ERR_COLL    = 5057, // Image is collecting data, and may not be deleted
    HR_ERR_IMG_DELETE_ERR_OPEN    = 5058, // Image is open, and may not be deleted
    HR_ERR_IMG_NO_DATA_DEST       = 5059, // this image has no data destination.
    
    HR_ERR_IMG_end                = 6999, // End marker of the Image errors


    /////////////////////////////////////////////////
    // ImageBuffer  Errors 7000 to 7499
    /////////////////////////////////////////////////  
    HR_ERR_IMGBUFFER_begin          = 7000, // begin marker for ImageBuffer errors

    HR_ERR_IMGBUFFER                = 7001, // general ImageBuffer error
    HR_ERR_IMGBUFFER_NOT_VALID      = 7003, // Imagebuffer is not valid
    HR_ERR_IMGBUFFER_ADDRESS_FAIL   = 7004, // Imagebuffer address is illegal

    HR_ERR_IMGBUFFER_end = 7499,   // end marker for ImageBuffer errors

    /////////////////////////////////////////////////
    // Image Control Port Socket Errors 7500 to 7999
    /////////////////////////////////////////////////  
    HR_ERR_ICPSOCK_begin            = 7500, // begin marker for ICPSocket errors

    HR_ERR_ICPSOCK                  = 7501, // General ICPSocket Error
    HR_ERR_ICPSOCK_READ_ERROR       = 7502, // Read error on the socket
    HR_ERR_ICPSOCK_RECV_SIZE        = 7503, // Bad recieve size
    HR_ERR_ICPSOCK_RECV_BUFFER      = 7504, // Bad ptr to a recieve buffer
    HR_ERR_ICPSOCK_IOCTL_FAIL       = 7505, // System call to IOCTL failed
    HR_ERR_ICPSOCK_WOULDBLOCK       = 7506, // Socket wouldblock
    HR_ERR_ICPSOCK_SEND_FAIL        = 7507, // Send attempt failed
    HR_ERR_ICPSOCK_BAD_SOCKET       = 7508, // Bad system socket
    HR_ERR_ICPSOCK_BUFFER_OVERFULL  = 7509, // ICP Socket buffer is dangerously full
    HR_ERR_ICPSOCKET_CLOSE_ERROR    = 7510, // Error on socket close

    HR_ERR_ICPSOCK_end              = 7999, // end marker for ICP sock error
    /////////////////////////////////////////////////
    // Camera Control Port Socket Errors 8000 to 8499
    /////////////////////////////////////////////////   
    HR_ERR_CCPSOCK_begin          = 8000, //begin marker for CCP Socket error
    
    HR_ERR_CCPSOCK                     = 8000, // General CCP Socket error
    HR_ERR_CCPSOCK_SOCKET_NULL         = 8001, // OS level socket is null
    HR_ERR_CCPSOCK_SEND_FAIL           = 8002, // Send call failed
    HR_ERR_CCPSOCK_GET_SOCK_FAIL       = 8004, // Failed to get OS socket
    HR_ERR_CCPSOCK_RECV_SIZE_ZERO      = 8005, // Recieve buffer is full, or uninitized
    HR_ERR_CCPSOCK_RECV_BUFF_TOO_SMALL = 8006, // Recieve buffer is too small
    HR_ERR_CCPSOCK_SOCKET_WOULDBLOCK   = 8008, // Socket would block
    HR_ERR_CCPSOCK_WRONG_MESSAGE_TYPE  = 8009, // Unhandled message type
    HR_ERR_CCPSOCK_ROLLING_BUFF_EMPTY  = 8011, // Rolling buffer is empty at read attempt
    HR_ERR_CCPSOCK_NO_220              = 8012, // No success acknowledge found
    HR_ERR_CCPSOCK_INVALID_EVENT       = 8013, // Create Event failed on socket startup
    HR_ERR_CCPSOCK_SELECT_FAILED       = 8014, // Select faled on startup
    HR_ERR_CCPSOCK_BIND_FAILED         = 8015, // Bind failed on startup
    HR_ERR_CCPSOCKET_520_PARSE         = 8016, // Error parsing unhappy reply


    HR_ERR_CCPSOCK_end = 8499, // end marker for CCP Socket errors



    /////////////////////////////////////////////////
    // Image Data Port Socket Errors 8500 to 8999
    /////////////////////////////////////////////////    
    HR_ERR_IDPSOCK_begin        = 8500, // begin marker for IDP Socket errors

    HR_ERR_IDPSOCK                      = 8501, // General IDP Socket error
    HR_ERR_IDPSOCK_INIT_ERR             = 8502, // Socket initialization error
    HR_ERR_IDPSOCK_READ_ERR             = 8503, // Socket read error
    HR_ERR_IDPSOCK_IOCTLSOCK_ERROR      = 8504, // IOCTRL set error
    HR_ERR_IDPSOCK_RECV_SIZE_ZERO       = 8505, // Recieve buffer full
    HR_ERR_IDCPSOCK_RECV_BUFF_TOO_SMALL = 8506, // Recieve buffer too small for incoming data read
    HR_ERR_IDPSOCK_SOCKET_WOULDBLOCK    = 8507, // Socket wouldblock
    HR_ERR_IDPSOCK_NULL_SOCKET          = 8509, // Socket object is null

    HR_ERR_IDPSOCK_end          = 8999, // end marker for IDP Socket errors

    /////////////////////////////////////////////////
    // Image Control Thread Errors 9000 to 9499
    /////////////////////////////////////////////////
    HR_ERR_ICPTHREAD_begin      = 9000, // begin marker for ICP Thread errors

    HR_ERR_ICPTHREAD                = 9001, // General ICP Thread error
    HR_ERR_ICPTHREAD_INIT_FAIL      = 9002, // ICP Thread initialization faild  
    HR_ERR_ICPTHREAD_NO_HND         = 9003, // ICP Thread handle error
    HR_ERR_ICPTHREAD_NO_THREAD_ID   = 9004, // ICP Thread ID is 0
    HR_ERR_ICPTHREAD_BAD_ICPSOCK    = 9005, // ICP Socket object pointer is null
    HR_ERR_ICPTHREAD_BAD_IDPSOCK    = 9006, // IDP Socket object pointer is null
    HR_ERR_ICPTHREAD_BAD_WSAEVENT   = 9007, // Invalid WASEvent found
    HR_ERR_ICPTHREAD_NO_THREAD_YET  = 9008, // Thread specific function called before thread created
    HR_ERR_ICPTHREAD_MSG_FAIL       = 9009, // System message check failed

    HR_ERR_ICPTHREAD_MSG_PROCESS_FAIL   = 9010, // Message processing failed
    HR_ERR_ICPTHREAD_CCPSOCK_EVENT_FAIL = 9011, // Socket event processing failed
    HR_ERR_ICPTHREAD_ICPSOCK_EVENT_FAIL = 9012, // Socket event processing failed
    HR_ERR_ICPTHREAD_CMD_LOOKUP_FAIL    = 9013, // Command translation failed
    HR_ERR_ICPTHREAD_POST_MSG_FAILED    = 9014, // Message post to mailbox failed
    HR_ERR_ICPTHREAD_NULL_IDPSOCK       = 9015, // IDP Socket pointer was invalid

    HR_ERR_ICPTHREAD_PROCESS_READ       = 9017, // Error reading
    HR_ERR_ICPTHREAD_UPDATE_THREAD_FAIL = 9018, // Thread failed to update state
    HR_ERR_ICPTHREAD_MAIN_FAIL          = 9019, // ICP Thream main exited unexpectidly
    HR_ERR_ICPTHREAD_NO_HANDLE_FOUND    = 9020, // Thread contained invalid parent handle
    HR_ERR_ICPTHREAD_BAD_DATA_DEST      = 9021, //  Invalid collecting image pointer
    HR_ERR_ICPTHREAD_BAD_STATE          = 9022, // We got an unxepected state here
    
    HR_ERR_ICPTHREAD_MSG_POSTED_AND_FAILED  = 9023, // Post Thread message attempt faoled
    HR_ERR_ICPTHREAD_PROC_EVENT_MALLOC_FAIL = 9024, // Process buffer malloc failed
    HR_ERR_ICPTHREAD_SOCK_READ_MALLOC_FAIL  = 9025, // socket read buffer allocation failed

    HR_ERR_ICPTHREAD_end        = 9499, // end marker for ICP Thread errors
 
    /////////////////////////////////////////////////
    // Camera Control Thread Errors 9500 to 9999
    /////////////////////////////////////////////////    
    HR_ERR_CCPTHREAD_begin      = 9500, // begin marker for CCP Thread errors

    HR_ERR_CCPTHREAD                = 9501, // General CCP Thread Error
    HR_ERR_CCPTHREAD_INIT_FAIL      = 9501, // Thread initialization failed
    HR_ERR_CPPTHREAD_BAD_SOCKET     = 9502, // Invaild socket error
    HR_ERR_CCPTHREAD_MSG_POST_FAIL  = 9503, // Thread failed to post a message to a mailbox
    HR_ERR_CCPTHREAD_NOT_SPAWNED    = 9504, // Thread function attempted before thread created
    HR_ERR_CCPTHREAD_NO_AVAIL_MSG   = 9505, // No thread messages available
    HR_ERR_CCPTHREAD_NO_NETEVENT    = 9506, // No thread network events available
    HR_ERR_CCPTHREAD_NETEVENT_NULL  = 9507, // Retrieved network event is null
    HR_ERR_CCPTHREAD_BAD_NETEVENT   = 9508, // Network event is not valid for this thread
    HR_ERR_CCPTHREAD_NO_MSG_AVAIL   = 9509, // No available thread message
    HR_ERR_CCPTHREAD_POST_FAIL      = 9510, // Thread message post failed
    HR_ERR_CCPTHREAD_MSG_PROC_FAIL  = 9511, // Processsing thread message failed
    HR_ERR_CCPTHREAD_SHUTDOWN       = 9512, // Function called after thread has shutdown
    
    HR_ERR_CCPTHREAD_BAD_REPLY   = 9530, // Camera reply indicates a command error
    HR_ERR_CCPTHREAD_520         = 9531, // Camera notified us of a command failure
    HR_ERR_CCPTHREAD_BAD_REPLY_A = 9532, // Camera reply indicates a command error
    HR_ERR_CCPTHREAD_BAD_REPLY_B = 9533, // Camera reply indicates a command error
    HR_ERR_CCPTHREAD_BAD_REPLY_C = 9534, // Camera reply indicates a command error
    HR_ERR_CCPTHREAD_BAD_REPLY_D = 9535, // Camera reply indicates a command error
    HR_ERR_CCPTHREAD_BAD_REPLY_E = 9536, // Camera reply indicates a command error
    HR_ERR_CCPTHREAD_BAD_REPLY_F = 9537, // Camera reply indicates a command error
    HR_ERR_CCPTHREAD_BAD_REPLY_G = 9538, // Camera reply indicates a command error
    HR_ERR_CCPTHREAD_BAD_REPLY_Z = 9538, // Camera reply indicates a command error



    HR_ERR_CCPTHREAD_SOCKET_CREATE_FAILED = 9550, // Socket initilzation failed
    HR_ERR_CCPTHREAD_MSG_NOT_PROCESSED    = 9551, // CCP Thread could not finish processing message
    HR_ERR_CCPTHREAD_WSA_WAIT_FAILED      = 9552, // Wait event failed
    HR_ERR_CCPTHREAD_NETEVENT_SOCK_ERROR  = 9553, // Socket error on network event
    HR_ERR_CCPTHREAD_UNKNOWN_NETEVENT     = 9554, // Unknown network even recieved
    HR_ERR_CCPTHREAD_PREV_MSG_BAD_STATE   = 9555, // A Preview start MSG during an unxepexted state
    HR_ERR_CCPTHREAD_CCPSOCK_IS_NULL      = 9556, // The CCPSocket pointer is null
    HR_ERR_CCPTHREAD_UNEXPECTED_NETEVENT  = 9557, // Unexpected network even recieved
    HR_ERR_CCPTHREAD_PENDPARAM_IS_NULL    = 9558, // Pending parameter is null
    HR_ERR_CCPTHREAD_NULL_CAM             = 9559, // Camera pointer is null
    HR_ERR_CCPTHREAD_SOCKET_READ_FAILED   = 9560, // Socket read returned an error
    HR_ERR_CCPTHREAD_BAD_DATA_ON_CCPSOCK  = 9561, // Data from the socket had an error
    HR_ERR_CCPTHREAD_CSNU_PARSE_FAILED    = 9562, // Failure to parse a camera reply

    HR_ERR_CCPTHREAD_BAD_PARENT_HANDLE          = 9563, // Parent camera handle is null
    HR_ERR_CCPTHREAD_UNHAPPY_REPLY              = 9564, // Bad command reply recieved
    HR_ERR_CCPTHREAD_NET_EVENT_MALLOC_FAIL      = 9565, // allocation failed
    HR_ERR_CCPTHREAD_BAD_NETEVENT_READ_SETTINGS = 9566, // Error in network event read settings
    HR_ERR_CCPTHREAD_PEND_PARAM_OUT_OF_STATE    = 9567, // We recieved aa pending parameter during a strange state
    HR_ERR_CCPTHREAD_TOKENIZE_INPUT_TOO_LONG    = 9568, // Tokenize failed. 'infinate' input buffer
    HR_ERR_CCPTHREAD_SET_FAIL,
    HR_ERR_CCPTHREAD_MSG_POSTED_AND_FAILED,
    HR_ERR_CCPTHREAD_NO_THREAD_YET,
    HR_ERR_CCPTHREAD_POST_MSG_FAILED,


    HR_ERR_CCPTHREAD_end        = 9999, // end marker for CCP Thread errors

    /////////////////////////////////////////////////
    // Handle Manager Errors 10000 to 10499
    ///////////////////////////////////////////////// 
    HR_ERR_HANDLEMGR_begin      = 10000, // begin marker for Handle Manager errors

    HR_ERR_HANDLEMGR                       = 10001, // General handle manager error 
    HR_ERR_HANDLEMGR_GET_FAILED            = 10002, // Object get failed
    HR_ERR_HANDLEMGR_IMAGE_HANDLE_FAIL     = 10003, // Image get failed
    HR_ERR_HANDLEMGR_IMAGE_GET_FAIL        = 10004, // Iamge get failed (case 2)
    HR_ERR_HANDLEMGR_REMOVE_FAIL           = 10005, // Object could not be removed from list
    HR_ERR_HANDLEMGR_IMAGE_GET_NEXT_FAIL   = 10006, // 'Next' object not found
    HR_ERR_HANDLEMGR_NO_IMAGEHANDLES_FOUND = 10007, // No imagehandles found
    HR_ERR_HANDLEMGR_HANDLE_NOT_VALID      = 10008, // Invalid handle recieved
    HR_ERR_HANDLEMGR_HANDLE_DEST_NOT_VALID = 10009, // Invalid output pointer
    HR_ERR_HANDLEMGR_BAD_CONTAINER_TYPE    = 10010, // Unknown container type recieved
    HR_ERR_HANDLEMGR_PTR_NULL              = 10011, // Output pointer null
    HR_ERR_HANDLEMGR_ZERO_COUNT            = 10012, // Output space is Zero
    HR_ERR_HANDLEMGR_INPCAM_NULL           = 10013, // Input camera pointer is null
    HR_ERR_HANDLEMGR_INIMAGE_NULL          = 10014, // passed image pointer is null
    HR_ERR_HANDLEMGR_IOIMAGE_NULL          = 10015, // passed image pointer is null
    HR_ERR_HANDLEMGR_OUTIMAGE_NULL         = 10016, // passed image pointer is null
    HR_ERR_HANDLEMGR_CAM_HANDLE_NOT_VALID  = 10017, // invalid camera handle passed
    HR_ERR_HANDLEMGR_HANDLE_PTR_NULL       = 10018, // null handle pointer passed
    HR_ERR_HANDLEMGR_HANDLE_NULL           = 10019, // null handle passed

    HR_ERR_HANDLEMGR_IMAGE_GET_FIRST_IMG_FAIL  = 10020, // an Error
    HR_ERR_HANDLEMGR_NO_COMPLETE_IMAGE_FOUND   = 10021, // an Error
    HR_ERR_HANDLEMGR_TOO_MANY_IMAGES_FOR_ARRAY = 10022, // an Error
    HR_ERR_HANDLE_MGR_RETURNED_NULL            = 10023,

     HR_ERR_HANDLEMGR_end   = 10499, // end marker for Handle Manager errors

     /////////////////////////////////////////////////
    // Parameter Errors 10500 to 10999
    /////////////////////////////////////////////////  
    HR_ERR_PARAM_begin      = 10500, // begin marker for Param errors

    HR_ERR_PARAM                  = 10500, // a General Parameter error
    HR_ERR_PARAM_INIT_FAIL        = 10501, // Failure creating a parameter
    HR_ERR_PARAM_SET_ELEMENT_FAIL = 10502, // Error setting data
    HR_ERR_PARAM_INTERNAL_LOGIC   = 10503, // Internal error
    HR_ERR_PARAM_INCOUNT_TOO_LOW  = 10504, // In data count too low
    HR_ERR_PARAM_NULL_POINTER     = 10505, // In data pointer is null
    HR_ERR_PARAM_READ_ONLY        = 10506, // Illegal request for a read only parameter
    HR_ERR_PARAM_INTYPE_NOT_VALID = 10507, // input datatype does not matck
    HR_ERR_PARAM_NO_DATA_ERROR    = 10508, // Data size calculated as 0
    HR_ERR_PARAM_SET_UNKNOWN_TYPE = 10509, // Unknown data type
    HR_ERR_PARAM_INTYPE_NULL      = 10510, // Input type is null, invalud
    HR_ERR_PARAM_INPVALUE_NULL    = 10511, // Input pointer is null, invalud
    HR_ERR_PARAM_ELEMENT_PTR_NULL = 10512, // Internal element ptr is null error
    HR_ERR_PARAM_IBUFF_NULL       = 10513, // Internal buffer is null
    HR_ERR_PARAM_OUTINFO_NULL     = 10518, // Out info pointer null
    HR_ERR_PARAM_OUTPDEST_NULL    = 10519, // Out dest poitner null

    HR_ERR_PARAM_INID_OUT_OF_RANGE  = 10520, // Invalid ID for parameter
    HR_ERR_PARAM_OUTVAILCOUNT_NULL  = 10521, // Output space available count is null
    HR_ERR_PARAM_OUTPVALUE_NULL     = 10522, // Output ptr is null
    HR_ERR_PARAM_INTYPE_ZERO        = 10523, // In Type is invalid
    HR_ERR_PARAM_VALUE_TOO_LOW      = 10524, // Value is too hight for this parameter
    HR_ERR_PARAM_VALUE_TOO_HIGH     = 10525, // Value is too low for this paramer
    HR_ERR_PARAM_BAD_ELEMENT_TYPE   = 10526, // Passed element type does not match

    HR_ERR_PARAM_end        = 10999, // end marker for Param errors

    /////////////////////////////////////////////////
    //  API Object Errors 11000 to 11499
    /////////////////////////////////////////////////  
    HR_ERR_APIOBJ_begin     = 11000, // begin marker for APIObject errors

    HR_ERR_APIOBJ                   = 11000, // General API Object failure
    HR_ERR_APIOBJ_INSERT_FAILED     = 11001, // API Object could not insert the passed parameter
    HR_ERR_APIOBJ_NULL_PTR_PASSED   = 11002, // Null pointer passed into an APIObject Function
    HR_ERR_APIOBJ_NULL_PID          = 11003, // A PID of 0 was passed GetDataFromStringAndType

    HR_ERR_APIOBJ_PID_NOT_FOUND_IN_OBJECT = 11004, // The requested PID was not found in the object's parameter map
    HR_ERR_APIOBJ_INID_OUT_OF_RANGE       = 11006, // The PID that was recieved is not a valid HR_SDK PID
    HR_ERR_APIOBJ_NULL_AVAIL_POINTER      = 11007, // Null outAvailable pointer in ApiObj       
    HR_ERR_APIOBJ_NULL_OUT_POINTER        = 11008, // Null output pointer in ApiObj
    HR_ERR_APIOBJ_NULL_IN_POINTER         = 11009, // Null in pointer in ApiObj
    HR_ERR_APIOBJ_INCOUNT_TOO_LOW         = 11010, // Incount must be at least 1
    HR_ERR_APIOBJ_OUTPPARAM_NULL          = 11011, // Output param is null

    HR_ERR_APIOBJ_end       = 11499,    // end marker for APIObject Errors
    /////////////////////////////////////////////////
    //  BMP Out Syste Errors 11500 to 11999
    /////////////////////////////////////////////////      
    HR_ERR_BMPWRITER_begin      = 11500, // begin marker for BMP Writer errors

    HR_ERR_BMPWRITER                = 11501, // General BMP Writer error
    HR_ERR_BMPWRITER_ZERO_BYE_COUNT = 11502, // Input byte count is zero
    HR_ERR_BMDWRITER_OUTSIZE_NULL   = 11503, // Output size is zero

    HR_ERR_BMPWRITER_end    = 11999, // end marker for BMP Writer errors

    /////////////////////////////////////////////////
    //  Ethernet Scanner Errors 12000 to 12499
    /////////////////////////////////////////////////     
    HR_ERR_ETHSCANNER_begin    = 12000, // begin marker for Ethernet Scanner errors

    HR_ERR_ETHSCANNER                        = 12001, // General ethernet scanner error

    // 12200 - 12299 - windows socket specific errors
    HR_ERR_ETHSCANNER_WIN32_SOCK_CREATE_FAIL  = 12200, // Socket creation failed
    HR_ERR_ETHSCANNER_WIN32_SOCK_BIND_FAIL    = 12201, // Socket bind failed
    HR_ERR_ETHSCANNER_WIN32_SOCK_SOCKOPT_FAIL = 12202, // Sockopt call to windows socket failed
    HR_ERR_ETHSCANNER_WIN32_SOCK_LISTEN_FAIL  = 12203, // Listen on socket failed
    HR_ERR_ETHSCANNER_WIN32_SOCK_SELECT_FAIL  = 12204, // Ethernet socket select failed
    HR_ERR_ETHSCANNER_WIN32_CLEANUP_FAIL      = 12205, // Winsock Init failed
    HR_ERR_ETHSCANNER_WIN32_STARTUP_FAIL      = 12206, // Winsock Cleanup failed

    HR_ERR_ETHSCANNER_end    = 12499, // end marker for Ethernet Scanner errors


    /////////////////////////////////////////////////
    //  Helper System Errors 12500 to 12999
    ///////////////////////////////////////////////// 
    HR_ERR_HELPERCLASS_begin    = 12500, // begin marker for Helper Class errors

    HR_ERR_HELPERCLASS                       = 12500, // General Helper Class error
    HR_ERR_HELPERCLASS_REMOVE_STR_DATA_ERROR = 12501, // Remove String Data error
    HR_ERR_HELPERCLASS_BAD_SPRINT            = 12502, // Print formatting error
    HR_ERR_HELPERCLASS_ENDLESS_CMD           = 12503, // Buffer overflow error
    HR_ERR_HELPERCLASS_SER_NUM_ERR           = 12504, // error parsing serial number

    HR_ERR_HELPERCLASS_end = 12999, // end marker for Helper Class errors
    
    /////////////////////////////////////////////////
    //  Class level Errors 13000 to 13499
    ///////////////////////////////////////////////// 
    HR_ERR_CLASS_begin      = 13000, // begin marker for Class errors

    HR_ERR_CLASS            = 13000, // General Class error
    HR_ERR_CLASS_BAD_HANDLE = 13001, // Invalid handle during function

    HR_ERR_CLASS_end    = 13499, // end marker for Class errors    


    //////////////////////////////////////////////
    // HR_LOADER error codes are 13000 to 13999
    //////////////////////////////////////////////


    /////////////////////////////////////////////
    // MemManager level errors 14000 14999
    ////////////////////////////////////////////
    HR_ERR_MEMMGR_begin     = 14000, // begin marker for Memory Manager errors

    HR_ERR_MEMMGR                         = 14001, // General Memory Manager error
    HR_ERR_MEMMGR_ALLOWED_MEMORY_EXCEEDED = 14002, // Memory allocation has exceeded allowed space
    HR_ERR_MEMMGR_SYSTEM_MEMORY_EXCEEDED  = 14003, // Memory allocation has exceeded system space
    HR_ERR_MEMMGR_OUTPTR_NULL             = 14004, // Memory space output ptr is null
    HR_ERR_MEMMMGR_MAP_SIZE_EXCEEDED      = 14005, // Memory map has exceeded allowable size
    HR_ERR_MEMMGR_BUFFSTRUCT_NOT_EMPTY    = 14006, // IO buffer structure is not empty
    HR_ERR_MEMMGR_NEW_FAILED              = 14007, // Memory allocation failed 
    HR_ERR_MEMMGR_IOBUFFER_NULL           = 14008, // IO buffer structure is null
    HR_ERR_MEMMGR_BUFFSTRUCT_DATAP_NULL   = 14009, // Unexpected null data pointer
    HR_ERR_MEMMGR_BUFFSTRUCT_BC_ZERO      = 14010, // Buffer bytecount zero 
    HR_ERR_MEMMGR_BUFFER_NOT_FOUND        = 14011, // Buffer structure not found

    HR_ERR_MEMMGR_end       = 14999, // end marker for Memory Manager errors

    HR_ERR_end = 2147483647 // end marker for all HR_SDK errors
};

#endif    //__HR_ERRORS_H__

