Throughput Sample Gatt Write 247 Byte

Hey There,

I have a question regarding the Throughput Sample. If I just run it normally (with 2 5340dk) then I reach a Throughput of about 1'300kbps, which is what I would expect. However, for my Setup I want to log everytime a packet has been successfully sent, so I wanted to use the same write-without-ack, however with the callback. If I use this callback with the same setup as before except the change in the write function, I still get the same throughput as expected. If I now however send 247 in every Gatt write (so the maximum which is possible per packet) instead of the 495, i get a much lower throughput, in the range of 9 kbps. Is this a bug? Shouldn't it result in the same throughput? In my understanding, it would just send more Gatt Write, but still the same data. The code I changed is the following:

	/* a dummy data buffer */
	/*The number i changed from 495 to 247*/
	static char dummy[247];

	if (!default_conn) {
		shell_error(shell, "Device is disconnected %s",
			    "Connect to the peer device before running test");
		return -EFAULT;
	}

if (IS_ENABLED(CONFIG_BT_THROUGHPUT_FILE)) {
		while (*img_ptr) {
			err = bt_throughput_write(&throughput, dummy, 247);
			if (err) {
				shell_error(shell, "GATT write failed (err %d)", err);
				break;
			}

			/* print graphics */
			str_len = (*img_ptr == '\x1b') ? 6 : 1;
			memcpy(str_buf, img_ptr, str_len);
			str_buf[str_len] = '\0';
			img_ptr += str_len;
			printk("%s", str_buf);

			data += 247;
		}

Parents Reply
  • Hi Vidar,

    Thanks now i get much higher values. I do seem to get however some lower values still. While for 495 I get around 1200, I only seem to ever get around 1050 for 244. Is there a reason for this? In my opinion it wouldn't make too much sense, as i am sending the maximum data per packet. 

    Or another question, do you know by chance why 495 is chosen by the sample?

    Thanks,

Children
Related