Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

Receiving BLE advertisment packets with CC1350

$
0
0

Hi all,

I'm already receiving BLE packets with the help of Smart RF Studio setting the chanel to 37,38 or 39. I'm aware that this software uses radio comands to configure and forcing the radio to listen with this commands.

CMD_RADIO_SETUP executed

> Status: 0x400 DONE_OK

>CMD_FS executed

> Status: 0x400 DONE_OK

>CMD_BLE_GENERIC_RX executed

> Status: 0x2 ACTIVE

Is there any example on which this commands were used? I've already download BLE stack and far as I could see I can't find nothing of this implementations.

My purpose is to understand how this work at command level in order to write a receiving function for Contiki.

In Contiki there already are an example which uses CMD_BLE_ADV_NC to send advertisment packets but for the receiving part there is none.

I've tried to write a function like this:

#define BLE_ACCESS_ADDRESS 0x8E89BED6

static dataQueue_t rx_data_queue = { 0 };

static int
send_ble_generic_rx()
{
  uint32_t cmd_status;
  rfc_CMD_BLE_GENERIC_RX_t cmd;
  rfc_bleGenericRxPar_t *params;
 
  params = (rfc_bleGenericRxPar_t *)ble_params_buf;
    
  /* Clear both buffers */
  memset(&cmd, 0x00, sizeof(cmd));
  memset(ble_params_buf, 0x00, sizeof(ble_params_buf));
    
  /* Adv RX */
  cmd.commandNo = CMD_BLE_GENERIC_RX; //
  cmd.condition.rule = COND_NEVER; //
  cmd.whitening.bOverride = 0;
  cmd.whitening.init = 0;
  cmd.pParams = params; //
  cmd.channel = 37; //

  /* Set up BLE parameters */
  params->accessAddress = BLE_ACCESS_ADDRESS; //
  params->endTrigger.triggerType = TRIG_NEVER; //
  params->endTime = TRIG_NEVER; //
 
  /* Set up BLE parameters */
  params = (rfc_bleGenericRxPar_t *)ble_params_buf;
  params->pRxQ = &rx_data_queue;


  if(rf_core_send_cmd((uint32_t)&cmd, &cmd_status) == RF_CORE_CMD_ERROR) {
    PRINTF("send_generic_rx_nc: Chan=%d CMDSTA=0x%08lx, status=0x%04x\n",
           37, cmd_status, cmd.status);
    return RF_CORE_CMD_ERROR;
  }

  return RF_CORE_CMD_OK;
}

When I use it doesn't return any error, but I don't know yet could I get data in case it works. 

If anyone could point me a little where to get more info I'll apreciate very much.

Thanks


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>