Add state to string API function
Added a state to string public API function. There was already a private function (`relay_chn_state_str`) that provides this functionality. So this function has been renamed to `relay_chn_state_to_str` and made publicly available. Refs #1104, #1105 and closes #1108.
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include "esp_check.h"
|
||||
#include "relay_chn.h"
|
||||
#include "relay_chn_priv_types.h"
|
||||
#include "relay_chn_core.h"
|
||||
#include "relay_chn_ctl.h"
|
||||
@@ -92,8 +93,8 @@ esp_err_t relay_chn_ctl_get_state_all(relay_chn_state_t *states)
|
||||
char *relay_chn_ctl_get_state_str(uint8_t chn_id)
|
||||
{
|
||||
return relay_chn_is_channel_id_valid(chn_id)
|
||||
? relay_chn_state_str(s_chn_ctls[chn_id].state)
|
||||
: relay_chn_state_str(RELAY_CHN_STATE_UNDEFINED);
|
||||
? relay_chn_state_to_str(s_chn_ctls[chn_id].state)
|
||||
: relay_chn_state_to_str(RELAY_CHN_STATE_UNDEFINED);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user