Hi
We use the tirtos_simplelink_2_13_00_06 stack with the simpleBLEBroadcaster.c example and developed a low-power sensor application which works fine. Now we would like to encrypt our advertisement packets with the hardware AES-Modul from the CC2650.
We tried using HCI_LE_EncryptCmd(myKey, myPlainText) in the SimpleBLEBroadcaster_taskFxn() and added an event listener to the GAPRole (broadcaster.c). From there, our callback function myEncryptCb() should be called. Sadly this does not happen. Any suggestions how to proceed?
static void gapRole_processStackMsg(ICall_Hdr *pMsg)
{
switch (pMsg->event)
{
case GAP_MSG_EVENT:
gapRole_processGAPMsg((gapEventHdr_t *)pMsg);
break;
case HCI_SMP_EVENT_EVENT: // TODO: CAM: Added option for AES-Encryption
if( pMsg->status == HCI_COMMAND_COMPLETE_EVENT_CODE )
{
hciEvt_CmdComplete_t *pPkt = (hciEvt_CmdComplete_t *)pMsg;
if (pPkt->cmdOpcode == HCI_LE_ENCRYPT)
{
extern void myEncryptCb(uint8_t, uint8_t *);
myEncryptCb(pPkt->pReturnParam[0], &pPkt->pReturnParam[1]);
}
}
break;
default:
break;
}
}
Kind regards
Martin