00001
00013 #include <cd_error.h>
00014
00015 struct cd_error_list_t {
00016 uint8_t cd_error_code;
00017 const char *meaning;
00018 };
00019
00020 struct cd_error_list_t cd_error_list[] = {
00021 {CD_Error_NoError, "No error."},
00022 {CD_Error_DAQBadSubdevice, "The specified subdevice number is not correct"},
00023 {CD_Error_BadValue, "The specified parameter value is not correct."},
00024 {CD_Error_DAQBadLine,"The specified input/output line is not correct or does not exist."},
00025 {CD_Error_UnableToOpenLink," Error configuring the master-slave link"},
00026 {CD_Error_LinkNotReady, "The loink is not ready"},
00027 {CD_Error_Timeout,"Timeout waiting response"},
00028
00029
00030 {CD_Error_UnimplementedError, "Error not implemented yet or erroneous code"}
00031 };
00032
00033
00041 const char* cd_ErrorStr(uint8_t error_code) {
00042
00043 uint8_t i;
00044
00045 while ((cd_error_list[i].cd_error_code != error_code) && (cd_error_list[i].cd_error_code != CD_Error_UnimplementedError)) {
00046 i++;
00047 }
00048
00049 return(cd_error_list[i].meaning);
00050 }
00051
00052
00053
00054
00055