Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
adba200
Bluetooth core foundations: uuid, errors, adapter state, device, facade
shai-almog Jul 17, 2026
d367efe
Bluetooth LE central: scan multiplexer, GATT client, op queue, L2CAP
shai-almog Jul 17, 2026
2562504
Bluetooth peripheral mode, classic RFCOMM, package docs
shai-almog Jul 17, 2026
20d3112
Auto-detect Bluetooth API usage in Android/iOS builders
shai-almog Jul 17, 2026
ebaac58
Android Bluetooth port: full stack over android.bluetooth
shai-almog Jul 17, 2026
70356b4
Bluetooth core API contract tests (layer 1)
shai-almog Jul 17, 2026
8821368
JavaSE Bluetooth: scriptable virtual stack + simulator port (layer 2)
shai-almog Jul 17, 2026
1acd0a1
iOS Bluetooth port: CoreBluetooth natives + Java bridge
shai-almog Jul 17, 2026
a9d2752
Bluetooth Simulation window + simulator hooks
shai-almog Jul 17, 2026
db45655
JavaSE native BLE backend: Rust btleplug helper + subprocess bridge
shai-almog Jul 17, 2026
4cabcf0
JavaScript port: Web Bluetooth over the worker host bridge
shai-almog Jul 17, 2026
d36f4c0
Developer guide: Bluetooth chapter + compilable snippets
shai-almog Jul 17, 2026
f9b3619
Developer guide: Bluetooth Simulation window screenshots
shai-almog Jul 17, 2026
d7d649e
Bluetooth record & replay: capture real traffic, scramble, replay
shai-almog Jul 17, 2026
1b44b84
Fix latent iOS bugs: WebAuthn trampoline names, IOSNfc static-init order
shai-almog Jul 17, 2026
a2fb36f
Don't ship the cn1-binaries ble README into the javase jar
shai-almog Jul 17, 2026
cecd4fe
Add missing copyright headers; make the header gate CRLF-tolerant
shai-almog Jul 17, 2026
82afea8
Resolve the BLE helper per CPU architecture, not just per OS
shai-almog Jul 17, 2026
d55fa3f
Fix device-API and SpotBugs violations Maven missed
shai-almog Jul 17, 2026
f7268d7
iOS port: replace Character.forDigit (absent from ParparVM JavaAPI)
shai-almog Jul 17, 2026
dc947db
Android port: clear 9 SpotBugs SIC_INNER_SHOULD_BE_STATIC_ANON findings
shai-almog Jul 17, 2026
af2196c
Merge remote-tracking branch 'origin/master' into first-class-bluetooth
shai-almog Jul 17, 2026
a7ae861
Fix forbidden PMD violations in the Bluetooth core
shai-almog Jul 17, 2026
f6cffdb
Extract shared native-ble helper client module; refactor JavaSE onto it
shai-almog Jul 17, 2026
280ad3e
Native subprocess bridge for the Win32 and Linux ports
shai-almog Jul 17, 2026
85e52ad
Real BLE central on the native Win32 and Linux ports
shai-almog Jul 17, 2026
de410a9
Move BLE helper client into core so the Ant build can see it
shai-almog Jul 17, 2026
2ccba2d
Add package-info for the relocated bluetooth.helper package
shai-almog Jul 17, 2026
eeea333
Convert bluetooth.helper doc comments to /// markdown style
shai-almog Jul 17, 2026
2dc6e93
Fix forbidden PMD and a test race exposed by moving the helper into core
shai-almog Jul 17, 2026
26ab773
Merge remote-tracking branch 'origin/master' into first-class-bluetooth
shai-almog Jul 18, 2026
c051ba9
WIP: keystone - internal com.codename1.impl.bluetooth native bridge
shai-almog Jul 19, 2026
a868c57
Replace the BLE helper subprocess with an in-process libcn1ble library
shai-almog Jul 19, 2026
131b7be
Include unistd.h in the Linux BLE native bridge for CN1_YIELD_THREAD
shai-almog Jul 19, 2026
2e1d873
Test the native BLE stack through the real libcn1ble, not a mock
shai-almog Jul 20, 2026
8e80b47
Load libcn1ble at runtime (dlopen) in the native BLE C bridges
shai-almog Jul 20, 2026
14973f6
Enable native BLE (libcn1ble) in the Linux and Windows native builders
shai-almog Jul 20, 2026
3654303
Overlay fresh cn1-binaries ble/ in PR CI so libcn1ble is present
shai-almog Jul 20, 2026
3a751b7
Always drain the native BLE engine handshake, even with no adapter
shai-almog Jul 20, 2026
8964a6a
Assert the deterministic capabilities handshake in the real-engine test
shai-almog Jul 20, 2026
e76e291
Make the BLE JSON codec and helper classes package-private, not API
shai-almog Jul 23, 2026
f860cc3
Merge remote-tracking branch 'origin/master' into first-class-bluetooth
shai-almog Jul 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .ci/container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ RUN apt-get update && apt-get install -y \
ant \
maven \
libncurses6 \
libdbus-1-3 \
sudo \
openjdk-17-jdk \
openjdk-21-jdk \
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,20 @@ jobs:
rm -rf maven/target/cn1-binaries
mkdir -p maven/target
cp -r /opt/cn1-binaries maven/target/cn1-binaries
# The container bakes a cn1-binaries snapshot at image-build time, so
# recently added native libraries lag until the image is rebuilt.
# Overlay a fresh ble/ from master (a small sparse/partial clone) so
# libcn1ble -- required by the JavaSE native-engine integration tests
# -- is present. Best-effort: a network hiccup leaves the baked copy.
rm -rf /tmp/cn1bin-ble
if git clone --no-checkout --depth 1 --filter=blob:none \
https://github.com/codenameone/cn1-binaries /tmp/cn1bin-ble \
&& git -C /tmp/cn1bin-ble sparse-checkout set ble \
&& git -C /tmp/cn1bin-ble checkout \
&& [ -d /tmp/cn1bin-ble/ble ]; then
rm -rf maven/target/cn1-binaries/ble
cp -r /tmp/cn1bin-ble/ble maven/target/cn1-binaries/ble
fi
- name: Run Maven plugin tests
if: ${{ matrix.java-version == 8 }}
working-directory: maven
Expand All @@ -127,6 +141,14 @@ jobs:
-Dcodename1.platform=javase \
-Dcn1.binaries="${CN1_BINARIES}" \
-pl codenameone-maven-plugin -am -Plocal-dev-javase test
- name: Install native BLE runtime dependency (libdbus)
if: ${{ matrix.java-version == 8 }}
# libcn1ble.so (the JavaSE native Bluetooth backend) links libdbus-1
# for BlueZ, so it must be present for the native-engine integration
# tests to load the library. Also baked into the pr-ci-container image
# (.ci/container/Dockerfile); this step covers running against the
# previously published container before the rebuild propagates.
run: apt-get update -qq && apt-get install -y -qq libdbus-1-3
- name: Run JavaSE port unit tests
if: ${{ matrix.java-version == 8 }}
# Surface regressions in the simulator-side helpers (CSSWatcher
Expand Down
57 changes: 57 additions & 0 deletions CodenameOne/src/com/codename1/bluetooth/AdapterState.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*
* Copyright (c) 2012, Codename One and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Codename One designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Codename One through http://www.codenameone.com/ if you
* need additional information or have any questions.
*/
package com.codename1.bluetooth;

