#include <XFuBluetoothNetwork.h>
Inheritance diagram for XFuBluetoothNetwork:
Public Member Functions | |
virtual INT | enableClientService () |
Enables the Bluetooth communication handler and opens it for service. | |
virtual INT | enableServerService (UINT16 aPort) |
Enables the Bluetooth communication handler and opens it for service. | |
virtual void | closeService () |
Closes the currently active service (communication handler). | |
virtual void | reset () |
Resets the communication manager. | |
virtual void | runCommunicationScheduler () |
Runs the communication scheduler. | |
virtual void | clientLost (INT32 aClientId) |
Connection lost handler (XFuClientLost) (callback). | |
virtual INT32 | addClient (XFcAddress *aAddress, INT32 aTimeoutTime=15000) |
Adds a client with the specific address. | |
virtual XFcClientCommWin * | getClient (INT32 aClientId) |
Returns the specified client. | |
virtual void | removeClient (INT32 aClientId) |
Removes the specified client. | |
virtual void | removeAllClients () |
Removes all clients. | |
virtual UINT32 | getAcceptGameToken () |
Returns the game token that is checked before new clients are allowed to connect. | |
virtual void | setAcceptGameToken (UINT32 aAcceptGameToken) |
Sets the game token that is checked before new clients are allowed to connect. | |
virtual void | sendGameConnectPacket (INT32 aClientId, UINT32 aGameToken) |
Sends a game connection packet. | |
virtual XFcDataReceiver * | getDefaultDataReceiver () |
Returns a pointer to the default data receiver. | |
virtual XFcDataReceiver * | getDataReceiver (UINT32 aId) |
Returns the specified data receiver. | |
virtual INT | addDataReceiver (UINT32 aId, XFcDataReceiver *aReceiver) |
Adds a new data receiver. | |
virtual void | setDefaultDataReceiver (XFcDataReceiver *aReceiver) |
Sets the default data receiver. | |
virtual XFcDataReceiver * | removeDataReceiver (UINT32 aId) |
Removes a data receiver. | |
virtual INT | handleSender (const void *aAddress, const CHAR8 *aData, INT32 aLen) |
Handle data from an unknown client (callback). | |
virtual XFcObjectDataFrame * | getPacketFrame (INT32 aClientId, XFCNET_MESSAGE_SLOT aSlot) |
Get packet frame. | |
virtual XFcObjectDataFrame * | getRecentStateFrame (INT32 aClientId, INT32 aRecentId) |
Get recent state frame. | |
virtual void | removeRecentStateFrame (INT32 aClientId, INT32 aRecentId) |
Remove recent state frame. | |
virtual INT32 | getRoundTripTime (INT32 aClientId) |
Returns the round trip time for the specified client. | |
virtual INT32 | send (INT32 aClientId, UINT32 aReceiverId, XFCNET_MESSAGE_SLOT aSlot, XFuSerializable *aSerializable) |
Sends a serializable object to the specified client. | |
virtual INT32 | sendRecentState (INT32 aClientId, UINT32 aReceiverId, INT32 aRecentId, XFuSerializable *aSerializable) |
Sends a serializable object to the specified client as a recent state packet. | |
virtual void | addEventHandler (XFuNetworkEventHandler *aHandler) |
Adds a communication event handler. | |
virtual void | removeEventHandler (XFuNetworkEventHandler *aHandler) |
Removes a communication event handler. | |
virtual void | removeAllEventHandlers () |
Removes all communication event handlers. | |
virtual void | stopDeviceDiscovery () |
Stops device discovery. | |
virtual void | stopServerDiscovery () |
Stops server discovery. | |
virtual void | stopAdvertiser () |
Stops server advertiser. | |
virtual INT | startDeviceDiscovery () |
Starts device discovery. | |
virtual INT | startServerDiscovery (const XFcBtUUID &aUuid, const XFcBtAddress *aAddress) |
Starts server discovery, if address is NULL engine will search througth all available bt devices. | |
virtual INT | startAdvertiser (const XFcBtUUID &aUuid, const CHAR8 *aMessage) |
Starts advertiser, if message is NULL default message is used. | |
virtual void | deviceDiscovery (const XFcLinkedList< XFcHostEntry * > &aHostEntry) |
Callback for device discovery. | |
virtual void | deviceDiscovery (const XFcLinkedList< XFcAdvertiser * > &aAdvertiser) |
Callback for server discovery. | |
virtual INT | deviceLocalName (XFcName &aName) |
Gets device local name. | |
virtual | ~XFuBluetoothNetwork () |
Virtual destructor. Closes all open tasks and deletes all created objects. | |
Static Public Member Functions | |
XFuBluetoothNetwork * | create () |
Static constructor. | |
Protected Member Functions | |
virtual void | deleteAllClients () |
Deletes all clients. | |
XFuBluetoothNetwork () | |
Protected constructor. | |
INT | init () |
Initializes this Bluetooth communication manager. | |
INT | initEnable (UINT16 aPort, INT aIsServer) |
Initializes enable service. | |
Private Attributes | |
XFuDynamicArray< XFuNetworkEventHandler * > * | mNetworkEventHandlers |
Pointer to array of communication event handlers. | |
XFcCommunicationScheduler * | mCommunicationScheduler |
Pointer to the communication scheduler. | |
XFcBtHandler * | mCommunicationHandler |
Pointer to the communication handler. | |
XFcBtCommService * | mCommunicationService |
Holds pointer to the Bluetooth communication services. | |
XFcDataReceiver * | mDefaultDataReceiver |
Pointer to the default data receiver. | |
XFcBtServerSearch * | mBtServerSearch |
Holds pointer to bt server search. | |
XFcBtCommService * | mService |
Holds bluetooth communication service, needed for bluetooth SDP and first free server port query. | |
XFcBtHostResolver * | mHostResolver |
Holds pointer to bt host resolver. | |
INT32 | mCommunicationHandlerId |
Id of the communication handler. | |
XFcBtClientWin * | mClient |
Array of pointers to clients. | |
INT32 | mClientId |
Holds ClientId, only one client is supported for now. | |
UINT32 | mAcceptGameToken |
Game token that is checked before new clients are allowed to connect. | |
UINT16 | mGamePort |
Holds game port. | |
XFcBtUUID | mUUID |
Holds bluetooth uuid for this game. |
|
Protected constructor.
Definition at line 51 of file XFuBluetoothNetwork.cpp. References mAcceptGameToken, mBtServerSearch, mClient, mClientId, mCommunicationHandler, mCommunicationHandlerId, mCommunicationScheduler, mCommunicationService, mDefaultDataReceiver, mGamePort, mHostResolver, mNetworkEventHandlers, and mService. |
|
Virtual destructor. Closes all open tasks and deletes all created objects.
Definition at line 70 of file XFuBluetoothNetwork.cpp. References closeService(), deleteAllClients(), mBtServerSearch, mCommunicationHandler, mHostResolver, mNetworkEventHandlers, mService, and removeAllEventHandlers(). |
|
Adds a client with the specific address.
Implements XFuNetwork. Definition at line 340 of file XFuBluetoothNetwork.cpp. References mClient, mClientId, and mCommunicationScheduler. |
|
Adds a new data receiver.
Implements XFuNetwork. Definition at line 304 of file XFuBluetoothNetwork.cpp. References mCommunicationScheduler. |
|
Adds a communication event handler.
Implements XFuNetwork. Definition at line 316 of file XFuBluetoothNetwork.cpp. References mNetworkEventHandlers, and XFuDynamicArray< XFuNetworkEventHandler * >::put(). |
|
Connection lost handler (XFuClientLost) (callback).
Definition at line 487 of file XFuBluetoothNetwork.cpp. References XFuDynamicArray< XFuNetworkEventHandler * >::get(), XFuNetworkEventHandler::handleClientLost(), mNetworkEventHandlers, removeClient(), and XFuDynamicArray< XFuNetworkEventHandler * >::size(). |
|
Closes the currently active service (communication handler).
Implements XFuNetwork. Definition at line 209 of file XFuBluetoothNetwork.cpp. References mCommunicationHandler, mCommunicationScheduler, mService, stopAdvertiser(), stopDeviceDiscovery(), and stopServerDiscovery(). Referenced by initEnable(), reset(), and ~XFuBluetoothNetwork(). |
|
Static constructor.
Definition at line 39 of file XFuBluetoothNetwork.cpp. References init(). |
|
Deletes all clients.
Definition at line 260 of file XFuBluetoothNetwork.cpp. References mClient, mClientId, and mCommunicationScheduler. Referenced by initEnable(), reset(), and ~XFuBluetoothNetwork(). |
|
Callback for server discovery.
Definition at line 635 of file XFuBluetoothNetwork.cpp. References XFuDynamicArray< XFuNetworkEventHandler * >::get(), XFuNetworkEventHandler::handleAdvertiseDiscovered(), mNetworkEventHandlers, and XFuDynamicArray< XFuNetworkEventHandler * >::size(). |
|
Callback for device discovery.
Definition at line 613 of file XFuBluetoothNetwork.cpp. References XFuDynamicArray< XFuNetworkEventHandler * >::get(), XFuNetworkEventHandler::handleDeviceDiscovered(), mNetworkEventHandlers, and XFuDynamicArray< XFuNetworkEventHandler * >::size(). |
|
Gets device local name.
Definition at line 699 of file XFuBluetoothNetwork.cpp. References mHostResolver. |
|
Enables the Bluetooth communication handler and opens it for service.
Definition at line 145 of file XFuBluetoothNetwork.cpp. References initEnable(), mCommunicationHandler, mCommunicationHandlerId, and mCommunicationScheduler. |
|
Enables the Bluetooth communication handler and opens it for service.
Definition at line 161 of file XFuBluetoothNetwork.cpp. References initEnable(), mClient, mClientId, mCommunicationHandler, mCommunicationHandlerId, and mCommunicationScheduler. |
|
Returns the game token that is checked before new clients are allowed to connect.
Definition at line 231 of file XFuBluetoothNetwork.cpp. References mAcceptGameToken. |
|
Returns the specified client.
Implements XFuNetwork. Definition at line 334 of file XFuBluetoothNetwork.cpp. References mClient. |
|
Returns the specified data receiver.
Implements XFuNetwork. Definition at line 298 of file XFuBluetoothNetwork.cpp. References mCommunicationScheduler. |
|
Returns a pointer to the default data receiver.
Implements XFuNetwork. Definition at line 285 of file XFuBluetoothNetwork.cpp. References mDefaultDataReceiver. |
|
Get packet frame.
Implements XFuNetwork. Definition at line 426 of file XFuBluetoothNetwork.cpp. References mCommunicationScheduler. Referenced by send(), and sendGameConnectPacket(). |
|
Get recent state frame.
Implements XFuNetwork. Definition at line 432 of file XFuBluetoothNetwork.cpp. References mCommunicationScheduler. Referenced by sendRecentState(). |
|
Returns the round trip time for the specified client.
Definition at line 420 of file XFuBluetoothNetwork.cpp. References mCommunicationScheduler. |
|
Handle data from an unknown client (callback).
Definition at line 501 of file XFuBluetoothNetwork.cpp. References XFuDynamicArray< XFuNetworkEventHandler * >::get(), XFuNetworkEventHandler::handleClientAccepted(), mAcceptGameToken, mClient, mNetworkEventHandlers, removeClient(), and XFuDynamicArray< XFuNetworkEventHandler * >::size(). |
|
Initializes this Bluetooth communication manager.
Definition at line 84 of file XFuBluetoothNetwork.cpp. References XFuDynamicArray< T >::create(), mCommunicationScheduler, and mNetworkEventHandlers. |
|
Initializes enable service.
Definition at line 115 of file XFuBluetoothNetwork.cpp. References closeService(), deleteAllClients(), mCommunicationHandler, mGamePort, and mService. Referenced by enableClientService(), and enableServerService(). |
|
Removes all clients.
Implements XFuNetwork. Definition at line 276 of file XFuBluetoothNetwork.cpp. References mCommunicationHandler, and removeClient(). |
|
Removes all communication event handlers.
Implements XFuNetwork. Definition at line 328 of file XFuBluetoothNetwork.cpp. References XFuDynamicArray< XFuNetworkEventHandler * >::isEmpty(), mNetworkEventHandlers, and XFuDynamicArray< XFuNetworkEventHandler * >::remove(). Referenced by reset(), and ~XFuBluetoothNetwork(). |
|
Removes the specified client.
Implements XFuNetwork. Definition at line 377 of file XFuBluetoothNetwork.cpp. References mClient, mClientId, mCommunicationHandler, and mCommunicationScheduler. Referenced by clientLost(), handleSender(), and removeAllClients(). |
|
Removes a data receiver.
Implements XFuNetwork. Definition at line 310 of file XFuBluetoothNetwork.cpp. References mCommunicationScheduler. |
|
Removes a communication event handler.
Implements XFuNetwork. Definition at line 322 of file XFuBluetoothNetwork.cpp. References mNetworkEventHandlers, and XFuDynamicArray< XFuNetworkEventHandler * >::remove(). |
|
Remove recent state frame.
Implements XFuNetwork. Definition at line 438 of file XFuBluetoothNetwork.cpp. References mCommunicationScheduler. |
|
Resets the communication manager.
Definition at line 104 of file XFuBluetoothNetwork.cpp. References closeService(), deleteAllClients(), init(), mAcceptGameToken, and removeAllEventHandlers(). |
|
Runs the communication scheduler.
Implements XFuNetwork. Definition at line 98 of file XFuBluetoothNetwork.cpp. References mCommunicationScheduler. |
|
Sends a serializable object to the specified client.
Definition at line 444 of file XFuBluetoothNetwork.cpp. References getPacketFrame(), and XFuSerializable::serialize(). |
|
Sends a game connection packet.
Definition at line 243 of file XFuBluetoothNetwork.cpp. References getPacketFrame(). |
|
Sends a serializable object to the specified client as a recent state packet.
Definition at line 466 of file XFuBluetoothNetwork.cpp. References getRecentStateFrame(), and XFuSerializable::serialize(). |
|
Sets the game token that is checked before new clients are allowed to connect.
Definition at line 237 of file XFuBluetoothNetwork.cpp. References mAcceptGameToken. |
|
Sets the default data receiver.
Implements XFuNetwork. Definition at line 291 of file XFuBluetoothNetwork.cpp. References mCommunicationScheduler, and mDefaultDataReceiver. |
|
Starts advertiser, if message is NULL default message is used.
Definition at line 658 of file XFuBluetoothNetwork.cpp. |
|
Starts device discovery.
Definition at line 548 of file XFuBluetoothNetwork.cpp. References mHostResolver, and stopDeviceDiscovery(). |
|
Starts server discovery, if address is NULL engine will search througth all available bt devices.
Definition at line 572 of file XFuBluetoothNetwork.cpp. References mBtServerSearch, mService, and mUUID. |
|
Stops server advertiser.
Definition at line 690 of file XFuBluetoothNetwork.cpp. References mService. Referenced by closeService(). |
|
Stops device discovery.
Definition at line 565 of file XFuBluetoothNetwork.cpp. References mHostResolver. Referenced by closeService(), and startDeviceDiscovery(). |
|
Stops server discovery.
Definition at line 600 of file XFuBluetoothNetwork.cpp. References mBtServerSearch, and mService. Referenced by closeService(). |
|
Game token that is checked before new clients are allowed to connect.
Definition at line 84 of file XFuBluetoothNetwork.h. Referenced by getAcceptGameToken(), handleSender(), reset(), setAcceptGameToken(), and XFuBluetoothNetwork(). |
|
Holds pointer to bt server search.
Definition at line 66 of file XFuBluetoothNetwork.h. Referenced by startServerDiscovery(), stopServerDiscovery(), XFuBluetoothNetwork(), and ~XFuBluetoothNetwork(). |
|
Array of pointers to clients.
Definition at line 78 of file XFuBluetoothNetwork.h. Referenced by addClient(), deleteAllClients(), enableServerService(), getClient(), handleSender(), removeClient(), and XFuBluetoothNetwork(). |
|
Holds ClientId, only one client is supported for now.
Definition at line 81 of file XFuBluetoothNetwork.h. Referenced by addClient(), deleteAllClients(), enableServerService(), removeClient(), and XFuBluetoothNetwork(). |
|
Pointer to the communication handler.
Definition at line 57 of file XFuBluetoothNetwork.h. Referenced by closeService(), enableClientService(), enableServerService(), initEnable(), removeAllClients(), removeClient(), XFuBluetoothNetwork(), and ~XFuBluetoothNetwork(). |
|
Id of the communication handler.
Definition at line 75 of file XFuBluetoothNetwork.h. Referenced by enableClientService(), enableServerService(), and XFuBluetoothNetwork(). |
|
Pointer to the communication scheduler.
Definition at line 54 of file XFuBluetoothNetwork.h. Referenced by addClient(), addDataReceiver(), closeService(), deleteAllClients(), enableClientService(), enableServerService(), getDataReceiver(), getPacketFrame(), getRecentStateFrame(), getRoundTripTime(), init(), removeClient(), removeDataReceiver(), removeRecentStateFrame(), runCommunicationScheduler(), setDefaultDataReceiver(), and XFuBluetoothNetwork(). |
|
Holds pointer to the Bluetooth communication services.
Definition at line 60 of file XFuBluetoothNetwork.h. Referenced by XFuBluetoothNetwork(). |
|
Pointer to the default data receiver.
Definition at line 63 of file XFuBluetoothNetwork.h. Referenced by getDefaultDataReceiver(), setDefaultDataReceiver(), and XFuBluetoothNetwork(). |
|
Holds game port.
Definition at line 87 of file XFuBluetoothNetwork.h. Referenced by initEnable(), and XFuBluetoothNetwork(). |
|
Holds pointer to bt host resolver.
Definition at line 72 of file XFuBluetoothNetwork.h. Referenced by deviceLocalName(), startDeviceDiscovery(), stopDeviceDiscovery(), XFuBluetoothNetwork(), and ~XFuBluetoothNetwork(). |
|
Pointer to array of communication event handlers.
Definition at line 51 of file XFuBluetoothNetwork.h. Referenced by addEventHandler(), clientLost(), deviceDiscovery(), handleSender(), init(), removeAllEventHandlers(), removeEventHandler(), XFuBluetoothNetwork(), and ~XFuBluetoothNetwork(). |
|
Holds bluetooth communication service, needed for bluetooth SDP and first free server port query.
Definition at line 69 of file XFuBluetoothNetwork.h. Referenced by closeService(), initEnable(), startAdvertiser(), startServerDiscovery(), stopAdvertiser(), stopServerDiscovery(), XFuBluetoothNetwork(), and ~XFuBluetoothNetwork(). |
|
Holds bluetooth uuid for this game.
Definition at line 90 of file XFuBluetoothNetwork.h. Referenced by startAdvertiser(), and startServerDiscovery(). |
![]() | ||||
![]() |
Confidential Copyright © 2002-2003 Fathammer | with doxygen by Dimitri van Heesch |