master/canopen.c
changeset 175 2e4b18203ade
parent 164 ed85368b2b2e
child 195 674071846ee3
equal deleted inserted replaced
174:99907332ff1e 175:2e4b18203ade
   266                 return -1;
   266                 return -1;
   267             }
   267             }
   268 
   268 
   269             // Initialize SDO object
   269             // Initialize SDO object
   270             sdo->index = sdo_index;
   270             sdo->index = sdo_index;
   271             sdo->type = 0x0000;
   271             //sdo->unkown = 0x0000;
   272             sdo->features = 0x00;
   272             sdo->object_code = 0x00;
   273             sdo->name = NULL;
   273             sdo->name = NULL;
   274             INIT_LIST_HEAD(&sdo->entries);
   274             INIT_LIST_HEAD(&sdo->entries);
   275 
   275 
   276             list_add_tail(&sdo->list, &slave->sdo_dictionary);
   276             list_add_tail(&sdo->list, &slave->sdo_dictionary);
   277         }
   277         }
   330             EC_ERR("Invalid data size!\n");
   330             EC_ERR("Invalid data size!\n");
   331             ec_print_data(data, rec_size);
   331             ec_print_data(data, rec_size);
   332             return -1;
   332             return -1;
   333         }
   333         }
   334 
   334 
   335         sdo->type = EC_READ_U16(data + 8);
   335         EC_DBG("object desc response:\n");
   336         sdo->features = EC_READ_U8(data + 11);
   336         ec_print_data(data, rec_size);
       
   337 
       
   338         //sdo->unknown = EC_READ_U16(data + 8);
       
   339         sdo->object_code = EC_READ_U8(data + 11);
   337 
   340 
   338         name_size = rec_size - 12;
   341         name_size = rec_size - 12;
   339         if (name_size) {
   342         if (name_size) {
   340             if (!(sdo->name = kmalloc(name_size + 1, GFP_KERNEL))) {
   343             if (!(sdo->name = kmalloc(name_size + 1, GFP_KERNEL))) {
   341                 EC_ERR("Failed to allocate SDO name!\n");
   344                 EC_ERR("Failed to allocate SDO name!\n");