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.

CCS: BLE Advertisment/Packets, Dual TX

Other Parts Discussed in Thread: CC1350, CC2650

Tool/software: Code Composer Studio

I'm using the rfDualModeTX example (in which i added an RX function). Later application: receive a RX message and forward it through BLE and Sub1ghz.

For BLE TX, in the example this command is used:

RF_runScheduleCmd(rfBleHandle, (RF_Op*) RF_ble_pCmdBleAdvNc, &schParams, txDoneCallback, 0);

And the settings that i use are:

RF_ble_pCmdBleAdvNc->pParams->advLen = PACKET_DATA_LENGTH;    //22
RF_ble_pCmdBleAdvNc->pParams->pAdvData = packet;                                //random data
RF_ble_pCmdBleAdvNc->startTrigger.triggerType = TRIG_NOW;

I don't have another CC1350 or CC2650 Chip to check the received messages. For this task, i want to use a BLE sniffer or a smartphone with a BLE analyzer app.
But the sniffer and the smartphone doesn't receive any BLE advertisment packets from the chip (i tried also to just send several packets through the advertisment channels 37, 38, 39. What can be the problem?

And my second question: In SmartRF Studio, there are also other BLE commands as 'BLE Slave Command'. Are they suitable with the CC1350 chip? And is the packet header the only difference between these commands?

Code without sub1ghz TX:

void *mainThread(void *arg0){
    uint32_t curtime;
    uint16_t cmdStatus;
    RF_EventMask terminationReason;

   pinHandle = PIN_open(&pinState, pinTable);
   if(pinHandle == NULL)
   {
       while(1);
   }

   /* Data queue should be large enough for either packet */
   if( RFQueue_defineQueue(&dataQueue,
                               rxDataEntryBuffer,
                               sizeof(rxDataEntryBuffer),
                               NUM_DATA_ENTRIES,
                               PAYLOAD_LENGTH + NUM_APPENDED_BYTES))
   {
       /* Failed to allocate space for all data entries */
       PIN_setOutputValue(pinHandle, Board_PIN_LED1, 1);
       PIN_setOutputValue(pinHandle, Board_PIN_LED2, 1);
       while(1);
   }

   /* Initialize multimode scheduling params
    * - Params shared between rf drivers since commands are synchronous
    * - Ignore end time
    * - Priority should not effect transmission */
   RF_ScheduleCmdParams schParams;
   schParams.endTime = 0;
   schParams.priority = RF_PriorityNormal;
   schParams.allowDelay = RF_AllowDelayAny;

   /* Initialize Prop RF Driver */
   RF_Params rfPropParams;
   RF_Params_init(&rfPropParams);

   /* Set mode for multiple clients
    * - Configure client event mask
    * - Set callback for client switch */
   RF_prop.rfMode = RF_MODE_MULTIPLE;
   rfPropParams.nClientEventMask = RF_ClientEventSwitchClientEntered;
   rfPropParams.pClientEventCb = rxSwitchClient;

   //////////////////////////

   RF_cmdPropRx.pQueue = &dataQueue;
   RF_cmdPropRx.rxConf.bAutoFlushIgnored = 1;  /* Discard ignored packets from Rx queue */
   RF_cmdPropRx.rxConf.bAutoFlushCrcErr = 0;   /* Discard packets with CRC error from Rx queue */
   RF_cmdPropRx.maxPktLen = PACKET_DATA_LENGTH;        /* Implement packet length filtering to avoid PROP_ERROR_RXBUF */
   RF_cmdPropRx.pktConf.bRepeatOk = 0;             //0    /* Repeat RX if packet received */
   RF_cmdPropRx.pktConf.bRepeatNok = 0;                /*  End operation after receiving a packet with CRC error, not again sync search *

   ////
   /* Stop 100 ms after command started */
   RF_cmdPropRx.endTrigger.triggerType = TRIG_REL_START;
   RF_cmdPropRx.endTime = RF_convertMsToRatTicks(10);


   ////

   /* Request access to the prop radio and
    * - Radio is not powered on by RF_open
    * - RF_cmdFs will power on the radio to cache the frequency settings */
   rfPropHandle = RF_open(&rfPropObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfPropParams);
   RF_postCmd(rfPropHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);

   /* Initialize BLE RF Driver */
   RF_Params rfBleParams;
   RF_Params_init(&rfBleParams);

   /* Set mode for multiple clients
    * - Configure client event mask
    * - Set callback for client switch */
   RF_pModeBle->rfMode = RF_MODE_MULTIPLE;
   rfBleParams.nClientEventMask = RF_ClientEventSwitchClientEntered;
   rfBleParams.pClientEventCb = rxSwitchClient;

   //TX //Added
   RF_ble_pCmdBleAdvNc->pParams->advLen = PACKET_DATA_LENGTH;
   RF_ble_pCmdBleAdvNc->pParams->pAdvData = packet;
   RF_ble_pCmdBleAdvNc->startTrigger.triggerType = TRIG_NOW;

   //RX
   RF_ble_pCmdBleGenericRx->pParams->pRxQ = &dataQueue;
   RF_ble_pCmdBleGenericRx->pParams->bRepeat = 0;
   RF_ble_pCmdBleGenericRx->pParams->rxConfig.bAutoFlushCrcErr = 1;


   /* Request access to the ble radio and
      * - RF_ble_pCmdFs does not need to run unless no channel is specified (0xFF)
      * - Channel 17 (0x8C) is used by default */
   rfBleHandle = RF_open(&rfBleObject, RF_pModeBle, (RF_RadioSetup*)RF_ble_pCmdRadioSetup, &rfBleParams);
   //RF_runCmd(rfBleHandle, (RF_Op*)RF_ble_pCmdFs, RF_PriorityNormal, NULL, 0);

        while(1)
   {
       // ADDED, packet for BLE TX
       /* Create packet with incrementing sequence number and random payload */
               uint8_t i;
               for (i = 0; i < PACKET_DATA_LENGTH; i++)
               {
                   packet[i] = rand();
               }


       RF_runScheduleCmd(rfPropHandle, (RF_Op*)&RF_cmdPropRx,
                                                 &schParams, &rxDoneCallback,
                                                 RF_EventLastCmdDone  | RF_EventRxEntryDone);
                                                 
       
       /* Get current time */
       //curtime = RF_getCurrentTime();
       //RF_ble_pCmdBleAdvNc->startTime = curtime;
       RF_ble_pCmdBleAdvNc->channel = 0x37;
      RF_runScheduleCmd(rfBleHandle, (RF_Op*) RF_ble_pCmdBleAdvNc,
                                                     &schParams, NULL, 0);
      RF_ble_pCmdBleAdvNc->channel = 0x38;
      RF_runScheduleCmd(rfBleHandle, (RF_Op*) RF_ble_pCmdBleAdvNc,
                                                     &schParams, NULL, 0);
      RF_ble_pCmdBleAdvNc->channel = 0x39;
      RF_runScheduleCmd(rfBleHandle, (RF_Op*) RF_ble_pCmdBleAdvNc,
&schParams, NULL, 0);
      /* Switch from PROP -> BLE client */
      RF_runScheduleCmd(rfBleHandle, (RF_Op*)RF_ble_pCmdBleGenericRx,
                                     &schParams, &rxDoneCallbackble,
                                     RF_EventCmdDone  | RF_EventRxEntryDone);
}