#include <XFuBluetoothMultiNetwork.h>
Inheritance diagram for XFuBluetoothMultiNetwork:
Public Member Functions | |
virtual INT | enableClientService (UINT16 aPort) |
Enables the Bluetooth communication handler and opens it for service. Opens device as bluetooth slave. | |
virtual INT | enableHostService () |
Enables the Bluetooth communication handler and opens it for service. Opens device as bluetooth master. | |
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 | stopClientDiscovery () |
Stops server discovery. | |
virtual void | stopAdvertiser () |
Stops server advertiser. | |
virtual INT | startDeviceDiscovery () |
Starts device discovery. | |
virtual INT | startClientDiscovery (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 | ~XFuBluetoothMultiNetwork () |
Virtual destructor. Closes all open tasks and deletes all created objects. | |
Static Public Member Functions | |
XFuBluetoothMultiNetwork * | create () |
Static constructor. | |
Protected Member Functions | |
virtual void | deleteAllClients () |
Deletes all clients. | |
XFuBluetoothMultiNetwork () | |
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. | |
XFcBtHostResolver * | mHostResolver |
Holds pointer to bt host resolver. | |
INT32 | mCommunicationHandlerId |
Id of the communication handler. | |
XFcHashtable< UINT32, XFcBtClientWin * > | mClients |
Array of pointers to clients. | |
INT32 | mSlaveClientId |
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. | |
XFcBtCommService * | mService |
Holds bluetooth communication service, needed for bluetooth SDP and first free server port query. | |
XFcBtUUID | mUUID |
Holds bluetooth uuid for this game. |
|
Protected constructor.
Definition at line 52 of file XFuBluetoothMultiNetwork.cpp. References mAcceptGameToken, mBtServerSearch, mCommunicationHandler, mCommunicationHandlerId, mCommunicationScheduler, mCommunicationService, mDefaultDataReceiver, mGamePort, mHostResolver, mNetworkEventHandlers, mService, and mSlaveClientId. |
|
Virtual destructor. Closes all open tasks and deletes all created objects.
Definition at line 71 of file XFuBluetoothMultiNetwork.cpp. References closeService(), deleteAllClients(), mHostResolver, mNetworkEventHandlers, mService, and removeAllEventHandlers(). |
|
Adds a client with the specific address.
Implements XFuNetwork. Definition at line 377 of file XFuBluetoothMultiNetwork.cpp. References mClients, and mCommunicationScheduler. |
|
Adds a new data receiver.
Implements XFuNetwork. Definition at line 330 of file XFuBluetoothMultiNetwork.cpp. References mCommunicationScheduler. |
|
Adds a communication event handler.
Implements XFuNetwork. Definition at line 342 of file XFuBluetoothMultiNetwork.cpp. References mNetworkEventHandlers, and XFuDynamicArray< XFuNetworkEventHandler * >::put(). |
|
Connection lost handler (XFuClientLost) (callback).
Definition at line 534 of file XFuBluetoothMultiNetwork.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 217 of file XFuBluetoothMultiNetwork.cpp. References mCommunicationHandler, mCommunicationScheduler, mService, stopAdvertiser(), stopClientDiscovery(), and stopDeviceDiscovery(). Referenced by initEnable(), reset(), and ~XFuBluetoothMultiNetwork(). |
|
Static constructor.
Definition at line 40 of file XFuBluetoothMultiNetwork.cpp. References init(). |
|
Deletes all clients.
Definition at line 271 of file XFuBluetoothMultiNetwork.cpp. References getClient(), mClients, mCommunicationScheduler, and mSlaveClientId. Referenced by initEnable(), reset(), and ~XFuBluetoothMultiNetwork(). |
|
Callback for server discovery.
Definition at line 692 of file XFuBluetoothMultiNetwork.cpp. References XFuDynamicArray< XFuNetworkEventHandler * >::get(), XFuNetworkEventHandler::handleAdvertiseDiscovered(), mNetworkEventHandlers, and XFuDynamicArray< XFuNetworkEventHandler * >::size(). |
|
Callback for device discovery.
Definition at line 675 of file XFuBluetoothMultiNetwork.cpp. References XFuDynamicArray< XFuNetworkEventHandler * >::get(), XFuNetworkEventHandler::handleDeviceDiscovered(), mNetworkEventHandlers, and XFuDynamicArray< XFuNetworkEventHandler * >::size(). |
|
Gets device local name.
Definition at line 754 of file XFuBluetoothMultiNetwork.cpp. References mHostResolver. |
|
Enables the Bluetooth communication handler and opens it for service. Opens device as bluetooth slave.
Definition at line 153 of file XFuBluetoothMultiNetwork.cpp. References initEnable(), mClients, mCommunicationHandler, mCommunicationHandlerId, mCommunicationScheduler, and mSlaveClientId. |
|
Enables the Bluetooth communication handler and opens it for service. Opens device as bluetooth master.
Definition at line 200 of file XFuBluetoothMultiNetwork.cpp. References initEnable(), mCommunicationHandler, mCommunicationHandlerId, and mCommunicationScheduler. |
|
Returns the game token that is checked before new clients are allowed to connect.
Definition at line 241 of file XFuBluetoothMultiNetwork.cpp. References mAcceptGameToken. |
|
Returns the specified client.
Implements XFuNetwork. Definition at line 360 of file XFuBluetoothMultiNetwork.cpp. References mClients. Referenced by deleteAllClients(), handleSender(), and removeClient(). |
|
Returns the specified data receiver.
Implements XFuNetwork. Definition at line 324 of file XFuBluetoothMultiNetwork.cpp. References mCommunicationScheduler. |
|
Returns a pointer to the default data receiver.
Implements XFuNetwork. Definition at line 311 of file XFuBluetoothMultiNetwork.cpp. References mDefaultDataReceiver. |
|
Get packet frame.
Implements XFuNetwork. Definition at line 467 of file XFuBluetoothMultiNetwork.cpp. References mCommunicationScheduler. Referenced by send(), and sendGameConnectPacket(). |
|
Get recent state frame.
Implements XFuNetwork. Definition at line 473 of file XFuBluetoothMultiNetwork.cpp. References mCommunicationScheduler. Referenced by sendRecentState(). |
|
Returns the round trip time for the specified client.
Definition at line 461 of file XFuBluetoothMultiNetwork.cpp. References mCommunicationScheduler. |
|
Handle data from an unknown client (callback).
Definition at line 549 of file XFuBluetoothMultiNetwork.cpp. References XFuDynamicArray< XFuNetworkEventHandler * >::get(), getClient(), XFuNetworkEventHandler::handleClientAccepted(), mAcceptGameToken, mNetworkEventHandlers, removeClient(), and XFuDynamicArray< XFuNetworkEventHandler * >::size(). |
|
Initializes this Bluetooth communication manager.
Definition at line 84 of file XFuBluetoothMultiNetwork.cpp. References XFuDynamicArray< T >::create(), mCommunicationScheduler, and mNetworkEventHandlers. |
|
Initializes enable service.
Definition at line 118 of file XFuBluetoothMultiNetwork.cpp. References closeService(), deleteAllClients(), mCommunicationHandler, mGamePort, and mService. Referenced by enableClientService(), and enableHostService(). |
|
Removes all clients.
Implements XFuNetwork. Definition at line 293 of file XFuBluetoothMultiNetwork.cpp. References mClients, mCommunicationHandler, and removeClient(). |
|
Removes all communication event handlers.
Implements XFuNetwork. Definition at line 354 of file XFuBluetoothMultiNetwork.cpp. References XFuDynamicArray< XFuNetworkEventHandler * >::isEmpty(), mNetworkEventHandlers, and XFuDynamicArray< XFuNetworkEventHandler * >::remove(). Referenced by reset(), and ~XFuBluetoothMultiNetwork(). |
|
Removes the specified client.
Implements XFuNetwork. Definition at line 415 of file XFuBluetoothMultiNetwork.cpp. References getClient(), mClients, mCommunicationHandler, mCommunicationScheduler, and mSlaveClientId. Referenced by clientLost(), handleSender(), and removeAllClients(). |
|
Removes a data receiver.
Implements XFuNetwork. Definition at line 336 of file XFuBluetoothMultiNetwork.cpp. References mCommunicationScheduler. |
|
Removes a communication event handler.
Implements XFuNetwork. Definition at line 348 of file XFuBluetoothMultiNetwork.cpp. References mNetworkEventHandlers, and XFuDynamicArray< XFuNetworkEventHandler * >::remove(). |
|
Remove recent state frame.
Implements XFuNetwork. Definition at line 479 of file XFuBluetoothMultiNetwork.cpp. References mCommunicationScheduler. |
|
Resets the communication manager.
Definition at line 104 of file XFuBluetoothMultiNetwork.cpp. References closeService(), deleteAllClients(), init(), mAcceptGameToken, and removeAllEventHandlers(). |
|
Runs the communication scheduler.
Implements XFuNetwork. Definition at line 98 of file XFuBluetoothMultiNetwork.cpp. References mCommunicationScheduler. |
|
Sends a serializable object to the specified client.
Definition at line 485 of file XFuBluetoothMultiNetwork.cpp. References getPacketFrame(), and XFuSerializable::serialize(). |
|
Sends a game connection packet.
Definition at line 253 of file XFuBluetoothMultiNetwork.cpp. References getPacketFrame(). |
|
Sends a serializable object to the specified client as a recent state packet.
Definition at line 510 of file XFuBluetoothMultiNetwork.cpp. References getRecentStateFrame(), and XFuSerializable::serialize(). |
|
Sets the game token that is checked before new clients are allowed to connect.
Definition at line 247 of file XFuBluetoothMultiNetwork.cpp. References mAcceptGameToken. |
|
Sets the default data receiver.
Implements XFuNetwork. Definition at line 317 of file XFuBluetoothMultiNetwork.cpp. References mCommunicationScheduler, and mDefaultDataReceiver. |
|
Starts advertiser, if message is NULL default message is used.
Definition at line 709 of file XFuBluetoothMultiNetwork.cpp. |
|
Starts server discovery, if address is NULL engine will search througth all available bt devices.
Definition at line 628 of file XFuBluetoothMultiNetwork.cpp. References mBtServerSearch, mService, and mUUID. |
|
Starts device discovery.
Definition at line 602 of file XFuBluetoothMultiNetwork.cpp. References mHostResolver, and stopDeviceDiscovery(). |
|
Stops server advertiser.
Definition at line 743 of file XFuBluetoothMultiNetwork.cpp. References mService. Referenced by closeService(). |
|
Stops server discovery.
Definition at line 659 of file XFuBluetoothMultiNetwork.cpp. References mBtServerSearch, and mService. Referenced by closeService(). |
|
Stops device discovery.
Definition at line 620 of file XFuBluetoothMultiNetwork.cpp. References mHostResolver. Referenced by closeService(), and startDeviceDiscovery(). |
|
Game token that is checked before new clients are allowed to connect.
Definition at line 78 of file XFuBluetoothMultiNetwork.h. Referenced by getAcceptGameToken(), handleSender(), reset(), setAcceptGameToken(), and XFuBluetoothMultiNetwork(). |
|
Holds pointer to bt server search.
Definition at line 63 of file XFuBluetoothMultiNetwork.h. Referenced by startClientDiscovery(), stopClientDiscovery(), and XFuBluetoothMultiNetwork(). |
|
Array of pointers to clients.
Definition at line 72 of file XFuBluetoothMultiNetwork.h. Referenced by addClient(), deleteAllClients(), enableClientService(), getClient(), removeAllClients(), and removeClient(). |
|
Pointer to the communication handler.
Definition at line 54 of file XFuBluetoothMultiNetwork.h. Referenced by closeService(), enableClientService(), enableHostService(), initEnable(), removeAllClients(), removeClient(), and XFuBluetoothMultiNetwork(). |
|
Id of the communication handler.
Definition at line 69 of file XFuBluetoothMultiNetwork.h. Referenced by enableClientService(), enableHostService(), and XFuBluetoothMultiNetwork(). |
|
Pointer to the communication scheduler.
Definition at line 51 of file XFuBluetoothMultiNetwork.h. Referenced by addClient(), addDataReceiver(), closeService(), deleteAllClients(), enableClientService(), enableHostService(), getDataReceiver(), getPacketFrame(), getRecentStateFrame(), getRoundTripTime(), init(), removeClient(), removeDataReceiver(), removeRecentStateFrame(), runCommunicationScheduler(), setDefaultDataReceiver(), and XFuBluetoothMultiNetwork(). |
|
Holds pointer to the Bluetooth communication services.
Definition at line 57 of file XFuBluetoothMultiNetwork.h. Referenced by XFuBluetoothMultiNetwork(). |
|
Pointer to the default data receiver.
Definition at line 60 of file XFuBluetoothMultiNetwork.h. Referenced by getDefaultDataReceiver(), setDefaultDataReceiver(), and XFuBluetoothMultiNetwork(). |
|
Holds game port.
Definition at line 81 of file XFuBluetoothMultiNetwork.h. Referenced by initEnable(), and XFuBluetoothMultiNetwork(). |
|
Holds pointer to bt host resolver.
Definition at line 66 of file XFuBluetoothMultiNetwork.h. Referenced by deviceLocalName(), startDeviceDiscovery(), stopDeviceDiscovery(), XFuBluetoothMultiNetwork(), and ~XFuBluetoothMultiNetwork(). |
|
Pointer to array of communication event handlers.
Definition at line 48 of file XFuBluetoothMultiNetwork.h. Referenced by addEventHandler(), clientLost(), deviceDiscovery(), handleSender(), init(), removeAllEventHandlers(), removeEventHandler(), XFuBluetoothMultiNetwork(), and ~XFuBluetoothMultiNetwork(). |
|
Holds bluetooth communication service, needed for bluetooth SDP and first free server port query.
Definition at line 84 of file XFuBluetoothMultiNetwork.h. Referenced by closeService(), initEnable(), startAdvertiser(), startClientDiscovery(), stopAdvertiser(), stopClientDiscovery(), XFuBluetoothMultiNetwork(), and ~XFuBluetoothMultiNetwork(). |
|
Holds ClientId, only one client is supported for now.
Definition at line 75 of file XFuBluetoothMultiNetwork.h. Referenced by deleteAllClients(), enableClientService(), removeClient(), and XFuBluetoothMultiNetwork(). |
|
Holds bluetooth uuid for this game.
Definition at line 87 of file XFuBluetoothMultiNetwork.h. Referenced by startAdvertiser(), and startClientDiscovery(). |
![]() | ||||
![]() |
Confidential Copyright © 2002-2003 Fathammer | with doxygen by Dimitri van Heesch |