this may be a very simple question, but I just don't it.
I am able to run the sample Exercise 1 – Nordic Developer Academy (nordicsemi.com) on the nRF52832 eval board, but I don't understand the following BLE call back function:
static ssize_t read_button(struct bt_conn *conn,
const struct bt_gatt_attr *attr,
void *buf,
uint16_t len,
uint16_t offset)
{
//get a pointer to button_state which is passed in the BT_GATT_CHARACTERISTIC() and stored in attr->user_data
const char *value = attr->user_data;
LOG_DBG("Attribute read, handle: %u, conn: %p", attr->handle,
(void *)conn);
if (lbs_cb.button_cb) {
// Call the application callback function to update the get the current value of the button
button_state = lbs_cb.button_cb();
return bt_gatt_attr_read(conn, attr, buf, len, offset, value,
sizeof(*value));
}
return 0;
}
button_state = lbs_cb.button_cb();calls the application callback to get the current button state
but button_state is not used in the following function bt_gatt_attr_read.
I guess the variable "value" of bt_gatt_attr_read should carry the current button state, then how is the input variable "value" got updated?
Thanks!

, the value of "value" is 65792 and 65793, I don't understand this change as the application call back "button_cb()" don't make chages except copying the value of a static variable to another.