master/module.c
changeset 403 7bb931deccd9
parent 383 30ae9db75fea
child 430 74754f45d5fa
equal deleted inserted replaced
402:03e31ac14047 403:7bb931deccd9
   231 /**
   231 /**
   232    Prints slave states in clear text.
   232    Prints slave states in clear text.
   233 */
   233 */
   234 
   234 
   235 size_t ec_state_string(uint8_t states, /**< slave states */
   235 size_t ec_state_string(uint8_t states, /**< slave states */
   236                        char *buffer /**< target buffer (min. 25 bytes) */
   236                        char *buffer /**< target buffer
       
   237                                        (min. EC_STATE_STRING_SIZE bytes) */
   237                        )
   238                        )
   238 {
   239 {
   239     off_t off = 0;
   240     off_t off = 0;
   240     unsigned int first = 1;
   241     unsigned int first = 1;
   241 
   242 
   259         first = 0;
   260         first = 0;
   260     }
   261     }
   261     if (states & EC_SLAVE_STATE_OP) {
   262     if (states & EC_SLAVE_STATE_OP) {
   262         if (!first) off += sprintf(buffer + off, ", ");
   263         if (!first) off += sprintf(buffer + off, ", ");
   263         off += sprintf(buffer + off, "OP");
   264         off += sprintf(buffer + off, "OP");
       
   265     }
       
   266     if (states & EC_SLAVE_STATE_ACK_ERR) {
       
   267         if (!first) off += sprintf(buffer + off, ", ");
       
   268         off += sprintf(buffer + off, "ERR");
   264     }
   269     }
   265 
   270 
   266     return off;
   271     return off;
   267 }
   272 }
   268 
   273