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?
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.
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:
Hello Aviel,
there are a couple of threads that may solve your issue : have you set permissiosn to be writeable ?
BR JE_Dialog
http://support.dialog-semiconductor.com/cant-write-characteristic-value
http://support.dialog-semiconductor.com/adding-notify-permission-characteristic
http://support.dialog-semiconductor.com/can-not-handle-write-out-response
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.
Permission of what need to be writable? of characteristics or of service?
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
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.
okay I am sorry , its my mistake, I send write command with wrong uuid.
now its work.
Thank you!!!!