Ignore:
Timestamp:
Dec 8, 2009, 6:18:58 PM (14 years ago)
Author:
mies
Message:

added bluetooth check

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/ariba/utility/transport/transport_peer.cpp

    r5614 r7041  
    11
     2#include<config.h>
    23#include "transport_peer.hpp"
    34#include "transport.hpp"
     
    1718                cout << "Started tcpip_transport on port "  << local.tcp.begin()->value() << endl;
    1819        }
     20
     21        #ifdef HAVE_LIBBLUETOOTH
    1922        // setup rfcomm transports
    2023        rfc = NULL;
     
    2427                cout << "Started rfcomm_transport on port "  << local.rfcomm.begin()->value() << endl;
    2528        }
     29        #endif
    2630}
    2731
    2832transport_peer::~transport_peer() {
    2933        if (tcp !=NULL ) delete tcp;
     34#ifdef HAVE_LIBBLUETOOTH
    3035        if (rfc !=NULL ) delete rfc;
     36#endif
    3137}
    3238
    3339void transport_peer::start() {
    3440        if (tcp!=NULL) tcp->start();
     41#ifdef HAVE_LIBBLUETOOTH
    3542        if (rfc!=NULL) rfc->start();
     43#endif
    3644}
    3745
    3846void transport_peer::stop() {
    3947        if (tcp!=NULL) tcp->stop();
     48#ifdef HAVE_LIBBLUETOOTH
    4049        if (rfc!=NULL) rfc->stop();
     50#endif
    4151}
    4252
     
    4555                tcp->send(remote,data,size);
    4656        } else
     57#ifdef HAVE_LIBBLUETOOTH
    4758        if (remote->instanceof<rfcomm_endpoint>() && rfc!=NULL) {
    4859                rfc->send(remote,data,size);
    4960        } else
     61#endif
    5062                cerr << "Could not send message to " << remote->to_string() << endl;
    5163}
     
    5365void transport_peer::send( const endpoint_set& endpoints, const uint8_t* data, size_t size ) {
    5466        if (tcp!=NULL) tcp->send(endpoints,data,size);
     67#ifdef HAVE_LIBBLUETOOTH
    5568        if (rfc!=NULL) rfc->send(endpoints,data,size);
     69#endif
    5670}
    5771
     
    5973        if (remote->instanceof<tcpip_endpoint>() && tcp!=NULL)
    6074                tcp->terminate(remote);
     75#ifdef HAVE_LIBBLUETOOTH
    6176        if (remote->instanceof<rfcomm_endpoint>() && rfc!=NULL)
    6277                rfc->terminate(remote);
     78#endif
    6379}
    6480
    6581void transport_peer::register_listener( transport_listener* listener ) {
    6682        if (tcp!=NULL) tcp->register_listener(listener);
     83#ifdef HAVE_LIBBLUETOOTH
    6784        if (rfc!=NULL) rfc->register_listener(listener);
     85#endif
    6886}
    6987
Note: See TracChangeset for help on using the changeset viewer.