This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

help regarding simpliciti basic

Other Parts Discussed in Thread: CC2500, SIMPLICITI

Hello,

I am new in this embeded system and i need your help regarding simpilciti, i am using simplicit v.1.05 and cc2500 with MSP 430. I need your help on very simple matter, i am working on P2P bidirectional example. Just to experiment whats the purpose of link token or link id, i had change the Default Link Token for LinkListenTo and LinkTo  smpl_nwk_config.dat file. Then i tried to connect both of my devices and they were connected (:). I am confused on this scenario, because according to the Simpliciti Developers note, Page 17 "The presence of an Access Point is optional. If it is not present the default Link tokens must match in the two End Devices or the listener will reject the Link message by simply not responding."   Thats what i am using no AP in middle.I did not only change the Default Link Token in config.dat file but also in nwk_link.c. My question is

What is Link id and Link Token? Is there any difference between them?

According to my understanding one Linkid is initated by the device itself on smplStatus_t_SMPL_Link call. Then this same link id is used for the making the connection between talker device and listener. 

 Secondly i am trying to send my on own data from one device to another, i am using the same sending and receiving procedure defined for P2P example, but without using LED toggle routine. On compliation my programm didn't show any error or warning, but i am unable to view my output on my sniffer iterface ( i am using packet sniffer). The application payload field only show XXXXXX and nothing else.
Any one out there tried the same application with predefined data, kindly guide me where i am wrong.

static void linkTo()
{
  uint8_t  msg[2], delay = 0;
 
 

  while (SMPL_SUCCESS != SMPL_Link(&sLinkID1))
  {
    // blink LEDs until we link successfully
    //toggleLED(1);
    //toggleLED(4);
    toggleLED(2);
    toggleLED(1);
    toggleLED(4);
   
    SPIN_ABOUT_A_SECOND;
  }

  // we're linked. turn off red LED. received messages will toggle the green LED.
  if (BSP_LED3_IS_ON())
  {
    toggleLED(1);
  }

  // put LED to toggle in the message
    msg[0] = 2;  // toggle red
  //msg
 
  /*while (1)
  {
    SPIN_ABOUT_A_SECOND;
    if (delay > 0x00)
    {
      SPIN_ABOUT_A_SECOND;
    }
    if (delay > 0x01)
    {
      SPIN_ABOUT_A_SECOND;
    }
    if (delay > 0x02)
    {
      SPIN_ABOUT_A_SECOND;
    }*/

    // delay longer and longer -- then start over
    delay = (delay+1) & 0x03;
    // put the sequence ID in the message
       // msg[1] = ++sTxTid;
    msg[1] = sTxTid--;
   
      //SMPL_Send(sLinkID1, msg, sizeof(msg));
     
   
      SMPL_Send(sLinkID1, "HELLO", 6);
     
     

Waiting for your kind reply.

Best Regards

R Soul

 

 

  • Hello.

    The link token is used only in the link negotiation. It is used only by the network layer and it appears in the link frame and is validated by the listener before the listener replies. The idea here is to provide a mechanism to keep devices from linking to the wrong device. Kind of like keeping your garage door opener from opening your neighbor's. Hopefully each device has a different link token if the topology is just P2P with no Access Point. If there is an Access Point you have the opportunity of distributing a link token at run time to further ensure uniqueness. But this isn't necessary. So, what you did by changing the value in the configuration file would change to default link token for all devices built with that file. This is really a don't-care if there is an Access Point since the AP will distribute a link token at join time and it could be different.

    The Link ID is simply the handle that the application uses to talk to its peer once the linking is complete. Think of it as a file descriptor or a socket -- just an alias that the network layer uses to find the connection information when the application does a SMPL_Send() or a SMPL_Receive(). It binds the local application to its remote peer.

    As for your application using different arguments in SMPL_Send() I see nothing wrong with what you've done from what you have provided. Sorry. Maybe there is some way to post or send the sniffer file so I can see it.

    Hope this helps.

    lfriedman

  • Hello lfriedman,

    Thank you for replying and guiding me, but my question regarding the Link Token is still there.  As you wrote

    The link token is used only in the link negotiation. It is used only by the network layer and it appears in the link frame and is validated by the listener before the listener replies. The idea here is to provide a mechanism to keep devices from linking to the wrong device. 

    I understood this point and according to my scenario also understood this line  Hopefully each device has a different link token if the topology is just P2P with no Access Point. As, in my scenario this thing is happening, two different end devices can connect with each other even with different link token. But my point is still there that in developers note Page 17

    "The presence of an Access Point is optional. If it is not present the default Link tokens must match in the two End Devices or the listener will reject the Link message by simply not responding. "

    So, what does this line mean, its confusing because when two end devices are directly connected they make P2P link.

    About the sniffer file i ll send you in attacgment on your mail.

     

    BR

    R Soul