I have the following typedefs. Pub type keeps two ints, and the pub_table keeps an array of publishers and an int.
Then on line
pt.table[pt.last] = p; I'm getting an error saying
" Error: incomplete structure ref 'table' saw 'operator: ='"
:: node_type == publisher ->
p.nodeid = node_id;
p.tid = topic_id;
pt.last = pt.last + 1;
pt.table[pt.last] = p;
Unfortunately I cannot see what's wrong on that line?
Best How To :
The error was because you can't assign a complete typedef variable in one go. I tried to do that by defining local variable
pub p; and then after initializing all fields in p, I tried to assign in one go here
pt.table[pt.last] = p. I managed to solve it like that:
pt.table[pt.last].nodeid = node_id;
pt.table[pt.last].tid = topic_id;
The current Spin implementation imposes the following restrictions on the use of typedef objects. It is not possible to assign the value of a complete typedef object directly to another such object of the same type in a single assignment.