Hi,
Working on CC2650, over Contiki. I am trying to shoot CMD_BLE_ADV to RFCore, but RFCOre is returning 0x82 Error Value on CMDSTA Register - "The command ID number in the command structure is unknown" as described on Datasheet.
A little glimse of my code goes below
printf("into send_ble_adv_con routine...\r\n");
/* Clear both buffers */
memset(&cmd, 0x00, sizeof(cmd));
memset(ble_params_buf, 0x00, sizeof(ble_params_buf));
memset(ble_device_address, 0x00, sizeof(ble_device_address));
/* Adv Cmd Packet Preparation packet code goes here */
cmd.commandNo = CMD_BLE_ADV;
cmd.condition.rule = 0x01;
cmd.whitening.bOverride = 0;
cmd.whitening.init = 0;
cmd.pParams = params;
cmd.channel = channel;
/* device info */
memset(payload, 0, BLE_ADV_PAYLOAD_BUF_LEN);
//Payload is for demo purpose.
payload[p++] = 0x15;// total length from here till end, in hex
payload[p++] = 0x03;
payload[p++] = 0x19; // Appearance GAP Profile.
payload[p++] = 0x02; //Next Data, Length 2 Byte
payload[p++] = 0x01; // Flag Type GAP Profile
payload[p++] = 0x06; //LE General Discoverable Mode.
payload[p++] = 0x14; // Device Name Length + 1
payload[p++] = 0x09; // Device Name GAP Profile id
memcpy(&payload[p], node_config.adv_device_name,
strlen(node_config.adv_device_name));
p += strlen(node_config.adv_device_name);
payload[p++] = 0xd3; // Flag Type GAP Profile
/* Set up BLE Advertisement parameters */
params->pDeviceAddress = ble_device_address;
params->endTrigger.triggerType = TRIG_NEVER;
params->endTime = TRIG_NEVER;
/* Set up BLE Advertisement parameters */
//params = (rfc_bleAdvPar_t *)ble_params_buf;
params->advLen = nAdv_Payload_Len;
params->pAdvData = adv_payload;
printf("Sending ADV_CMD to Core Now...\r\n");
if(rf_core_send_cmd((uint32_t)&cmd, &cmd_status) == RF_CORE_CMD_ERROR) {
printf("send_ble_adv FAILED: Send Cmd : Chan=%d CMDSTA=0x%08lx, status=0x%04x\r\n",
channel, cmd_status, cmd.status);
return RF_CORE_CMD_ERROR;
}
printf("CMD_Send to Core for ADV SUCCESS.Now Waiting for good Response from RF Core...\r\n");
/* Wait until the command is done */
if(rf_core_wait_cmd_done(&cmd) != RF_CORE_CMD_OK) {
printf("send_ble_adv-wait FAILED: Wait For Cmd: Chan=%d CMDSTA=0x%08lx, status=0x%04x\r\n",
channel, cmd_status, cmd.status);
return RF_CORE_CMD_ERROR;
}
printf("ADV CMD SUCCESS. Now BLE ACTIVE and working...\r\n");
I am unable to track it out where is the fault? is my struct is not correctly filled or what? Its been a nightmare for me. Apart from this, Bluestack which TI Released has loads of code supported for TI RTOS whihc is quitee hard to pathc up with contiki. What could be the issue? Anybody?