关于TelosB的整个系统是如何工作的,我有一个非常基本的问题。我已经看过了数据手册和TelosB是如何操作的。
现在我需要通过TelosB节点发送一些特定的数据。我看到了TinyOS的数据包格式。并定义了有效载荷。
typedef nx_struct packet {
nx_uint16_t id; /* Mote id of sending mote. */
nx_uint16_t count; } packet_t;在无线电计数leds代码中,我更改了几个小东西
#include "Timer.h"
#include "RadioCountToLeds.h"
module RadioCountToLedsC @safe() {
uses {
interface Leds;
interface Boot;
interface Receive;
interface AMSend;
interface Timer<TMilli> as MilliTimer;
interface SplitControl as AMControl;
interface Packet;
}
}
implementation {
message_t packet;
bool locked;
uint16_t counter = 0;
event void Boot.booted() {
call AMControl.start();
}
event void AMControl.startDone(error_t err) {
if (err == SUCCESS) {
call MilliTimer.startPeriodic(250);
}
else {
call AMControl.start();
}
}
event void AMControl.stopDone(error_t err) {
// do nothing
}
event void MilliTimer.fired() {
counter++;
dbg("RadioCountToLedsC", "RadioCountToLedsC: timer fired, counter is
%hu.\n", counter);
if (locked) {
return;
}
else {
radio_count_msg_t* rcm = (radio_count_msg_t*)call
Packet.getPayload(&packet, sizeof(radio_count_msg_t));
if (rcm == NULL) {
return;
}
rcm->counter = 11110000;
if (call AMSend.send(AM_BROADCAST_ADDR, &packet, sizeof(radio_count_msg_t)) == SUCCESS) {
dbg("RadioCountToLedsC", "RadioCountToLedsC: packet sent.\n", counter);
locked = TRUE;
}
}}
计数器是我想要传输的数据。是11110000。当此TinyOS代码在Telosb微尘中运行时,如何解释11110000?我需要非常具体地说明哪些数据将进入telosb或OQPSK的DAC。
我想详细了解数据是如何读取和解释的。
发布于 2019-07-17 11:00:22
我想我得到答案了。cc2420芯片
http://www.ti.com/lit/ds/symlink/cc2420.pdf
https://stackoverflow.com/questions/57066449
复制相似问题