Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
3cadf6de
Kaydet (Commit)
3cadf6de
authored
Agu 21, 2012
tarafından
Andrzej J.R. Hunt
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added bluez_bluetooth headers as a module.
Change-Id: Id9f4e59b5c46c7bee3cf0b129f523d963c0407a6
üst
f2b1841a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
356 additions
and
11 deletions
+356
-11
Module_tail_build.mk
Module_tail_build.mk
+1
-0
Repository.mk
Repository.mk
+1
-0
RepositoryModule_ooo.mk
RepositoryModule_ooo.mk
+1
-0
BluetoothClient.java
...reoffice/impressremote/communication/BluetoothClient.java
+111
-0
CommunicationService.java
...ice/impressremote/communication/CommunicationService.java
+4
-2
Module_bluez_bluetooth.mk
bluez_bluetooth/Module_bluez_bluetooth.mk
+38
-0
Package_inc.mk
bluez_bluetooth/Package_inc.mk
+40
-0
README
bluez_bluetooth/README
+4
-0
bluetooth.h
bluez_bluetooth/inc/bluetooth/bluetooth.h
+7
-5
hci.h
bluez_bluetooth/inc/bluetooth/hci.h
+0
-0
hci_lib.h
bluez_bluetooth/inc/bluetooth/hci_lib.h
+24
-0
l2cap.h
bluez_bluetooth/inc/bluetooth/l2cap.h
+87
-0
rfcomm.h
bluez_bluetooth/inc/bluetooth/rfcomm.h
+5
-4
sco.h
bluez_bluetooth/inc/bluetooth/sco.h
+32
-0
Library_sd.mk
sd/Library_sd.mk
+1
-0
No files found.
Module_tail_build.mk
Dosyayı görüntüle @
3cadf6de
...
...
@@ -37,6 +37,7 @@ $(eval $(call gb_Module_add_moduledirs,tail_end,\
basic
\
bean
\
binaryurp
\
bluez_bluetooth
\
canvas
\
chart2
\
configmgr
\
...
...
Repository.mk
Dosyayı görüntüle @
3cadf6de
...
...
@@ -430,6 +430,7 @@ $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO, \
avmediagst \
avmediagst_0_10 \
avmediawin \
bluez_bluetooth \
cached1 \
collator_data \
dbpool2 \
...
...
RepositoryModule_ooo.mk
Dosyayı görüntüle @
3cadf6de
...
...
@@ -40,6 +40,7 @@ $(eval $(call gb_Module_add_moduledirs,ooo,\
basic
\
bean
\
binaryurp
\
bluez_bluetooth
\
canvas
\
chart2
\
clucene
\
...
...
android/sdremote/src/org/libreoffice/impressremote/communication/BluetoothClient.java
0 → 100644
Dosyayı görüntüle @
3cadf6de
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
package
org
.
libreoffice
.
impressremote
.
communication
;
import
java.net.Socket
;
import
java.util.UUID
;
import
android.bluetooth.BluetoothAdapter
;
import
android.bluetooth.BluetoothDevice
;
import
android.bluetooth.BluetoothSocket
;
import
android.content.Context
;
/**
* Standard Network client. Connects to a server using Sockets.
*
* @author Andrzej J.R. Hunt
*/
public
class
BluetoothClient
extends
Client
{
private
static
final
int
PORT
=
5
;
private
Socket
mSocket
;
public
BluetoothClient
(
String
bluetoothAddress
,
Context
aContext
)
{
super
(
aContext
);
try
{
BluetoothAdapter
aAdapter
=
BluetoothAdapter
.
getDefaultAdapter
();
BluetoothDevice
aDevice
=
aAdapter
.
getRemoteDevice
(
bluetoothAddress
);
BluetoothSocket
aSocket
=
aDevice
.
createRfcommSocketToServiceRecord
(
UUID
.
fromString
(
"00001101-0000-1000-8000-00805f9b34fb"
));
aSocket
.
connect
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
// BluetoothSocket aSocket = new BluetoothClient(bluetoothAddress, aContext)
// .createRfcommSocketToServiceRecord(UUID
// .fromString("00001101-0000-1000-8000-00805F9B34F
// }
// try {
// mSocket = new Socket(ipAddress, PORT);
// mInputStream = mSocket.getInputStream();
// mReader = new BufferedReader(new InputStreamReader(mInputStream,
// CHARSET));
// mOutputStream = mSocket.getOutputStream();
// // Pairing.
// Random aRandom = new Random();
// String aPin = "" + (aRandom.nextInt(9000) + 1000);
// while (aPin.length() < 4) {
// aPin = "0" + aPin; // Add leading zeros if necessary
// }
// Intent aIntent = new Intent(
// CommunicationService.MSG_PAIRING_STARTED);
// aIntent.putExtra("PIN", aPin);
// mPin = aPin;
// LocalBroadcastManager.getInstance(mContext).sendBroadcast(aIntent);
// // Send out
// String aName = CommunicationService.getDeviceName(); // TODO: get the proper name
// sendCommand("LO_SERVER_CLIENT_PAIR\n" + aName + "\n" + aPin
// + "\n\n");
//
// // Wait until we get the appropriate string back...
// System.out.println("SF:waiting");
// String aTemp = mReader.readLine();
// System.out.println("SF:waited");
// if (!aTemp.equals("LO_SERVER_SERVER_PAIRED")) {
// return;
// } else {
// aIntent = new Intent(
// CommunicationService.MSG_PAIRING_SUCCESSFUL);
// LocalBroadcastManager.getInstance(mContext).sendBroadcast(
// aIntent);
// }
// while (mReader.readLine().length() != 0) {
// // Get rid of extra lines
// System.out.println("SF: empty line");
// }
// System.out.println("SD: empty");
// startListening();
// } catch (UnknownHostException e) {
// // TODO Tell the user we have a problem
// e.printStackTrace();
// } catch (IOException e) {
// // TODO As above
// e.printStackTrace();
// }
}
@Override
public
void
closeConnection
()
{
// try {
// if (mSocket != null)
// mSocket.close();
// } catch (IOException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java
Dosyayı görüntüle @
3cadf6de
...
...
@@ -81,12 +81,14 @@ public class CommunicationService extends Service implements Runnable {
case
NETWORK:
mClient
=
new
NetworkClient
(
mServerDesired
.
getAddress
(),
this
);
mTransmitter
=
new
Transmitter
(
mClient
);
mClient
.
setReceiver
(
mReceiver
);
break
;
case
BLUETOOTH:
mClient
=
new
BluetoothClient
(
mServerDesired
.
getAddress
(),
this
);
break
;
}
mTransmitter
=
new
Transmitter
(
mClient
);
mClient
.
setReceiver
(
mReceiver
);
mState
=
State
.
CONNECTED
;
}
}
...
...
bluez_bluetooth/Module_bluez_bluetooth.mk
0 → 100644
Dosyayı görüntüle @
3cadf6de
#
# Version: MPL 1.1 / GPLv3+ / LGPLv3+
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License or as specified alternatively below. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Initial Developer of the Original Code is
# Peter Foley <pefoley2@verizon.net>
# Portions created by the Initial Developer are Copyright (C) 2011 the
# Initial Developer. All Rights Reserved.
#
# Major Contributor(s):
#
# For minor contributions see the git repository.
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
# instead of those above.
#
$(eval $(call gb_Module_Module,bluez_bluetooth))
$(eval $(call gb_Module_add_targets,bluez_bluetooth,\
Package_inc \
))
# vim: set noet sw=4 ts=4:
\ No newline at end of file
bluez_bluetooth/Package_inc.mk
0 → 100644
Dosyayı görüntüle @
3cadf6de
#
# Version: MPL 1.1 / GPLv3+ / LGPLv3+
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License or as specified alternatively below. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Initial Developer of the Original Code is
# Peter Foley <pefoley2@verizon.net>
# Portions created by the Initial Developer are Copyright (C) 2011 the
# Initial Developer. All Rights Reserved.
#
# Major Contributor(s):
#
# For minor contributions see the git repository.
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
# instead of those above.
#
$(eval $(call gb_Package_Package,bluez_bluetooth_inc,$(SRCDIR)/bluez_bluetooth/inc))
$(eval $(call gb_Package_add_file,bluez_bluetooth_inc,inc/bluetooth/bluetooth.h,bluetooth/bluetooth.h))
$(eval $(call gb_Package_add_file,bluez_bluetooth_inc,inc/bluetooth/hci.h,bluetooth/hci.h))
$(eval $(call gb_Package_add_file,bluez_bluetooth_inc,inc/bluetooth/hci_lib.h,bluetooth/hci_lib.h))
$(eval $(call gb_Package_add_file,bluez_bluetooth_inc,inc/bluetooth/l2cap.h,bluetooth/l2cap.h))
$(eval $(call gb_Package_add_file,bluez_bluetooth_inc,inc/bluetooth/rfcomm.h,bluetooth/rfcomm.h))
$(eval $(call gb_Package_add_file,bluez_bluetooth_inc,inc/bluetooth/sco.h,bluetooth/sco.h))
# vim: set noet sw=4 ts=4:
\ No newline at end of file
bluez_bluetooth/README
0 → 100644
Dosyayı görüntüle @
3cadf6de
Cleaned linux bluez headers.
Originally gotten from:
http://gitorious.org/0xdroid/system_bluetooth/trees/59ca0be6dc8ef3f30f8f863d8fb805a55bf12fe5/bluez-clean-headers
sd/source/ui/remotecontrol
/bluetooth/bluetooth.h
→
bluez_bluetooth/inc
/bluetooth/bluetooth.h
Dosyayı görüntüle @
3cadf6de
...
...
@@ -58,11 +58,13 @@
#define BDADDR_LOCAL (&(bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff}})
#ifdef __cplusplus
#endif
typedef
struct
{
uint8_t
b
[
6
];
}
__attribute__
((
packed
))
bdaddr_t
;
static
inline
void
bacpy
(
bdaddr_t
*
dst
,
const
bdaddr_t
*
src
)
typedef
struct
{
memcpy
(
dst
,
src
,
sizeof
(
bdaddr_t
));
uint8_t
b
[
6
];
}
__attribute__
((
packed
))
bdaddr_t
;
static
inline
void
bacpy
(
bdaddr_t
*
dst
,
const
bdaddr_t
*
src
)
{
memcpy
(
dst
,
src
,
sizeof
(
bdaddr_t
));
}
#endif
bluez_bluetooth/inc/bluetooth/hci.h
0 → 100644
Dosyayı görüntüle @
3cadf6de
This diff is collapsed.
Click to expand it.
bluez_bluetooth/inc/bluetooth/hci_lib.h
0 → 100644
Dosyayı görüntüle @
3cadf6de
/****************************************************************************
****************************************************************************
***
*** This header was automatically generated from a Bluez header
*** of the same name, to make information necessary for userspace to
*** call into the kernel available to Android. It contains only constants,
*** structures, and macros generated from the original header, and thus,
*** contains no copyrightable information.
***
****************************************************************************
****************************************************************************/
#ifndef __HCI_LIB_H
#define __HCI_LIB_H
#ifdef __cplusplus
#endif
#ifdef __cplusplus
#endif
static
inline
int
hci_test_bit
(
int
nr
,
void
*
addr
)
{
return
*
((
uint32_t
*
)
addr
+
(
nr
>>
5
))
&
(
1
<<
(
nr
&
31
));
}
#endif
bluez_bluetooth/inc/bluetooth/l2cap.h
0 → 100644
Dosyayı görüntüle @
3cadf6de
/****************************************************************************
****************************************************************************
***
*** This header was automatically generated from a Linux kernel header
*** of the same name, to make information necessary for userspace to
*** call into the kernel available to libc. It contains only constants,
*** structures, and macros generated from the original header, and thus,
*** contains no copyrightable information.
***
****************************************************************************
****************************************************************************/
#ifndef __L2CAP_H
#define __L2CAP_H
#ifdef __cplusplus
#endif
#include <sys/socket.h>
#define L2CAP_DEFAULT_MTU 672
#define L2CAP_DEFAULT_FLUSH_TO 0xFFFF
#define L2CAP_CONN_TIMEOUT (HZ * 40)
#define L2CAP_OPTIONS 0x01
#define L2CAP_CONNINFO 0x02
#define L2CAP_LM 0x03
#define L2CAP_LM_MASTER 0x0001
#define L2CAP_LM_AUTH 0x0002
#define L2CAP_LM_ENCRYPT 0x0004
#define L2CAP_LM_TRUSTED 0x0008
#define L2CAP_LM_RELIABLE 0x0010
#define L2CAP_LM_SECURE 0x0020
#define L2CAP_LM_FLUSHABLE 0x0040
#define L2CAP_COMMAND_REJ 0x01
#define L2CAP_CONN_REQ 0x02
#define L2CAP_CONN_RSP 0x03
#define L2CAP_CONF_REQ 0x04
#define L2CAP_CONF_RSP 0x05
#define L2CAP_DISCONN_REQ 0x06
#define L2CAP_DISCONN_RSP 0x07
#define L2CAP_ECHO_REQ 0x08
#define L2CAP_ECHO_RSP 0x09
#define L2CAP_INFO_REQ 0x0a
#define L2CAP_INFO_RSP 0x0b
#define L2CAP_HDR_SIZE 4
#define L2CAP_CMD_HDR_SIZE 4
#define L2CAP_CMD_REJ_SIZE 2
#define L2CAP_CONN_REQ_SIZE 4
#define L2CAP_CONN_RSP_SIZE 8
#define L2CAP_CR_SUCCESS 0x0000
#define L2CAP_CR_PEND 0x0001
#define L2CAP_CR_BAD_PSM 0x0002
#define L2CAP_CR_SEC_BLOCK 0x0003
#define L2CAP_CR_NO_MEM 0x0004
#define L2CAP_CS_NO_INFO 0x0000
#define L2CAP_CS_AUTHEN_PEND 0x0001
#define L2CAP_CS_AUTHOR_PEND 0x0002
#define L2CAP_CONF_REQ_SIZE 4
#define L2CAP_CONF_RSP_SIZE 6
#define L2CAP_CONF_SUCCESS 0x0000
#define L2CAP_CONF_UNACCEPT 0x0001
#define L2CAP_CONF_REJECT 0x0002
#define L2CAP_CONF_UNKNOWN 0x0003
#define L2CAP_CONF_OPT_SIZE 2
#define L2CAP_CONF_MTU 0x01
#define L2CAP_CONF_FLUSH_TO 0x02
#define L2CAP_CONF_QOS 0x03
#define L2CAP_CONF_RFC 0x04
#define L2CAP_CONF_RFC_MODE 0x04
#define L2CAP_CONF_MAX_SIZE 22
#define L2CAP_MODE_BASIC 0x00
#define L2CAP_MODE_RETRANS 0x01
#define L2CAP_MODE_FLOWCTL 0x02
#define L2CAP_DISCONN_REQ_SIZE 4
#define L2CAP_DISCONN_RSP_SIZE 4
#define L2CAP_INFO_REQ_SIZE 2
#define L2CAP_INFO_RSP_SIZE 4
#define L2CAP_IT_CL_MTU 0x0001
#define L2CAP_IT_FEAT_MASK 0x0002
#define L2CAP_IR_SUCCESS 0x0000
#define L2CAP_IR_NOTSUPP 0x0001
#ifdef __cplusplus
#endif
struct
sockaddr_l2
{
sa_family_t
l2_family
;
unsigned
short
l2_psm
;
bdaddr_t
l2_bdaddr
;
};
#endif
sd/source/ui/remotecontrol
/bluetooth/rfcomm.h
→
bluez_bluetooth/inc
/bluetooth/rfcomm.h
Dosyayı görüntüle @
3cadf6de
...
...
@@ -38,9 +38,10 @@
#define RFCOMM_TTY_ATTACHED 3
#ifdef __cplusplus
#endif
struct
sockaddr_rc
{
sa_family_t
rc_family
;
bdaddr_t
rc_bdaddr
;
uint8_t
rc_channel
;
struct
sockaddr_rc
{
sa_family_t
rc_family
;
bdaddr_t
rc_bdaddr
;
uint8_t
rc_channel
;
};
#endif
bluez_bluetooth/inc/bluetooth/sco.h
0 → 100644
Dosyayı görüntüle @
3cadf6de
/****************************************************************************
****************************************************************************
***
*** This header was automatically generated from a Bluez header
*** of the same name, to make information necessary for userspace to
*** call into the kernel available to Android. It contains only constants,
*** structures, and macros generated from the original header, and thus,
*** contains no copyrightable information.
***
****************************************************************************
****************************************************************************/
#ifndef __SCO_H
#define __SCO_H
#ifdef __cplusplus
#endif
#define SCO_DEFAULT_MTU 500
#define SCO_DEFAULT_FLUSH_TO 0xFFFF
#define SCO_CONN_TIMEOUT (HZ * 40)
#define SCO_DISCONN_TIMEOUT (HZ * 2)
#define SCO_CONN_IDLE_TIMEOUT (HZ * 60)
#define SCO_OPTIONS 0x01
#define SCO_CONNINFO 0x02
#ifdef __cplusplus
#endif
struct
sockaddr_sco
{
sa_family_t
sco_family
;
bdaddr_t
sco_bdaddr
;
uint16_t
sco_pkt_type
;
};
#endif
sd/Library_sd.mk
Dosyayı görüntüle @
3cadf6de
...
...
@@ -50,6 +50,7 @@ $(eval $(call gb_Library_add_sdi_headers,sd,\
$(eval $(call gb_Library_use_packages,sd,\
animations_inc \
bluez_bluetooth_inc \
))
$(eval $(call gb_Library_set_include,sd,\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment