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.

Cant use SMPL_LINKID_USER_UUD broadcasts without first joining a network?????

Other Parts Discussed in Thread: SIMPLICITI, CC430F5137

I can use SMPL_LINKID_USER_UUD successfully, but ONLY if I join a network normally to begin with.

If I don't do the usual LINK and JOIN functions then the code refuses to work. If I add in LINK and JOIN, but change nothing else then it all works fine if I use SMPL_LINKID_USER_UUD in Rx/Tx for both AP and EP.

I thought the idea of the Unconnected User Datagram was to be able to send a broadcast without being connected? Hence, i can only assume I'm doing something wrong. However, the first few lines of SMPL_SendOpt would seem to suggest the reason why being unconnected is not tolerated:

smplStatus_t SMPL_SendOpt(linkID_t lid, uint8_t *msg, uint8_t len, txOpt_t options)
{
  frameInfo_t  *pFrameInfo;
  connInfo_t   *pCInfo     = nwk_getConnInfo(lid);
  smplStatus_t  rc         = SMPL_BAD_PARAM;
  uint8_t       radioState = MRFI_GetRadioState();
  uint8_t       ackreq     = 0;
#if defined(ACCESS_POINT)
  uint8_t  loc;
#endif

  /* we have the connection info for this Link ID. make sure it is valid. */
   if (!pCInfo || ((rc=nwk_checkConnInfo(pCInfo, CHK_TX)) != SMPL_SUCCESS))
  {
    return rc;
  }

  • Hi,

    Are you sure the UUID packet is not actually being sent? Do you have a Simpliciti sniffer to check whats going on on the radio link, because if not I suggest you get one. I found that when I tried to do what you say from an unjoined state the packet was actually sent but I never received it.

    Investigating the low level I discovered the callback functions require the LinkId, and I had to specifically put the SMPL_LINKID_USER_UUD in the callback and the message read to get them off the Simpliciti message queue.

    /*******************************************************************************
    * Function : DeviceCB
    * Description : Call back thread
    * Date : 12XXXX
    * Parameters : None
    * Returns : None
    * Caveats : Runs in ISR context. Reading the frame should be done in the
    * application thread not in the ISR thread.
    ******************************************************************************/
    uint8_t DeviceCB(linkID_t lid)
    {
    if (lid || SMPL_LINKID_USER_UUD)
    {
    sPeerFrameSem++;
    DBGRP(printf("P%d\n\r", sPeerFrameSem);)
    }

    /* leave frame to be read by application. */
    return 0;
    }

    void DeviceProcessMessagesRadio(void)
    {
    bspIState_t intState;

    /* Have we received a frame on one of the ED connections?
    * No critical section -- it doesn't really matter much if we miss a poll
    */
    if (sPeerFrameSem)
    {
    uint8_t msg[MAX_APP_PAYLOAD], len;

    // process all link frames waiting
    if (SMPL_SUCCESS == SMPL_Receive(LinkID1, msg, &len))
    {
    BSP_ENTER_CRITICAL_SECTION(intState);
    sPeerFrameSem--;
    DBGRP(printf("ML%d\n\r", sPeerFrameSem);)
    BSP_EXIT_CRITICAL_SECTION(intState);

    DeviceProcessDetailRadio(LinkID1, msg, len);
    }

    //process any broadcast messages
    if (SMPL_SUCCESS == SMPL_Receive(SMPL_LINKID_USER_UUD, msg, &len))
    {
    BSP_ENTER_CRITICAL_SECTION(intState);
    sPeerFrameSem--;
    DBGRP(printf("MB%d\n\r", sPeerFrameSem);)
    BSP_EXIT_CRITICAL_SECTION(intState);

    DeviceProcessDetailRadio(SMPL_LINKID_USER_UUD, msg, len);
    }

    }
    }

  • Hi Simon,

    Thanks for the feedback. I'm not currently using a packet sniffer and I agree that it would be a good thing.

    I think you may be onto something with your thoughts that the message is being sent, but not received. I am going to look into this and report back. If I cant get any further than I'll invest in the HW for a packet sniffer.

    Cheers,

    Stuart

  • Hi Stuart,

    I am using the CC430F5137 in the our system, and the CC1110dkmini, http://www.ti.com/tool/cc1110dk-mini-868 for the sniffer. only $75 and worth every cent I paid.

    You need to match the sniffer hardware frequency with your target hardware.

    Regards

    Simon Buchwald
    Amatek Design
    www.amatek.com 

  • OK, problem solved. It turned out that I was Joining AND Linking, whereas all I have to do is Join the network (ie invoke SMPL_Init(0) ).

    Thanks again for the help

  • Hi Stuart,

    In my implementation I was able to send and receive broadcast messages regardless of the join or link state. But if joining works for you then that's good.

    Regards

    Simon Buchwald

  • Hello.

    This is correct. It is not necessary to Join or Link in order to use the broadcast capability.

    The SimpliciTI initialization silently populates the Connection Table with an entry that ensures any application frame sent using the Link ID  SMPL_LINKID_USER_UUD is considered valid by the network layer of any device that receives it, i.e. nwk_isConnectionValid() will return non-zero. Any application that then looks for such a message (does a SMPL_Receive()) on the Link ID SMPL_LINKID_USER_UUD will get the message.

    lfriedman