2018-03-08 08:26 AM
Hello all,
I am having a problems to update some values on the master, I am using bluenrg-1 I have one device working as a master and other as a slave. The slave has a button, I have both connected and every time I press the button on the slave the function aci_gatt_update_char_value() is called containing a value, I have on the slave that configuration:
aci_gatt_add_char( Service_Handle,
UUID_TYPE_128, &char_uuid, CHAR_VALUE_LENGTH,CHAR_PROP_READ|CHAR_PROP_NOTIFY, ATTR_PERMISSION_NONE, GATT_DONT_NOTIFY_EVENTS, ENCRYPTION_KEY_SIZE, ATT_HAS_FIXED_LENGTH, &CharHandle);the master is discovering the service and characteristic from the slave. Do I need to do something more or in a different manner? Which event function will be call on the master?
I can read the values from the master requesting the value every x time once both are connected but I would like to received the value on the master just the button is pressed.
Thank you
Solved! Go to Solution.
2018-03-13 04:29 AM
Hi Jamp,
just to clarify, the arguments for the aci_gatt_write_char_desc() are:
ConnectionHandle - Length: 2 bytes (Connection handle for which the command is given)
AttrHandle - Length: 2 bytes (Handle of the attribute to be written)
ValLen - Length: 1 byte (Length of the value to be written)
AttrVal (Value to be written)
Kind regards
Andrea
2018-03-13 04:40 AM
Hello Andrea,
Yes those are the arguments I am using. Not sure what the AttrVal should be. Should be always
AttrVal =
{0x01,0x00}
I don't know if there is any difference as I am using the master as a coprocess
If I just declare one of the characteristics, it does not matter which one, I will receive always an update on the master, every time the value is changed.
Thank you
2018-03-13 06:40 AM
Doing more tests, I can see that the only characteristic that is received to the master is the first characteristic added on the slave, it does not matter the characteristic is first added, it is the only one received on the master.
2018-03-15 08:52 AM
Hello,
I have checked that when I am calling the function with:
aci_gatt_write_char_desc(
Connectionhandle, handle+2, length, Value) with length different to 1 I get the error 0x41(Failed) some idea why is that error.
Thank you
2018-03-22 08:36 AM
Hi Jamp,
It is strange, because the length should be always 0x02. Is it happening for any char?
Regards
Andrea
2018-03-22 09:07 AM
Hi Jamp,
please, note also that before calling
succeeding aci_gatt_write_char_desc() you should wait for the previous action to complete (i.e., for the aci_gatt_proc_complete_event event to be generated).
Hope that can help.
Andrea
2018-03-26 12:58 AM
Yes I have it working thanks, I added a waiting time between the calling functions