Changeset 572

Show
Ignore:
Timestamp:
05/03/08 15:44:43 (2 weeks ago)
Author:
agr
Message:

xmpp update

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • nano-RK/projects/SAMPL/slip-clients/xmpp-client/globals.h

    r500 r572  
    33 
    44#include <stdint.h> 
     5#include <lm-library.h> 
    56 
    67uint8_t debug_txt_flag; 
     
    910uint8_t print_input_flag; 
    1011 
     12XMPPConnection *connection; 
     13 
    1114#endif 
  • nano-RK/projects/SAMPL/slip-clients/xmpp-client/main.c

    r566 r572  
    8888no_slip_flag=0; 
    8989print_input_flag=0; 
     90connection=NULL; 
    9091 
    9192  if (argc < 3 || argc > 6) { 
     
    171172        } 
    172173         
    173         ret = start_xmpp_client(username,  
     174        connection = start_xmpp_client(username,  
    174175                                password,  
    175176                                xmpp_server,  
     
    179180                                NULL); 
    180181 
    181         if(ret != XMPP_NO_ERROR) { 
    182                 g_printerr("Could not start client. Error='%s'\n",ERROR_MESSAGE(ret)); 
     182        if(connection == NULL) { 
     183                g_printerr("Could not start client.\n"); 
    183184                return -1; 
    184185        } 
     
    205206  { 
    206207        // generate parent node for gateway 
    207         ret = create_event_node(name,NULL,FALSE); 
     208        ret = create_event_node(connection, name,NULL,FALSE); 
    208209        if(ret != XMPP_NO_ERROR) { 
    209210                if(ret == XMPP_ERROR_NODE_EXISTS) 
  • nano-RK/projects/SAMPL/slip-clients/xmpp-client/node_list.c

    r500 r572  
    5454        node_list_add(node_name); 
    5555        // generate parent node for gateway 
    56         ret = create_event_node(node_name,NULL,FALSE); 
     56        ret = create_event_node(connection, node_name,NULL,FALSE); 
    5757        if(ret != XMPP_NO_ERROR) { 
    5858                if(ret == XMPP_ERROR_NODE_EXISTS) 
     
    7474                strftime(timeStr,100,"%Y-%m-%d %X",localtime(&timestamp)); 
    7575                sprintf(buf,"<Node id=\"%s\" type=\"FIREFLY\" description=\"A Firefly Node\" timestamp=\"%s\"></Node>",node_name,timeStr); 
    76                 if(xmpp_flag==1) ret = publish_to_node(node_name,buf); 
     76                if(xmpp_flag==1) ret = publish_to_node(connection,node_name,buf); 
    7777  
    7878} 
  • nano-RK/projects/SAMPL/slip-clients/xmpp-client/xmpp_pkt_writer.c

    r566 r572  
    8080         
    8181        if(debug_txt_flag==1 ) printf( "Publish: %s\n",buf); 
    82         if(xmpp_flag==1 ) ret = publish_to_node(publisher_node_name,buf); 
     82        if(xmpp_flag==1 ) ret = publish_to_node(connection, publisher_node_name,buf); 
    8383        if(xmpp_flag && ret!=XMPP_NO_ERROR) printf( "XMPP Error: %s\n",ERROR_MESSAGE(ret)); 
    8484 
     
    122122         
    123123        if(debug_txt_flag==1) printf( "Publish: %s\n",buf); 
    124         if(xmpp_flag==1) ret = publish_to_node(node_name,buf); 
     124        if(xmpp_flag==1) ret = publish_to_node(connection,node_name,buf); 
    125125        if(xmpp_flag==1 && ret!=XMPP_NO_ERROR) printf( "XMPP Error: %s\n",ERROR_MESSAGE(ret)); 
    126126  
     
    173173        { 
    174174        if(debug_txt_flag==1 ) printf( "Publish: %s\n",buf); 
    175         if(xmpp_flag==1 ) ret = publish_to_node(node_name,buf); 
     175        if(xmpp_flag==1 ) ret = publish_to_node(connection,node_name,buf); 
    176176        if(xmpp_flag && ret!=XMPP_NO_ERROR) printf( "XMPP Error: %s\n",ERROR_MESSAGE(ret)); 
    177177        if(debug_txt_flag==1) printf( "Publish done\n");