Commit c3e4c508 authored by Emil Gydesen's avatar Emil Gydesen Committed by Anas Nashif
Browse files

samples: Bluetooth: TMAP periph: Handle empty URI string

The supported URI list may be empty which the sample did not
properly support.

Signed-off-by: default avatarEmil Gydesen <emil.gydesen@nordicsemi.no>
parent b1dc99d0
Loading
Loading
Loading
Loading
+7 −0
Changes for samples/bluetooth/tmap_peripheral/src/ccp_call_ctrl.c: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@
 *
 *  SPDX-License-Identifier: Apache-2.0
 */
#include <errno.h>

#include <zephyr/kernel.h>
#include <zephyr/sys/printk.h>
@@ -139,6 +140,12 @@ int ccp_originate_call(void)
	int err;
	char uri[CONFIG_BT_TBS_MAX_URI_LENGTH];

	/* If remote_uri is empty then we cannot place a call */
	if (remote_uri[0] == '\0') {
		printk("Remote does not support any URI schemes, cannot place call\n");
		return -ENOENT;
	}

	strcpy(uri, remote_uri);
	strcat(uri, URI_SEPARATOR);
	strcat(uri, CALLER_ID);
+2 −1
Changes for samples/bluetooth/tmap_peripheral/src/main.c: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -289,10 +289,11 @@ int main(void)
		err = ccp_originate_call();
		if (err != 0) {
			printk("Error sending call originate command!\n");
		}
		} else {
			/* Start timer to send terminate call command */
			k_work_schedule(&call_terminate_set_work, K_MSEC(2000));
		}
	}

	if (peer_is_ums) {
		/* Play media with MCP */