int BthUtils::GetDeviceInfo(DeviceInfo *pPeerDeviceInfo, int iSelectedItem) { int iCtr=0; for (m_pCurrentDevice = m_pStart;(m_pCurrentDevice);m_pCurrentDevice=m_pCurrentDevice->NextDevice,iCtr++) { if(iCtr==iSelectedItem) { StringCchPrintf(pPeerDeviceInfo[0].szDeviceNameAddr, sizeof(pPeerDeviceInfo[0].szDeviceNameAddr), L"%s:(%04x%08x)", m_pCurrentDevice->bthName, GET_NAP(m_pCurrentDevice->bthAddress), GET_SAP(m_pCurrentDevice->bthAddress)); return 0; } } return -1; }
//Function: GetDeviceInfo //Purpose: Searches the link list for the specified device and returns address and name in DeviceInfo //Input: The current device index selected in the UI //Output: DeviceInfo: name and address //Return: Returns -1 in case of an error, otherwise returns zero. int RhoBluetoothManager::GetDeviceInfo(RhoDeviceInfo *pPeerDeviceInfo, int iSelectedItem) { int iCtr=0; for (m_pCurrentDevice = m_pStart;(m_pCurrentDevice);m_pCurrentDevice=m_pCurrentDevice->NextDevice,iCtr++) { if(iCtr==iSelectedItem) { StringCchPrintf(pPeerDeviceInfo[0].szDeviceNameAddr, ARRAYSIZE(pPeerDeviceInfo[0].szDeviceNameAddr), L"%s:(%04x%08x)", m_pCurrentDevice->bthName, GET_NAP(m_pCurrentDevice->bthAddress), GET_SAP(m_pCurrentDevice->bthAddress)); return 0; } } return -1; }
int BthUtils::GetDeviceInfo(DeviceInfo *pPeerDevicesInfo) { int iCtr=0; for (m_pCurrentDevice = m_pStart;(m_pCurrentDevice);m_pCurrentDevice=m_pCurrentDevice->NextDevice,iCtr++) { StringCchPrintf(pPeerDevicesInfo[iCtr].szDeviceNameAddr, sizeof(pPeerDevicesInfo[iCtr].szDeviceNameAddr), L"%s:(%04x%08x)", m_pCurrentDevice->bthName, GET_NAP(m_pCurrentDevice->bthAddress), GET_SAP(m_pCurrentDevice->bthAddress)); } return 0; }