Writing a characteristic > 20 bytes

3 posts / 0 new
Last post
marcodg
Offline
Last seen:2 years 7 months ago
加入:2015-01-14 17:58
Writing a characteristic > 20 bytes

I'm using the device as a server connecting to it via a PC. I am able to write to the device characteristic values that are longer than 20 bytes. The characteristic value arrives in pieces with 'param->last' being true with the last piece. That is working fine.

When the device wants to write a value into its database (with notification) I can write more than 20 bytes but the PC side only appears to receive 20 and I'm not really sure where the problem lies. Here is the device code that responds to the 'update_req_handler:


if(param->conhdl == gapc_get_conhdl(controller_env.con_info.conidx))
{
// Update value in database
attmdb_att_set_value(controller_env.akpatch_controller_shdl + CONTROLLER_RESPONSE_IDX_VAL, param->reply_length, (uint8_t *)param->reply);
arch_printf("replying with %d bytes\n", param->reply_length);
if((controller_env.notify_property_status & PRF_CLI_START_NTF))
// Send notification through GATT
prf_server_send_event((prf_env_struct *)&controller_env, false, controller_env.controller_shdl + CONTROLLER_RESPONSE_IDX_VAL);
}

Am I missing something? Do I need to break the database update into pieces?

thanks,
marco

Device:
summer20100514
Offline
Last seen:4 years 2 months ago
Guru
加入:2014-12-30 05:01
The notification size is

The notification size is limited to 20 bytes.

marcodg
Offline
Last seen:2 years 7 months ago
加入:2015-01-14 17:58
Thanks... I figured that was

Thanks... I figured that was probably true but I felt I should take a shot.

marco