Hi, I'm trying to controll the port of my nRF52832 by writing to a characteristic value. So far everything works fine but I'm unable to get the value of my characteristic. I tried using the
Hi, I'm trying to controll the port of my nRF52832 by writing to a characteristic value. So far everything works fine but I'm unable to get the value of my characteristic. I tried using the
I figured it out. Using this code it finally worked:
uint8_t testStore;
ble_gatts_value_t testStruct;
testStruct.p_value = &testStore;
testStruct.len = 4;
testStruct.offset = 0;
sd_ble_gatts_value_get(BLE_CONN_HANDLE_INVALID, 0x000E, &testStruct);
sd_ble_gatts_value_set(BLE_CONN_HANDLE_INVALID, 0x0011, &testStruct);
The problem was that I didn't initialize the values in the testStruct correctly.
I figured it out. Using this code it finally worked:
uint8_t testStore;
ble_gatts_value_t testStruct;
testStruct.p_value = &testStore;
testStruct.len = 4;
testStruct.offset = 0;
sd_ble_gatts_value_get(BLE_CONN_HANDLE_INVALID, 0x000E, &testStruct);
sd_ble_gatts_value_set(BLE_CONN_HANDLE_INVALID, 0x0011, &testStruct);
The problem was that I didn't initialize the values in the testStruct correctly.