src/AduProtocol.c
/**
 * Handler for the "MKddd" command, which sets the 8-bit relay port to the
 * value indicated by the decimal string ddd. This command does not have a
 * response.
 *
 * @param[in] args The non-fixed portion of the command string (if any)
 *
 * @return Returns true on success or false on failure
 */
Handler for the "MKddd" command, which sets the 8-bit relay port to the
value indicated by the decimal string ddd. This command does not have a
response.

@param[in] args The non-fixed portion of the command string (if any)

@return Returns true on success or false on failure
Handler for the " MKddd " command which sets the 8 - bit relay port to the value indicated by the decimal string ddd . This command does not have a response . @param [ in ] args The non - fixed portion of the command string ( if any ) @return Returns true on success or false on failure
static bool HandlerWriteRelayPort(const char *args)
{
    BoardDebugPrint("Hit %s\r\n", __func__);
    bool success = false;
    if (strlen(args) <= 3)
    {
        char *endptr;
        unsigned long portValue = strtoul(args, &endptr, 10);
        if (*endptr == '\0' && portValue <= UINT8_MAX)
        {
            BoardWriteRelays(portValue);
            success = true;
        }
    }
    return success;
}
static bool HandlerWriteRelayPort ( const char * args ) { BoardDebugPrint ( " \r \n " , __func__ ) ; bool success = false ; if ( strlen ( args ) <= 3 ) { char * endptr ; unsigned long portValue = strtoul ( args , & endptr , 10 ) ; if ( * endptr == ' \0 ' && portValue <= UINT8_MAX ) { BoardWriteRelays ( portValue ) ; success = true ; } } return success ; }
Handler for the "MKddd" command, which sets the 8-bit relay port to the
 value indicated by the decimal string ddd.
Handler for the " MKddd " command which sets the 8 - bit relay port to the value indicated by the decimal string ddd .
// There should be no more than 3 decimal characters/digital representing // the 8-bit value to write to the relay port