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

Add macros for AIRQ history log format and commands LOG_MULTI_WRITE / LOG_MULTI_READ #66

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .github/workflows/astyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v4

# Install Artistic Style
- name: Install Astyle
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ceedling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Ruby 2.7
- name: Set up Ruby 3.0
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
ruby-version: '3.0'

# Runs a single command using the runners shell
- name: Install Ceedling
run: gem install ceedling
run: gem install ceedling -v 0.31.1

# Runs a set of commands using the runners shell
- name: Run a multi-line script
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: recursive

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: recursive

Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/sonar-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Checkout submodules
run: git submodule update --init --recursive
Expand All @@ -40,21 +40,20 @@ jobs:
unzip -q nRF5_SDK_15.3.0_59ac345.zip
fi

# Runs a single command using the runners shell
- name: Compile project
run: build-wrapper-linux-x86-64 --out-dir bw-output make sonar

- name: Set up Ruby 2.7
- name: Set up Ruby 3.0
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
ruby-version: '3.0'

# Runs a single command using the runners shell
- name: Install Ceedling and GCovr
run: |
gem install ceedling
gem install ceedling -v 0.31.1
sudo pip install gcovr

# Runs a single command using the runners shell
- name: Compile project
run: build-wrapper-linux-x86-64 --out-dir bw-output make sonar

# Runs a set of commands using the runners shell
- name: Run Sonar scanner
Expand Down
35 changes: 33 additions & 2 deletions src/ruuvi_endpoints.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ typedef float re_float; //!< Ruuvi endpoint float type
#define RE_STANDARD_LOG_VALUE_READ (RE_STANDARD_LOG_VALUE_WRITE | \
RE_STANDARD_OP_READ_BIT)

#define RE_STANDARD_LOG_MULTI_WRITE (0x20U)
#define RE_STANDARD_LOG_MULTI_READ (RE_STANDARD_LOG_MULTI_WRITE | \
RE_STANDARD_OP_READ_BIT)

#define RE_SYS_CONFIG_WRITE_HEARTBEAT (0xF2U)
#define RE_SYS_CONFIG_READ_HEARTBEAT (RE_SYS_CONFIG_WRITE_HEARTBEAT | \
RE_STANDARD_OP_READ_BIT)
Expand All @@ -113,6 +117,29 @@ typedef float re_float; //!< Ruuvi endpoint float type
#define RE_LOG_WRITE_VALUE_B3_IDX (9U) //!< B3 of value.
#define RE_LOG_WRITE_VALUE_LSB_IDX (10U) //!< LSB of value.

#define RE_LOG_WRITE_MULTI_NUM_RECORDS_IDX (3U) //!< Number of records.
#define RE_LOG_WRITE_MULTI_RECORD_LEN_IDX (4U) //!< Length of record.
#define RE_LOG_WRITE_MULTI_PAYLOAD_IDX (5U) //!< Start of payload.

#define RE_LOG_WRITE_AIRQ_TIMESTAMP_MSB_OFS (0U) //!< MSB offset of timestamp.
#define RE_LOG_WRITE_AIRQ_TEMPERATURE_MSB_OFS (4U) //!< MSB offset of temperature.
#define RE_LOG_WRITE_AIRQ_HUMIDITY_MSB_OFS (6U) //!< MSB offset of humidity.
#define RE_LOG_WRITE_AIRQ_PRESSURE_MSB_OFS (8U) //!< MSB offset of pressure.
#define RE_LOG_WRITE_AIRQ_PM1P0_MSB_OFS (10U) //!< MSB offset of pm1p0.
#define RE_LOG_WRITE_AIRQ_PM2P5_MSB_OFS (12U) //!< MSB offset of pm2p5.
#define RE_LOG_WRITE_AIRQ_PM4P0_MSB_OFS (14U) //!< MSB offset of pm4p0.
#define RE_LOG_WRITE_AIRQ_PM10P0_MSB_OFS (16U) //!< MSB offset of pm10p0.
#define RE_LOG_WRITE_AIRQ_CO2_MSB_OFS (18U) //!< MSB offset of CO2.
#define RE_LOG_WRITE_AIRQ_VOC_MSB_OFS (20U) //!< MSB offset of VOC index.
#define RE_LOG_WRITE_AIRQ_NOX_MSB_OFS (22U) //!< MSB offset of NOx index.
#define RE_LOG_WRITE_AIRQ_LUMINOSITY_MSB_OFS (24U) //!< MSB offset of luminosity.
#define RE_LOG_WRITE_AIRQ_SOUND_DBA_AVG_OFS (26U) //!< MSB offset of sound_dba_avg.
#define RE_LOG_WRITE_AIRQ_SOUND_DBA_PEAK_OFS (27U) //!< MSB offset of sound_dba_peak.
#define RE_LOG_WRITE_AIRQ_VOLTAGE_MSB_OFS (28U) //!< MSB offset of voltage.
#define RE_LOG_WRITE_AIRQ_FLAGS_MSB_OFS (30U) //!< MSB offset of flags.
#define RE_LOG_WRITE_AIRQ_RECORD_LEN (32U) //!< Length of record.


