src/electricui.c
// Internal search in either variable array
Internal search in either variable array
Internal search in either variable array
static eui_message_t * 
find_message_object( const char * search_id, uint8_t is_internal )
{
    eui_message_t *found_obj_ptr = 0;
    if( search_id )
    {
        if( is_internal )
        {
            for(eui_variable_count_t i = 0; i < EUI_ARR_ELEM( internal_msg_store ); i++)
            {
                if( strncmp( search_id, internal_msg_store[i].id, EUI_MAX_MSGID_SIZE ) == 0 )
                {
                    found_obj_ptr = &internal_msg_store[i];
                    i = EUI_ARR_ELEM( internal_msg_store );
                }
            }
        }
        else
        {
            for(eui_variable_count_t i = 0; i < dev_tracked_num; i++)
            {
                if( strncmp( search_id, p_dev_tracked[i].id, EUI_MAX_MSGID_SIZE ) == 0 )
                {
                    found_obj_ptr = &p_dev_tracked[i];
                    i = dev_tracked_num;
                }
            }
        }
    }
    return found_obj_ptr;
}
static eui_message_t * find_message_object ( const char * search_id , uint8_t is_internal ) { eui_message_t * found_obj_ptr = 0 ; if ( search_id ) { if ( is_internal ) { for ( eui_variable_count_t i = 0 ; i < EUI_ARR_ELEM ( internal_msg_store ) ; i ++ ) { if ( strncmp ( search_id , internal_msg_store [ i ] . id , EUI_MAX_MSGID_SIZE ) == 0 ) { found_obj_ptr = & internal_msg_store [ i ] ; i = EUI_ARR_ELEM ( internal_msg_store ) ; } } } else { for ( eui_variable_count_t i = 0 ; i < dev_tracked_num ; i ++ ) { if ( strncmp ( search_id , p_dev_tracked [ i ] . id , EUI_MAX_MSGID_SIZE ) == 0 ) { found_obj_ptr = & p_dev_tracked [ i ] ; i = dev_tracked_num ; } } } } return found_obj_ptr ; }
Internal search in either variable array
Internal search in either variable array
//search the internal array for matching messageID //search developer space array for matching messageID