// This file is generated by kconfig_compiler from bluetooth.kcfg.
// All changes you do to this file will be lost.
#ifndef KNM_BLUETOOTH_H
#define KNM_BLUETOOTH_H

#include <kglobal.h>
#include <kconfigskeleton.h>
#include <kdebug.h>
#include "setting.h"
#include "knminternals_export.h"

namespace Knm {

class KNMINTERNALS_EXPORT BluetoothSetting : public Setting
{
  public:

    BluetoothSetting( );
    ~BluetoothSetting();

    QString name() const;

    bool hasSecrets() const;

    /**
      Set Network Name
    */
    void setNetworkname( const QString & v )
    {
        mNetworkname = v;
    }

    /**
      Get Network Name
    */
    QString networkname() const
    {
      return mNetworkname;
    }


    /**
      Set Bdaddr
    */
    void setBdaddr( const QByteArray & v )
    {
        mBdaddr = v;
    }

    void setBdaddrFromString( const QString & s)
    {
        QStringList macStringList = s.split(":");
        QByteArray ba;
        if (!s.isEmpty())
        {
            ba.resize(6);
            int i = 0;
    
            foreach (QString macPart, macStringList) {
                ba[i++] = macPart.toUInt(0, 16);
            }
    	}
        setBdaddr(ba);
    }

    /**
      Get Bdaddr
    */
    QByteArray bdaddr() const
    {
      return mBdaddr;
    }

    QString bdaddrAsString() const
    {
     QStringList mac;

     for (int i=0; i < mBdaddr.size(); i++)
     {
        mac << QString("%1").arg((quint8)mBdaddr[i], 2, 16, QLatin1Char('0')).toUpper();
     }

     return mac.join(":");
    }

    /**
      Set Network Type
    */
    void setNetworktype( const QString & v )
    {
        mNetworktype = v;
    }

    /**
      Get Network Type
    */
    QString networktype() const
    {
      return mNetworktype;
    }

  protected:

    // bluetooth
    QString mNetworkname;
    QByteArray mBdaddr;
    QString mNetworktype;

  private:
};

}

#endif