/// Lifecycle states of the local Bluetooth adapter, a union of the Android
/// `BluetoothAdapter` states and the iOS `CBManagerState` values. Query via
/// [Bluetooth#getAdapterState()] and observe changes with
/// [Bluetooth#addAdapterStateListener(AdapterStateListener)].
public enum AdapterState {
/// The state has not been determined yet -- e.g. iOS before the first
/// CoreBluetooth manager callback fired.
UNKNOWN,

/// The device has no Bluetooth hardware, or the port does not implement
/// Bluetooth at all. The fallback base [Bluetooth] class always reports
/// this state.
UNSUPPORTED,

/// The app is not authorized to use Bluetooth (iOS privacy authorization
/// denied / restricted, or missing runtime permissions on Android).
UNAUTHORIZED,

/// The adapter is off. Ask the user to enable it, optionally via
/// [Bluetooth#requestEnable()].
POWERED_OFF,

/// The adapter is transitioning to [#POWERED_ON] (Android only; iOS
/// reports the transition as a direct state change).
TURNING_ON,

/// The adapter is on and ready for scanning, connections and
/// advertising.
POWERED_ON,

/// The adapter is transitioning to [#POWERED_OFF] (Android only).
TURNING_OFF
}
33 changes: 33 additions & 0 deletions CodenameOne/src/com/codename1/bluetooth/AdapterStateListener.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright (c) 2012, Codename One and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Codename One designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Codename One through http://www.codenameone.com/ if you
* need additional information or have any questions.
*/
package com.codename1.bluetooth;

/// Observes local adapter state changes registered via
/// [Bluetooth#addAdapterStateListener(AdapterStateListener)]. Single
/// abstract method so application code can pass a lambda. Always invoked on
/// the EDT.
public interface AdapterStateListener {
/// Fired on the EDT whenever the adapter transitions to a new
/// [AdapterState].
void adapterStateChanged(AdapterState newState);
}
Loading
Loading