Skip to content

Commit

Permalink
Merge pull request #22 from joric/revert-20-IronOS-2.22
Browse files Browse the repository at this point in the history
Revert "Changes for IronOs 2.22"
  • Loading branch information
joric authored Mar 10, 2024
2 parents 22dccc9 + a3a841c commit c321e1a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Pinecil
# pinecil

Bluetooth client for Pinecil V2

> [!IMPORTANT]
> This requires the current version of IronOS (v2.22)
[IronOS (v2.22)](https://github.com/Ralim/IronOS/releases/tag/v2.22).

* Live demo: https://joric.github.io/pinecil
* Wiki: https://github.com/joric/pinecil/wiki
22 changes: 11 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@
let log = console.log;

function init() {
// defines: https://github.com/Ralim/IronOS/blob/dev/source/Core/BSP/Pinecilv2/ble_characteristics.h
// handlers: https://github.com/Ralim/IronOS/blob/dev/source/Core/BSP/Pinecilv2/ble_handlers.cpp#L152-L167
// defines: https://github.com/Ralim/IronOS/blob/BLE/source/Core/BSP/Pinecilv2/ble_characteristics.h
// handlers: https://github.com/Ralim/IronOS/blob/BLE/source/Core/BSP/Pinecilv2/ble_handlers.cpp
// there's no notification services yet so I do polling every 1000ms

console.log('If something does not work, please read project wiki first: https://github.com/joric/pinecil/wiki');
Expand All @@ -198,12 +198,12 @@
return false;
}

BT_UUID_SVC_BULK_DATA = '9eae1adb-9d0d-48c5-a6e7-ae93f0ea37b0'; // bulk service
BT_UUID_CHAR_BLE_BULK_LIVE_DATA = BluetoothUUID.canonicalUUID(1);
BT_UUID_SVC_BULK_DATA = '9eae1000-9d0d-48c5-aa55-33e27f9bc533'; // bulk service
BT_UUID_CHAR_BLE_BULK_LIVE_DATA = '9eae1001-9d0d-48c5-aa55-33e27f9bc533'; // was BluetoothUUID.canonicalUUID(1);

BT_UUID_SVC_SETTINGS_DATA = 'f6d75f91-5a10-4eba-a233-47d3f26a907f'; // settings service
BT_UUID_CHAR_BLE_SETTINGS_VALUE_SAVE = BluetoothUUID.canonicalUUID(0); // write 1 to save settings
BT_UUID_CHAR_BLE_SETTINGS_VALUE_1 = BluetoothUUID.canonicalUUID(1); // setpoint temp setting
BT_UUID_SVC_SETTINGS_DATA = 'f6d80000-5a10-4eba-aa55-33e27f9bc533'; // settings service
BT_UUID_CHAR_BLE_SETTINGS_VALUE_SAVE = 'f6d7ffff-5a10-4eba-aa55-33e27f9bc533'; // was BluetoothUUID.canonicalUUID("0xFFFF"); // write 1 to save settings
BT_UUID_CHAR_BLE_SETTINGS_VALUE_SETPOINT = 'f6d70000-5a10-4eba-aa55-33e27f9bc533'; // was BluetoothUUID.canonicalUUID(0); // setpoint temp setting

autoconnect = typeof navigator.bluetooth.getDevices != 'undefined'

Expand Down Expand Up @@ -409,15 +409,15 @@
TipThermoModel::getTipMaxInC(), // 9 - max temp
TipThermoModel::convertTipRawADCTouV(getTipRawTemp(0), true), // 10 - Raw tip in μV
abs(getRawHallEffect()), // 11 - hall sensor
(uint32_t)currentOperatingMode, // 12 - Operating mode
currentMode, // 12 - Operating mode
x10WattHistory.average(), // 13 - Estimated Wattage *10
};
*/
// each item in the struct has 4 bits
temp = value.getUint32(0, true);
spt = value.getUint32(4, true);
handle = value.getUint32(8, true) / 10;
dc = value.getUint32(12, true) / 10;
dc = value.getUint32(8, true) / 10;
handle = value.getUint32(12, true) / 10;

watt = Math.round(value.getUint32(52, true) / 10);

Expand Down Expand Up @@ -818,4 +818,4 @@

</body>
</html>

0 comments on commit c321e1a

Please sign in to comment.