diff --git a/README.md b/README.md index 60b3ad8..dd7efc2 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/index.html b/index.html index f794517..f597365 100644 --- a/index.html +++ b/index.html @@ -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'); @@ -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' @@ -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); @@ -818,4 +818,4 @@ - +