#include "core/internal/bluetooth_endpoint_channel.h" #include namespace location { namespace nearby { namespace connections { template Ptr > BluetoothEndpointChannel::createOutgoing( Ptr > medium_manager, const string& channel_name, Ptr bluetooth_socket) { return MakePtr( new BluetoothEndpointChannel(channel_name, bluetooth_socket)); } template Ptr > BluetoothEndpointChannel::createIncoming( Ptr > medium_manager, const string& channel_name, Ptr bluetooth_socket) { return MakePtr( new BluetoothEndpointChannel(channel_name, bluetooth_socket)); } template BluetoothEndpointChannel::BluetoothEndpointChannel( const string& channel_name, Ptr bluetooth_socket) : BaseEndpointChannel(channel_name, bluetooth_socket->getInputStream(), bluetooth_socket->getOutputStream()), bluetooth_socket_(bluetooth_socket) {} template BluetoothEndpointChannel::~BluetoothEndpointChannel() {} template proto::connections::Medium BluetoothEndpointChannel::getMedium() { return proto::connections::Medium::BLUETOOTH; } template void BluetoothEndpointChannel::closeImpl() { Exception::Value exception = bluetooth_socket_->close(); if (exception != Exception::NONE) { if (exception == Exception::IO) { // TODO(tracyzhou): Add logging. } } } } // namespace connections } // namespace nearby } // namespace location