Documente online.
Zona de administrare documente. Fisierele tale
Am uitat parola x Creaza cont nou
 HomeExploreaza
upload
Upload




Codul sursa al obiectului principal al aplicatiei

c


Codul sursa al obiectului principal al aplicatiei



Nume fisier    : BluetoothPMPExampleEngine.cpp

Nume proiect : Bluetooth piconet example

Dezvoltat de    : Marius Alexandru 17217y2420r

Nota :Continut initial generat de Series 60 AppWizard (codul scris cursiv).

// INCLUDE

#include <aknquerydialog.h> // pentru dialogul prin care se introduce textul de trimis

#include <utf.h> //contine descriptorii de text

#include <BluetoothPMPExample.rsg>

#include "Common.h"

#include "BluetoothPMPExampleEngine.h"

#include "DeviceDiscoverer.h"

#include "ServiceAdvertiser.h"

#include "ServiceDiscoverer.h"

#include "Listener.h"

#include "Connector.h"

#include <cntdb.h> //util pt lucrul cu contacte

#include <cntitem.h>

CBluetoothPMPExampleEngine* CBluetoothPMPExampleEngine::NewL(

CBluetoothPMPExampleAppUi* aAppUi)

CBluetoothPMPExampleEngine* CBluetoothPMPExampleEngine::NewLC(

CBluetoothPMPExampleAppUi* aAppUi)

// constructor standard EPOC, faza a doua

void CBluetoothPMPExampleEngine::ConstructL()

}

// CBluetoothPMPExampleEngine::CBluetoothPMPExampleEngine(

CBluetoothPMPExampleAppUi* aAppUi)

// constructorul

CBluetoothPMPExampleEngine::CBluetoothPMPExampleEngine(

CBluetoothPMPExampleAppUi* aAppUi):

iListener(NULL),

iDeviceDiscoverer(NULL),

iServiceAdvertiser(NULL),

iServiceDiscoverer(NULL),

iIsSlave(EFalse),

iMsgLines(0),

iConnectedDeviceCount(0)

// CBluetoothPMPExampleEngine::~CBluetoothPMPExampleEngine()

// destructorul

CBluetoothPMPExampleEngine::~CBluetoothPMPExampleEngine()

// ShowMessageL(

const TDesC& aMsg, TBool aReset=false)

// afiseaza un text referentiat de aMsg. Textul se va adauga la mesajul deja existent

// pe ecran daca aReset este false,in caz contrar se va sterge mai intai ceea ce era afisat inainte

void CBluetoothPMPExampleEngine::ShowMessageL(const TDesC& aMsg,

TBool aReset=false)

iMsg.Append(aMsg);

iAppUi->iAppContainer->ShowMessageL(iMsg);

iMsgLines++;

}

// CBluetoothPMPExampleEngine::DiscoverDevicesL()

// descopera dispozitivele Bluetooth din raza

void CBluetoothPMPExampleEngine::DiscoverDevicesL()

// CBluetoothPMPExampleEngine::DiscoverServicesL()

// descopera serviciile oferite de dispozitivele descoperite anterior

void CBluetoothPMPExampleEngine::DiscoverServicesL()

// CBluetoothPMPExampleEngine::StartSlaveL()

// seteaza aplicatia sa ruleze in modul sclav. dispozitivul va face public serviciul

// oferit pe un anumit canal si va asculta cererile care vin pe acel canal.

void CBluetoothPMPExampleEngine::StartSlaveL()

// CBluetoothPMPExampleEngine::DisconnectDevicesL()

// deconecteaza dispozitivele conectate si sterge tabela de conexiuni

void CBluetoothPMPExampleEngine::DisconnectDevicesL()

}

}

// CBluetoothPMPExampleEngine::ConnectDevicesL()

// incearca sa se conecteze cu toate dispozitivele compatibile

void CBluetoothPMPExampleEngine::ConnectDevicesL()

else

}

}

ShowConnectedDevicesL();

}

// CBluetoothPMPExampleEngine::ShowConnectedDevicesL()

// afiseaza dispozitivele cu care au fost stabilite conexiuni

void CBluetoothPMPExampleEngine::ShowConnectedDevicesL()

}

if ( count==0 )

}

// CBluetoothPMPExampleEngine::SendMessage()

// trimite un mesaj introdus de utilizator tuturor dispozitivelor conectate.

// mesajul va avea maxim 20 de caractere.

void CBluetoothPMPExampleEngine::SendMessage()

else

}

}

}

// CBluetoothPMPExampleEngine::SendObject()

// trimite un obiect (demonstrativ) tuturor dispoziitvelor conectate

// acest obiect ar putea fi o cate de vizita

void CBluetoothPMPExampleEngine::SendObject()

else

}

}

}

// CBluetoothPMPExampleEngine::HandleListenerDataReceivedL(TDesC& aData)

// afiseaza datele receptionate de sclav de la master. acesta este un apel de tip

// "callback" pe care clasa CListener il invoca atunci cand primeste date.

void CBluetoothPMPExampleEngine::HandleListenerDataReceivedL(TDesC& aData)

//altfel, daca s-a receptionat text

else

// CBluetoothPMPExampleEngine::HandleListenerConnectedL()

// un apel de tip callback receptionat de la CListener pentru a indica faptul

// ca s-a realizat o conexiune

void CBluetoothPMPExampleEngine::HandleListenerConnectedL()

// CBluetoothPMPExampleEngine::HandleListenerDisconnectedL()

// un apel de tip callback receptionat de la CListener pentru a indica faptul

// ca sclavul a fost deconectat de master

void CBluetoothPMPExampleEngine::HandleListenerDisconnectedL()

// CBluetoothPMPExampleEngine::HandleConnectorDataReceivedL(THostName aName,

TDesC& aData)

// afiseaza datele pe care masterul le primeste de la un sclav conectat.

// acesta este un callback invocat de clasa CConnector cand primeste date de la sclav.

void CBluetoothPMPExampleEngine::HandleConnectorDataReceivedL(THostName aName,

TDesC& aData)

//altfel, daca s-a primit text

// afiseaza textul primit alaturi de numele sclavului care l-a trimis

else

}

// CBluetoothPMPExampleEngine::HandleDeviceDiscoveryCompleteL()

// un callback de la device discoverer pentru a semnala ca s-a terminat

// descoperirea dispozitivelor.

void CBluetoothPMPExampleEngine::HandleDeviceDiscoveryCompleteL()

}

else

}

// CBluetoothPMPExampleEngine::HandleServiceDiscoveryCompleteL()

// un callback de la service discoverer pt a indica incheierea descoperirii

// serviciilor.

void CBluetoothPMPExampleEngine::HandleServiceDiscoveryCompleteL()

}

if ( count==0 )

}

// CBluetoothPMPExampleEngine::HasConnections()

// intoarce true daca masterul are cel putin o conexiune cu undispozitiv sclav

TBool CBluetoothPMPExampleEngine::HasConnections()



Document Info


Accesari: 1546
Apreciat: hand-up

Comenteaza documentul:

Nu esti inregistrat
Trebuie sa fii utilizator inregistrat pentru a putea comenta


Creaza cont nou

A fost util?

Daca documentul a fost util si crezi ca merita
sa adaugi un link catre el la tine in site


in pagina web a site-ului tau.




eCoduri.com - coduri postale, contabile, CAEN sau bancare

Politica de confidentialitate | Termenii si conditii de utilizare




Copyright © Contact (SCRIGROUP Int. 2024 )