/**
 * Returns bluetooth friendly name
 * Output: bluetooth friendly name
 */
std::wstring *S60BluetoothPlatformControl::getBluetoothName()
{
    TBuf16<KMaxBluetoothNameLen> bluetoothName;

    JELOG2(EJavaBluetooth);
    TInt error = RProperty::Get(KPropertyUidBluetoothCategory,
                                KPropertyKeyBluetoothGetDeviceName, bluetoothName);

    if (error != KErrNone || (0 == bluetoothName.Length()))
    {
        ELOG(EJavaBluetooth, "Bluetooth friendly name was not set");
        return NULL;
    }
    std::wstring *deviceName =
        new std::wstring((wchar_t*) bluetoothName.Ptr());

    deviceName->resize(bluetoothName.Length());
    return deviceName;
}
/**
 * Returns bluetooth address
 * Output: bluetooth address
 */
std::wstring *S60BluetoothPlatformControl::getBluetoothAddress()
{
    TPckgBuf<TBTDevAddr> localDeviceBluetoothAddress;
    TBuf16<20> bluetoothAddress;

    JELOG2(EJavaBluetooth);
    TInt error = RProperty::Get(KPropertyUidBluetoothCategory,
                                KPropertyKeyBluetoothGetLocalDeviceAddress,
                                localDeviceBluetoothAddress);

    if (error != KErrNone)
    {
        return NULL;
    }

    localDeviceBluetoothAddress().GetReadable(bluetoothAddress);
    std::wstring *deviceAddress =
        new std::wstring((wchar_t*) bluetoothAddress.Ptr());
    deviceAddress->resize(bluetoothAddress.Length());
    return deviceAddress;
}