首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >TinyOS如何与TelosB硬件通信?

TinyOS如何与TelosB硬件通信?
EN

Stack Overflow用户
提问于 2019-07-17 06:54:36
回答 1查看 66关注 0票数 0

关于TelosB的整个系统是如何工作的,我有一个非常基本的问题。我已经看过了数据手册和TelosB是如何操作的。

现在我需要通过TelosB节点发送一些特定的数据。我看到了TinyOS的数据包格式。并定义了有效载荷。

代码语言:javascript
复制
  typedef nx_struct packet {
      nx_uint16_t id; /* Mote id of sending mote. */
      nx_uint16_t count; } packet_t;

在无线电计数leds代码中,我更改了几个小东西

代码语言:javascript
复制
    #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。

我想详细了解数据是如何读取和解释的。

EN

回答 1

Stack Overflow用户

发布于 2019-07-17 11:00:22

我想我得到答案了。cc2420芯片

http://www.ti.com/lit/ds/symlink/cc2420.pdf

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57066449

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档