/* verifies that source id is not taken by another client, calls device handler to send requests to the device */
int smsclient_sendrequest(struct smscore_client_t *client, void *buffer, size_t size)
/* verifies that source id is not taken by another client, calls device handler to send requests to the device */
int smsclient_sendrequest(struct smscore_client_t *client, void *buffer, size_t size)
{
	struct smscore_device_t *coredev;
	struct SmsMsgHdr_ST *phdr = (struct SmsMsgHdr_ST *) buffer;
	int rc;
	if (client == NULL) {
		sms_err("Got NULL client");
		return -EINVAL;
	}
	coredev = client->coredev;
	if (coredev == NULL) {
		sms_err("Got NULL coredev");
		return -EINVAL;
	}
	rc = smscore_validate_client(client->coredev, client, 0,
				     phdr->msgSrcId);
	if (rc < 0)
		return rc;
	return coredev->sendrequest_handler(coredev->context, buffer, size);
}