I can't receivce the msg(GATTC_WRITE_CMD_IND)

7 posts / 0 new
Last post
Aviel
Offline
Last seen:6 years 4 weeks ago
Joined:2015-02-22 14:34
I can't receivce the msg(GATTC_WRITE_CMD_IND)

Hi,
I download the DSPS project and I try to send some message from DSPS application, but I am not receivce the msg(GATTC_WRITE_CMD_IND) in the BLE device. someone know why?

JE_Dialog
Offline
Last seen:3 weeks 4 days ago
Staff
Joined:2013-12-05 14:02
Hello Aviel,
Aviel
Offline
Last seen:6 years 4 weeks ago
Joined:2015-02-22 14:34
Hi,

Hi,
是的,可写权限,需求方的代码is ready to work no?, I refer in the threads but they not solved my problem.
this problem occur also in sample 128 project. I think that I not understand somthing.

Aviel
Offline
Last seen:6 years 4 weeks ago
Joined:2015-02-22 14:34
Permission of what need to be

Permission of what need to be writable? of characteristics or of service?

gl_dialog (not verified)
Hi Aviel,

Hi Aviel,

The DSPS profile works "out of the box".

I guess you want to create your own GATTC_WRITE_CMD_IND CHAR. Please find the exmaple steps below:

1) In your handler, add:

//add CHAR attribute
status = attmdb_add_attribute(adc_notify_env.adc_notify_shdl, ATT_UUID_128_LEN + 3, //Data size = 19 (ATT_UUID_128_LEN + 3)
ATT_UUID_16_LEN, (uint8_t*) &att_decl_char, PERM(RD, ENABLE), //THIS IS PERMISSION OF CHAR DESCRIPTOR ATTRIBUTE.
&(char_hdl)); // CHAR descriptor attributes are always RD ONLY.

//add VAL attribute
status = attmdb_add_attribute(adc_notify_env.adc_notify_shdl, 16, //Data size: 16 bytes
ATT_UUID_128_LEN, (uint8_t*)&change_beacon_parameters_val.uuid, PERM(WR, ENABLE), //VALUE ATTRIBUTE IS WRITE
&(val_hdl));

memcpy(change_beacon_parameters_char.attr_hdl, &val_hdl, sizeof(uint16_t));
// Write the handle of value attribute to characteristic descriptor’s. The size of handle is always 2 (sizeof(uint16_t))
status = attmdb_att_set_value(char_hdl, sizeof(change_beacon_parameters_char), (uint8_t *)&change_beacon_parameters_char);

2) in the gattc_write_cmd_ind_handler handler, add:

if(char_code ==xxxx_CHAR)
{
arch_printf("\n\r\n\rWRITE");

regards,

DIALOG_TEAM

Aviel
Offline
Last seen:6 years 4 weeks ago
Joined:2015-02-22 14:34
this example already exist in

this example already exist in sample 128 profile and i am not receive interrupt of WRITE_CMD. i am succeed to read char but not to write.

Aviel
Offline
Last seen:6 years 4 weeks ago
Joined:2015-02-22 14:34
okay I am sorry , its my

okay I am sorry , its my mistake, I send write command with wrong uuid.
now its work.
Thank you!!!!