GAPM_USE_ENC_BLOCK_IND is not received after GAPM_USE_ENC_BLOCK_CMD is send.

2 posts / 0 new
Last post
Cheng Yang
Offline
Last seen:2 years 10 months ago
加入:2016-04-29 03:20
GAPM_USE_ENC_BLOCK_IND is not received after GAPM_USE_ENC_BLOCK_CMD is send.

Send command
{
printf_string("second encode");
struct gapm_use_enc_block_cmd* cmd = KE_MSG_ALLOC(GAPM_USE_ENC_BLOCK_CMD, TASK_GAPM, TASK_APP,
gapm_use_enc_block_cmd);
memcpy (cmd - >歌剧nd_1, key, sizeof(key));
//memset(cmd->operand_2, 0, KEY_LEN);
memcpy (cmd - >歌剧nd_2, data, KEY_LEN);
cmd->operation = GAPM_USE_ENC_BLOCK_CMD;

ke_msg_send(cmd);
}

int gapm_use_enc_block_ind_handler(ke_msg_id_t const msgid,
void const *param,
ke_task_id_t const dest_id,
ke_task_id_t const src_id)
{
printf_string("enter ind");
struct gapm_use_enc_block_ind* ptr = (struct gapm_use_enc_block_ind*)param;
char outbuf[100] = {0};
size_t olen;
mbedtls_base64_encode(outbuf, 100, &olen, ptr->result, 16);
printf_string(outbuf);
return (KE_MSG_CONSUMED);
}

and map event here
EXTERN const struct ke_msg_handler app_default_state[] =
{
{GAPM_USE_ENC_BLOCK_IND, (ke_msg_func_t)gapm_use_enc_block_ind_handler},
{GAPM_DEVICE_READY_IND, (ke_msg_func_t)gapm_device_ready_ind_handler},
{GAPM_CMP_EVT, (ke_msg_func_t)gapm_cmp_evt_handler},
{GAPC_CMP_EVT, (ke_msg_func_t)gapc_cmp_evt_handler},

No message arrive in gapm_use_enc_block_ind_handler.
Is there anything I missed?

Device:
Qinjiny_Dialog
Offline
Last seen:3周3天前
工作人员
加入:2016-11-01 05:47
Hi,

Hi,

Please refer to this post:

https://support.dialog-semiconductor.com/ciphering-application-level-gives-strange-results

which is a successful example of utilizing the AES-128 hardware block.

BR,