samedi 2 juillet 2016

Why ValueID passed to SetValue is not a Int Value?

I get Warning, Exception: Manager.cpp:2660 - 102 - ValueID passed to SetValue is not a Int Value when work with Manager.cpp.

Here is my code:

int nodeid = atoi(argv[2]); // 6
int classid = strtol(argv[3], NULL, 16); // 0x25

SetValue(50, nodeid, classid);

void SetValue(int value, int nodeid, int classid)
{
    pthread_mutex_lock( &g_criticalSection );
    for( list<NodeInfo*>::iterator it = g_nodes.begin(); it != g_nodes.end(); ++it )
    {
    NodeInfo* nodeInfo = *it;
    if( nodeInfo->m_nodeId != nodeid ) continue;
    for( list<ValueID>::iterator it2 = nodeInfo->m_values.begin(); it2 != nodeInfo->m_values.end(); ++it2 )
    {
        ValueID v = *it2;
        if( v.GetCommandClassId() == classid)
        {
        int32* status;

        printf("n Setting Node %d to %i ",
               nodeInfo->m_nodeId,
               value);
        Manager::Get()->SetValue(v, value); // HERE IS THE ERROR
        printf("n Node %d is now %i n",
               nodeInfo->m_nodeId,
               Manager::Get()->GetValueAsInt(v, status));

        break;
        }
    }
    }

    pthread_mutex_unlock( &g_criticalSection );
}

Why 50 is not integer?

Aucun commentaire:

Enregistrer un commentaire