This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Error 0x10 when writing to peripheral.

Hello. I get error 0x10 (error for invalid flags) when i want to write to peripheral with my master module. I use the same code i always used, and i didnt change anything. This code worked perfect until today. Now i can write to my peripheral 1 time, next time i want to write i get error 0x10.

Has someone had same problems with their modules?

UPDATE:

As my main module i use nRF51822-mKit and beacons. I'm using S130 dual mode.

For writing to characteristic, i use this function:

static void writeChar (uint16_t peripheral_id,uint8_t *zelVrednost)
{
    uint32_t                 error_code   = NRF_ERROR_NOT_FOUND;
    ble_gattc_write_params_t write_params = {0};
		LOG_INFO("I: %d",velikostStringa);
		LOG_INFO("CHAR HANDLE WRITE: 0x%04x",gs_peripheral2[peripheral_id].value_handle);

	write_params.write_op = BLE_GATT_OP_WRITE_REQ;
	write_params.handle = 0x000B;
	write_params.offset = 0x0000;
	write_params.len = velikostStringa;
	//for(int i = 0; i
		write_params.p_value = zelVrednost;
		LOG_DEBUG("Length: 0x%02x\r\n", sizeof(write_params));
		
		if ((error_code = sd_ble_gattc_write(naprave[peripheral_id].conn_handle, &write_params)) != NRF_SUCCESS)
		{
			LOG_DEBUG("(Peripheral %i) Error:: 0x%x", peripheral_id, error_code);
		}
		else
		{
			
			LOG_DEBUG("Success");
			}
}

Also, this problem of mine only seems to occur when mKit want's to write to beacon. Beacons don't seem to have that problem ...

Parents Reply Children
Related