tool/FoeCommand.cpp
changeset 1804 742607c464c4
parent 1363 11c0b2caa253
equal deleted inserted replaced
1803:5b04770444df 1804:742607c464c4
    39 
    39 
    40 /****************************************************************************/
    40 /****************************************************************************/
    41 
    41 
    42 std::string FoeCommand::resultText(int result)
    42 std::string FoeCommand::resultText(int result)
    43 {
    43 {
    44 	switch (result) {
    44     switch (result) {
    45 		case FOE_BUSY:
    45         case FOE_BUSY:
    46 			return "FOE_BUSY";
    46             return "FOE_BUSY";
    47 		case FOE_READY:
    47         case FOE_READY:
    48 			return "FOE_READY";
    48             return "FOE_READY";
    49 		case FOE_IDLE:
    49         case FOE_IDLE:
    50 			return "FOE_IDLE";
    50             return "FOE_IDLE";
    51 		case FOE_WC_ERROR:
    51         case FOE_WC_ERROR:
    52 			return "FOE_WC_ERROR";
    52             return "FOE_WC_ERROR";
    53 		case FOE_RECEIVE_ERROR:
    53         case FOE_RECEIVE_ERROR:
    54 			return "FOE_RECEIVE_ERROR";
    54             return "FOE_RECEIVE_ERROR";
    55 		case FOE_PROT_ERROR:
    55         case FOE_PROT_ERROR:
    56 			return "FOE_PROT_ERROR";
    56             return "FOE_PROT_ERROR";
    57 		case FOE_NODATA_ERROR:
    57         case FOE_NODATA_ERROR:
    58 			return "FOE_NODATA_ERROR";
    58             return "FOE_NODATA_ERROR";
    59 		case FOE_PACKETNO_ERROR:
    59         case FOE_PACKETNO_ERROR:
    60 			return "FOE_PACKETNO_ERROR";
    60             return "FOE_PACKETNO_ERROR";
    61 		case FOE_OPCODE_ERROR:
    61         case FOE_OPCODE_ERROR:
    62 			return "FOE_OPCODE_ERROR";
    62             return "FOE_OPCODE_ERROR";
    63 		case FOE_TIMEOUT_ERROR:
    63         case FOE_TIMEOUT_ERROR:
    64 			return "FOE_TIMEOUT_ERROR";
    64             return "FOE_TIMEOUT_ERROR";
    65 		case FOE_SEND_RX_DATA_ERROR:
    65         case FOE_SEND_RX_DATA_ERROR:
    66 			return "FOE_SEND_RX_DATA_ERROR";
    66             return "FOE_SEND_RX_DATA_ERROR";
    67 		case FOE_RX_DATA_ACK_ERROR:
    67         case FOE_RX_DATA_ACK_ERROR:
    68 			return "FOE_RX_DATA_ACK_ERROR";
    68             return "FOE_RX_DATA_ACK_ERROR";
    69 		case FOE_ACK_ERROR:
    69         case FOE_ACK_ERROR:
    70 			return "FOE_ACK_ERROR";
    70             return "FOE_ACK_ERROR";
    71 		case FOE_MBOX_FETCH_ERROR:
    71         case FOE_MBOX_FETCH_ERROR:
    72 			return "FOE_MBOX_FETCH_ERROR";
    72             return "FOE_MBOX_FETCH_ERROR";
    73 		case FOE_READ_NODATA_ERROR:
    73         case FOE_READ_NODATA_ERROR:
    74 			return "FOE_READ_NODATA_ERROR";
    74             return "FOE_READ_NODATA_ERROR";
    75 		case FOE_MBOX_PROT_ERROR:
    75         case FOE_MBOX_PROT_ERROR:
    76 			return "FOE_MBOX_PROT_ERROR";
    76             return "FOE_MBOX_PROT_ERROR";
    77 		default:
    77         default:
    78 			return "???";
    78             return "???";
    79 	}
    79     }
    80 }
    80 }
    81 
    81 
    82 /****************************************************************************/
    82 /****************************************************************************/
    83 
    83 
    84 std::string FoeCommand::errorText(int errorCode)
    84 std::string FoeCommand::errorText(int errorCode)
    85 {
    85 {
    86 	switch (errorCode) {
    86     switch (errorCode) {
    87         case 0x00008001:
    87         case 0x00008001:
    88             return "Not found.";
    88             return "Not found.";
    89         case 0x00008002:
    89         case 0x00008002:
    90             return "Access denied.";
    90             return "Access denied.";
    91         case 0x00008003:
    91         case 0x00008003:
   104             return "Not Bootstrap.";
   104             return "Not Bootstrap.";
   105         case 0x0000800a:
   105         case 0x0000800a:
   106             return "No rights.";
   106             return "No rights.";
   107         case 0x0000800b:
   107         case 0x0000800b:
   108             return "Program Error.";
   108             return "Program Error.";
   109 		default:
   109         default:
   110 			return "Unknown error code";
   110             return "Unknown error code";
   111 	}
   111     }
   112 }
   112 }
   113 
   113 
   114 /****************************************************************************/
   114 /****************************************************************************/