Skip to content
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

Fix RH_CO2_ALT sample size #9

Merged
merged 3 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

### Fixed
- Sample size for type RH_CO2_ALT resp Sample type 2 changed from 6 to 8 Bytes as specified in
https://github.com/Sensirion/arduino-ble-gadget/blob/master/documents/00-Sensirion_BLE_communication_protocol.pdf

## [0.3.0] - Breaking Changes

### Added
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Sensirion UPT Core
version=0.3.0
version=0.3.1
author=Jonas Stolle, Maximilian Paulsen
maintainer=Sensirion AG <sensirion.com>
sentence=Library for definitions and configurations used by other Sensirion Unified Prototyping Toolkit (UPT) libraries.
Expand Down
6 changes: 4 additions & 2 deletions src/BLEProtocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ std::map<DataType, SampleConfig> sampleConfigSelector = {
{.dataType = DataType::T_RH_CO2_ALT,
.downloadType = 7,
.sampleType = 8,
.sampleSizeBytes = 6, // ALT is not being sent
.sampleSizeBytes = 8,
.sampleCountPerPacket = 2,
.sensirionAdvertisementSampleType = 0,
.sampleSlots = {{SignalType::TEMPERATURE_DEGREES_CELSIUS,
Expand All @@ -100,7 +100,9 @@ std::map<DataType, SampleConfig> sampleConfigSelector = {
{.signalType = SignalType::CO2_PARTS_PER_MILLION,
.offset = 4,
.encodingFunction = &encodeSimple,
.decodingFunction = &decodeSimple}}}}},
.decodingFunction = &decodeSimple}}
// 2 Bytes reserved (ALT), not used, but bytes must be sent for proper decoding of samples
}}},
{T_RH_CO2_PM25,
{.dataType = DataType::T_RH_CO2_PM25,
.downloadType = 11,
Expand Down
Loading