> From: himanshu barve <[email protected]>
> Date: 2009/10/28
> Subject: problem while having both CTP(multihop) and AMsenderC instances in
> same program
> To: Omprakash Gnawali <[email protected]>,
> [email protected]
>
>
> Hello Friends . ,
> I have included Omprakash Gnawali as i have seen him answering most of the
> answers related to CTP .
> I am working on one program , in which i need some motes to have both
> multihop and single hop instances together . Basically multihop protocol is
> for data acquisition and its data flow is from sensor nodes to base node.
> And AMsenderC instance is bidirectional which originates from base , and
> does kind of manual multihop . with the help of if condition and again send
> the same to respective mote.
> Now the problem is arising in some motes where CollectionSenderC and
> AMsenderC are working together . (Problem did not came for the one where
> Receive and CollectionSenderC was there .. )
> Now some part of my program ..
>   Status_MoteAppC.nc (not whole but only required field)
> _______________________________________________________________
>         components CollectionC as Collector; // Collection layer
>      components ActiveMessageC;                       // AM layer
>      components new CollectionSenderC(MHOP_WIRELESSMON); // Sends multihop
> RF
>      components new AMSenderC(AM_RADIO_SENSOR);
>    components new AMReceiverC(AM_RADIO_STATUS);
>         App.MhopSend -> CollectionSenderC.Send;
>    App.SnoopMsg -> Collector.Intercept[MHOP_WIRELESSMON];
>    App.RoutingControl -> Collector;
>    App.RadioControl -> ActiveMessageC;
> App.RootControl -> Collector;
> App.ResetSend -> AMSenderC.AMSend;
>    App.ResetReceive -> AMReceiverC.Receive;
>    App.Packet -> AMSenderC;
> -----------------------------------------------------------------------------------------------------------------------
> Status_MoteC.nc (only required part)
>          uses interface Send as MhopSend;
>          uses interface CollectionPacket;
>    uses interface RootControl;
>    uses interface SplitControl as RadioControl;
>    uses interface StdControl as RoutingControl;
>    uses interface Receive as ResetReceive;
>      uses interface Send as ResetSend;
>      uses interface Packet;
>
> event message_t* ResetReceive.receive(message_t* ResBuf ,void* payload,
> uint8_t len)
> {
> if (len != sizeof(ResetMesg_t))
> {
> return ResBuf;
> }
> else
> {
>        ResetMesg_t* Res = (ResetMesg_t*)payload;
>        if (Res -> reset_nodeid == TOS_NODE_ID || Res -> reset_nodeid == 0 )
>        {
>        call ResetTimer.startOneShot(100);
>        }
>        if (Res -> reset_statusid == TOS_NODE_ID)
>        {
>        if (!ResetBusy)
>        {
>       if (call ResetSend.send(TOS_BCAST_ADDR, &Resbuf, sizeof(ResetMesg_t))
> == SUCCESS)
>        {
> ResetBusy = TRUE;
>        }
>        }
>        }
>
>        return ResBuf;
>        }
>        }
> --------------------------------------------------------------------------------------------------------------------------------------
> Error message
> In component `Status_MoteC':
> Status_MoteC.nc: In function `ResetReceive.receive':
> Status_MoteC.nc:208: warning: passing argument 1 of `ResetSend.send' makes
> point
> er from integer without a cast
> Status_MoteC.nc:208: warning: passing argument 2 of `ResetSend.send' makes
> integ
> er from pointer without a cast
> Status_MoteC.nc:208: too many arguments to function `ResetSend.send'
> /opt/tinyos-2.x/tos/chips/cc2420/lpl/DummyLplC.nc:39:2: warning: #warning

This means you have too many arguments to ResetSend.send. It should
have two arguments. Here is a snippet from tos/interfaces/Send.nc:

  /**
    * Send a packet with a data payload of <tt>len</tt>. To determine
    * the maximum available size, use the Packet interface of the
    * component providing Send. If send returns SUCCESS, then the
    * component will signal the sendDone event in the future; if send
    * returns an error, it will not signal sendDone.  Note that a
    * component may accept a send request which it later finds it
    * cannot satisfy; in this case, it will signal sendDone with an
    * appropriate error code.
    *
    * @param   'message_t* ONE msg'     the packet to send
    * @param   len     the length of the packet payload
    * @return          SUCCESS if the request was accepted and will issue
    *                  a sendDone event, EBUSY if the component cannot accept
    *                  the request now but will be able to later, FAIL
    *                  if the stack is in a state that cannot accept requests
    *                  (e.g., it's off).
    */
  command error_t send(message_t* msg, uint8_t len);

- om_p

_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to