LibreOffice Module sd (master) 1
OSXBluetooth.mm
Go to the documentation of this file.
1/* -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9#include <osl/conditn.hxx>
10#include <sal/log.hxx>
11
12#include <premac.h>
13#import <IOBluetooth/objc/IOBluetoothRFCOMMChannel.h>
14#include <postmac.h>
15
16#include "OSXBluetooth.h"
17
18@implementation ChannelDelegate
19
20- (id) initWithCommunicatorAndSocket:(sd::Communicator*)communicator socket:(sd::OSXBluetoothWrapper*)socket
21{
22 pCommunicator = communicator;
23 pSocket = socket;
24 return self;
25}
26
27- (void) rfcommChannelData:(IOBluetoothRFCOMMChannel*)rfcommChannel data:(void *)dataPointer length:(size_t)dataLength
28{
29 (void) rfcommChannel;
30
31 if ( pSocket )
32 {
33 pSocket->appendData(dataPointer, dataLength);
34 }
35}
36
37- (void) rfcommChannelClosed:(IOBluetoothRFCOMMChannel*)rfcommChannel
38{
39 (void) rfcommChannel;
40
41 SAL_INFO( "sdremote.bluetooth", "ChannelDelegate::rfcommChannelClosed()");
42
43 if ( pSocket )
44 {
46 }
47 pCommunicator = nullptr;
48 pSocket = nullptr;
49}
50
51@end
52
53/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void appendData(void *pBuffer, size_t len)
sd::Communicator * pCommunicator
Definition: OSXBluetooth.h:21
sd::OSXBluetoothWrapper * pSocket
Definition: OSXBluetooth.h:22
#define SAL_INFO(area, stream)