Skip to content

Commit

Permalink
refactor settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Amerlander committed Mar 11, 2024
1 parent 7dd8081 commit ebbf816
Show file tree
Hide file tree
Showing 26 changed files with 173 additions and 34 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion libs/bluetooth-android/_locales/bluetooth-strings.json

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion libs/bluetooth-disabled/_locales/ble-disabled-strings.json

This file was deleted.

7 changes: 7 additions & 0 deletions libs/bluetooth-disabled/pxt.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@
"enabled": 0
}
}
},
"optionalConfig": {
"microbit-dal": {
"bluetooth": {
"enabled": 0
}
}
}
}
}
13 changes: 13 additions & 0 deletions libs/bluetooth-no-pairing/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Bluetooth settings for Android and Calliope mini 1 and 2

This extension set the BLE settings to make sure they work for iOS and Calliope mini 1 and 2:

```
"bluetooth": {
"open": 0,
"security_level": "SECURITY_MODE_ENCRYPTION_NO_MITM",
"whitelist": 1
}
```

These settings are the default for Calliope mini 1 and 2, so this extension is only required to be included for Calliope mini 1 and 2 Projects where "bluetooth-pairing" was loaded before.
32 changes: 32 additions & 0 deletions libs/bluetooth-no-pairing/pxt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "bluetooth-no-pairing",
"description": "Bluetooth settings for iOS and Calliope mini 1 and 2.",
"dependencies": {
"core": "file:../core"
},
"files": [
"README.md"
],
"public": true,
"searchOnly": true,
"weight": 100,
"icon": "./static/packages/bluetooth/icon.png",
"yotta": {
"config": {
"microbit-dal": {
"bluetooth": {
"open": 1,
"security_level": null,
"whitelist": 0
}
}
},
"userConfigs": [
{
"description": "Bluetooth: No pairing required | Calliope mini 1 and 2 (iOS)",
"config": {
}
}
]
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Bluetooth settings for Android and Calliope mini 1 and 2

This extensiion set the BLE settings to make sure they work with the Android App:
This extensiion set the BLE settings to make sure they work for Calliope mini 3 or android + Calliope mini 1 and 2.:

```
"bluetooth": {
Expand All @@ -10,4 +10,4 @@ This extensiion set the BLE settings to make sure they work with the Android App
}
```

These settings are the default for Calliope mini 3, so this extension is only required to be included for Projects using the Calliope mini 1 or Calliope mini 2.
These settings are the default for Calliope mini 3, so this extension is only required to be included for Projects using the Calliope mini 1 or Calliope mini 2 on Android.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bluetooth-android-settings",
"description": "Bluetooth settings for Android and Calliope mini 1 and 2.",
"name": "bluetooth-pairing",
"description": "Bluetooth settings for Calliope mini 3 or android + Calliope mini 1 and 2.",
"dependencies": {
"core": "file:../core"
},
Expand All @@ -20,6 +20,13 @@
"whitelist": 1
}
}
}
},
"userConfigs": [
{
"description": "Bluetooth: Pairing required | Calliope mini 3 (iOS) | all Calliope mini Versions (Android)",
"config": {
}
}
]
}
}
15 changes: 7 additions & 8 deletions libs/core-mini-codal/pxt.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"description": "The mini codal core library",
"dependencies": {
"core": "file:../core",
"microphone": "file:../microphone"
"microphone": "file:../microphone",
"bluetooth-pairing": "file:../bluetooth-pairing"
},
"disablesVariants": [
"minidal"
Expand All @@ -23,14 +24,12 @@
"touchmode.cpp"
],
"yotta": {
"optionalConfig": {
"microbit-dal": {
"bluetooth": {
"open": 0,
"security_level": "SECURITY_MODE_ENCRYPTION_NO_MITM",
"whitelist": 1
"userConfigs": [
{
"description": "Calliope mini 3",
"config": {
}
}
}
]
}
}
17 changes: 15 additions & 2 deletions libs/core/pxt.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,19 @@
"debug": 0,
"heap_debug": 0
}
}
}
},
"userConfigs": [
{
"description": "Only load Bluetooth while pairing mode is activated (holding A+B and briefly the Reset button)",
"config": {
"microbit-dal": {
"bluetooth": {
"enabled": 0
}
}
}
}
]
},
"partial": true
}
3 changes: 3 additions & 0 deletions libs/localization-strings-stable/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Localization strings for Stable version

This extensions includes strings, that are changed or deleted in newer version than the current release.
63 changes: 63 additions & 0 deletions libs/localization-strings-stable/pxt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"name": "localization-strings-stable",
"description": "Adds strings for translations.",
"dependencies": {
"core": "file:../core"
},
"files": [
"README.md"
],
"public": true,
"weight": 0,
"searchOnly": true,
"yotta": {
"optionalConfig": {
},
"userConfigs": [
{
"description": "Only load Bluetooth while Paring-Mode is activated (holding A+B and briefly the Reset button)",
"config": {
"microbit-dal": {
"bluetooth": {
"enabled": 0
}
}
}
},
{
"description": "Disable partial flashing (increases available RAM)",
"config": {
"microbit-dal": {
"bluetooth": {
"partial_flashing": 0
}
}
}
},
{
"description": "Bluetooth: No pairing required",
"config": {
"microbit-dal": {
"bluetooth": {
"open": 1,
"security_level": null,
"whitelist": 0
}
}
}
},
{
"description": "Bluetooth: Pairing required",
"config": {
"microbit-dal": {
"bluetooth": {
"open": 0,
"security_level": "SECURITY_MODE_ENCRYPTION_NO_MITM",
"whitelist": 1
}
}
}
}
]
}
}
17 changes: 9 additions & 8 deletions libs/v1/pxt.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,20 @@
"yotta": {
"config": {
"microbit-dal": {
"bluetooth": {
"enabled": 0
},
"sram_end": "0x20004000",
"RAM_SIZE": "\"16K\""
}
},
"optionalConfig": {
"microbit-dal": {
"bluetooth": {
"enabled": 0
"userConfigs": [
{
"description": "Calliope mini 1",
"config": {
}
},{
"description": "Calliope mini 2",
"config": {
}
}
}
]
}
}
9 changes: 8 additions & 1 deletion libs/v2/pxt.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@
"sram_end": "0x20008000",
"RAM_SIZE": "\"32K\""
}
}
},
"userConfigs": [
{
"description": "Calliope mini 2",
"config": {
}
}
]
}
}
6 changes: 4 additions & 2 deletions pxtarget.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@
"libs/radio",
"libs/devices",
"libs/bluetooth",
"libs/bluetooth-android",
"libs/bluetooth-no-pairing",
"libs/bluetooth-pairing",
"libs/bluetooth-disabled",
"libs/servo",
"libs/radio-broadcast",
"libs/microphone",
"libs/settings",
"libs/flashlog",
"libs/datalogger",
"libs/audio-recording"
"libs/audio-recording",
"libs/localization-strings-stable"
],
"cloud": {
"workspace": false,
Expand Down

0 comments on commit ebbf816

Please sign in to comment.