/* Set CC3000 in mDNS advertiser mode in order to advertise itself. 
mdnsAdvertiser */
INT16 CC3000_EXPORT() mdnsAdvertiser(UINT16 mdnsEnabled, CHAR *deviceServiceName, UINT16 deviceServiceNameLength)
/* Set CC3000 in mDNS advertiser mode in order to advertise itself. 
mdnsAdvertiser */
INT16 CC3000_EXPORT() mdnsAdvertiser(UINT16 mdnsEnabled, CHAR *deviceServiceName, UINT16 deviceServiceNameLength)
{
	INT8 ret;
	UINT8 *pTxBuffer, *pArgs;
	if (deviceServiceNameLength > MDNS_DEVICE_SERVICE_MAX_LENGTH)
	{
		return EFAIL;
	}
	pTxBuffer = tSLInformation.pucTxCommandBuffer;
	pArgs = (pTxBuffer + SIMPLE_LINK_HCI_CMND_TRANSPORT_HEADER_SIZE);
	pArgs = UINT32_TO_STREAM(pArgs, mdnsEnabled);
	pArgs = UINT32_TO_STREAM(pArgs, 8);
	pArgs = UINT32_TO_STREAM(pArgs, deviceServiceNameLength);
	ARRAY_TO_STREAM(pArgs, deviceServiceName, deviceServiceNameLength);
	hci_command_send(HCI_CMND_MDNS_ADVERTISE, pTxBuffer, SOCKET_MDNS_ADVERTISE_PARAMS_LEN + deviceServiceNameLength);
	SimpleLinkWaitEvent(HCI_EVNT_MDNS_ADVERTISE, &ret);
	return ret;
}