Skip to content

Sync 1.4.0 #78

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 60 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
e61315d
Update api.md
SUI298 Mar 13, 2023
9a6d4e0
fix: compilation error when using _BLE_TRACE
FidelSch Feb 19, 2025
2975d9f
fix(HCI): missing LE_Event_Mask
fpistm Mar 20, 2025
bf62cd5
fix: signed and init field warnings
fpistm Mar 5, 2025
d52e25a
Update src/utility/L2CAPSignaling.cpp
FidelSch Mar 24, 2025
bc03713
Merge pull request #386 from fpistm/fix_le_event_mask
facchinm Apr 8, 2025
7a039d7
Merge pull request #387 from fpistm/fix_warning
facchinm Apr 8, 2025
e59d4ad
[WIP] Add unit test workflow
polldo Nov 2, 2020
1340d09
[CI] Fix uninitialized checked variable
polldo Nov 3, 2020
8035af8
[CI] Improve unit tests
polldo Nov 11, 2020
6fa0191
[CI] use codecov token
pennam Apr 8, 2025
c5bed55
[CI] modernize cmake build
pennam Apr 8, 2025
a1f8e3e
[CI] import c++11 F replacement
pennam Apr 9, 2025
e389eaf
Wrap prints with #ifdef _BLE_TRACE_
pennam Apr 9, 2025
ee05fe6
GATTClass::end(): fix possible leak
pennam Apr 9, 2025
9712cb1
Merge pull request #388 from pennam/ci-unit-test
pennam Apr 9, 2025
bbc2baa
fix ble end on mbed portenta boards for successfully ble restart
fabik111 Oct 29, 2024
c91c02c
Merge pull request #374 from fabik111/fix-shutdown-ble-portenta
pennam Apr 9, 2025
80036ba
clear characteristic cccd value when disconnect
fabik111 Dec 5, 2024
e1cbac4
fix build for ESP32-C2, ESP32-C6 and ESP32-H2 targets with Arduino-ES…
lyusupov Aug 8, 2024
e9f16eb
[CI] enable esp32c6 and esp32h2
pennam Apr 9, 2025
7322196
Add BLEPermission Support to BLEStringCharacteristic
porubcinj Feb 4, 2025
ab1ea93
Merge pull request #389 from pennam/new-esp
pennam Apr 10, 2025
e2bf0c0
Add basic test case on characteristic permissions
pennam Apr 10, 2025
87913ee
Merge pull request #390 from pennam/ble-permission
pennam Apr 10, 2025
9f7d347
Merge pull request #376 from fabik111/fix-disconnection
pennam Apr 10, 2025
b3a6a5b
Merge pull request #384 from FidelSch/patch-2
pennam Apr 10, 2025
f18b1c0
Merge pull request #291 from SUI298/master
pennam Apr 10, 2025
ab7509f
Make handleNotify and handleInd return written bytes per peer
pennam Apr 8, 2025
1619dd0
BLE.setAdvertisedServiceData: adopt _valueLength limit
pennam Apr 8, 2025
5d22155
writeValue: return the number of bytes written/stored in buffer
pennam Apr 8, 2025
2a4e4b5
Add writeValue tests
pennam Apr 10, 2025
233d4bc
fix: keywords.txt
fpistm Mar 18, 2025
b7c6120
fix(HCI): SetAdvertise only if enabled
fpistm Mar 19, 2025
240c74f
test: check broadcast handleInt and handleNotify with no peers
pennam Apr 10, 2025
2d0b42e
Merge pull request #392 from pennam/write-value
pennam Apr 11, 2025
aa57b0e
Merge pull request #394 from fpistm/fix_keywords
pennam Apr 11, 2025
5855ec1
Merge pull request #395 from fpistm/advertising_enabled
pennam Apr 14, 2025
757ae3b
Publish 1.4.0
pennam Apr 14, 2025
3f85702
Merge branch 'main'
fpistm Apr 17, 2025
6c9aa25
feat: add HCISpiTransport
cparata Sep 19, 2019
6f53cbe
chore: moved to STM32duinoBLE
fpistm Mar 26, 2025
a633b95
feat: ability to define HCI SPI transport configuration
fpistm Mar 18, 2025
44880e2
chore(ci): add build-for-stm32 step
fpistm Feb 17, 2020
bbbf535
feat: add editor config
fpistm Mar 18, 2025
141ebdd
feat: add HCISharedMemTransport
FRASTM Mar 18, 2025
4e0d7d6
feat: add the STM32Cube_FW to support stm32wb
FRASTM Mar 18, 2025
71cd1d1
feat: add patch files to be applied on stm32wb Cube update
ABOSTM Mar 18, 2025
c6082cd
chore: update with stm32wb
fpistm Mar 26, 2025
c6e7932
feat: add possibility to choose the ownAddressType in the Arduino stack
cparata Feb 9, 2021
a34566b
fix: HCI only Firmware not supporting ACI_GAP_INIT ACI_GATT_INIT
ABOSTM Oct 24, 2022
001aca9
feat: add API to get random address
Mar 14, 2023
04de5df
chore(GAP): improve scan
cparata Feb 7, 2020
3ee75de
chore(examples): enhance button support
fpistm Mar 20, 2025
2c8c4a7
chore(examples): enhance scan management
fpistm Mar 20, 2025
2f0cef7
fix: for pairing with Static Random Address
AresMaster Mar 18, 2025
6c815fc
fix: wrong Le Event Mask set
fpistm Mar 20, 2025
dd9d269
Reset scan filters when stopScan is called [Fixes #350]
andrewchilds Feb 5, 2024
612d7d1
Fix for issue #245 - ATT_OP_FIND_INFO_RESP incorrect processing durin…
carterd Sep 25, 2022
def51aa
fix: unused variable warnings
fpistm Apr 17, 2025
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
3 changes: 3 additions & 0 deletions .github/workflows/compile-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ on:
- ".github/workflows/compile-examples.yml"
- "examples/**"
- "src/**"
schedule:
# Run every Tuesday at 8 AM UTC to catch breakage caused by changes to external resources (libraries, platforms).
- cron: "0 8 * * TUE"
workflow_dispatch:

jobs:
Expand Down
126 changes: 126 additions & 0 deletions extras/test/src/test_characteristic/test_permissions.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
/*
This file is part of the ArduinoBLE library.
Copyright (c) 2018 Arduino SA. All rights reserved.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library 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
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include <catch2/catch_test_macros.hpp>

#define private public
#define protected public

#include "FakeBLELocalDevice.h"
#include "BLEAdvertisingData.h"
#include "BLETypedCharacteristics.h"
#include "BLELocalCharacteristic.h"
#include "BLEStringCharacteristic.h"
#include "BLEProperty.h"
#include <memory>

int property[] = {
BLEBroadcast,
BLERead,
BLEWriteWithoutResponse,
BLEWrite,
BLENotify,
BLEIndicate,
BLEAuthSignedWrite,
BLEExtProp,
BLERead | BLEWrite | BLENotify
};

int permission[] = {
BLEEncryption,
BLEAuthentication,
BLEAuthorization,
BLEEncryption | BLEAuthentication
};

const char uuid[][31] = {
"1 Bool",
"2 Char",
"3 UnsignedChar",
"4 Byte",
"5 Short",
"6 UnsignedShort",
"7 Word",
"8 Int",
"9 UnsignedInt",
"A Long",
"B UnsignedLong",
"C Float",
"D Double",
"E String"
};

std::unique_ptr<BLECharacteristic> createCharacteristic(const char* uuid, unsigned int properties)
{
switch(uuid[0])
{
case '1':
return std::unique_ptr<BLECharacteristic>(new BLEBoolCharacteristic(uuid, properties));
case '2':
return std::unique_ptr<BLECharacteristic>(new BLECharCharacteristic(uuid, properties));
case '3':
return std::unique_ptr<BLECharacteristic>(new BLEUnsignedCharCharacteristic(uuid, properties));
case '4':
return std::unique_ptr<BLECharacteristic>(new BLEByteCharacteristic(uuid, properties));
case '5':
return std::unique_ptr<BLECharacteristic>(new BLEShortCharacteristic(uuid, properties));
case '6':
return std::unique_ptr<BLECharacteristic>(new BLEUnsignedShortCharacteristic(uuid, properties));
case '7':
return std::unique_ptr<BLECharacteristic>(new BLEWordCharacteristic(uuid, properties));
case '8':
return std::unique_ptr<BLECharacteristic>(new BLEIntCharacteristic(uuid, properties));
case '9':
return std::unique_ptr<BLECharacteristic>(new BLEUnsignedIntCharacteristic(uuid, properties));
case 'A':
return std::unique_ptr<BLECharacteristic>(new BLELongCharacteristic(uuid, properties));
case 'B':
return std::unique_ptr<BLECharacteristic>(new BLEUnsignedLongCharacteristic(uuid, properties));
case 'C':
return std::unique_ptr<BLECharacteristic>(new BLEFloatCharacteristic(uuid, properties));
case 'D':
return std::unique_ptr<BLECharacteristic>(new BLEDoubleCharacteristic(uuid, properties));
case 'E':
return std::unique_ptr<BLECharacteristic>(new BLEStringCharacteristic(uuid, properties, 2));
default:
break;
}
return nullptr;
}

TEST_CASE("Test characteristic properties and permissions", "[ArduinoBLE::BLECharacteristic]")
{
WHEN("Create a characteristic")
{
for(int i = 0; i < sizeof(property)/sizeof(int); i++)
{
for(int j = 0; j < sizeof(permission)/sizeof(int); j++)
{
for(int k = 0; k < 14; k++)
{
std::unique_ptr<BLECharacteristic> ptr = createCharacteristic(uuid[k], property[i] | permission[j]);
REQUIRE(ptr != nullptr);
REQUIRE(ptr->properties() == (property[i]));
BLELocalCharacteristic * local = ptr->local();
REQUIRE(local->permissions() == (permission[j] >> 8));
}
}
}
}
}
Loading