On Wed, 25 Feb 2009 07:53:41 -0700
KURT PETERS <[email protected]> wrote:
>
> The IEEE 802.15.4 specification for the PHY only allows for 1 byte to specify
> the PSDU size (the payload size for the MAC). 1 bit of that is reserved, so
> your whole MAC payload should only be < 127 bytes.
>
> I don't know how Javier is able to send such a large payload, unless
> mutliple PHY packets are being sent, or 802.15.4 PHY packet documentation is
> not being followed somehow.
>
>
>
> I'd be interested to know though.
Ok, that's the main code of my application radio module:
<file RadioES.h>
#ifndef __RADIO_ES
#define __RADIO_ES
enum {
RDATA_LENGTH = 128,
AM_RADIOES = 1,
RADIO_PREAMBLE_SIZE = 5
};
extern bool inputPending;
extern bool incomingF;
typedef nx_struct RadioES {
nx_uint16_t addr; /* Direccion del origen del mensaje */
nx_uint16_t endpoint; /* Endpoint al que va destinado el mensaje */
nx_uint8_t mLength; /* Longitud del mensaje */
nx_uint8_t data[RDATA_LENGTH]; /* Datos */
} RadioES_t;
#endif
<file RadioESC.nc>
......
......
......
event void Timer.fired() {
/*
Espera a que la radio este libre y transmite el mensaje
en cuanto puede.
*/
if (!busy) {
RadioES_t* radioPkg = (RadioES_t*) (call
Packet.getPayload(&package,NULL));
radioPkg->mLength = (uint8_t)charCount;
radioPkg->addr = TOS_NODE_ID;
radioPkg->endpoint = endpAddr;
call RoundI.read(&bufferO, (uint8_t*)radioPkg->data, charCount);
if (call AMSend.send(destination,
&package,radioPkg->mLength+RADIO_PREAMBLE_SIZE) == SUCCESS){
busy = TRUE;
charCount = 0;
dbg("Radio", "Sending data...\n");
/* Mensaje enviado correctamente */
}
} else {
post resend();
}
}
task void resend() {
call Timer.startOneShot(10);
}
event message_t* Receive.receive(message_t* msg, void* payload,uint8_t len)
{
RadioES_t* received;
call Leds.led1Toggle();
//if (len == sizeof(RadioES_t)) {
received = (RadioES_t*)payload;
sendingGateway = (uint16_t)received->addr;
sendingEndpoint = (uint16_t)received->endpoint;
call
RoundI.store(&bufferI,(uint8_t*)received->data,(uint16_t)received->mLength);
//}
if(inputPending) {
/* Hay lecturas pendientes */
inputPending=FALSE;
signal IOSystem.resumeInput();
}
return msg;
}
.........
.........
now, in the event Timer.fired() I send radioPkg->mLength+
RADIO_PREAMBLE_SIZE (<128 almost all times). But this is since 2 weeks
ago.
I've have been sending sizeof(RadioES_t) bytes (and using
RadioES_t.mLength to know hot many bytes of RadioES_t were valid
data) over 2 years in a older version of my project and it works fine in
a mica2, mica2dot and Iris.
I used cutecom to see the serial dump from a radio<---->rs232 gateway
and I received all the 133 bytes send by the radio of a mote.
That's the list of the module uses:
module RadioESC {
provides interface IOSystem;
uses {
interface RoundI;
interface Packet;
interface AMPacket;
interface AMSend;
interface Receive;
interface SplitControl as AMControl;
interface Timer<TMilli> as Timer;
interface Leds;
}
}
and this the Radio subsystem main configuration:
configuration RadioPicoC {
provides interface IOSystem;
}
implementation {
components RadioESC;
components RoundBufferC;
components ActiveMessageC;
components new AMSenderC(AM_RADIOES);
components new AMReceiverC(AM_RADIOES);
components new TimerMilliC() as Timer;
components LedsC;
RadioESC.RoundI -> RoundBufferC;
RadioESC.Packet -> AMSenderC;
RadioESC.AMPacket -> AMSenderC;
RadioESC.AMSend -> AMSenderC;
RadioESC.Receive -> AMReceiverC;
RadioESC.AMControl -> ActiveMessageC;
RadioESC.Timer -> Timer;
RadioESC.Leds -> LedsC;
IOSystem = RadioESC;
}
Interface IOSystem is an interface I wrote to access the radio subsystem
That's all...
Cheers
>
> Regards,
>
> Kurt
>
--
Nunca confies en un S.O. del que no tienes código fuente ;-)
--------------------------------
Javier Almansa Sobrino.
Ingeniero Técnico en Informática de Sistemas.
FSF #7032 Member (www.fsf.com)
Grupo de Investigación ARCo.
Escuela Superior de Informática. Ciudad Real
Tel: (+34)926 29 53 00 Ext: 3705
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help