#define RE_STANDARD_DESTINATION_ACCELERATION (0x4AU) //!< XYZ acceleration combined
#define RE_STANDARD_DESTINATION_ACCELERATION_X (0x40U) //!< X acceleration
#define RE_STANDARD_DESTINATION_ACCELERATION_Y (0x41U) //!< Y acceleration
Expand All @@ -125,10 +152,11 @@ typedef float re_float; //!< Ruuvi endpoint float type
#define RE_STANDARD_DESTINATION_HUMIDITY (0x31U) //!< Humidity
#define RE_STANDARD_DESTINATION_PRESSURE (0x32U) //!< Pressure
#define RE_STANDARD_DESTINATION_ENVIRONMENTAL (0x3AU) //!< Temp Humi Pres combined.
#define RE_STANDARD_DESTINATION_AIRQ (0x3BU) //!< All AIRQ measurements combined.
#define RE_STANDARD_DESTINATION_ADC_BATTERY (0x20U) //!< ADC battery vs GND
#define RE_STANDARD_DESTINATION_RTC (0x21U) //!< RTC value
#define RE_STANDARD_DESTINATION_PASSWORD (0x2AU) //!< Password endpoint.
#define RE_STANDARD_DESTINATION_SYS_CONFIG (0x22U) //!< Configuration of system settings
#define RE_STANDARD_DESTINATION_SYS_CONFIG (0x22U) //!< Configuration of system settings

typedef enum
{
Expand All @@ -141,6 +169,7 @@ typedef enum
RE_GYR_Y = RE_STANDARD_DESTINATION_GYRATION_Y,
RE_GYR_Z = RE_STANDARD_DESTINATION_GYRATION_Z,
RE_ENV_ALL = RE_STANDARD_DESTINATION_ENVIRONMENTAL,
RE_ENV_AIRQ = RE_STANDARD_DESTINATION_AIRQ,
RE_ENV_TEMP = RE_STANDARD_DESTINATION_TEMPERATURE,
RE_ENV_HUMI = RE_STANDARD_DESTINATION_HUMIDITY,
RE_ENV_PRES = RE_STANDARD_DESTINATION_PRESSURE,
Expand All @@ -161,7 +190,9 @@ typedef enum
RE_SENSOR_CONFIG_W = RE_STANDARD_SENSOR_CONFIGURATION_WRITE,
RE_SENSOR_CONFIG_R = RE_STANDARD_SENSOR_CONFIGURATION_READ,
RE_LOG_W = RE_STANDARD_LOG_VALUE_WRITE,
RE_LOG_R = RE_STANDARD_LOG_VALUE_READ
RE_LOG_R = RE_STANDARD_LOG_VALUE_READ,
RE_LOG_W_MULTI = RE_STANDARD_LOG_MULTI_WRITE,
RE_LOG_R_MULTI = RE_STANDARD_LOG_MULTI_READ,
} re_op_t;

/**
Expand Down
Loading