Hi there

In an effort to try and understand networking, I copied some code from the 
following link 
(http://64.233.183.104/search?q=cache:lcu-HYOtTCUJ:www.et.byu.edu/groups/ececmpsysweb/cmpsys.2008.winter/tinyos.ppt+call+AMSend&hl=en&ct=clnk&cd=5&gl=uk)
 and when I compile it I get the following error message:

[Simple1]$ make micaz sim
mkdir -p build/micaz
  placing object files in build/micaz
  writing XML schema to app.xml
  compiling simple1AppC to object file sim.o
ncc -c -shared -fPIC -o build/micaz/sim.o -g -O0 -tossim 
-fnesc-nido-tosnodes=1000 -fnesc-simulate -fnesc-nido-motenumber=sim_node\(\)   
-finline-limit=100000 -Wall -Wshadow -Wnesc-all -target=micaz 
-fnesc-cfile=build/micaz/app.c -board=micasb 
-DIDENT_PROGRAM_NAME=\"simple1AppC\" -DIDENT_USER_ID=\"AntMan\" 
-DIDENT_HOSTNAME=\"FedAnt.Bikefact\" -DIDENT_USER_HASH=0xeeddd9a1L 
-DIDENT_UNIX_TIME=0x4863bd91L -DIDENT_UID_HASH=0x35974569L -Wno-nesc-data-race 
simple1AppC.nc   -fnesc-dump=components -fnesc-dump=variables 
-fnesc-dump=constants -fnesc-dump=typedefs -fnesc-dump=interfacedefs 
-fnesc-dump=tags -fnesc-dumpfile=app.xml
nesc1: nesc-semantics.c:145: language_name: Assertion `0' failed.
nesC: Internal error. Please send a bug report to the nesC bug mailing list
at [EMAIL PROTECTED]
make: *** [sim-exe] Error 1
[Simple1]$ 

To advise I have previously compiled many programs without this problem, 
including BlinkToRadio.

I am trying to understand how the send and receive works so I can get each mote 
to broadcast and then compile a local table of the n-hop motes. I wanted to 
start again with a simple example and then expand out..

Below is the code I am compiling, can you advise what I am missing. I cannot 
see what I have missed.

Thanks

Anthony

#ifndef SIMPLE1_H
#define SIMPLE1_H

typedef nx_struct MyPayload 
{
  nx_uint8_t count;
} MyPayload;

#endif


#include 
#include "simple1.h"

module simple1C
{
        uses interface Boot;
        uses interface AMPacket;
        uses interface AMSend;
        uses interface SplitControl;
        uses interface Receive;
}
implementation
{
        task void sendMsg();
        task void createMsg();

        message_t myMsg;
        int8_t myCount = 0; 

        event void Boot.booted() 
        {
                call SplitControl.start();
        } 

        event void SplitControl.startDone(error_t error) 
        {
                post createMsg();
                post sendMsg();
        } 

        event void SplitControl.stopDone(error_t error) 
        {
        }

        task void sendMsg() 
        {
                if(call AMSend.send(AM_BROADCAST_ADDR, &myMsg, 0) != SUCCESS) 
                {
                        post sendMsg();
                }
        }

        event void AMSend.sendDone(message_t* msg, error_t error) 
        {
                post sendMsg();
        }


        event message_t* Receive.receive(message_t* msg, void* payload, uint8_t 
len) 
        {
                return msg;
        }

        task void createMsg() 
        {
                MyPayload* payload = (MyPayload*) call 
AMSend.getPayload(&myMsg);
                payload->count = (myCount++);
                post sendMsg();
        }

}


#include 
#include "simple1.h"

configuration simple1App1C
{ }
implementation
{
        components MainC;
        components simple1C as Simple1;
        components ActiveMessageC;
        components new AMSenderC(0);  // send an AM type 0 message
        components new AMReceiverC(0);  // receive an AM type 0 message 


        Simple1.Boot -> MainC;
        Simple1.SplitControl -> ActiveMessageC;
        Simple1.AMSend -> AMSenderC;
        Simple1.Receive -> AMReceiverC;

}

COMPONENT=simple1AppC
include $(MAKERULES)

_________________________________________________________________
Great deals on almost anything at eBay.co.uk. Search, bid, find and win on eBay 
today!
http://clk.atdmt.com/UKM/go/msnnkmgl0010000004ukm/direct/01/
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to