src/lss.c
changeset 370 6fecf36df407
parent 365 9b76e0881beb
child 381 854c43cdc24a
equal deleted inserted replaced
369:8b67289d50b5 370:6fecf36df407
    39 #ifdef CO_ENABLE_LSS
    39 #ifdef CO_ENABLE_LSS
    40 
    40 
    41 #include "data.h"
    41 #include "data.h"
    42 #include "lss.h"
    42 #include "lss.h"
    43 #include "canfestival.h"
    43 #include "canfestival.h"
       
    44 #include "sysdep.h"
    44 
    45 
    45 //#define LSS_TIMEOUT_MS	(TIMEVAL)1000  /* ms */
    46 //#define LSS_TIMEOUT_MS	(TIMEVAL)1000  /* ms */
    46 //#define LSS_FS_TIMEOUT_MS	(TIMEVAL)100  /* ms */
    47 //#define LSS_FS_TIMEOUT_MS	(TIMEVAL)100  /* ms */
    47 
    48 
    48 /* Returns the LSS ident field from a Message struct */
    49 /* Returns the LSS ident field from a Message struct */
   278    
   279    
   279   for(i=1;i<8;i++)m.data[i]=0;
   280   for(i=1;i<8;i++)m.data[i]=0;
   280   m.len = 8;
   281   m.len = 8;
   281   m.rtr = NOT_A_REQUEST;
   282   m.rtr = NOT_A_REQUEST;
   282   m.data[0]=command;
   283   m.data[0]=command;
   283   m.cob_id=SLSS_ADRESS;
   284   m.cob_id=UNS16_LE(SLSS_ADRESS);
   284   
   285   
   285   /* Tha data sent with the msg depends on the command */
   286   /* Tha data sent with the msg depends on the command */
   286   switch(command){
   287   switch(command){
   287   case LSS_INQ_NODE_ID: /* Inquire Node-ID */
   288   case LSS_INQ_NODE_ID: /* Inquire Node-ID */
   288   	m.data[1]=*(UNS8 *)dat1;
   289   	m.data[1]=*(UNS8 *)dat1;
   329   
   330   
   330   for(i=1;i<8;i++)m.data[i]=0;
   331   for(i=1;i<8;i++)m.data[i]=0;
   331   m.len = 8;
   332   m.len = 8;
   332   m.rtr = NOT_A_REQUEST;
   333   m.rtr = NOT_A_REQUEST;
   333   m.data[0]=command;
   334   m.data[0]=command;
   334   m.cob_id=MLSS_ADRESS;
   335   m.cob_id=UNS16_LE(MLSS_ADRESS);
   335   
   336   
   336   /* Tha data sent with the msg depends on the command */	
   337   /* Tha data sent with the msg depends on the command */	
   337   switch(command){
   338   switch(command){
   338   case LSS_SM_GLOBAL: /* Switch Mode Global */
   339   case LSS_SM_GLOBAL: /* Switch Mode Global */
   339   	d->lss_transfer.state=LSS_FINISHED;
   340   	d->lss_transfer.state=LSS_FINISHED;