/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Description: This function sets local device name Arguments: void Return: void ---------------------------------------------------------------------------*/ void Test_Btsdk_SetLocalName(void) { BTUINT8 szLocalDevName[BTSDK_DEVNAME_LEN] = {0}; BTUINT16 usLen = 0; BTUINT32 ulRet = 0; printf("Please input a string of which length is smaller than BTSDK_DEVNAME_LEN as the local device's name.\n"); printf("Local Name = "); scanf(" %s", szLocalDevName); usLen = strlen(szLocalDevName) +1; ulRet = Btsdk_SetLocalName(szLocalDevName, usLen); if (BTSDK_OK == ulRet) { printf("You have set the name of this local device successfully.\n"); } else { PrintErrorMessage(ulRet, BTSDK_TRUE); } }
void QBtLocalDevicePrivate::SetLocalDeviceName(const QString & devName) { Btsdk_SetLocalName((BTUINT8*)devName.toUtf8().constData(), devName.size()); }