master/fsm_foe.c
branchredundancy
changeset 2344 2a3c1d27eb0f
parent 2336 dc82f7d09767
child 2498 9cdd7669dc0b
equal deleted inserted replaced
2343:0d2e24f2e1b2 2344:2a3c1d27eb0f
   727         EC_SLAVE_ERR(slave, "Reception of FoE DATA READ failed: ");
   727         EC_SLAVE_ERR(slave, "Reception of FoE DATA READ failed: ");
   728         ec_datagram_print_wc_error(datagram);
   728         ec_datagram_print_wc_error(datagram);
   729         return;
   729         return;
   730     }
   730     }
   731 
   731 
   732     if (!(data = ec_slave_mbox_fetch(slave, datagram, &mbox_prot, &rec_size))) {
   732     if (!(data = ec_slave_mbox_fetch(slave, datagram, &mbox_prot,
       
   733                     &rec_size))) {
   733         ec_foe_set_rx_error(fsm, FOE_MBOX_FETCH_ERROR);
   734         ec_foe_set_rx_error(fsm, FOE_MBOX_FETCH_ERROR);
   734         return;
   735         return;
   735     }
   736     }
   736 
   737 
   737     if (mbox_prot != EC_MBOX_TYPE_FILEACCESS) { // FoE
   738     if (mbox_prot != EC_MBOX_TYPE_FILEACCESS) { // FoE
   753     if (opCode == EC_FOE_OPCODE_ERR) {
   754     if (opCode == EC_FOE_OPCODE_ERR) {
   754         fsm->request->error_code = EC_READ_U32(data + 2);
   755         fsm->request->error_code = EC_READ_U32(data + 2);
   755         EC_SLAVE_ERR(slave, "Received FoE Error Request (code 0x%08x).\n",
   756         EC_SLAVE_ERR(slave, "Received FoE Error Request (code 0x%08x).\n",
   756                 fsm->request->error_code);
   757                 fsm->request->error_code);
   757         if (rec_size > 6) {
   758         if (rec_size > 6) {
   758             uint8_t text[1024];
   759             uint8_t text[256];
   759             strncpy(text, data + 6, min(rec_size - 6, sizeof(text)));
   760             strncpy(text, data + 6, min(rec_size - 6, sizeof(text)));
   760             EC_SLAVE_ERR(slave, "FoE Error Text: %s\n", text);
   761             EC_SLAVE_ERR(slave, "FoE Error Text: %s\n", text);
   761         }
   762         }
   762         ec_foe_set_rx_error(fsm, FOE_OPCODE_ERROR);
   763         ec_foe_set_rx_error(fsm, FOE_OPCODE_ERROR);
   763         return;
   764         return;