src/AduProtocol.c
/**
 * Handler for the "RCx" command, which responds with the current count, as a
 * decimal value of event counter n in (where n ranges from '0' to '7'). This
 * is the same as the "REx" command, except that the event count is also reset.
 *
 * @post On success, the response buffer is populated
 *
 * @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 "RCx" command, which responds with the current count, as a
decimal value of event counter n in (where n ranges from '0' to '7'). This
is the same as the "REx" command, except that the event count is also reset.

@post On success, the response buffer is populated

@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 " RCx " command which responds with the current count as a decimal value of event counter n in ( where n ranges from ' 0 ' to ' 7 ' ) . This is the same as the " REx " command except that the event count is also reset . @post On success the response buffer is populated @param [ in ] args The non - fixed portion of the command string ( if any ) @return Returns true on success or false on failure
static bool HandlerReadAndResetEventCounter(const char *args)
{
    BoardDebugPrint("Hit %s\r\n", __func__);
    bool success = false;
    if (strlen(args) == 1)
    {
        char *endptr;
        unsigned long index = strtoul(args, &endptr, 10);
        if (*endptr == '\0' && index < EVENT_COUNTER_NUM_COUNTERS)
        {
            uint16_t count = EventCounterRead(index, true);
            WriteResponseDecimal(count, DEC_DIGITS_16_BIT);
            success = true;
        }
    }
    return success;
}
static bool HandlerReadAndResetEventCounter ( const char * args ) { BoardDebugPrint ( " \r \n " , __func__ ) ; bool success = false ; if ( strlen ( args ) == 1 ) { char * endptr ; unsigned long index = strtoul ( args , & endptr , 10 ) ; if ( * endptr == ' \0 ' && index < EVENT_COUNTER_NUM_COUNTERS ) { uint16_t count = EventCounterRead ( index , true ) ; WriteResponseDecimal ( count , DEC_DIGITS_16_BIT ) ; success = true ; } } return success ; }
Handler for the "RCx" command, which responds with the current count, as a
 decimal value of event counter n in (where n ranges from '0' to '7').
Handler for the " RCx " command which responds with the current count as a decimal value of event counter n in ( where n ranges from ' 0 ' to ' 7 ' ) .