An Overlay-based
Virtual Network Substrate
SpoVNet

Changeset 7041 for source


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

added bluetooth check

Location:
source/ariba/utility
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • source/ariba/utility/addressing/mac_address.hpp

    r5284 r7041  
    44#include "detail/address_convenience.hpp"
    55
     6#include<config.h>
    67#include<string>
    78#include<cassert>
    89#include<boost/tr1/functional.hpp>
     10#ifdef HAVE_LIBBLUETOOTH
    911#include<bluetooth/bluetooth.h>
     12#endif
    1013
    1114namespace ariba {
     
    125128
    126129        //--- conversion ----------------------------------------------------------
     130#ifdef HAVE_LIBBLUETOOTH
    127131
    128132        bdaddr_t bluetooth() const {
     
    135139                for (size_t i=0; i<6; i++) mac[i] = addr.b[5-i];
    136140        }
     141#endif
    137142};
    138143
  • source/ariba/utility/transport/asio/bluetooth_endpoint.hpp

    r6185 r7041  
     1#include<config.h>
     2
     3#ifdef HAVE_LIBBLUETOOTH
     4
    15#ifndef BOOST_ASIO_BLUETOOTH_BLUETOOTH_ENDPOINT_HPP__
    26#define BOOST_ASIO_BLUETOOTH_BLUETOOTH_ENDPOINT_HPP__
     
    180184
    181185#endif
     186#endif
  • source/ariba/utility/transport/rfcomm/rfcomm.cpp

    r5993 r7041  
     1#include<config.h>
     2
     3#ifdef HAVE_LIBBLUETOOTH
     4
    15#include "rfcomm.hpp"
    26
     
    432436
    433437}} // namespace ariba::transport
     438
     439#endif
  • source/ariba/utility/transport/rfcomm/rfcomm.hpp

    r5993 r7041  
     1#include<config.h>
     2
     3#ifdef HAVE_LIBBLUETOOTH
     4
    15#ifndef RFCOMM_HPP_
    26#define RFCOMM_HPP_
     
    7276
    7377#endif /* RFCOMM_HPP_ */
     78#endif
  • 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
  • source/ariba/utility/transport/transport_peer.hpp

    r5993 r7041  
    22#define TRANSPORT_PEER_HPP_
    33
     4#include<config.h>
    45#include "transport_protocol.hpp"
    56#include "ariba/utility/addressing/endpoint_set.hpp"
     
    1213
    1314class tcpip;
     15#ifdef HAVE_LIBBLUETOOTH
    1416class rfcomm;
     17#endif
    1518
    1619/**
     
    3538        endpoint_set&  local;
    3639        tcpip* tcp;
     40#ifdef HAVE_LIBBLUETOOTH
    3741        rfcomm* rfc;
     42#endif
    3843};
    3944
Note: See TracChangeset for help on using the changeset viewer.