Hi all
Maybe my following question either is a bit tricky or has no solution. Suppose
the following multi-hop scenario where we have an end-device (no routing
capabilities, it only transmits data to a unique destination), one or several
routing devices (their aim is to forward the data transmitted by the end-device
to one or several destinations), and one destination (sink):
End-Device --> Routing Device 1 --> ... --> Routing Device n --> Destination
I am implementing some libraries which ought to be the same regardless of the
type of device, namely end-device, routing device and/or destination. As I
briefly pointed out, the end-device has no routing capabilities, which implies
that its routing table only constains the node it used for joining the network
-parent node- and, additionally, it should not implement any message queue to
store data. On the contrary, this same features do have to be implemented by
the intermediate devices (routing ones), that is, routing tables of higher size
for storing more neighboring devices, and message_t queues.
I've "solved" the former using dynamic memory (I know this is supposed to not
be used, by I've tried to control the usage of memory). However, the issue
comes with the latter requirement of implementing the message_t queues. This is
explained below.
In my library, I employ a unique configuration file (I'll refer it hereafter as
main_conf.nc ) that wires everything and it is the same for end-devices and
routing-devices. It is worthy to remark that the final application running on
each device has a different configuration file that wires to this library.
Thus, in this file main_conf.nc, the QueueC and PoolC components ought to be
included. A priori, it should be done as follows:
In some .h file:
#define RX_QUEUE_SIZE 12
or
enum{ RX_QUEUE_SIZE = 12};
and in the confuguration file:
implements{...components new QueueC(message_t*, RX_QUEUE_SIZE),
new PoolC(message_t, RX_QUEUE_SIZE);...}
The easy way would be to change the RX_QUEUE_SIZE value to 1 (or eliminate the
QueueC and PoolC components of the code) every time I compile the code for an
end-device, being this slow and/or inefficient. So, is it possible to do this
in any way? Had both components been defined in the configuration file without
indicating the size of the queue, I may use again dynamic memory. But in this
case...
I hope all written above were easily understood!
Regards,
David
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help