There may be an overloading of "AMSend" names going on...
In the congig file try, instead of
TestAdcC.AMSend -> AM.AMSend[AM_TEST_SERIAL_MSG];
something like:
TestAdcC.TestMessage -> AM.AMSend[AM_TEST_SERIAL_MSG];
And then in the program file use:
call TestMessage.send(AM_BROADCAST_ADDR, ...
and
event void TestMessage.sendDone(message_t* ...
That's how I would do it with the old and moldy TOS1.x code anyway.
MS
Juan Verdu wrote:
> Hello everyone,
>
> I am working with a MSP430F2617 microcontroller and a radio CC2420
> under the Zolertia driver.
>
> I am making an application to read the internal temperature of the
> microcontroller, and later I will send the information to a base station
> under the Basestation application.
>
> My application performs Send () correctly but this application fails
> AM.sendDone (), if I change the component SerialActiveMessageC by
> ActiveMessageC, the same problem will happen. In this case, I do not use
> a radio. I use the serial port and I wouldn´t use the BaseStation
> application.
>
> The code is as follows:
>
>
> _Makefile_
>
> COMPONENT=TestAdcAppC
> CFLAGS += -DADC12_TIMERA_ENABLED
> CFLAGS += -DADC12_ONLY_WITH_DMA
> include $(MAKERULES)
> CFLAGS += -DCC2420_DEF_CHANNEL=20
>
> _TestAdc.h_
>
>
> #ifndef TEST_SERIAL_H
> #define TEST_SERIAL_H
> typedef nx_struct test_serial_msg {
> nx_uint16_t counter;
> } test_serial_msg_t;
> enum {
> AM_TEST_SERIAL_MSG = 0x89,
> };
> #endif
>
> _TestAdcC.nc _
>
> #include "Timer.h"
> #include "TestAdc.h"
>
> module TestAdcC
> {
> uses interface Boot;
> uses interface Leds;
> uses interface Timer<TMilli> as Timer0;
> uses interface Msp430Adc12Overflow as overflow;
> uses interface Msp430Adc12SingleChannel as adc;
> uses interface Resource;
> uses interface SplitControl as Control;
> uses interface Packet;
> uses interface AMSend;
> }
>
> implementation
> {
> #define BUF_SIZE 100
> uint16_t buf[BUF_SIZE];
> message_t packet;
>
> uint16_t counter = 0;
> uint16_t Data;
>
> void configureSingle();
> msp430adc12_channel_config_t adcconfig = {
> inch: SUPPLY_VOLTAGE_HALF_CHANNEL,
> sref: REFERENCE_VREFplus_AVss,
> ref2_5v: REFVOLT_LEVEL_1_5,
> adc12ssel: SHT_SOURCE_ACLK,
> adc12div: SHT_CLOCK_DIV_1,
> sht: SAMPLE_HOLD_4_CYCLES,
> sampcon_ssel: SAMPCON_SOURCE_SMCLK,
> sampcon_id: SAMPCON_CLOCK_DIV_1
> };
>
> event void Boot.booted()
> {
> call Resource.request();
> }
> async event void overflow.conversionTimeOverflow(){
> }
> async event void overflow.memOverflow(){
> }
>
> async event uint16_t *adc.multipleDataReady(uint16_t *buffer, uint16_t
> numSamples){
> return buffer;
> }
> task void send(){
> test_serial_msg_t* rcm = (test_serial_msg_t*)call
> Packet.getPayload(&packet, sizeof(test_serial_msg_t));
> // call Resource.release();
> call Leds.led0Toggle();
> rcm->counter = Data;
> if( call AMSend.send(AM_BROADCAST_ADDR, &packet,
> sizeof(test_serial_msg_t)) == SUCCESS)
> call Leds.led1Toggle();
> }
> async event error_t adc.singleDataReady(uint16_t data){
> Data = data;
> post send();
> return SUCCESS;
> }
> event void Resource.granted(){
> configureSingle();
> call Timer0.startPeriodic(2048);
> }
> void configureSingle(){
> error_t e;
> e = call adc.configureSingle(&adcconfig);
> }
> event void Timer0.fired()
> {
> call adc.getData();
> }
> event void AMSend.sendDone(message_t* bufPtr, error_t error) {
> call Leds.led2Toggle();
> }
> event void Control.startDone(error_t err) {
> }
>
> event void Control.stopDone(error_t err) {
> }
> }
>
> _TestAdcAppC.nc_
>
> #include "TestAdc.h"
> configuration TestAdcAppC {
> }
> implementation
> {
> components MainC,
> TestAdcC,
> LedsC;
> components ActiveMessageC as AM;
> components new TimerMilliC() as Timer0;
> components new Msp430Adc12ClientAutoDMAC() as Lectura;
> TestAdcC.overflow -> Lectura;
> TestAdcC.adc -> Lectura;
> TestAdcC.Resource -> Lectura;
> TestAdcC -> MainC.Boot;
> TestAdcC.Leds -> LedsC;
> TestAdcC.Timer0 -> Timer0;
> TestAdcC.Control -> AM;
> TestAdcC.AMSend -> AM.AMSend[AM_TEST_SERIAL_MSG];
> TestAdcC.Packet -> AM;
> }
>
> Could someone help me?
>
> Escribe texto o la dirección de un sitio web, o bien, traduce un
> documento <http://translate.google.es/?tr=f&hl=es>.
> Cancelar <http://translate.google.es/?tr=t&hl=es>
>
>
> traducción del español al inglés
>
> A greeting and thank you very much
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help