Hi,
I'm trying to adapt the Oscilloscope exemple, present in TinyOS 2.1.1, to my
purpose. Instead of reading from a sensor and transmit those readings, I want
to read from serial using pins 2 and 4 of the expansion port of a telosb mote.
If I use the Oscilloscope example without any change, my test scenario works.
When I introduce my changes, the event UartReceive.receive is never called. The
source is sending data, as I tested it with a notebook.
My changes came from the BaseStation example, and are the following:
configuration OscilloscopeAppC { }
implementation
{
( ... )
components ActiveMessageC as Radio, SerialActiveMessageC as Serial;
OscilloscopeC.SerialControl -> Serial;
//OscilloscopeC.UartSend -> Serial;
OscilloscopeC.UartReceive -> Serial.Receive;
OscilloscopeC.UartPacket -> Serial;
OscilloscopeC.UartAMPacket -> Serial;
}
module OscilloscopeC @safe()
{
uses {
( ... )
interface SplitControl as SerialControl;
//interface AMSend as UartSend[am_id_t id];
interface Receive as UartReceive[am_id_t id];
interface Packet as UartPacket;
interface AMPacket as UartAMPacket;
}
}
implementation
{
event void Boot.booted() {
uint8_t i;
for (i = 0; i < UART_QUEUE_LEN; i++)
uartQueue[i] = &uartQueueBufs[i];
uartIn = uartOut = 0;
uartBusy = FALSE;
uartFull = TRUE;
( ... )
if (call SerialControl.start() != SUCCESS)
report_problem();
}
event void SerialControl.startDone(error_t error) {
event void SerialControl.stopDone(error_t error) {}
event message_t *UartReceive.receive[am_id_t id](message_t *msg, void
*payload, uint8_t len)
{
message_t *ret = msg;
call Leds.led2Toggle();
atomic
if( reading != NREADINGS )
{
local.readings[reading++] = msg->data[0];
}
return ret;
}
Looks like the mote isn't reading from UART0TX/ UART0RX pins. What may be still
missing?
Thanks in advance!
Best regards,
Marcelo Coelho<mailto:[email protected]>
________________________________
DISCLAIMER: This message is confidential and may contain privileged
information. It is for use only by the people or entities to whom it is
addressed. If you are not an intended recipient, you should not disclose,
distribute, copy, print, rely on or otherwise make use of this message. If an
addressing or transmission error has misdirected it to you we would be grateful
if you would please notify the sender by return, before deleting it from your
system.
________________________________
Are you controlling information disclosure? Decide what you need to keep secret
and enforce it with csSECURE. See how at www.csSECURE.net.
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help