Merge branch 'development' of https://github.com/blakadder/Tasmota into development

This commit is contained in:
blakadder 2022-09-03 17:12:15 +02:00
commit 428a21b83a
440 changed files with 40831 additions and 14516 deletions

331
BUILDS.md
View File

@ -6,174 +6,177 @@ l = lite, t = tasmota, k = knx, s = sensors, i = ir, d = display
Note: `minimal` variant is not listed as it shouldn't be used outside of the [upgrading](https://tasmota.github.io/docs/Upgrading/) process.
| Feature or Sensor | l | t | k | s | i | d | Remarks
|-----------------------|---|-------|---|---|---|---|--------
| MY_LANGUAGE en_GB | x | x / x | x | x | x | x |
| USE_IMPROV | x | x / x | x | x | x | x |
| USE_UFILESYS | - | - / x | - | - | - | - |
| USE_ARDUINO_OTA | - | - / - | - | - | - | - |
| USE_DOMOTICZ | - | x / x | x | x | x | - |
| USE_HOME_ASSISTANT | - | - / - | - | - | - | - |
| USE_TASMOTA_DISCOVERY | x | x / x | x | x | x | x |
| USE_MQTT_TLS* | - | - / x | - | - | - | - |
| USE_MQTT_AWS_IOT | - | - / - | - | - | - | - |
| USE_4K_RSA | - | - / - | - | - | - | - |
| USE_TELEGRAM | - | - / - | - | - | - | - |
| USE_KNX | - | - / x | x | - | - | - |
| USE_WEBSERVER | x | x / x | x | x | x | x |
| USE_WEBSEND_RESPONSE | - | - / - | - | - | - | - |
| USE_EMULATION_HUE | x | x / x | - | x | - | - |
| USE_EMULATION_WEMO | x | x / x | - | x | - | - |
| USE_DISCOVERY | - | - / - | - | - | - | - |
| WEBSERVER_ADVERTISE | - | x / - | x | - | - | x |
| MQTT_HOST_DISCOVERY | - | - / - | - | - | - | - |
| USE_TIMERS | x | x / x | x | x | x | x |
| USE_TIMERS_WEB | x | x / x | x | x | x | x |
| USE_SUNRISE | x | x / x | x | x | x | x |
| USE_RULES | x | x / x | x | x | x | x |
| USE_SCRIPT | - | - / - | - | - | - | - |
| USE_EXPRESSION | - | - / - | - | - | - | - |
| SUPPORT_IF_STATEMENT | - | - / - | - | - | - | - |
| USE_HOTPLUG | - | - / - | - | - | - | - |
| USE_PROMETHEUS | - | - / - | - | - | - | - |
| USE_PING | - | - / - | - | - | - | - |
| | | | | | | |
| Feature or Sensor | l | t | k | s | i | d | Remarks
| ROTARY_V1 | - | x / x | - | x | - | - |
| USE_SONOFF_RF | - | x / - | x | x | - | - |
| USE_RF_FLASH | - | x / - | x | x | - | - |
| USE_SONOFF_SC | - | x / - | x | x | - | - |
| USE_TUYA_MCU | x | x / - | x | x | - | x |
| USE_ARMTRONIX_DIMMERS | - | x / - | x | - | - | - |
| USE_PS_16_DZ | - | x / - | x | - | - | - |
| USE_SONOFF_IFAN | - | x / - | x | - | - | - |
| USE_BUZZER | - | x / x | x | x | - | - |
| USE_ARILUX_RF | - | x / - | x | - | - | - |
| USE_SHUTTER | - | x / x | x | - | - | - |
| USE_DEEPSLEEP | - | x / x | - | x | - | - |
| USE_EXS_DIMMER | - | x / - | x | - | - | - |
| USE_DEVICE_GROUPS | - | x / x | - | - | - | - |
| USE_PWM_DIMMER | - | x / - | x | - | - | - |
| USE_KEELOQ | - | - / - | - | - | - | - |
| USE_SONOFF_D1 | - | x / - | x | - | - | - |
| USE_SHELLY_DIMMER | - | x / - | - | - | - | - |
| USE_AC_ZERO_CROSS_DIMMER | - | x / x | x | x | x | x |
| | | | | | | |
| Feature or Sensor | l | t | k | s | i | d | Remarks
| USE_LIGHT | x | x / x | x | x | x | x |
| USE_WS2812 | - | x / x | x | x | - | x |
| USE_WS2812_DMA | - | - / - | - | - | - | - |
| USE_MY92X1 | - | x / - | x | x | - | x |
| USE_SM16716 | - | x / - | x | x | - | x |
| USE_SM2135 | - | x / - | x | x | - | x |
| USE_SM2335 | - | x / - | x | x | - | x |
| USE_BP5758D | - | x / - | x | x | - | x |
| USE_SONOFF_L1 | - | x / - | x | x | - | x |
| USE_ELECTRIQ_MOODL | - | x / - | x | x | - | x |
| | | | | | | |
| USE_ENERGY_SENSOR | x | x / x | x | x | - | - |
| USE_ENERGY_DUMMY | x | x / x | x | x | - | - |
| USE_PZEM004T | - | x / x | x | x | - | - |
| USE_PZEM_AC | - | x / x | x | x | - | - |
| USE_PZEM_DC | - | x / x | x | x | - | - |
| USE_MCP39F501 | x | x / - | x | x | - | - |
| USE_SDM72 | - | - / x | - | x | - | - |
| USE_SDM120 | - | - / x | - | x | - | - |
| USE_SDM230 | - | - / x | - | - | - | - |
| USE_SDM630 | - | - / x | - | x | - | - |
| USE_DDS2382 | - | - / x | - | x | - | - |
| USE_DDSU666 | - | - / x | - | x | - | - |
| USE_SOLAX_X1 | - | - / - | - | - | - | - |
| USE_LE01MR | - | - / - | - | - | - | - |
| USE_BL09XX | x | x / x | x | x | - | - |
| USE_TELEINFO | - | - / - | - | - | - | - |
| USE_IEM3000 | - | - / - | - | - | - | - |
| USE_WE517 | - | - / - | - | - | - | - |
| | | | | | | |
| USE_ADC_VCC | x | - / - | - | - | x | - |
| USE_COUNTER | - | x / x | x | x | - | x |
| USE_DS18x20 | - | x / x | x | x | - | x |
| USE_DHT | - | x / x | x | x | - | x |
| USE_MAX31855 | - | - / x | - | x | - | - |
| USE_MAX31865 | - | - / - | - | - | - | - |
| USE_THERMOSTAT | - | - / - | - | - | - | - |
| USE_LMT01 | - | - / x | - | x | - | - |
| | | | | | | |
| Feature or Sensor | l | t | k | s | i | d | Remarks
| USE_I2C | - | x / x | x | x | - | x |
| USE_SHT | - | - / x | - | x | - | - |
| USE_HTU | - | - / x | - | x | - | - |
| USE_BMP | - | - / x | - | x | - | - |
| USE_BME68X | - | - / x | - | x | - | - |
| USE_BH1750 | - | - / x | - | x | - | - |
| USE_VEML6070 | - | - / x | - | x | - | - |
| USE_ADS1115 | - | - / x | - | x | - | - |
| USE_INA219 | - | - / x | - | x | - | - |
| USE_INA226 | - | - / - | - | - | - | - |
| USE_SHT3X | - | - / x | - | x | - | - |
| USE_TSL2561 | - | - / - | - | - | - | - |
| USE_TSL2591 | - | - / - | - | - | - | - |
| USE_MGS | - | - / x | - | x | - | - |
| USE_SGP30 | - | - / x | - | x | - | - |
| USE_SI1145 | - | - / - | - | - | - | - |
| USE_LM75AD | - | - / x | - | x | - | - |
| USE_APDS9960 | - | - / - | - | - | - | - |
| USE_MCP230xx | - | - / - | - | - | - | - |
| USE_PCA9685 | - | - / - | - | - | - | - |
| USE_MPR121 | - | - / - | - | - | - | - |
| USE_CCS811 | - | - / - | - | x | - | - |
| USE_CCS811_V2 | - | - / x | - | - | - | - |
| USE_MPU6050 | - | - / - | - | - | - | - |
| USE_DS3231 | - | - / - | - | - | - | - |
| USE_MGC3130 | - | - / - | - | - | - | - |
| USE_MAX44009 | - | - / - | - | - | - | - |
| USE_SCD30 | - | - / x | - | x | - | - |
| USE_SCD40 | - | - / x | - | - | - | - |
| USE_SPS30 | - | - / - | - | - | - | - |
| USE_ADE7880 | - | - / - | - | - | - | - |
| USE_ADE7953 | - | x / x | x | x | - | x |
| USE_VL53L0X | - | - / x | - | x | - | - |
| USE_VL53L1X | - | - / - | - | - | - | - |
| USE_MLX90614 | - | - / - | - | - | - | - |
| USE_CHIRP | - | - / - | - | - | - | - |
| USE_PAJ7620 | - | - / - | - | - | - | - |
| USE_PCF8574 | - | - / - | - | - | - | - |
| | | | | | | |
| Feature or Sensor | l | t | k | s | i | d | Remarks
| USE_HIH6 | - | - / x | - | x | - | - |
| USE_DHT12 | - | - / x | - | x | - | - |
| USE_DS1624 | - | - / x | - | x | - | - |
| USE_AHT1x | - | - / - | - | - | - | - |
| USE_HDC1080 | - | - / - | - | - | - | - |
| USE_WEMOS_MOTOR_V1 | - | - / x | - | x | - | - |
| USE_IAQ | - | - / x | - | x | - | - |
| USE_AS3935 | - | - / x | - | x | - | - |
| USE_VEML6075 | - | - / - | - | - | - | - |
| USE_VEML7700 | - | - / - | - | - | - | - |
| USE_MCP9808 | - | - / - | - | - | - | - |
| USE_HP303B | - | - / - | - | - | - | - |
| USE_EZOCO2 | - | - / - | - | - | - | - |
| USE_EZODO | - | - / - | - | - | - | - |
| USE_EZOEC | - | - / - | - | - | - | - |
| USE_EZOFLO | - | - / - | - | - | - | - |
| USE_EZOHUM | - | - / - | - | - | - | - |
| USE_EZOO2 | - | - / - | - | - | - | - |
| USE_EZOORP | - | - / - | - | - | - | - |
| USE_EZOPH | - | - / - | - | - | - | - |
| USE_EZOPMP | - | - / - | - | - | - | - |
| USE_EZOPRS | - | - / - | - | - | - | - |
| USE_EZORGB | - | - / - | - | - | - | - |
| USE_EZORTD | - | - / - | - | - | - | - |
| USE_SEESAW_SOIL | - | - / - | - | - | - | - |
| USE_TOF10120 | - | - / - | - | - | - | - |
| USE_BM8563 | - | - / - | - | - | - | - |
| USE_AM2320 | - | - / - | - | - | - | - |
| Feature or Sensor | l | t | k | s | i | d | Remarks
|---------------------------|---|-------|---|---|---|---|--------
| MY_LANGUAGE en_GB | x | x / x | x | x | x | x |
| USE_IMPROV | x | x / x | x | x | x | x |
| USE_UFILESYS | - | - / x | - | - | - | - |
| USE_ARDUINO_OTA | - | - / - | - | - | - | - |
| USE_DOMOTICZ | - | x / x | x | x | x | - |
| USE_HOME_ASSISTANT | - | - / - | - | - | - | - |
| USE_TASMOTA_DISCOVERY | x | x / x | x | x | x | x |
| USE_MQTT_TLS* | - | - / x | - | - | - | - |
| USE_MQTT_AWS_IOT | - | - / - | - | - | - | - |
| USE_4K_RSA | - | - / - | - | - | - | - |
| USE_TELEGRAM | - | - / - | - | - | - | - |
| USE_KNX | - | - / x | x | - | - | - |
| USE_WEBSERVER | x | x / x | x | x | x | x |
| USE_WEBSEND_RESPONSE | - | - / - | - | - | - | - |
| USE_EMULATION_HUE | x | x / x | - | x | - | - |
| USE_EMULATION_WEMO | x | x / x | - | x | - | - |
| USE_DISCOVERY | - | - / - | - | - | - | - |
| WEBSERVER_ADVERTISE | - | x / - | x | - | - | x |
| MQTT_HOST_DISCOVERY | - | - / - | - | - | - | - |
| USE_TIMERS | x | x / x | x | x | x | x |
| USE_TIMERS_WEB | x | x / x | x | x | x | x |
| USE_SUNRISE | x | x / x | x | x | x | x |
| USE_RULES | x | x / x | x | x | x | x |
| USE_SCRIPT | - | - / - | - | - | - | - |
| USE_EXPRESSION | - | - / - | - | - | - | - |
| SUPPORT_IF_STATEMENT | - | - / - | - | - | - | - |
| USE_HOTPLUG | - | - / - | - | - | - | - |
| USE_PROMETHEUS | - | - / - | - | - | - | - |
| USE_PING | - | - / - | - | - | - | - |
| | | | | | | |
| Feature or Sensor | l | t | k | s | i | d | Remarks
| ROTARY_V1 | - | x / x | - | x | - | - |
| USE_SONOFF_RF | - | x / - | x | x | - | - |
| USE_RF_FLASH | - | x / - | x | x | - | - |
| USE_SONOFF_SC | - | x / - | x | x | - | - |
| USE_TUYA_MCU | x | x / - | x | x | - | x |
| USE_ARMTRONIX_DIMMERS | - | x / - | x | - | - | - |
| USE_PS_16_DZ | - | x / - | x | - | - | - |
| USE_SONOFF_IFAN | - | x / - | x | - | - | - |
| USE_BUZZER | - | x / x | x | x | - | - |
| USE_ARILUX_RF | - | x / - | x | - | - | - |
| USE_SHUTTER | - | x / x | x | - | - | - |
| USE_DEEPSLEEP | - | x / x | - | x | - | - |
| USE_EXS_DIMMER | - | x / - | x | - | - | - |
| USE_DEVICE_GROUPS | - | x / x | - | - | - | - |
| USE_PWM_DIMMER | - | x / - | x | - | - | - |
| USE_KEELOQ | - | - / - | - | - | - | - |
| USE_SONOFF_D1 | - | x / - | x | - | - | - |
| USE_SHELLY_DIMMER | - | x / - | - | - | - | - |
| USE_AC_ZERO_CROSS_DIMMER | - | x / x | x | x | x | x |
| | | | | | | |
| Feature or Sensor | l | t | k | s | i | d | Remarks
| USE_LIGHT | x | x / x | x | x | x | x |
| USE_WS2812 | - | x / x | x | x | - | x |
| USE_WS2812_DMA | - | - / - | - | - | - | - |
| USE_MY92X1 | - | x / - | x | x | - | x |
| USE_SM16716 | - | x / - | x | x | - | x |
| USE_SM2135 | - | x / - | x | x | - | x |
| USE_SM2335 | - | x / - | x | x | - | x |
| USE_BP5758D | - | x / - | x | x | - | x |
| USE_SONOFF_L1 | - | x / - | x | x | - | x |
| USE_ELECTRIQ_MOODL | - | x / - | x | x | - | x |
| | | | | | | |
| USE_ENERGY_SENSOR | x | x / x | x | x | - | - |
| USE_ENERGY_DUMMY | x | x / x | x | x | - | - |
| USE_PZEM004T | - | x / x | x | x | - | - |
| USE_PZEM_AC | - | x / x | x | x | - | - |
| USE_PZEM_DC | - | x / x | x | x | - | - |
| USE_MCP39F501 | x | x / - | x | x | - | - |
| USE_SDM72 | - | - / x | - | x | - | - |
| USE_SDM120 | - | - / x | - | x | - | - |
| USE_SDM230 | - | - / x | - | - | - | - |
| USE_SDM630 | - | - / x | - | x | - | - |
| USE_DDS2382 | - | - / x | - | x | - | - |
| USE_DDSU666 | - | - / x | - | x | - | - |
| USE_SOLAX_X1 | - | - / - | - | - | - | - |
| USE_LE01MR | - | - / - | - | - | - | - |
| USE_BL09XX | x | x / x | x | x | - | - |
| USE_TELEINFO | - | - / - | - | - | - | - |
| USE_IEM3000 | - | - / - | - | - | - | - |
| USE_WE517 | - | - / - | - | - | - | - |
| | | | | | | |
| USE_ADC_VCC | x | - / - | - | - | x | - |
| USE_COUNTER | - | x / x | x | x | - | x |
| USE_DS18x20 | - | x / x | x | x | - | x |
| USE_DHT | - | x / x | x | x | - | x |
| USE_MAX31855 | - | - / x | - | x | - | - |
| USE_MAX31865 | - | - / - | - | - | - | - |
| USE_THERMOSTAT | - | - / - | - | - | - | - |
| USE_LMT01 | - | - / x | - | x | - | - |
| | | | | | | |
| Feature or Sensor | l | t | k | s | i | d | Remarks
| USE_I2C | - | x / x | x | x | - | x |
| USE_SHT | - | - / x | - | x | - | - |
| USE_HTU | - | - / x | - | x | - | - |
| USE_BMP | - | - / x | - | x | - | - |
| USE_BME68X | - | - / x | - | x | - | - |
| USE_BH1750 | - | - / x | - | x | - | - |
| USE_VEML6070 | - | - / x | - | x | - | - |
| USE_ADS1115 | - | - / x | - | x | - | - |
| USE_INA219 | - | - / x | - | x | - | - |
| USE_INA226 | - | - / - | - | - | - | - |
| USE_SHT3X | - | - / x | - | x | - | - |
| USE_TSL2561 | - | - / - | - | - | - | - |
| USE_TSL2591 | - | - / - | - | - | - | - |
| USE_MGS | - | - / x | - | x | - | - |
| USE_SGP30 | - | - / x | - | x | - | - |
| USE_SGP40 | - | - / x | - | x | - | - |
| USE_SI1145 | - | - / - | - | - | - | - |
| USE_LM75AD | - | - / x | - | x | - | - |
| USE_APDS9960 | - | - / - | - | - | - | - |
| USE_MCP230xx | - | - / - | - | - | - | - |
| USE_PCA9685 | - | - / - | - | - | - | - |
| USE_MPR121 | - | - / - | - | - | - | - |
| USE_CCS811 | - | - / - | - | x | - | - |
| USE_CCS811_V2 | - | - / x | - | - | - | - |
| USE_MPU6050 | - | - / - | - | - | - | - |
| USE_DS3231 | - | - / - | - | - | - | - |
| USE_MGC3130 | - | - / - | - | - | - | - |
| USE_MAX44009 | - | - / - | - | - | - | - |
| USE_SCD30 | - | - / x | - | x | - | - |
| USE_SCD40 | - | - / x | - | - | - | - |
| USE_SPS30 | - | - / - | - | - | - | - |
| USE_ADE7880 | - | - / - | - | - | - | - |
| USE_ADE7953 | - | x / x | x | x | - | x |
| USE_VL53L0X | - | - / x | - | x | - | - |
| USE_VL53L1X | - | - / - | - | - | - | - |
| USE_MLX90614 | - | - / - | - | - | - | - |
| USE_CHIRP | - | - / - | - | - | - | - |
| USE_PAJ7620 | - | - / - | - | - | - | - |
| USE_PCF8574 | - | - / - | - | - | - | - |
| | | | | | | |
| Feature or Sensor | l | t | k | s | i | d | Remarks
| USE_HIH6 | - | - / x | - | x | - | - |
| USE_DHT12 | - | - / x | - | x | - | - |
| USE_DS1624 | - | - / x | - | x | - | - |
| USE_AHT1x | - | - / - | - | - | - | - |
| USE_HDC1080 | - | - / - | - | - | - | - |
| USE_WEMOS_MOTOR_V1 | - | - / x | - | x | - | - |
| USE_IAQ | - | - / x | - | x | - | - |
| USE_AS3935 | - | - / x | - | x | - | - |
| USE_VEML6075 | - | - / - | - | - | - | - |
| USE_VEML7700 | - | - / - | - | - | - | - |
| USE_MCP9808 | - | - / - | - | - | - | - |
| USE_MLX90640 | - | - / - | - | - | - | - |
| USE_HP303B | - | - / - | - | - | - | - |
| USE_EZOCO2 | - | - / - | - | - | - | - |
| USE_EZODO | - | - / - | - | - | - | - |
| USE_EZOEC | - | - / - | - | - | - | - |
| USE_EZOFLO | - | - / - | - | - | - | - |
| USE_EZOHUM | - | - / - | - | - | - | - |
| USE_EZOO2 | - | - / - | - | - | - | - |
| USE_EZOORP | - | - / - | - | - | - | - |
| USE_EZOPH | - | - / - | - | - | - | - |
| USE_EZOPMP | - | - / - | - | - | - | - |
| USE_EZOPRS | - | - / - | - | - | - | - |
| USE_EZORGB | - | - / - | - | - | - | - |
| USE_EZORTD | - | - / - | - | - | - | - |
| USE_SEESAW_SOIL | - | - / - | - | - | - | - |
| USE_TOF10120 | - | - / - | - | - | - | - |
| USE_BM8563 | - | - / - | - | - | - | - |
| USE_AM2320 | - | - / - | - | - | - | - |
| USE_T67XX | - | - / - | - | - | - | - |
| USE_HM330X | - | - / - | - | - | - | - |
| USE_HDC2010 | - | - / - | - | - | - | - |
| USE_PCF85363 | - | - / - | - | - | - | - |
| USE_DS3502 | - | - / - | - | - | - | - |
| USE_HYT | - | - / - | - | - | - | - |
| USE_LUXV30B | - | - / - | - | - | - | - |
| | | | | | | |
| Feature or Sensor | l | t | k | s | i | d | Remarks
| USE_SPI | - | - / - | - | - | - | x |
@ -198,7 +201,7 @@ Note: `minimal` variant is not listed as it shouldn't be used outside of the [up
| USE_MIEL_HVAC | - | - / - | - | - | - | - |
| USE_PROJECTOR_CTRL | - | - / - | - | - | - | - |
| USE_AS608 | - | - / - | - | - | - | - |
| USE_TCP_BRIDGE | - | - / - | - | - | - | - | zbbridge
| USE_TCP_BRIDGE | - | - / - | - | - | - | - | zbbridge / zbbrdgpro
| | | | | | | |
| USE_NRF24 | - | - / - | - | - | - | - |
| USE_MIBLE | - | - / - | - | - | - | - |
@ -252,4 +255,4 @@ Note: `minimal` variant is not listed as it shouldn't be used outside of the [up
| USE_TTGO_WATCH | | / - | | | | |
| USE_SONOFF_SPM | | / x | | | | |
* USE_MQTT_TLS is enabled by default in every ESP32 variants
* USE_MQTT_TLS is enabled by default in every ESP32 variants

View File

@ -3,7 +3,55 @@ All notable changes to this project will be documented in this file.
## [Unreleased] - Development
## [12.0.2.4]
## [12.1.1.1]
### Added
- Support for SGP40 gas and air quality sensor (#16341)
- Support for Modbus writing using ModbusBridge by JeroenSt (#16351)
- Support for Ethernet in ESP32 safeboot firmware (#16388)
- Flowrate meter flow amount/duration, show values in table format (#16385)
- Zigbee prepare for Green Power support (#16407)
- Command ``SetOption146 1`` to enable display of ESP32 internal temperature
- Support for DFRobot SEN0390 V30B ambient light sensor (#16105)
### Changed
- TasmotaModbus library from v3.5.0 to v3.6.0 (#16351)
- Button debouncing V3 by adopting switch debounce code (#16339)
- Thermostat max allowed temperature from 100 to 200C (#16363)
- Using command ``SerialBuffer`` raise max allowed buffer size to 2048 characters (#16374)
### Fixed
- Removed whitespace from JSON values with no decimals (#16365)
### Removed
## [12.1.0.1] 20220825
### Added
- Zigbee device plugin mechanism with commands ``ZbLoad``, ``ZbUnload`` and ``ZbLoadDump`` (#16252)
- ESP32-S3 support for internal temperature sensor
- Command ``StatusRetain`` (#11109)
### Changed
- ESP32 NimBLE library from v1.3.6 to v1.4.0
### Fixed
### Removed
## [Released]
## [12.1.1] 20220825
- Release Patricia
### Fixed
- RTC not detected when lights are present (#16242)
- DNS lookup for .local domains (#16273)
- Button response delay regression from v12.0.2.4 (#16319)
- Lost module name in GUI regression from v12.0.2.4 - 20220803 (#16324)
## [12.1.0] 20220818
- Release Patricia
## [12.0.2.4] 20220818
### Added
- Command ``SetOption45 1..250`` to change default bistable latching relay pulse length of 40 milliseconds
- Support for Modbus bridge adding commands ``ModbusSend``, ``ModbusBaudrate`` and ``ModbusSerialConfig`` (#16013)
@ -18,14 +66,13 @@ All notable changes to this project will be documented in this file.
### Changed
- ESP32 LVGL library from v8.2.0 to v8.3.0 (#16019)
- Tasmota ESP32 Arduino core from v2.0.4 to v2.0.4.1 (#16110)
- TasmotaModbus library from v3.4.0 to v3.5.0 (#16245)
### Fixed
- Restore EnergyToday after using command ``restart 2`` and power cycle (#16118)
- Fixed IR crash on ESP32 (#16173)
- Zigbee fix Tuya for writing attributes
### Removed
## [12.0.2.3] 20220716
### Added
- Support for Sonoff POWR3xxD and THR3xxD (#15856)
@ -50,8 +97,6 @@ All notable changes to this project will be documented in this file.
### Fixed
- ESP32 SendMail not working over ethernet (#15794)
## [Released]
## [12.0.2] 20220620
- Release Paul

View File

@ -18,7 +18,7 @@ See [CHANGELOG.md](https://github.com/arendst/Tasmota/blob/development/tasmota/C
## Development
[![Dev Version](https://img.shields.io/badge/development%20version-v11.0.x.x-blue.svg)](https://github.com/arendst/Tasmota)
[![Dev Version](https://img.shields.io/badge/development%20version-v12.1.x.x-blue.svg)](https://github.com/arendst/Tasmota)
[![Download Dev](https://img.shields.io/badge/download-development-yellow.svg)](http://ota.tasmota.com/tasmota/)
[![Tasmota CI](https://github.com/arendst/Tasmota/workflows/Tasmota%20CI/badge.svg)](https://github.com/arendst/Tasmota/actions?query=workflow%3A%22Tasmota+CI%22)
[![Tasmota ESP32 CI](https://github.com/arendst/Tasmota/workflows/Tasmota%20ESP32%20CI/badge.svg)](https://github.com/arendst/Tasmota/actions?query=workflow%3A%22Tasmota+ESP32+CI%22)

View File

@ -103,3 +103,5 @@ Index | Define | Driver | Device | Address(es) | Description
66 | USE_PCF85363 | xsns_99 | PCF85363 | 0x51 | Real time clock
67 | USE_DS3502 | xdrv_61 | DS3502 | 0x28 - 0x2B | Digital potentiometer
68 | USE_HYT | xsns_97 | HYTxxx | 0x28 | Temperature and Humidity sensor
69 | USE_SGP40 | xsns_98 | SGP40 | 0x59 | Gas (TVOC) and air quality
70 | USE_LUXV30B | xsns_99 | LUXV30B | 0x4A | DFRobot SEN0390 V30B lux sensor

View File

@ -31,7 +31,7 @@ Firmware binaries can be downloaded from http://ota.tasmota.com/tasmota/release/
## Development
[![Dev Version](https://img.shields.io/badge/development%20version-v12.0.x.x-blue.svg)](https://github.com/arendst/Tasmota)
[![Dev Version](https://img.shields.io/badge/development%20version-v12.1.x.x-blue.svg)](https://github.com/arendst/Tasmota)
[![Download Dev](https://img.shields.io/badge/download-development-yellow.svg)](http://ota.tasmota.com/tasmota/)
[![Tasmota CI](https://github.com/arendst/Tasmota/actions/workflows/build_all_the_things.yml/badge.svg)](https://github.com/arendst/Tasmota/actions/workflows/build_all_the_things.yml)
[![Build_development](https://github.com/arendst/Tasmota/actions/workflows/Tasmota_build_devel.yml/badge.svg)](https://github.com/arendst/Tasmota/actions/workflows/Tasmota_build_devel.yml)

View File

@ -14,7 +14,7 @@ Pay attention to the following version breaks due to dynamic settings updates:
1. Migrate to **Sonoff-Tasmota 3.9.x**
2. Migrate to **Sonoff-Tasmota 4.x**
3. Migrate to **Sonoff-Tasmota 5.14**
3. Migrate to **Sonoff-Tasmota 5.14** (http://ota.tasmota.com/tasmota/release_5.14.0/sonoff.bin) - NOTICE underscore as a dash is not supported in older versions
4. Migrate to **Sonoff-Tasmota 6.7.1** (http://ota.tasmota.com/tasmota/release_6.7.1/sonoff.bin) - NOTICE underscore as a dash is not supported in older versions
5. Migrate to **Tasmota 7.2.0** (http://ota.tasmota.com/tasmota/release-7.2.0/tasmota.bin)
@ -56,7 +56,7 @@ The following binary downloads have been compiled with ESP8266/Arduino library c
- **tasmota.bin** = The Tasmota version with most drivers for 1M+ flash. **RECOMMENDED RELEASE BINARY**
- **tasmota4M.bin** = The Tasmota version with most drivers and filesystem for 4M+ flash.
- **tasmota-AF.bin** to **tasmota-VN.bin** = The Tasmota version in different languages for 1M+ flash.
- **tasmota-AD.bin** to **tasmota-VN.bin** = The Tasmota version in different languages for 1M+ flash.
- **tasmota-lite.bin** = The Lite version without most drivers and sensors for 1M+ flash.
- **tasmota-knx.bin** = The Knx version without some features but adds KNX support for 1M+ flash.
- **tasmota-sensors.bin** = The Sensors version adds more useful sensors for 1M+ flash.
@ -72,7 +72,7 @@ Latest released binaries can be downloaded from
- http://ota.tasmota.com/tasmota/release
Historical binaries can be downloaded from
- http://ota.tasmota.com/tasmota/release-12.0.2
- http://ota.tasmota.com/tasmota/release-12.1.1
The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmota.com/tasmota/release/tasmota.bin.gz``
@ -83,7 +83,7 @@ The following binary downloads have been compiled with ESP32/Arduino library cor
- **tasmota32xy.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-C3/S2/S3 and 4M+ flash.
- **tasmota32xycdc.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-C3/S2/S3 with serial over embedded USB CDC only and 4M+ flash.
- **tasmota32solo1.bin** = The Tasmota version with most drivers including additional sensors and KNX for single core ESP32 and 4M+ flash.
- **tasmota32-AF.bin** to **tasmota32-VN.bin** = The Tasmota version in different languages for 4M+ flash.
- **tasmota32-AD.bin** to **tasmota32-VN.bin** = The Tasmota version in different languages for 4M+ flash.
- **tasmota32-bluetooth.bin** = The Bluetooth version adds BLE support for 4M+ flash.
- **tasmota32-display.bin** = The Display version without Energy Monitoring but adds display support for 4M+ flash.
- **tasmota32-ir.bin** = The InfraRed Receiver and transmitter version allowing all available protocols provided by library IRremoteESP8266 but without most other features for 4M+ flash.
@ -97,7 +97,7 @@ Latest released binaries can be downloaded from
- http://ota.tasmota.com/tasmota32/release
Historical binaries can be downloaded from
- http://ota.tasmota.com/tasmota32/release-12.0.2
- http://ota.tasmota.com/tasmota32/release-12.1.1
The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmota.com/tasmota32/release/tasmota32.bin``
@ -107,34 +107,33 @@ The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmo
[Complete list](BUILDS.md) of available feature and sensors.
## Changelog v12.0.2.4
## Changelog v12.1.1.1
### Added
- Command ``SetOption45 1..250`` to change default bistable latching relay pulse length of 40 milliseconds
- Command ``SetOption144 1`` includes a timestamp in zigbee `ZbReceived` messages
- Command ``GlobalTemp2 1..250`` to select Global Temperature source indexed from teleperiod occurance data [#15834](https://github.com/arendst/Tasmota/issues/15834)
- Command ``GlobalHum2 1..250`` to select Global Humidity source indexed from teleperiod occurance data [#15834](https://github.com/arendst/Tasmota/issues/15834)
- Command ``GlobalPress2 1..250`` to select Global Pressure source indexed from teleperiod occurance data [#15834](https://github.com/arendst/Tasmota/issues/15834)
- Command ``Sleep2 !`` to cancel pending one-shot speed setting [#15954](https://github.com/arendst/Tasmota/issues/15954)
- Commands ``WifiScan`` and ``WifiTest`` [#16141](https://github.com/arendst/Tasmota/issues/16141)
- Support for 5-channel light dimmer driver SM2335 used in SwitchBot Color Bulbs [#15839](https://github.com/arendst/Tasmota/issues/15839)
- Support for Sonoff POWR3xxD and THR3xxD [#15856](https://github.com/arendst/Tasmota/issues/15856)
- Support for bistable (latching) relays mixed with monostable relays using GPIO Relay_b or Relay_bi as used by Sonoff POWR320D and THR320D
- Support for Modbus bridge adding commands ``ModbusSend``, ``ModbusBaudrate`` and ``ModbusSerialConfig`` [#16013](https://github.com/arendst/Tasmota/issues/16013)
- Support for multiple ``IRsend`` GPIOs [#16138](https://github.com/arendst/Tasmota/issues/16138)
- Support for Catalan language translations by Albert Gonzalez [#16145](https://github.com/arendst/Tasmota/issues/16145)
- Zigbee added recording of when the battery was last reported [#16146](https://github.com/arendst/Tasmota/issues/16146)
- Zigbee add Battery auto-probe (can be disabled with ``SetOption143 1``) [#16148](https://github.com/arendst/Tasmota/issues/16148)
- ESP32 Support for Ultra Low Power (ULP) coprocessor via Berry by Christian Staars [#15916](https://github.com/arendst/Tasmota/issues/15916)
- Command ``SetOption146 1`` to enable display of ESP32 internal temperature
- Command ``StatusRetain`` [#11109](https://github.com/arendst/Tasmota/issues/11109)
- Support for SGP40 gas and air quality sensor [#16341](https://github.com/arendst/Tasmota/issues/16341)
- Support for Modbus writing using ModbusBridge by JeroenSt [#16351](https://github.com/arendst/Tasmota/issues/16351)
- Support for DFRobot SEN0390 V30B ambient light sensor [#16105](https://github.com/arendst/Tasmota/issues/16105)
- Zigbee device plugin mechanism with commands ``ZbLoad``, ``ZbUnload`` and ``ZbLoadDump`` [#16252](https://github.com/arendst/Tasmota/issues/16252)
- Zigbee prepare for Green Power support [#16407](https://github.com/arendst/Tasmota/issues/16407)
- Flowrate meter flow amount/duration, show values in table format [#16385](https://github.com/arendst/Tasmota/issues/16385)
- Support for Ethernet in ESP32 safeboot firmware [#16388](https://github.com/arendst/Tasmota/issues/16388)
- ESP32-S3 support for internal temperature sensor
### Breaking Changed
### Changed
- ESP32 Arduino core from v2.0.3 to v2.0.4.1 [#15940](https://github.com/arendst/Tasmota/issues/15940)
- ESP32 LVGL library from v8.2.0 to v8.3.0 [#16019](https://github.com/arendst/Tasmota/issues/16019)
- Driver DHT v6 consolidation for both ESP8266 and ESP32 to support SI7021, THS01 and MS01 on ESP32 [#15856](https://github.com/arendst/Tasmota/issues/15856)
- ESP32 NimBLE library from v1.3.6 to v1.4.0
- TasmotaModbus library from v3.5.0 to v3.6.0 [#16351](https://github.com/arendst/Tasmota/issues/16351)
- Button debouncing V3 by adopting switch debounce code [#16339](https://github.com/arendst/Tasmota/issues/16339)
- Thermostat max allowed temperature from 100 to 200C [#16363](https://github.com/arendst/Tasmota/issues/16363)
- Using command ``SerialBuffer`` raise max allowed buffer size to 2048 characters [#16374](https://github.com/arendst/Tasmota/issues/16374)
### Fixed
- Restore EnergyToday after using command ``restart 2`` and power cycle [#16118](https://github.com/arendst/Tasmota/issues/16118)
- ESP32 SendMail not working over ethernet [#15794](https://github.com/arendst/Tasmota/issues/15794)
- RTC not detected when lights are present [#16242](https://github.com/arendst/Tasmota/issues/16242)
- DNS lookup for .local domains [#16273](https://github.com/arendst/Tasmota/issues/16273)
- Button response delay regression from v12.0.2.4 [#16319](https://github.com/arendst/Tasmota/issues/16319)
- Lost module name in GUI regression from v12.0.2.4 - 20220803 [#16324](https://github.com/arendst/Tasmota/issues/16324)
- Removed whitespace from JSON values with no decimals [#16365](https://github.com/arendst/Tasmota/issues/16365)
### Removed

View File

@ -7,7 +7,7 @@
"extra_flags": "-DARDUINO_ESP32_DEV -DBOARD_HAS_PSRAM -DHAS_PSRAM_FIX -mfix-esp32-psram-cache-issue -mfix-esp32-psram-cache-strategy=memw -DARDUINO_USB_CDC_ON_BOOT=0 -DESP32_4M",
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "dout",
"flash_mode": "dio",
"mcu": "esp32",
"variant": "esp32",
"partitions": "partitions/esp32_partition_app2880k_fs320k.csv"

View File

@ -7,7 +7,7 @@
"extra_flags": "-DARDUINO_M5STACK_Core2 -DBOARD_HAS_PSRAM -DARDUINO_USB_CDC_ON_BOOT=0 -DESP32_16M",
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "dout",
"flash_mode": "qio",
"mcu": "esp32",
"variant": "m5stack_core2",
"partitions": "partitions/esp32_partition_app2944k_fs10M.csv"

View File

@ -7,7 +7,7 @@
"extra_flags": "-DARDUINO_ODROID_ESP32 -DBOARD_HAS_PSRAM -DHAS_PSRAM_FIX -mfix-esp32-psram-cache-issue -mfix-esp32-psram-cache-strategy=memw -DARDUINO_USB_CDC_ON_BOOT=0 -DESP32_16M",
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "dout",
"flash_mode": "dio",
"mcu": "esp32",
"variant": "odroid_esp32",
"partitions": "partitions/esp32_partition_app2944k_fs10M.csv"

View File

@ -7,7 +7,7 @@
"extra_flags": "-DARDUINO_ESP32_DEV -DBOARD_HAS_PSRAM -DARDUINO_USB_CDC_ON_BOOT=0 -DESP32_16M",
"f_cpu": "80000000L",
"f_flash": "40000000L",
"flash_mode": "dout",
"flash_mode": "dio",
"mcu": "esp32",
"variant": "esp32",
"partitions": "partitions/esp32_partition_app2944k_fs10M.csv"

View File

@ -7,7 +7,7 @@
"extra_flags": "-DARDUINO_ESP32_DEV -DBOARD_HAS_PSRAM -DARDUINO_USB_CDC_ON_BOOT=0 -DESP32_4M",
"f_cpu": "80000000L",
"f_flash": "40000000L",
"flash_mode": "dout",
"flash_mode": "dio",
"mcu": "esp32",
"variant": "esp32",
"partitions": "partitions/esp32_partition_app2880k_fs320k.csv"

View File

@ -7,7 +7,7 @@
"extra_flags": "-DARDUINO_ESP32_DEV -DBOARD_HAS_PSRAM -DARDUINO_USB_CDC_ON_BOOT=0 -DESP32_4M",
"f_cpu": "80000000L",
"f_flash": "40000000L",
"flash_mode": "dout",
"flash_mode": "dio",
"mcu": "esp32",
"variant": "esp32",
"partitions": "partitions/esp32_partition_app1856k_fs1344k.csv"

View File

@ -7,7 +7,7 @@
"extra_flags": "-DARDUINO_ESP32_DEV -DBOARD_HAS_PSRAM -DARDUINO_USB_CDC_ON_BOOT=0 -DESP32_4M",
"f_cpu": "80000000L",
"f_flash": "40000000L",
"flash_mode": "dout",
"flash_mode": "dio",
"mcu": "esp32",
"variant": "esp32",
"partitions": "partitions/esp32_partition_app1856k_fs320k.csv"

View File

@ -7,7 +7,7 @@
"extra_flags": "-DARDUINO_ESP32_DEV -DBOARD_HAS_PSRAM -DARDUINO_USB_CDC_ON_BOOT=0 -DESP32_8M",
"f_cpu": "80000000L",
"f_flash": "40000000L",
"flash_mode": "dout",
"flash_mode": "dio",
"mcu": "esp32",
"variant": "esp32",
"partitions": "partitions/esp32_partition_app2944k_fs2M.csv"

View File

@ -7,7 +7,7 @@
"extra_flags": "-DARDUINO_ESP32_DEV -DARDUINO_USB_CDC_ON_BOOT=0 -DESP32_4M -DCORE32SOLO1",
"f_cpu": "80000000L",
"f_flash": "40000000L",
"flash_mode": "dout",
"flash_mode": "dio",
"mcu": "esp32",
"variant": "esp32",
"partitions": "partitions/esp32_partition_app2880k_fs320k.csv"

View File

@ -7,13 +7,14 @@
"extra_flags": "-DARDUINO_USB_MODE=1 -DARDUINO_USB_CDC_ON_BOOT=0 -DESP32_4M -DESP32C3",
"f_cpu": "160000000L",
"f_flash": "80000000L",
"flash_mode": "dout",
"flash_mode": "dio",
"mcu": "esp32c3",
"variant": "esp32c3",
"partitions": "partitions/esp32_partition_app2880k_fs320k.csv"
},
"connectivity": [
"wifi"
"wifi",
"bluetooth"
],
"debug": {
"openocd_target": "esp32c3.cfg"

View File

@ -7,13 +7,14 @@
"extra_flags": "-DARDUINO_USB_MODE=1 -DARDUINO_USB_CDC_ON_BOOT=0 -DESP32_4M -DESP32C3 -DUSE_USB_CDC_CONSOLE",
"f_cpu": "160000000L",
"f_flash": "80000000L",
"flash_mode": "dout",
"flash_mode": "dio",
"mcu": "esp32c3",
"variant": "esp32c3",
"partitions": "partitions/esp32_partition_app2880k_fs320k.csv"
},
"connectivity": [
"wifi"
"wifi",
"bluetooth"
],
"debug": {
"openocd_target": "esp32c3.cfg"

View File

@ -7,7 +7,7 @@
"extra_flags": "-DBOARD_HAS_PSRAM -DARDUINO_USB_MODE=0 -DARDUINO_USB_CDC_ON_BOOT=0 -DARDUINO_USB_MSC_ON_BOOT=0 -DARDUINO_USB_DFU_ON_BOOT=0 -DESP32_4M -DESP32S2",
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "dout",
"flash_mode": "dio",
"mcu": "esp32s2",
"variant": "esp32s2",
"partitions": "partitions/esp32_partition_app2880k_fs320k.csv"

View File

@ -7,7 +7,7 @@
"extra_flags": "-DBOARD_HAS_PSRAM -DARDUINO_USB_MODE=0 -DARDUINO_USB_CDC_ON_BOOT=0 -DARDUINO_USB_MSC_ON_BOOT=0 -DARDUINO_USB_DFU_ON_BOOT=0 -DUSE_USB_CDC_CONSOLE -DESP32_4M -DESP32S2",
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "dout",
"flash_mode": "dio",
"mcu": "esp32s2",
"variant": "esp32s2",
"partitions": "partitions/esp32_partition_app2880k_fs320k.csv"
@ -37,6 +37,7 @@
"maximum_size": 4194304,
"require_upload_port": true,
"before_reset": "usb_reset",
"after_reset": "no_reset",
"speed": 460800
},
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/hw-reference/esp32s2/user-guide-saola-1-v1.2.html",

View File

@ -1,13 +1,14 @@
{
"build": {
"arduino":{
"ldscript": "esp32s3_out.ld"
"ldscript": "esp32s3_out.ld",
"memory_type": "qio_qspi"
},
"core": "esp32",
"extra_flags": "-DBOARD_HAS_PSRAM -DARDUINO_USB_MODE=0 -DARDUINO_USB_CDC_ON_BOOT=0 -DARDUINO_USB_MSC_ON_BOOT=0 -DARDUINO_USB_DFU_ON_BOOT=0 -DESP32_4M -DESP32S3",
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "dio",
"flash_mode": "qio",
"mcu": "esp32s3",
"variant": "esp32s3",
"partitions": "partitions/esp32_partition_app2880k_fs320k.csv"

View File

@ -1,13 +1,14 @@
{
"build": {
"arduino":{
"ldscript": "esp32s3_out.ld"
"ldscript": "esp32s3_out.ld",
"memory_type": "qio_qspi"
},
"core": "esp32",
"extra_flags": "-DBOARD_HAS_PSRAM -DARDUINO_USB_MODE=0 -DARDUINO_USB_CDC_ON_BOOT=0 -DARDUINO_USB_MSC_ON_BOOT=0 -DARDUINO_USB_DFU_ON_BOOT=0 -DESP32_8M -DESP32S3",
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "dio",
"flash_mode": "qio",
"mcu": "esp32s3",
"variant": "esp32s3",
"partitions": "partitions/esp32_partition_app2944k_fs2M.csv"

View File

@ -8,7 +8,7 @@
"extra_flags": "-DBOARD_HAS_PSRAM -DARDUINO_USB_MODE=1 -DARDUINO_USB_CDC_ON_BOOT=0 -DARDUINO_USB_MSC_ON_BOOT=0 -DARDUINO_USB_DFU_ON_BOOT=0 -DUSE_USB_CDC_CONSOLE -DESP32_16M -DESP32S3",
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "dio",
"flash_mode": "qio",
"mcu": "esp32s3",
"variant": "esp32s3",
"partitions": "partitions/esp32_partition_app2944k_fs10M.csv"

View File

@ -1,13 +1,14 @@
{
"build": {
"arduino":{
"ldscript": "esp32s3_out.ld"
"ldscript": "esp32s3_out.ld",
"memory_type": "qio_qspi"
},
"core": "esp32",
"extra_flags": "-DBOARD_HAS_PSRAM -DARDUINO_USB_MODE=1 -DARDUINO_USB_CDC_ON_BOOT=0 -DARDUINO_USB_MSC_ON_BOOT=0 -DARDUINO_USB_DFU_ON_BOOT=0 -DUSE_USB_CDC_CONSOLE -DESP32_4M -DESP32S3",
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "dio",
"flash_mode": "qio",
"mcu": "esp32s3",
"variant": "esp32s3",
"partitions": "partitions/esp32_partition_app2880k_fs320k.csv"

View File

@ -15,9 +15,7 @@
"wifi"
],
"frameworks": [
"arduino",
"esp8266-rtos-sdk",
"esp8266-nonos-sdk"
"arduino"
],
"name": "Espressif Generic ESP8266 Tasmota 1M sketch NO FS",
"upload": {

View File

@ -15,9 +15,7 @@
"wifi"
],
"frameworks": [
"arduino",
"esp8266-rtos-sdk",
"esp8266-nonos-sdk"
"arduino"
],
"name": "Espressif Generic ESP8266 Tasmota 1M sketch 1M FS",
"upload": {

View File

@ -15,9 +15,7 @@
"wifi"
],
"frameworks": [
"arduino",
"esp8266-rtos-sdk",
"esp8266-nonos-sdk"
"arduino"
],
"name": "Espressif Generic ESP8266 Tasmota 1M sketch 772k OTA 256k FS",
"upload": {

View File

@ -15,9 +15,7 @@
"wifi"
],
"frameworks": [
"arduino",
"esp8266-rtos-sdk",
"esp8266-nonos-sdk"
"arduino"
],
"name": "Espressif Generic ESP8266 Tasmota 1M sketch 1M OTA 2M FS",
"upload": {

View File

@ -15,9 +15,7 @@
"wifi"
],
"frameworks": [
"arduino",
"esp8266-rtos-sdk",
"esp8266-nonos-sdk"
"arduino"
],
"name": "Espressif Generic ESP8266 Tasmota 1M sketch 3M FS",
"upload": {

View File

@ -15,9 +15,7 @@
"wifi"
],
"frameworks": [
"arduino",
"esp8266-rtos-sdk",
"esp8266-nonos-sdk"
"arduino"
],
"name": "Sonoff ZbBridge Tasmota 1M sketch 772k OTA 256k FS",
"upload": {

View File

@ -335,7 +335,8 @@ int32_t ext_vsnprintf_P(char * out_buf, size_t buf_len, const char * fmt_P, va_l
if (isnan(number) || isinf(number)) {
new_val_str = "null";
} else {
dtostrf(*(float*)cur_val, (decimals + 2), decimals, hex);
uint32_t len = (decimals) ? decimals +2 : 1;
dtostrf(*(float*)cur_val, len, decimals, hex);
if (truncate) {
uint32_t last = strlen(hex) - 1;

View File

@ -1,7 +0,0 @@
# TasmotaSerial
Implementation of software serial with hardware serial fallback library for the ESP8266
Allows for several instances to be active at the same time.
Please note that due to the fact that the ESP always have other activities ongoing, there will be some inexactness in interrupt timings. This may lead to bit errors when having heavy data traffic.

View File

@ -1,169 +0,0 @@
/*
TasmotaModbus.cpp - Basic modbus wrapper for TasmotaSerial for Tasmota
Copyright (C) 2021 Theo Arends
This library is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "TasmotaModbus.h"
TasmotaModbus::TasmotaModbus(int receive_pin, int transmit_pin) : TasmotaSerial(receive_pin, transmit_pin, 1)
{
mb_address = 0;
}
uint16_t TasmotaModbus::CalculateCRC(uint8_t *frame, uint8_t num)
{
uint16_t crc = 0xFFFF;
for (uint8_t i = 0; i < num; i++) {
crc ^= frame[i];
for (uint8_t j = 8; j; j--) {
if ((crc & 0x0001) != 0) { // If the LSB is set
crc >>= 1; // Shift right and XOR 0xA001
crc ^= 0xA001;
} else { // Else LSB is not set
crc >>= 1; // Just shift right
}
}
}
return crc;
}
int TasmotaModbus::Begin(long speed, uint32_t config)
{
int result = 0;
if (begin(speed, config)) {
result = 1;
if (hardwareSerial()) { result = 2; }
}
return result;
}
void TasmotaModbus::Send(uint8_t device_address, uint8_t function_code, uint16_t start_address, uint16_t register_count)
{
uint8_t frame[8];
mb_address = device_address; // Save address for receipt check
frame[0] = mb_address; // 0xFE default device address or dedicated like 0x01
frame[1] = function_code;
frame[2] = (uint8_t)(start_address >> 8); // MSB
frame[3] = (uint8_t)(start_address); // LSB
frame[4] = (uint8_t)(register_count >> 8); // MSB
frame[5] = (uint8_t)(register_count); // LSB
uint16_t crc = CalculateCRC(frame, 6);
frame[6] = (uint8_t)(crc);
frame[7] = (uint8_t)(crc >> 8);
flush();
write(frame, sizeof(frame));
}
bool TasmotaModbus::ReceiveReady()
{
return (available() > 4);
}
uint8_t TasmotaModbus::ReceiveBuffer(uint8_t *buffer, uint8_t register_count)
{
mb_len = 0;
uint32_t timeout = millis() + 10;
while ((mb_len < (register_count *2) + 5) && (millis() < timeout)) {
if (available()) {
uint8_t data = (uint8_t)read();
if (!mb_len) { // Skip leading data as provided by hardware serial
if (mb_address == data) {
buffer[mb_len++] = data;
}
} else {
buffer[mb_len++] = data;
if (3 == mb_len) {
if (buffer[1] & 0x80) { // 01 84 02 f2 f1
if (0 == buffer[2]) {
return 3; // 3 = Illegal Data Value,
}
return buffer[2]; // 1 = Illegal Function,
// 2 = Illegal Data Address,
// 3 = Illegal Data Value,
// 4 = Slave Error
// 5 = Acknowledge but not finished (no error)
// 6 = Slave Busy
// 8 = Memory Parity error
// 10 = Gateway Path Unavailable
// 11 = Gateway Target device failed to respond
}
}
}
timeout = millis() + 10;
}
}
if (mb_len < 7) { return 7; } // 7 = Not enough data
/*
if (mb_len != buffer[2] + 5) {
buffer[2] = mb_len - 5; // As it's wrong anyway let's store actual number received in here (5 will be added by client)
return 3; // 3 = Unexpected result
}
*/
uint16_t crc = (buffer[mb_len -1] << 8) | buffer[mb_len -2];
if (CalculateCRC(buffer, mb_len -2) != crc) {
return 9; // 9 = crc error
}
return 0; // 0 = No error
}
uint8_t TasmotaModbus::Receive16BitRegister(uint16_t *value)
{
// 0 1 2 3 4 5 6
// 01 04 02 43 21 HH LL
// Id Cc Sz Regis Crc--
uint8_t buffer[7];
uint8_t error = ReceiveBuffer(buffer, 1); // 1 x 16bit register
if (!error) {
*value = (buffer[3] << 8) | buffer[4];
}
return error;
}
uint8_t TasmotaModbus::Receive32BitRegister(float *value)
{
// 0 1 2 3 4 5 6 7 8
// 01 04 04 87 65 43 21 HH LL
// Id Cc Sz Register--- Crc--
uint8_t buffer[9];
*value = NAN;
uint8_t error = ReceiveBuffer(buffer, 2); // 1 x 32bit register
if (!error) {
((uint8_t*)value)[3] = buffer[3];
((uint8_t*)value)[2] = buffer[4];
((uint8_t*)value)[1] = buffer[5];
((uint8_t*)value)[0] = buffer[6];
}
return error;
}

View File

@ -1,10 +1,10 @@
{
"name": "TasmotaModbus",
"version": "3.4.0",
"version": "3.6.0",
"keywords": [
"serial", "io", "TasmotaModbus"
],
"description": "Basic modbus wrapper for TasmotaSerial for ESP8266.",
"description": "Modbus wrapper for TasmotaSerial.",
"repository":
{
"type": "git",

View File

@ -1,5 +1,5 @@
name=TasmotaModbus
version=3.4.0
version=3.6.0
author=Theo Arends
maintainer=Theo Arends <theo@arends.com>
sentence=Basic modbus wrapper for TasmotaSerial for ESP8266.

View File

@ -0,0 +1,285 @@
/*
TasmotaModbus.cpp - Basic modbus wrapper for TasmotaSerial for Tasmota
Copyright (C) 2021 Theo Arends
This library is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Documentation about modbus protocol: https://www.modbustools.com/modbus.html
*/
#include "Arduino.h"
#include "TasmotaModbus.h"
extern void AddLog(uint32_t loglevel, PGM_P formatP, ...);
enum LoggingLevels {LOG_LEVEL_NONE, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG, LOG_LEVEL_DEBUG_MORE};
//#define TASMOTAMODBUSDEBUG
TasmotaModbus::TasmotaModbus(int receive_pin, int transmit_pin) : TasmotaSerial(receive_pin, transmit_pin, 1)
{
mb_address = 0;
}
uint16_t TasmotaModbus::CalculateCRC(uint8_t *frame, uint8_t num)
{
uint16_t crc = 0xFFFF;
for (uint8_t i = 0; i < num; i++) {
crc ^= frame[i];
for (uint8_t j = 8; j; j--) {
if ((crc & 0x0001) != 0) { // If the LSB is set
crc >>= 1; // Shift right and XOR 0xA001
crc ^= 0xA001;
} else { // Else LSB is not set
crc >>= 1; // Just shift right
}
}
}
return crc;
}
int TasmotaModbus::Begin(long speed, uint32_t config)
{
int result = 0;
if (begin(speed, config)) {
result = 1;
if (hardwareSerial()) { result = 2; }
}
return result;
}
uint8_t TasmotaModbus::Send(uint8_t device_address, uint8_t function_code, uint16_t start_address, uint16_t count, uint16_t *write_data)
{
uint8_t *frame;
uint8_t framepointer = 0;
uint16_t byte_count = count * 2; // In register mode count is nr of registers (2 bytes)
if ((function_code == 1) || (function_code == 2) || (function_code == 15)) byte_count = ((count-1) / 8) + 1; // In bitmode count is nr of bits
if (function_code < 7)
{
frame = (uint8_t *)malloc(8); // Addres(1), Function(1), Start/Coil Address(2), Registercount or Data (2), CRC(2)
}
else
{
frame = (uint8_t *)malloc(9 + byte_count); // Addres(1), Function(1), Start/Coil Address(2),Quantity of registers (2), Bytecount(1), Data(1..n), CRC(2)
}
mb_address = device_address; // Save address for receipt check
frame[framepointer++] = mb_address; // 0xFE default device address or dedicated like 0x01
frame[framepointer++] = function_code;
frame[framepointer++] = (uint8_t)(start_address >> 8); // MSB
frame[framepointer++] = (uint8_t)(start_address); // LSB
if (function_code < 5)
{
frame[framepointer++] = (uint8_t)(count >> 8); // MSB
frame[framepointer++] = (uint8_t)(count); // LSB
}
else if ((function_code == 5) || (function_code == 6))
{
if (write_data == NULL)
{
free(frame);
return 13; // Register data not specified
}
if (count != 1)
{
free(frame);
return 12; // Wrong register count
}
frame[framepointer++] = (uint8_t)(write_data[0] >> 8); // MSB
frame[framepointer++] = (uint8_t)(write_data[0]); // LSB
}
else if ((function_code == 15) || (function_code == 16))
{
frame[framepointer++] = (uint8_t)(count >> 8); // MSB
frame[framepointer++] = (uint8_t)(count); // LSB
frame[framepointer++] = byte_count;
if (write_data == NULL)
{
free(frame);
return 13; // Register data not specified
}
if (count == 0)
{
free(frame);
return 12; // Wrong register count
}
for (uint16_t bytepointer = 0; bytepointer < byte_count; bytepointer++)
{
frame[framepointer++] = (uint8_t)(write_data[bytepointer/2] >> (bytepointer % 2 ? 0 : 8)); // MSB, LSB, MSB ....
}
}
else
{
free(frame);
return 1; // Wrong function code
}
uint16_t crc = CalculateCRC(frame, framepointer);
frame[framepointer++] = (uint8_t)(crc);
frame[framepointer++] = (uint8_t)(crc >> 8);
#ifdef TASMOTAMODBUSDEBUG
uint8_t *buf;
uint16_t bufsize=(framepointer + 1) * 3;
buf = (uint8_t *)malloc(bufsize);
memset(buf, 0, bufsize);
uint16_t i;
for (i = 0; i < framepointer;i++)
snprintf((char *)&buf[i*3], (bufsize-i*3), "%02X ",frame[i]);
AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("MBS: Serial Send: %s"), buf);
free(buf);
#endif
flush();
write(frame, framepointer);
free(frame);
return 0;
}
bool TasmotaModbus::ReceiveReady()
{
return (available() > 4);
}
uint8_t TasmotaModbus::ReceiveBuffer(uint8_t *buffer, uint8_t register_count, uint16_t byte_count)
{
mb_len = 0;
uint32_t timeout = millis() + 10;
uint8_t header_length = 3;
if (byte_count == 0) byte_count = (register_count * 2);
while ((mb_len < byte_count + header_length + 2) && (millis() < timeout)) {
if (available()) {
uint8_t data = (uint8_t)read();
if (!mb_len) { // Skip leading data as provided by hardware serial
if (mb_address == data) {
buffer[mb_len++] = data;
}
} else {
buffer[mb_len++] = data;
if (3 == mb_len) {
if ((buffer[1] == 5) || (buffer[1] == 6) || (buffer[1] == 15) || (buffer[1] == 16)) header_length = 4; // Addr, Func, StartAddr
}
}
timeout = millis() + 10;
}
}
#ifdef TASMOTAMODBUSDEBUG
// RX Logging
uint8_t *buf;
uint16_t bufsize=(mb_len + 1) * 3;
buf = (uint8_t *)malloc(bufsize);
memset(buf, 0, bufsize);
uint16_t i;
for (i = 0; i < mb_len;i++)
snprintf((char *)&buf[i*3], (bufsize-i*3), "%02X ",buffer[i]);
AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("MBS: Serial Received: %s"), buf);
free(buf);
#endif
if (buffer[1] & 0x80)
{ // 01 84 02 f2 f1
if (0 == buffer[2])
{
return 3; // 3 = Illegal Data Value,
}
return buffer[2]; // 1 = Illegal Function,
// 2 = Illegal Data Address,
// 3 = Illegal Data Value,
// 4 = Slave Error
// 5 = Acknowledge but not finished (no error)
// 6 = Slave Busy
// 8 = Memory Parity error
// 10 = Gateway Path Unavailable
// 11 = Gateway Target device failed to respond
}
if (mb_len < 6) { return 7; } // 7 = Not enough data
/*
if (mb_len != buffer[2] + 5) {
buffer[2] = mb_len - 5; // As it's wrong anyway let's store actual number received in here (5 will be added by client)
return 3; // 3 = Unexpected result
}
*/
uint16_t crc = (buffer[mb_len -1] << 8) | buffer[mb_len -2];
if (CalculateCRC(buffer, mb_len -2) != crc) {
return 9; // 9 = crc error
}
return 0; // 0 = No error
}
uint8_t TasmotaModbus::Receive8BitRegister(uint8_t *value)
{
// 0 1 2 3 4 5
// 01 04 02 43 HH LL
// Id Cc Sz Regis Crc--
uint8_t buffer[6];
uint8_t error = ReceiveBuffer(buffer, 1); // 1 x 16bit register
if (!error) {
*value = buffer[3];
}
return error;
}
uint8_t TasmotaModbus::Receive16BitRegister(uint16_t *value)
{
// 0 1 2 3 4 5 6
// 01 04 02 43 21 HH LL
// Id Cc Sz Regis Crc--
uint8_t buffer[7];
uint8_t error = ReceiveBuffer(buffer, 1); // 1 x 16bit register
if (!error) {
*value = (buffer[3] << 8) | buffer[4];
}
return error;
}
uint8_t TasmotaModbus::Receive32BitRegister(float *value)
{
// 0 1 2 3 4 5 6 7 8
// 01 04 04 87 65 43 21 HH LL
// Id Cc Sz Register--- Crc--
uint8_t buffer[9];
*value = NAN;
uint8_t error = ReceiveBuffer(buffer, 2); // 1 x 32bit register
if (!error) {
((uint8_t*)value)[3] = buffer[3];
((uint8_t*)value)[2] = buffer[4];
((uint8_t*)value)[1] = buffer[5];
((uint8_t*)value)[0] = buffer[6];
}
return error;
}

View File

@ -34,8 +34,6 @@ class TasmotaModbus : public TasmotaSerial {
uint16_t CalculateCRC(uint8_t *frame, uint8_t num);
void Send(uint8_t device_address, uint8_t function_code, uint16_t start_address, uint16_t register_count);
bool ReceiveReady();
/* Return codes:
@ -51,8 +49,17 @@ class TasmotaModbus : public TasmotaSerial {
* 9 = Crc error
* 10 = Gateway Path Unavailable
* 11 = Gateway Target device failed to respond
* 12 = Wrong number of registers
* 13 = Register data not specified
* 14 = To many registers
*/
uint8_t ReceiveBuffer(uint8_t *buffer, uint8_t register_count);
uint8_t Send(uint8_t device_address, uint8_t function_code, uint16_t start_address, uint16_t count, uint16_t *writeData = NULL);
// Count is nr of registers for function code 3,4,6 and 16, nr of coils/inputs for function code 1,2 and 15 and must be 1 for function code 5 and 6
uint8_t ReceiveBuffer(uint8_t *buffer, uint8_t register_count, uint16_t byte_count = 0);
// Bytecount is mandatory for functioncode 1 and 2 because they can return an odd number of bytes.
uint8_t Receive8BitRegister(uint8_t *value);
uint8_t Receive16BitRegister(uint16_t *value);
uint8_t Receive32BitRegister(float *value);

View File

@ -0,0 +1,9 @@
*~
doxygen_sqlite3.db
html# osx
.DS_Store
# doxygen
doxygen_sqlite3.db
html
*.tmp

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,53 @@
# Adafruit SGP40 Gas / Air Quality I2C sensor [![Build Status](https://github.com/adafruit/Adafruit_SGP40/workflows/Arduino%20Library%20CI/badge.svg)](https://github.com/adafruit/Adafruit_SGP40/actions)[![Documentation](https://github.com/adafruit/ci-arduino/blob/master/assets/doxygen_badge.svg)](http://adafruit.github.io/Adafruit_SGP40/html/index.html)
<a href="https://www.adafruit.com/product/4829"><img src="https://cdn-shop.adafruit.com/970x728/4829-05.jpg" width="500px"></a>
This is the Adafruit SGP40 Gas / Air Quality I2C sensor library
Tested and works great with the Aadafruit SGP40 Breakout Board
* http://www.adafruit.com/products/4829
This chip uses I2C to communicate, 2 pins are required to interface
Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!
# Installation
To install, use the Arduino Library Manager and search for "Adafruit SGP40" and install the library.
## Dependencies
* [Adafruit Bus IO](https://github.com/adafruit/Adafruit_BusIO)
# Contributing
Contributions are welcome! Please read our [Code of Conduct](https://github.com/adafruit/Adafruit_SGP40/blob/master/CODE_OF_CONDUCT.md>)
before contributing to help this project stay welcoming.
## Documentation and doxygen
Documentation is produced by doxygen. Contributions should include documentation for any new code added.
Some examples of how to use doxygen can be found in these guide pages:
https://learn.adafruit.com/the-well-automated-arduino-library/doxygen
https://learn.adafruit.com/the-well-automated-arduino-library/doxygen-tips
## Formatting and clang-format
This library uses [`clang-format`](https://releases.llvm.org/download.html) to standardize the formatting of `.cpp` and `.h` files.
Contributions should be formatted using `clang-format`:
The `-i` flag will make the changes to the file.
```bash
clang-format -i *.cpp *.h
```
If you prefer to make the changes yourself, running `clang-format` without the `-i` flag will print out a formatted version of the file. You can save this to a file and diff it against the original to see the changes.
Note that the formatting output by `clang-format` is what the automated formatting checker will expect. Any diffs from this formatting will result in a failed build until they are addressed. Using the `-i` flag is highly recommended.
### clang-format resources
* [Binary builds and source available on the LLVM downloads page](https://releases.llvm.org/download.html)
* [Documentation and IDE integration](https://clang.llvm.org/docs/ClangFormat.html)
## About this Driver
Written by Limor Fried for Adafruit Industries.
BSD license, check license.txt for more information
All text above must be included in any redistribution

View File

@ -0,0 +1,127 @@
# Adafruit Community Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and leaders pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level or type of
experience, education, socio-economic status, nationality, personal appearance,
race, religion, or sexual identity and orientation.
## Our Standards
We are committed to providing a friendly, safe and welcoming environment for
all.
Examples of behavior that contributes to creating a positive environment
include:
* Be kind and courteous to others
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Collaborating with other community members
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and sexual attention or advances
* The use of inappropriate images, including in a community member's avatar
* The use of inappropriate language, including in a community member's nickname
* Any spamming, flaming, baiting or other attention-stealing behavior
* Excessive or unwelcome helping; answering outside the scope of the question
asked
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate
The goal of the standards and moderation guidelines outlined here is to build
and maintain a respectful community. We ask that you dont just aim to be
"technically unimpeachable", but rather try to be your best self.
We value many things beyond technical expertise, including collaboration and
supporting others within our community. Providing a positive experience for
other community members can have a much more significant impact than simply
providing the correct answer.
## Our Responsibilities
Project leaders are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project leaders have the right and responsibility to remove, edit, or
reject messages, comments, commits, code, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any community member for other behaviors that they deem
inappropriate, threatening, offensive, or harmful.
## Moderation
Instances of behaviors that violate the Adafruit Community Code of Conduct
may be reported by any member of the community. Community members are
encouraged to report these situations, including situations they witness
involving other community members.
You may report in the following ways:
In any situation, you may send an email to <support@adafruit.com>.
On the Adafruit Discord, you may send an open message from any channel
to all Community Helpers by tagging @community helpers. You may also send an
open message from any channel, or a direct message to @kattni#1507,
@tannewt#4653, @Dan Halbert#1614, @cater#2442, @sommersoft#0222, or
@Andon#8175.
Email and direct message reports will be kept confidential.
In situations on Discord where the issue is particularly egregious, possibly
illegal, requires immediate action, or violates the Discord terms of service,
you should also report the message directly to Discord.
These are the steps for upholding our communitys standards of conduct.
1. Any member of the community may report any situation that violates the
Adafruit Community Code of Conduct. All reports will be reviewed and
investigated.
2. If the behavior is an egregious violation, the community member who
committed the violation may be banned immediately, without warning.
3. Otherwise, moderators will first respond to such behavior with a warning.
4. Moderators follow a soft "three strikes" policy - the community member may
be given another chance, if they are receptive to the warning and change their
behavior.
5. If the community member is unreceptive or unreasonable when warned by a
moderator, or the warning goes unheeded, they may be banned for a first or
second offense. Repeated offenses will result in the community member being
banned.
## Scope
This Code of Conduct and the enforcement policies listed above apply to all
Adafruit Community venues. This includes but is not limited to any community
spaces (both public and private), the entire Adafruit Discord server, and
Adafruit GitHub repositories. Examples of Adafruit Community spaces include
but are not limited to meet-ups, audio chats on the Adafruit Discord, or
interaction at a conference.
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. As a community
member, you are representing our community, and are expected to behave
accordingly.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 1.4, available at
<https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>,
and the [Rust Code of Conduct](https://www.rust-lang.org/en-US/conduct.html).
For other projects adopting the Adafruit Community Code of
Conduct, please contact the maintainers of those projects for enforcement.
If you wish to use this code of conduct for your own project, consider
explicitly mentioning your moderation policy or making a copy with your
own moderation policy so as to avoid confusion.

View File

@ -0,0 +1,48 @@
#include "Adafruit_SGP40.h"
#include "Adafruit_SHT31.h"
Adafruit_SGP40 sgp;
Adafruit_SHT31 sht31;
void setup() {
Serial.begin(115200);
while (!Serial) { delay(10); } // Wait for serial console to open!
Serial.println("SGP40 test with SHT31 compensation");
if (! sgp.begin()){
Serial.println("SGP40 sensor not found :(");
while (1);
}
if (! sht31.begin(0x44)) { // Set to 0x45 for alternate i2c addr
Serial.println("Couldn't find SHT31");
while (1);
}
Serial.print("Found SHT3x + SGP40 serial #");
Serial.print(sgp.serialnumber[0], HEX);
Serial.print(sgp.serialnumber[1], HEX);
Serial.println(sgp.serialnumber[2], HEX);
}
int counter = 0;
void loop() {
uint16_t sraw;
int32_t voc_index;
float t = sht31.readTemperature();
Serial.print("Temp *C = "); Serial.print(t); Serial.print("\t\t");
float h = sht31.readHumidity();
Serial.print("Hum. % = "); Serial.println(h);
sraw = sgp.measureRaw(t, h);
Serial.print("Raw measurement: ");
Serial.println(sraw);
voc_index = sgp.measureVocIndex(t, h);
Serial.print("Voc Index: ");
Serial.println(voc_index);
delay(1000);
}

View File

@ -0,0 +1,32 @@
#include <Wire.h>
#include "Adafruit_SGP40.h"
Adafruit_SGP40 sgp;
void setup() {
Serial.begin(115200);
while (!Serial) { delay(10); } // Wait for serial console to open!
Serial.println("SGP40 test");
if (! sgp.begin()){
Serial.println("Sensor not found :(");
while (1);
}
Serial.print("Found SGP40 serial #");
Serial.print(sgp.serialnumber[0], HEX);
Serial.print(sgp.serialnumber[1], HEX);
Serial.println(sgp.serialnumber[2], HEX);
}
int counter = 0;
void loop() {
uint16_t raw;
raw = sgp.measureRaw();
Serial.print("Measurement: ");
Serial.println(raw);
delay(1000);
}

View File

@ -0,0 +1,10 @@
name=Adafruit SGP40 Sensor
version=1.1.0
author=Adafruit
maintainer=Adafruit <info@adafruit.com>
sentence=This is an Arduino library for the Adafruit SGP40 Gas / Air Quality Sensor
paragraph=This is an Arduino library for the Adafruit SGP40 Gas / Air Quality Sensor
category=Sensors
url=https://github.com/adafruit/Adafruit_SGP40
architectures=*
depends=Adafruit BusIO, Adafruit SHT31 Library

View File

@ -0,0 +1,26 @@
Software License Agreement (BSD License)
Copyright (c) 2012, Adafruit Industries
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holders nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -0,0 +1,230 @@
/*!
* @file Adafruit_SGP40.cpp
*
* @mainpage Adafruit SGP40 gas sensor driver
*
* @section intro_sec Introduction
*
* This is the documentation for Adafruit's SGP40 driver for the
* Arduino platform. It is designed specifically to work with the
* Adafruit SGP40 breakout: http://www.adafruit.com/products/4829
*
* These sensors use I2C to communicate, 2 pins (SCL+SDA) are required
* to interface with the breakout.
*
* Adafruit invests time and resources providing this open source code,
* please support Adafruit and open-source hardware by purchasing
* products from Adafruit!
*
*
* @section author Author
* Written by Ladyada for Adafruit Industries.
*
* @section license License
* BSD license, all text here must be included in any redistribution.
*
*/
#include "Adafruit_SGP40.h"
#include "Arduino.h"
//#define I2C_DEBUG
/*!
* @brief Instantiates a new SGP40 class
*/
Adafruit_SGP40::Adafruit_SGP40() {}
/*!
* @brief Setups the hardware and detects a valid SGP40. Initializes I2C
* then reads the serialnumber and checks that we are talking to an
* SGP40
* @param theWire
* Optional pointer to I2C interface, otherwise use Wire
* @return True if SGP40 found on I2C, False if something went wrong!
*/
boolean Adafruit_SGP40::begin(TwoWire *theWire) {
if (i2c_dev) {
delete i2c_dev; // remove old interface
}
i2c_dev = new Adafruit_I2CDevice(SGP40_I2CADDR_DEFAULT, theWire);
if (!i2c_dev->begin()) {
return false;
}
uint8_t command[2];
command[0] = 0x36;
command[1] = 0x82;
if (!readWordFromCommand(command, 2, 10, serialnumber, 3))
return false;
uint16_t featureset;
command[0] = 0x20;
command[1] = 0x2F;
if (!readWordFromCommand(command, 2, 10, &featureset, 1))
return false;
// Serial.print("Featureset 0x"); Serial.println(featureset, HEX);
VocAlgorithm_init(&voc_algorithm_params);
return selfTest();
}
/*!
* @brief Commands the sensor to perform a soft reset using the "General
* Call" mode. Take note that this is not sensor specific and all devices that
* support the General Call mode on the on the same I2C bus will perform this.
*
* @return True if command completed successfully, false if something went
* wrong!
*/
boolean Adafruit_SGP40::softReset(void) {
uint8_t command[2];
command[0] = 0x00;
command[1] = 0x06;
return readWordFromCommand(command, 2, 10);
}
/**
* @brief Request the sensor to turn off heater to lower curent consumption.
* Launching a measurement automatically wakes up the sensor again.
*
* @return true: success false: failure
*/
bool Adafruit_SGP40::heaterOff(void) {
uint8_t command[2];
command[0] = 0x36;
command[1] = 0x15;
return i2c_dev->write(command, 2);
}
/**
* @brief Request the sensor to perform a self-test, returning the result
*
* @return true: success false:failure
*/
bool Adafruit_SGP40::selfTest(void) {
uint8_t command[2];
uint16_t reply;
command[0] = 0x28;
command[1] = 0x0E;
if (!readWordFromCommand(command, 2, 250, &reply, 1))
return false;
if ((reply == 0xD400)) {
return true;
}
return false;
}
/**
* @brief Combined the measured gasses, temperature, and humidity
* to calculate the VOC Index
*
* @param temperature The measured temperature in degrees C
* @param humidity The measured relative humidity in % rH
* @return int32_t The VOC Index
*/
int32_t Adafruit_SGP40::measureVocIndex(float temperature, float humidity) {
int32_t voc_index;
uint16_t sraw = measureRaw(temperature, humidity);
VocAlgorithm_process(&voc_algorithm_params, sraw, &voc_index);
return voc_index;
}
/**
* @brief Return the raw gas measurement
*
* @param temperature The measured temperature in degrees C
* @param humidity The measured relative humidity in % rH
* @return uint16_t The current raw gas measurement
*/
uint16_t Adafruit_SGP40::measureRaw(float temperature, float humidity) {
uint8_t command[8];
uint16_t reply;
command[0] = 0x26;
command[1] = 0x0F;
uint16_t rhticks = (uint16_t)((humidity * 65535) / 100 + 0.5);
command[2] = rhticks >> 8;
command[3] = rhticks & 0xFF;
command[4] = generateCRC(command + 2, 2);
uint16_t tempticks = (uint16_t)(((temperature + 45) * 65535) / 175);
command[5] = tempticks >> 8;
command[6] = tempticks & 0xFF;
command[7] = generateCRC(command + 5, 2);
;
if (!readWordFromCommand(command, 8, 250, &reply, 1))
return 0x0;
return reply;
}
/*!
* @brief I2C low level interfacing
*/
bool Adafruit_SGP40::readWordFromCommand(uint8_t command[],
uint8_t commandLength,
uint16_t delayms, uint16_t *readdata,
uint8_t readlen) {
if (!i2c_dev->write(command, commandLength)) {
return false;
}
delay(delayms);
if (readlen == 0)
return true;
uint8_t replylen = readlen * (SGP40_WORD_LEN + 1);
uint8_t replybuffer[replylen];
if (!i2c_dev->read(replybuffer, replylen)) {
return false;
}
for (uint8_t i = 0; i < readlen; i++) {
uint8_t crc = generateCRC(replybuffer + i * 3, 2);
#ifdef I2C_DEBUG
Serial.print("\t\tCRC calced: 0x");
Serial.print(crc, HEX);
Serial.print(" vs. 0x");
Serial.println(replybuffer[i * 3 + 2], HEX);
#endif
if (crc != replybuffer[i * 3 + 2])
return false;
// success! store it
readdata[i] = replybuffer[i * 3];
readdata[i] <<= 8;
readdata[i] |= replybuffer[i * 3 + 1];
#ifdef I2C_DEBUG
Serial.print("\t\tRead: 0x");
Serial.println(readdata[i], HEX);
#endif
}
return true;
}
uint8_t Adafruit_SGP40::generateCRC(uint8_t *data, uint8_t datalen) {
// calculates 8-Bit checksum with given polynomial
uint8_t crc = SGP40_CRC8_INIT;
for (uint8_t i = 0; i < datalen; i++) {
crc ^= data[i];
for (uint8_t b = 0; b < 8; b++) {
if (crc & 0x80)
crc = (crc << 1) ^ SGP40_CRC8_POLYNOMIAL;
else
crc <<= 1;
}
}
return crc;
}

View File

@ -0,0 +1,71 @@
/*!
* @file Adafruit_SGP40.h
*
* This is the documentation for Adafruit's SGP40 driver for the
* Arduino platform. It is designed specifically to work with the
* Adafruit SGP40 breakout: http://www.adafruit.com/products/4829
*
* These sensors use I2C to communicate, 2 pins (SCL+SDA) are required
* to interface with the breakout.
*
* Adafruit invests time and resources providing this open source code,
* please support Adafruit and open-source hardware by purchasing
* products from Adafruit!
*
* Written by Ladyada for Adafruit Industries.
*
* BSD license, all text here must be included in any redistribution.
*
*/
#ifndef ADAFRUIT_SGP40_H
#define ADAFRUIT_SGP40_H
#include "Arduino.h"
#include <Adafruit_BusIO_Register.h>
#include <Adafruit_I2CDevice.h>
extern "C" {
#include "sensirion_arch_config.h"
#include "sensirion_voc_algorithm.h"
};
// the i2c address
#define SGP40_I2CADDR_DEFAULT 0x59 ///< SGP40 has only one I2C address
// commands and constants
#define SGP40_FEATURESET 0x0020 ///< The required set for this library
#define SGP40_CRC8_POLYNOMIAL 0x31 ///< Seed for SGP40's CRC polynomial
#define SGP40_CRC8_INIT 0xFF ///< Init value for CRC
#define SGP40_WORD_LEN 2 ///< 2 bytes per word
/*!
* @brief Class that stores state and functions for interacting with
* SGP40 Gas Sensor
*/
class Adafruit_SGP40 {
public:
Adafruit_SGP40();
bool begin(TwoWire *theWire = &Wire);
bool selfTest(void);
bool softReset();
bool heaterOff();
uint16_t measureRaw(float temperature = 25, float humidity = 50);
int32_t measureVocIndex(float temperature = 25, float humidity = 50);
/** The 48-bit serial number, this value is set when you call {@link begin()}
* **/
uint16_t serialnumber[3];
private:
Adafruit_I2CDevice *i2c_dev = NULL; ///< Pointer to I2C bus interface
void write(uint8_t address, uint8_t *data, uint8_t n);
void read(uint8_t address, uint8_t *data, uint8_t n);
bool readWordFromCommand(uint8_t command[], uint8_t commandLength,
uint16_t delayms, uint16_t *readdata = NULL,
uint8_t readlen = 0);
uint8_t generateCRC(uint8_t data[], uint8_t datalen);
VocAlgorithmParams voc_algorithm_params;
};
#endif // ndef ADAFRUIT_SGP40_H

View File

@ -0,0 +1,96 @@
/*
* Copyright (c) 2019, Sensirion AG
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of Sensirion AG nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef SENSIRION_ARCH_CONFIG_H
#define SENSIRION_ARCH_CONFIG_H
/**
* If your platform does not provide the library stdlib.h you have to remove the
* include and define NULL yourself (see below).
*/
#include <stdlib.h>
/**
* #ifndef NULL
* #define NULL ((void *)0)
* #endif
*/
/**
* If your platform does not provide the library stdint.h you have to
* define the integral types yourself (see below).
*/
#include <stdint.h>
/**
* Typedef section for types commonly defined in <stdint.h>
* If your system does not provide stdint headers, please define them
* accordingly. Please make sure to define int64_t and uint64_t.
*/
/* typedef unsigned long long int uint64_t;
* typedef long long int int64_t;
* typedef long int32_t;
* typedef unsigned long uint32_t;
* typedef short int16_t;
* typedef unsigned short uint16_t;
* typedef char int8_t;
* typedef unsigned char uint8_t; */
#ifndef __cplusplus
/**
* If your platform doesn't define the bool type we define it as int. Depending
* on your system update the definition below.
*/
#if __STDC_VERSION__ >= 199901L
#include <stdbool.h>
#else
#ifndef bool
#define bool int
#define true 1
#define false 0
#endif /* bool */
#endif /* __STDC_VERSION__ */
#endif /* __cplusplus */
/**
* The clock period of the i2c bus in microseconds. Increase this, if your GPIO
* ports cannot support a 200 kHz output rate. (2 * 1 / 10usec == 200Khz)
*
* This is only relevant for the sw-i2c HAL (bit-banging on GPIO pins). The
* pulse length is half the clock period, the number should thus be even.
*/
#define SENSIRION_I2C_CLOCK_PERIOD_USEC 10
#endif /* SENSIRION_ARCH_CONFIG_H */

View File

@ -0,0 +1,805 @@
/*
* Copyright (c) 2021, Sensirion AG
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of Sensirion AG nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "sensirion_voc_algorithm.h"
/* The fixed point arithmetic parts of this code were originally created by
* https://github.com/PetteriAimonen/libfixmath
*/
/*!< the maximum value of fix16_t */
#define FIX16_MAXIMUM 0x7FFFFFFF
/*!< the minimum value of fix16_t */
#define FIX16_MINIMUM 0x80000000
/*!< the value used to indicate overflows when FIXMATH_NO_OVERFLOW is not
* specified */
#define FIX16_OVERFLOW 0x80000000
/*!< fix16_t value of 1 */
#define FIX16_ONE 0x00010000
static inline fix16_t fix16_from_int(int32_t a) {
return a * FIX16_ONE;
}
static inline int32_t fix16_cast_to_int(fix16_t a) {
return (a >= 0) ? (a >> 16) : -((-a) >> 16);
}
/*! Multiplies the two given fix16_t's and returns the result. */
static fix16_t fix16_mul(fix16_t inArg0, fix16_t inArg1);
/*! Divides the first given fix16_t by the second and returns the result. */
static fix16_t fix16_div(fix16_t inArg0, fix16_t inArg1);
/*! Returns the square root of the given fix16_t. */
static fix16_t fix16_sqrt(fix16_t inValue);
/*! Returns the exponent (e^) of the given fix16_t. */
static fix16_t fix16_exp(fix16_t inValue);
static fix16_t fix16_mul(fix16_t inArg0, fix16_t inArg1) {
// Each argument is divided to 16-bit parts.
// AB
// * CD
// -----------
// BD 16 * 16 -> 32 bit products
// CB
// AD
// AC
// |----| 64 bit product
uint32_t absArg0 = (uint32_t)((inArg0 >= 0) ? inArg0 : (-inArg0));
uint32_t absArg1 = (uint32_t)((inArg1 >= 0) ? inArg1 : (-inArg1));
uint32_t A = (absArg0 >> 16), C = (absArg1 >> 16);
uint32_t B = (absArg0 & 0xFFFF), D = (absArg1 & 0xFFFF);
uint32_t AC = A * C;
uint32_t AD_CB = A * D + C * B;
uint32_t BD = B * D;
uint32_t product_hi = AC + (AD_CB >> 16);
// Handle carry from lower 32 bits to upper part of result.
uint32_t ad_cb_temp = AD_CB << 16;
uint32_t product_lo = BD + ad_cb_temp;
if (product_lo < BD)
product_hi++;
#ifndef FIXMATH_NO_OVERFLOW
// The upper 17 bits should all be zero.
if (product_hi >> 15)
return (fix16_t)FIX16_OVERFLOW;
#endif
#ifdef FIXMATH_NO_ROUNDING
fix16_t result = (fix16_t)((product_hi << 16) | (product_lo >> 16));
if ((inArg0 < 0) != (inArg1 < 0))
result = -result;
return result;
#else
// Adding 0x8000 (= 0.5) and then using right shift
// achieves proper rounding to result.
// Handle carry from lower to upper part.
uint32_t product_lo_tmp = product_lo;
product_lo += 0x8000;
if (product_lo < product_lo_tmp)
product_hi++;
// Discard the lowest 16 bits and convert back to signed result.
fix16_t result = (fix16_t)((product_hi << 16) | (product_lo >> 16));
if ((inArg0 < 0) != (inArg1 < 0))
result = -result;
return result;
#endif
}
static fix16_t fix16_div(fix16_t a, fix16_t b) {
// This uses the basic binary restoring division algorithm.
// It appears to be faster to do the whole division manually than
// trying to compose a 64-bit divide out of 32-bit divisions on
// platforms without hardware divide.
if (b == 0)
return (fix16_t)FIX16_MINIMUM;
uint32_t remainder = (uint32_t)((a >= 0) ? a : (-a));
uint32_t divider = (uint32_t)((b >= 0) ? b : (-b));
uint32_t quotient = 0;
uint32_t bit = 0x10000;
/* The algorithm requires D >= R */
while (divider < remainder) {
divider <<= 1;
bit <<= 1;
}
#ifndef FIXMATH_NO_OVERFLOW
if (!bit)
return (fix16_t)FIX16_OVERFLOW;
#endif
if (divider & 0x80000000) {
// Perform one step manually to avoid overflows later.
// We know that divider's bottom bit is 0 here.
if (remainder >= divider) {
quotient |= bit;
remainder -= divider;
}
divider >>= 1;
bit >>= 1;
}
/* Main division loop */
while (bit && remainder) {
if (remainder >= divider) {
quotient |= bit;
remainder -= divider;
}
remainder <<= 1;
bit >>= 1;
}
#ifndef FIXMATH_NO_ROUNDING
if (remainder >= divider) {
quotient++;
}
#endif
fix16_t result = (fix16_t)quotient;
/* Figure out the sign of result */
if ((a < 0) != (b < 0)) {
#ifndef FIXMATH_NO_OVERFLOW
if (result == FIX16_MINIMUM)
return (fix16_t)FIX16_OVERFLOW;
#endif
result = -result;
}
return result;
}
static fix16_t fix16_sqrt(fix16_t x) {
// It is assumed that x is not negative
uint32_t num = (uint32_t)x;
uint32_t result = 0;
uint32_t bit;
uint8_t n;
bit = (uint32_t)1 << 30;
while (bit > num)
bit >>= 2;
// The main part is executed twice, in order to avoid
// using 64 bit values in computations.
for (n = 0; n < 2; n++) {
// First we get the top 24 bits of the answer.
while (bit) {
if (num >= result + bit) {
num -= result + bit;
result = (result >> 1) + bit;
} else {
result = (result >> 1);
}
bit >>= 2;
}
if (n == 0) {
// Then process it again to get the lowest 8 bits.
if (num > 65535) {
// The remainder 'num' is too large to be shifted left
// by 16, so we have to add 1 to result manually and
// adjust 'num' accordingly.
// num = a - (result + 0.5)^2
// = num + result^2 - (result + 0.5)^2
// = num - result - 0.5
num -= result;
num = (num << 16) - 0x8000;
result = (result << 16) + 0x8000;
} else {
num <<= 16;
result <<= 16;
}
bit = 1 << 14;
}
}
#ifndef FIXMATH_NO_ROUNDING
// Finally, if next bit would have been 1, round the result upwards.
if (num > result) {
result++;
}
#endif
return (fix16_t)result;
}
static fix16_t fix16_exp(fix16_t x) {
// Function to approximate exp(); optimized more for code size than speed
// exp(x) for x = +/- {1, 1/8, 1/64, 1/512}
#define NUM_EXP_VALUES 4
static const fix16_t exp_pos_values[NUM_EXP_VALUES] = {
F16(2.7182818), F16(1.1331485), F16(1.0157477), F16(1.0019550)};
static const fix16_t exp_neg_values[NUM_EXP_VALUES] = {
F16(0.3678794), F16(0.8824969), F16(0.9844964), F16(0.9980488)};
const fix16_t* exp_values;
fix16_t res, arg;
uint16_t i;
if (x >= F16(10.3972))
return FIX16_MAXIMUM;
if (x <= F16(-11.7835))
return 0;
if (x < 0) {
x = -x;
exp_values = exp_neg_values;
} else {
exp_values = exp_pos_values;
}
res = FIX16_ONE;
arg = FIX16_ONE;
for (i = 0; i < NUM_EXP_VALUES; i++) {
while (x >= arg) {
res = fix16_mul(res, exp_values[i]);
x -= arg;
}
arg >>= 3;
}
return res;
}
static void VocAlgorithm__init_instances(VocAlgorithmParams* params);
static void
VocAlgorithm__mean_variance_estimator__init(VocAlgorithmParams* params);
static void VocAlgorithm__mean_variance_estimator___init_instances(
VocAlgorithmParams* params);
static void VocAlgorithm__mean_variance_estimator__set_parameters(
VocAlgorithmParams* params, fix16_t std_initial,
fix16_t tau_mean_variance_hours, fix16_t gating_max_duration_minutes);
static void
VocAlgorithm__mean_variance_estimator__set_states(VocAlgorithmParams* params,
fix16_t mean, fix16_t std,
fix16_t uptime_gamma);
static fix16_t
VocAlgorithm__mean_variance_estimator__get_std(VocAlgorithmParams* params);
static fix16_t
VocAlgorithm__mean_variance_estimator__get_mean(VocAlgorithmParams* params);
static void VocAlgorithm__mean_variance_estimator___calculate_gamma(
VocAlgorithmParams* params, fix16_t voc_index_from_prior);
static void VocAlgorithm__mean_variance_estimator__process(
VocAlgorithmParams* params, fix16_t sraw, fix16_t voc_index_from_prior);
static void VocAlgorithm__mean_variance_estimator___sigmoid__init(
VocAlgorithmParams* params);
static void VocAlgorithm__mean_variance_estimator___sigmoid__set_parameters(
VocAlgorithmParams* params, fix16_t L, fix16_t X0, fix16_t K);
static fix16_t VocAlgorithm__mean_variance_estimator___sigmoid__process(
VocAlgorithmParams* params, fix16_t sample);
static void VocAlgorithm__mox_model__init(VocAlgorithmParams* params);
static void VocAlgorithm__mox_model__set_parameters(VocAlgorithmParams* params,
fix16_t SRAW_STD,
fix16_t SRAW_MEAN);
static fix16_t VocAlgorithm__mox_model__process(VocAlgorithmParams* params,
fix16_t sraw);
static void VocAlgorithm__sigmoid_scaled__init(VocAlgorithmParams* params);
static void
VocAlgorithm__sigmoid_scaled__set_parameters(VocAlgorithmParams* params,
fix16_t offset);
static fix16_t VocAlgorithm__sigmoid_scaled__process(VocAlgorithmParams* params,
fix16_t sample);
static void VocAlgorithm__adaptive_lowpass__init(VocAlgorithmParams* params);
static void
VocAlgorithm__adaptive_lowpass__set_parameters(VocAlgorithmParams* params);
static fix16_t
VocAlgorithm__adaptive_lowpass__process(VocAlgorithmParams* params,
fix16_t sample);
void VocAlgorithm_init(VocAlgorithmParams* params) {
params->mVoc_Index_Offset = F16(VocAlgorithm_VOC_INDEX_OFFSET_DEFAULT);
params->mTau_Mean_Variance_Hours =
F16(VocAlgorithm_TAU_MEAN_VARIANCE_HOURS);
params->mGating_Max_Duration_Minutes =
F16(VocAlgorithm_GATING_MAX_DURATION_MINUTES);
params->mSraw_Std_Initial = F16(VocAlgorithm_SRAW_STD_INITIAL);
params->mUptime = F16(0.);
params->mSraw = F16(0.);
params->mVoc_Index = 0;
VocAlgorithm__init_instances(params);
}
static void VocAlgorithm__init_instances(VocAlgorithmParams* params) {
VocAlgorithm__mean_variance_estimator__init(params);
VocAlgorithm__mean_variance_estimator__set_parameters(
params, params->mSraw_Std_Initial, params->mTau_Mean_Variance_Hours,
params->mGating_Max_Duration_Minutes);
VocAlgorithm__mox_model__init(params);
VocAlgorithm__mox_model__set_parameters(
params, VocAlgorithm__mean_variance_estimator__get_std(params),
VocAlgorithm__mean_variance_estimator__get_mean(params));
VocAlgorithm__sigmoid_scaled__init(params);
VocAlgorithm__sigmoid_scaled__set_parameters(params,
params->mVoc_Index_Offset);
VocAlgorithm__adaptive_lowpass__init(params);
VocAlgorithm__adaptive_lowpass__set_parameters(params);
}
void VocAlgorithm_get_states(VocAlgorithmParams* params, int32_t* state0,
int32_t* state1) {
*state0 = VocAlgorithm__mean_variance_estimator__get_mean(params);
*state1 = VocAlgorithm__mean_variance_estimator__get_std(params);
return;
}
void VocAlgorithm_set_states(VocAlgorithmParams* params, int32_t state0,
int32_t state1) {
VocAlgorithm__mean_variance_estimator__set_states(
params, state0, state1, F16(VocAlgorithm_PERSISTENCE_UPTIME_GAMMA));
params->mSraw = state0;
}
void VocAlgorithm_set_tuning_parameters(VocAlgorithmParams* params,
int32_t voc_index_offset,
int32_t learning_time_hours,
int32_t gating_max_duration_minutes,
int32_t std_initial) {
params->mVoc_Index_Offset = (fix16_from_int(voc_index_offset));
params->mTau_Mean_Variance_Hours = (fix16_from_int(learning_time_hours));
params->mGating_Max_Duration_Minutes =
(fix16_from_int(gating_max_duration_minutes));
params->mSraw_Std_Initial = (fix16_from_int(std_initial));
VocAlgorithm__init_instances(params);
}
void VocAlgorithm_process(VocAlgorithmParams* params, int32_t sraw,
int32_t* voc_index) {
if ((params->mUptime <= F16(VocAlgorithm_INITIAL_BLACKOUT))) {
params->mUptime =
(params->mUptime + F16(VocAlgorithm_SAMPLING_INTERVAL));
} else {
if (((sraw > 0) && (sraw < 65000))) {
if ((sraw < 20001)) {
sraw = 20001;
} else if ((sraw > 52767)) {
sraw = 52767;
}
params->mSraw = (fix16_from_int((sraw - 20000)));
}
params->mVoc_Index =
VocAlgorithm__mox_model__process(params, params->mSraw);
params->mVoc_Index =
VocAlgorithm__sigmoid_scaled__process(params, params->mVoc_Index);
params->mVoc_Index =
VocAlgorithm__adaptive_lowpass__process(params, params->mVoc_Index);
if ((params->mVoc_Index < F16(0.5))) {
params->mVoc_Index = F16(0.5);
}
if ((params->mSraw > F16(0.))) {
VocAlgorithm__mean_variance_estimator__process(
params, params->mSraw, params->mVoc_Index);
VocAlgorithm__mox_model__set_parameters(
params, VocAlgorithm__mean_variance_estimator__get_std(params),
VocAlgorithm__mean_variance_estimator__get_mean(params));
}
}
*voc_index = (fix16_cast_to_int((params->mVoc_Index + F16(0.5))));
return;
}
static void
VocAlgorithm__mean_variance_estimator__init(VocAlgorithmParams* params) {
VocAlgorithm__mean_variance_estimator__set_parameters(params, F16(0.),
F16(0.), F16(0.));
VocAlgorithm__mean_variance_estimator___init_instances(params);
}
static void VocAlgorithm__mean_variance_estimator___init_instances(
VocAlgorithmParams* params) {
VocAlgorithm__mean_variance_estimator___sigmoid__init(params);
}
static void VocAlgorithm__mean_variance_estimator__set_parameters(
VocAlgorithmParams* params, fix16_t std_initial,
fix16_t tau_mean_variance_hours, fix16_t gating_max_duration_minutes) {
params->m_Mean_Variance_Estimator__Gating_Max_Duration_Minutes =
gating_max_duration_minutes;
params->m_Mean_Variance_Estimator___Initialized = false;
params->m_Mean_Variance_Estimator___Mean = F16(0.);
params->m_Mean_Variance_Estimator___Sraw_Offset = F16(0.);
params->m_Mean_Variance_Estimator___Std = std_initial;
params->m_Mean_Variance_Estimator___Gamma =
(fix16_div(F16((VocAlgorithm_MEAN_VARIANCE_ESTIMATOR__GAMMA_SCALING *
(VocAlgorithm_SAMPLING_INTERVAL / 3600.))),
(tau_mean_variance_hours +
F16((VocAlgorithm_SAMPLING_INTERVAL / 3600.)))));
params->m_Mean_Variance_Estimator___Gamma_Initial_Mean =
F16(((VocAlgorithm_MEAN_VARIANCE_ESTIMATOR__GAMMA_SCALING *
VocAlgorithm_SAMPLING_INTERVAL) /
(VocAlgorithm_TAU_INITIAL_MEAN + VocAlgorithm_SAMPLING_INTERVAL)));
params->m_Mean_Variance_Estimator___Gamma_Initial_Variance = F16(
((VocAlgorithm_MEAN_VARIANCE_ESTIMATOR__GAMMA_SCALING *
VocAlgorithm_SAMPLING_INTERVAL) /
(VocAlgorithm_TAU_INITIAL_VARIANCE + VocAlgorithm_SAMPLING_INTERVAL)));
params->m_Mean_Variance_Estimator__Gamma_Mean = F16(0.);
params->m_Mean_Variance_Estimator__Gamma_Variance = F16(0.);
params->m_Mean_Variance_Estimator___Uptime_Gamma = F16(0.);
params->m_Mean_Variance_Estimator___Uptime_Gating = F16(0.);
params->m_Mean_Variance_Estimator___Gating_Duration_Minutes = F16(0.);
}
static void
VocAlgorithm__mean_variance_estimator__set_states(VocAlgorithmParams* params,
fix16_t mean, fix16_t std,
fix16_t uptime_gamma) {
params->m_Mean_Variance_Estimator___Mean = mean;
params->m_Mean_Variance_Estimator___Std = std;
params->m_Mean_Variance_Estimator___Uptime_Gamma = uptime_gamma;
params->m_Mean_Variance_Estimator___Initialized = true;
}
static fix16_t
VocAlgorithm__mean_variance_estimator__get_std(VocAlgorithmParams* params) {
return params->m_Mean_Variance_Estimator___Std;
}
static fix16_t
VocAlgorithm__mean_variance_estimator__get_mean(VocAlgorithmParams* params) {
return (params->m_Mean_Variance_Estimator___Mean +
params->m_Mean_Variance_Estimator___Sraw_Offset);
}
static void VocAlgorithm__mean_variance_estimator___calculate_gamma(
VocAlgorithmParams* params, fix16_t voc_index_from_prior) {
fix16_t uptime_limit;
fix16_t sigmoid_gamma_mean;
fix16_t gamma_mean;
fix16_t gating_threshold_mean;
fix16_t sigmoid_gating_mean;
fix16_t sigmoid_gamma_variance;
fix16_t gamma_variance;
fix16_t gating_threshold_variance;
fix16_t sigmoid_gating_variance;
uptime_limit = F16((VocAlgorithm_MEAN_VARIANCE_ESTIMATOR__FIX16_MAX -
VocAlgorithm_SAMPLING_INTERVAL));
if ((params->m_Mean_Variance_Estimator___Uptime_Gamma < uptime_limit)) {
params->m_Mean_Variance_Estimator___Uptime_Gamma =
(params->m_Mean_Variance_Estimator___Uptime_Gamma +
F16(VocAlgorithm_SAMPLING_INTERVAL));
}
if ((params->m_Mean_Variance_Estimator___Uptime_Gating < uptime_limit)) {
params->m_Mean_Variance_Estimator___Uptime_Gating =
(params->m_Mean_Variance_Estimator___Uptime_Gating +
F16(VocAlgorithm_SAMPLING_INTERVAL));
}
VocAlgorithm__mean_variance_estimator___sigmoid__set_parameters(
params, F16(1.), F16(VocAlgorithm_INIT_DURATION_MEAN),
F16(VocAlgorithm_INIT_TRANSITION_MEAN));
sigmoid_gamma_mean =
VocAlgorithm__mean_variance_estimator___sigmoid__process(
params, params->m_Mean_Variance_Estimator___Uptime_Gamma);
gamma_mean =
(params->m_Mean_Variance_Estimator___Gamma +
(fix16_mul((params->m_Mean_Variance_Estimator___Gamma_Initial_Mean -
params->m_Mean_Variance_Estimator___Gamma),
sigmoid_gamma_mean)));
gating_threshold_mean =
(F16(VocAlgorithm_GATING_THRESHOLD) +
(fix16_mul(
F16((VocAlgorithm_GATING_THRESHOLD_INITIAL -
VocAlgorithm_GATING_THRESHOLD)),
VocAlgorithm__mean_variance_estimator___sigmoid__process(
params, params->m_Mean_Variance_Estimator___Uptime_Gating))));
VocAlgorithm__mean_variance_estimator___sigmoid__set_parameters(
params, F16(1.), gating_threshold_mean,
F16(VocAlgorithm_GATING_THRESHOLD_TRANSITION));
sigmoid_gating_mean =
VocAlgorithm__mean_variance_estimator___sigmoid__process(
params, voc_index_from_prior);
params->m_Mean_Variance_Estimator__Gamma_Mean =
(fix16_mul(sigmoid_gating_mean, gamma_mean));
VocAlgorithm__mean_variance_estimator___sigmoid__set_parameters(
params, F16(1.), F16(VocAlgorithm_INIT_DURATION_VARIANCE),
F16(VocAlgorithm_INIT_TRANSITION_VARIANCE));
sigmoid_gamma_variance =
VocAlgorithm__mean_variance_estimator___sigmoid__process(
params, params->m_Mean_Variance_Estimator___Uptime_Gamma);
gamma_variance =
(params->m_Mean_Variance_Estimator___Gamma +
(fix16_mul(
(params->m_Mean_Variance_Estimator___Gamma_Initial_Variance -
params->m_Mean_Variance_Estimator___Gamma),
(sigmoid_gamma_variance - sigmoid_gamma_mean))));
gating_threshold_variance =
(F16(VocAlgorithm_GATING_THRESHOLD) +
(fix16_mul(
F16((VocAlgorithm_GATING_THRESHOLD_INITIAL -
VocAlgorithm_GATING_THRESHOLD)),
VocAlgorithm__mean_variance_estimator___sigmoid__process(
params, params->m_Mean_Variance_Estimator___Uptime_Gating))));
VocAlgorithm__mean_variance_estimator___sigmoid__set_parameters(
params, F16(1.), gating_threshold_variance,
F16(VocAlgorithm_GATING_THRESHOLD_TRANSITION));
sigmoid_gating_variance =
VocAlgorithm__mean_variance_estimator___sigmoid__process(
params, voc_index_from_prior);
params->m_Mean_Variance_Estimator__Gamma_Variance =
(fix16_mul(sigmoid_gating_variance, gamma_variance));
params->m_Mean_Variance_Estimator___Gating_Duration_Minutes =
(params->m_Mean_Variance_Estimator___Gating_Duration_Minutes +
(fix16_mul(F16((VocAlgorithm_SAMPLING_INTERVAL / 60.)),
((fix16_mul((F16(1.) - sigmoid_gating_mean),
F16((1. + VocAlgorithm_GATING_MAX_RATIO)))) -
F16(VocAlgorithm_GATING_MAX_RATIO)))));
if ((params->m_Mean_Variance_Estimator___Gating_Duration_Minutes <
F16(0.))) {
params->m_Mean_Variance_Estimator___Gating_Duration_Minutes = F16(0.);
}
if ((params->m_Mean_Variance_Estimator___Gating_Duration_Minutes >
params->m_Mean_Variance_Estimator__Gating_Max_Duration_Minutes)) {
params->m_Mean_Variance_Estimator___Uptime_Gating = F16(0.);
}
}
static void VocAlgorithm__mean_variance_estimator__process(
VocAlgorithmParams* params, fix16_t sraw, fix16_t voc_index_from_prior) {
fix16_t delta_sgp;
fix16_t c;
fix16_t additional_scaling;
if ((params->m_Mean_Variance_Estimator___Initialized == false)) {
params->m_Mean_Variance_Estimator___Initialized = true;
params->m_Mean_Variance_Estimator___Sraw_Offset = sraw;
params->m_Mean_Variance_Estimator___Mean = F16(0.);
} else {
if (((params->m_Mean_Variance_Estimator___Mean >= F16(100.)) ||
(params->m_Mean_Variance_Estimator___Mean <= F16(-100.)))) {
params->m_Mean_Variance_Estimator___Sraw_Offset =
(params->m_Mean_Variance_Estimator___Sraw_Offset +
params->m_Mean_Variance_Estimator___Mean);
params->m_Mean_Variance_Estimator___Mean = F16(0.);
}
sraw = (sraw - params->m_Mean_Variance_Estimator___Sraw_Offset);
VocAlgorithm__mean_variance_estimator___calculate_gamma(
params, voc_index_from_prior);
delta_sgp = (fix16_div(
(sraw - params->m_Mean_Variance_Estimator___Mean),
F16(VocAlgorithm_MEAN_VARIANCE_ESTIMATOR__GAMMA_SCALING)));
if ((delta_sgp < F16(0.))) {
c = (params->m_Mean_Variance_Estimator___Std - delta_sgp);
} else {
c = (params->m_Mean_Variance_Estimator___Std + delta_sgp);
}
additional_scaling = F16(1.);
if ((c > F16(1440.))) {
additional_scaling = F16(4.);
}
params->m_Mean_Variance_Estimator___Std = (fix16_mul(
fix16_sqrt((fix16_mul(
additional_scaling,
(F16(VocAlgorithm_MEAN_VARIANCE_ESTIMATOR__GAMMA_SCALING) -
params->m_Mean_Variance_Estimator__Gamma_Variance)))),
fix16_sqrt((
(fix16_mul(
params->m_Mean_Variance_Estimator___Std,
(fix16_div(
params->m_Mean_Variance_Estimator___Std,
(fix16_mul(
F16(VocAlgorithm_MEAN_VARIANCE_ESTIMATOR__GAMMA_SCALING),
additional_scaling)))))) +
(fix16_mul(
(fix16_div(
(fix16_mul(
params->m_Mean_Variance_Estimator__Gamma_Variance,
delta_sgp)),
additional_scaling)),
delta_sgp))))));
params->m_Mean_Variance_Estimator___Mean =
(params->m_Mean_Variance_Estimator___Mean +
(fix16_mul(params->m_Mean_Variance_Estimator__Gamma_Mean,
delta_sgp)));
}
}
static void VocAlgorithm__mean_variance_estimator___sigmoid__init(
VocAlgorithmParams* params) {
VocAlgorithm__mean_variance_estimator___sigmoid__set_parameters(
params, F16(0.), F16(0.), F16(0.));
}
static void VocAlgorithm__mean_variance_estimator___sigmoid__set_parameters(
VocAlgorithmParams* params, fix16_t L, fix16_t X0, fix16_t K) {
params->m_Mean_Variance_Estimator___Sigmoid__L = L;
params->m_Mean_Variance_Estimator___Sigmoid__K = K;
params->m_Mean_Variance_Estimator___Sigmoid__X0 = X0;
}
static fix16_t VocAlgorithm__mean_variance_estimator___sigmoid__process(
VocAlgorithmParams* params, fix16_t sample) {
fix16_t x;
x = (fix16_mul(params->m_Mean_Variance_Estimator___Sigmoid__K,
(sample - params->m_Mean_Variance_Estimator___Sigmoid__X0)));
if ((x < F16(-50.))) {
return params->m_Mean_Variance_Estimator___Sigmoid__L;
} else if ((x > F16(50.))) {
return F16(0.);
} else {
return (fix16_div(params->m_Mean_Variance_Estimator___Sigmoid__L,
(F16(1.) + fix16_exp(x))));
}
}
static void VocAlgorithm__mox_model__init(VocAlgorithmParams* params) {
VocAlgorithm__mox_model__set_parameters(params, F16(1.), F16(0.));
}
static void VocAlgorithm__mox_model__set_parameters(VocAlgorithmParams* params,
fix16_t SRAW_STD,
fix16_t SRAW_MEAN) {
params->m_Mox_Model__Sraw_Std = SRAW_STD;
params->m_Mox_Model__Sraw_Mean = SRAW_MEAN;
}
static fix16_t VocAlgorithm__mox_model__process(VocAlgorithmParams* params,
fix16_t sraw) {
return (fix16_mul((fix16_div((sraw - params->m_Mox_Model__Sraw_Mean),
(-(params->m_Mox_Model__Sraw_Std +
F16(VocAlgorithm_SRAW_STD_BONUS))))),
F16(VocAlgorithm_VOC_INDEX_GAIN)));
}
static void VocAlgorithm__sigmoid_scaled__init(VocAlgorithmParams* params) {
VocAlgorithm__sigmoid_scaled__set_parameters(params, F16(0.));
}
static void
VocAlgorithm__sigmoid_scaled__set_parameters(VocAlgorithmParams* params,
fix16_t offset) {
params->m_Sigmoid_Scaled__Offset = offset;
}
static fix16_t VocAlgorithm__sigmoid_scaled__process(VocAlgorithmParams* params,
fix16_t sample) {
fix16_t x;
fix16_t shift;
x = (fix16_mul(F16(VocAlgorithm_SIGMOID_K),
(sample - F16(VocAlgorithm_SIGMOID_X0))));
if ((x < F16(-50.))) {
return F16(VocAlgorithm_SIGMOID_L);
} else if ((x > F16(50.))) {
return F16(0.);
} else {
if ((sample >= F16(0.))) {
shift = (fix16_div(
(F16(VocAlgorithm_SIGMOID_L) -
(fix16_mul(F16(5.), params->m_Sigmoid_Scaled__Offset))),
F16(4.)));
return ((fix16_div((F16(VocAlgorithm_SIGMOID_L) + shift),
(F16(1.) + fix16_exp(x)))) -
shift);
} else {
return (fix16_mul(
(fix16_div(params->m_Sigmoid_Scaled__Offset,
F16(VocAlgorithm_VOC_INDEX_OFFSET_DEFAULT))),
(fix16_div(F16(VocAlgorithm_SIGMOID_L),
(F16(1.) + fix16_exp(x))))));
}
}
}
static void VocAlgorithm__adaptive_lowpass__init(VocAlgorithmParams* params) {
VocAlgorithm__adaptive_lowpass__set_parameters(params);
}
static void
VocAlgorithm__adaptive_lowpass__set_parameters(VocAlgorithmParams* params) {
params->m_Adaptive_Lowpass__A1 =
F16((VocAlgorithm_SAMPLING_INTERVAL /
(VocAlgorithm_LP_TAU_FAST + VocAlgorithm_SAMPLING_INTERVAL)));
params->m_Adaptive_Lowpass__A2 =
F16((VocAlgorithm_SAMPLING_INTERVAL /
(VocAlgorithm_LP_TAU_SLOW + VocAlgorithm_SAMPLING_INTERVAL)));
params->m_Adaptive_Lowpass___Initialized = false;
}
static fix16_t
VocAlgorithm__adaptive_lowpass__process(VocAlgorithmParams* params,
fix16_t sample) {
fix16_t abs_delta;
fix16_t F1;
fix16_t tau_a;
fix16_t a3;
if ((params->m_Adaptive_Lowpass___Initialized == false)) {
params->m_Adaptive_Lowpass___X1 = sample;
params->m_Adaptive_Lowpass___X2 = sample;
params->m_Adaptive_Lowpass___X3 = sample;
params->m_Adaptive_Lowpass___Initialized = true;
}
params->m_Adaptive_Lowpass___X1 =
((fix16_mul((F16(1.) - params->m_Adaptive_Lowpass__A1),
params->m_Adaptive_Lowpass___X1)) +
(fix16_mul(params->m_Adaptive_Lowpass__A1, sample)));
params->m_Adaptive_Lowpass___X2 =
((fix16_mul((F16(1.) - params->m_Adaptive_Lowpass__A2),
params->m_Adaptive_Lowpass___X2)) +
(fix16_mul(params->m_Adaptive_Lowpass__A2, sample)));
abs_delta =
(params->m_Adaptive_Lowpass___X1 - params->m_Adaptive_Lowpass___X2);
if ((abs_delta < F16(0.))) {
abs_delta = (-abs_delta);
}
F1 = fix16_exp((fix16_mul(F16(VocAlgorithm_LP_ALPHA), abs_delta)));
tau_a =
((fix16_mul(F16((VocAlgorithm_LP_TAU_SLOW - VocAlgorithm_LP_TAU_FAST)),
F1)) +
F16(VocAlgorithm_LP_TAU_FAST));
a3 = (fix16_div(F16(VocAlgorithm_SAMPLING_INTERVAL),
(F16(VocAlgorithm_SAMPLING_INTERVAL) + tau_a)));
params->m_Adaptive_Lowpass___X3 =
((fix16_mul((F16(1.) - a3), params->m_Adaptive_Lowpass___X3)) +
(fix16_mul(a3, sample)));
return params->m_Adaptive_Lowpass___X3;
}

View File

@ -0,0 +1,182 @@
/*
* Copyright (c) 2020, Sensirion AG
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of Sensirion AG nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef VOCALGORITHM_H_
#define VOCALGORITHM_H_
#include "sensirion_arch_config.h"
/* The fixed point arithmetic parts of this code were originally created by
* https://github.com/PetteriAimonen/libfixmath
*/
typedef int32_t fix16_t;
#define F16(x) \
((fix16_t)(((x) >= 0) ? ((x)*65536.0 + 0.5) : ((x)*65536.0 - 0.5)))
#define VocAlgorithm_SAMPLING_INTERVAL (1.)
#define VocAlgorithm_INITIAL_BLACKOUT (45.)
#define VocAlgorithm_VOC_INDEX_GAIN (230.)
#define VocAlgorithm_SRAW_STD_INITIAL (50.)
#define VocAlgorithm_SRAW_STD_BONUS (220.)
#define VocAlgorithm_TAU_MEAN_VARIANCE_HOURS (12.)
#define VocAlgorithm_TAU_INITIAL_MEAN (20.)
#define VocAlgorithm_INIT_DURATION_MEAN ((3600. * 0.75))
#define VocAlgorithm_INIT_TRANSITION_MEAN (0.01)
#define VocAlgorithm_TAU_INITIAL_VARIANCE (2500.)
#define VocAlgorithm_INIT_DURATION_VARIANCE ((3600. * 1.45))
#define VocAlgorithm_INIT_TRANSITION_VARIANCE (0.01)
#define VocAlgorithm_GATING_THRESHOLD (340.)
#define VocAlgorithm_GATING_THRESHOLD_INITIAL (510.)
#define VocAlgorithm_GATING_THRESHOLD_TRANSITION (0.09)
#define VocAlgorithm_GATING_MAX_DURATION_MINUTES ((60. * 3.))
#define VocAlgorithm_GATING_MAX_RATIO (0.3)
#define VocAlgorithm_SIGMOID_L (500.)
#define VocAlgorithm_SIGMOID_K (-0.0065)
#define VocAlgorithm_SIGMOID_X0 (213.)
#define VocAlgorithm_VOC_INDEX_OFFSET_DEFAULT (100.)
#define VocAlgorithm_LP_TAU_FAST (20.0)
#define VocAlgorithm_LP_TAU_SLOW (500.0)
#define VocAlgorithm_LP_ALPHA (-0.2)
#define VocAlgorithm_PERSISTENCE_UPTIME_GAMMA ((3. * 3600.))
#define VocAlgorithm_MEAN_VARIANCE_ESTIMATOR__GAMMA_SCALING (64.)
#define VocAlgorithm_MEAN_VARIANCE_ESTIMATOR__FIX16_MAX (32767.)
/**
* Struct to hold all the states of the VOC algorithm.
*/
typedef struct {
fix16_t mVoc_Index_Offset;
fix16_t mTau_Mean_Variance_Hours;
fix16_t mGating_Max_Duration_Minutes;
fix16_t mSraw_Std_Initial;
fix16_t mUptime;
fix16_t mSraw;
fix16_t mVoc_Index;
fix16_t m_Mean_Variance_Estimator__Gating_Max_Duration_Minutes;
bool m_Mean_Variance_Estimator___Initialized;
fix16_t m_Mean_Variance_Estimator___Mean;
fix16_t m_Mean_Variance_Estimator___Sraw_Offset;
fix16_t m_Mean_Variance_Estimator___Std;
fix16_t m_Mean_Variance_Estimator___Gamma;
fix16_t m_Mean_Variance_Estimator___Gamma_Initial_Mean;
fix16_t m_Mean_Variance_Estimator___Gamma_Initial_Variance;
fix16_t m_Mean_Variance_Estimator__Gamma_Mean;
fix16_t m_Mean_Variance_Estimator__Gamma_Variance;
fix16_t m_Mean_Variance_Estimator___Uptime_Gamma;
fix16_t m_Mean_Variance_Estimator___Uptime_Gating;
fix16_t m_Mean_Variance_Estimator___Gating_Duration_Minutes;
fix16_t m_Mean_Variance_Estimator___Sigmoid__L;
fix16_t m_Mean_Variance_Estimator___Sigmoid__K;
fix16_t m_Mean_Variance_Estimator___Sigmoid__X0;
fix16_t m_Mox_Model__Sraw_Std;
fix16_t m_Mox_Model__Sraw_Mean;
fix16_t m_Sigmoid_Scaled__Offset;
fix16_t m_Adaptive_Lowpass__A1;
fix16_t m_Adaptive_Lowpass__A2;
bool m_Adaptive_Lowpass___Initialized;
fix16_t m_Adaptive_Lowpass___X1;
fix16_t m_Adaptive_Lowpass___X2;
fix16_t m_Adaptive_Lowpass___X3;
} VocAlgorithmParams;
/**
* Initialize the VOC algorithm parameters. Call this once at the beginning or
* whenever the sensor stopped measurements.
* @param params Pointer to the VocAlgorithmParams struct
*/
void VocAlgorithm_init(VocAlgorithmParams *params);
/**
* Get current algorithm states. Retrieved values can be used in
* VocAlgorithm_set_states() to resume operation after a short interruption,
* skipping initial learning phase. This feature can only be used after at least
* 3 hours of continuous operation.
* @param params Pointer to the VocAlgorithmParams struct
* @param state0 State0 to be stored
* @param state1 State1 to be stored
*/
void VocAlgorithm_get_states(VocAlgorithmParams *params, int32_t *state0,
int32_t *state1);
/**
* Set previously retrieved algorithm states to resume operation after a short
* interruption, skipping initial learning phase. This feature should not be
* used after inerruptions of more than 10 minutes. Call this once after
* VocAlgorithm_init() and the optional VocAlgorithm_set_tuning_parameters(), if
* desired. Otherwise, the algorithm will start with initial learning phase.
* @param params Pointer to the VocAlgorithmParams struct
* @param state0 State0 to be restored
* @param state1 State1 to be restored
*/
void VocAlgorithm_set_states(VocAlgorithmParams *params, int32_t state0,
int32_t state1);
/**
* Set parameters to customize the VOC algorithm. Call this once after
* VocAlgorithm_init(), if desired. Otherwise, the default values will be used.
*
* @param params Pointer to the VocAlgorithmParams struct
* @param voc_index_offset VOC index representing typical (average)
* conditions. Range 1..250, default 100
* @param learning_time_hours Time constant of long-term estimator.
* Past events will be forgotten after about
* twice the learning time.
* Range 1..72 [hours], default 12 [hours]
* @param gating_max_duration_minutes Maximum duration of gating (freeze of
* estimator during high VOC index signal).
* 0 (no gating) or range 1..720 [minutes],
* default 180 [minutes]
* @param std_initial Initial estimate for standard deviation.
* Lower value boosts events during initial
* learning period, but may result in larger
* device-to-device variations.
* Range 10..500, default 50
*/
void VocAlgorithm_set_tuning_parameters(VocAlgorithmParams *params,
int32_t voc_index_offset,
int32_t learning_time_hours,
int32_t gating_max_duration_minutes,
int32_t std_initial);
/**
* Calculate the VOC index value from the raw sensor value.
*
* @param params Pointer to the VocAlgorithmParams struct
* @param sraw Raw value from the SGP40 sensor
* @param voc_index Calculated VOC index value from the raw sensor value. Zero
* during initial blackout period and 1..500 afterwards
*/
void VocAlgorithm_process(VocAlgorithmParams *params, int32_t sraw,
int32_t *voc_index);
#endif /* VOCALGORITHM_H_ */

View File

@ -2026,12 +2026,13 @@ api_mul(unsigned char *G, size_t Glen,
p256_jacobian P;
(void)curve;
if (Glen != 65) {
return 0;
}
r = p256_decode(&P, G, Glen);
p256_mul(&P, x, xlen);
if (Glen >= 65) {
p256_to_affine(&P);
p256_encode(G, &P);
}
p256_to_affine(&P);
p256_encode(G, &P);
return r;
}
@ -2046,16 +2047,6 @@ api_mulgen(unsigned char *R,
p256_to_affine(&P);
p256_encode(R, &P);
return 65;
/*
const unsigned char *G;
size_t Glen;
G = api_generator(curve, &Glen);
memcpy(R, G, Glen);
api_mul(R, Glen, x, xlen, curve);
return Glen;
*/
}
static uint32_t
@ -2068,6 +2059,9 @@ api_muladd(unsigned char *A, const unsigned char *B, size_t len,
int i;
(void)curve;
if (len != 65) {
return 0;
}
r = p256_decode(&P, A, len);
p256_mul(&P, x, xlen);
if (B == NULL) {

View File

@ -735,11 +735,12 @@ api_mul(unsigned char *G, size_t Glen,
jacobian P;
cc = id_to_curve(curve);
if (Glen != cc->point_len) {
return 0;
}
r = point_decode(&P, G, Glen, cc);
point_mul(&P, x, xlen, cc);
if (Glen == cc->point_len) {
point_encode(G, &P, cc);
}
point_encode(G, &P, cc);
return r;
}
@ -772,6 +773,9 @@ api_muladd(unsigned char *A, const unsigned char *B, size_t len,
*/
cc = id_to_curve(curve);
if (len != cc->point_len) {
return 0;
}
r = point_decode(&P, A, len, cc);
if (B == NULL) {
size_t Glen;

View File

@ -1,113 +1,50 @@
/* pgmspace_bearssl.h - Accessor utilities/types for accessing PROGMEM data */
/* PGMSPACE.H - Accessor utilities/types for accessing PROGMEM data */
//#pragma GCC optimize ("O2") // -Os is the default, forcing -O2 for BearSSL
//#define PGM_READ_UNALIGNED 0 // all calls are aligned, take the optimized version
//#include <sys/pgmspace.h>
#ifndef _PGMSPACE_H_
#define _PGMSPACE_H_
#ifndef _PGMSPACEWRAPPER_H_
#define _PGMSPACEWRAPPER_H_
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifndef ESP32
#ifndef ICACHE_RODATA_ATTR
#define ICACHE_RODATA_ATTR __attribute__((section(".irom.text")))
#endif
#ifndef PROGMEM
// The following two macros cause a parameter to be enclosed in quotes
// by the preopressor (i.e. for concatenating ints to strings)
#define __STRINGIZE_NX(A) #A
#define __STRINGIZE(A) __STRINGIZE_NX(A)
// Since __section__ is supposed to be only use for global variables,
// there could be conflicts when a static/inlined function has them in the
// same file as a non-static PROGMEM object.
// Ref: https://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/Variable-Attributes.html
// Place each progmem object into its own named section, avoiding conflicts
#define PROGMEM __attribute__((section( "\".irom.text." __FILE__ "." __STRINGIZE(__LINE__) "." __STRINGIZE(__COUNTER__) "\"")))
#endif
#endif //ESP32
#ifndef PGM_P
#define PGM_P const char *
#endif
#ifndef PGM_VOID_P
#define PGM_VOID_P const void *
#endif
// PSTR() macro modified to start on a 32-bit boundary. This adds on average
// 1.5 bytes/string, but in return memcpy_P and strcpy_P will work 4~8x faster
#ifndef PSTR
#define PSTR(s) (__extension__({static const char __c[] __attribute__((__aligned__(4))) PROGMEM = (s); &__c[0];}))
#endif
#ifdef ESP8266
// Flash memory must be read using 32 bit aligned addresses else a processor
// exception will be triggered.
// The order within the 32 bit values are:
// --------------
// b3, b2, b1, b0
// w1, w0
#define pgm_read_with_offset(addr, res) \
__asm__ ("extui %0, %1, 0, 2\n" /* Extract offset within word (in bytes) */ \
"sub %1, %1, %0\n" /* Subtract offset from addr, yielding an aligned address */ \
"l32i.n %1, %1, 0x0\n" /* Load word from aligned address */ \
"slli %0, %0, 3\n" /* Mulitiply offset by 8, yielding an offset in bits */ \
"ssr %0\n" /* Prepare to shift by offset (in bits) */ \
"srl %0, %1\n" /* Shift right; now the requested byte is the first one */ \
:"=r"(res), "=r"(addr) \
:"1"(addr) \
:);
#include <sys/pgmspace.h>
static inline uint8_t pgm_read_byte_inlined(const void* addr) {
register uint32_t res;
pgm_read_with_offset(addr, res);
return (uint8_t) res; /* This masks the lower byte from the returned word */
}
#else //!ESP8266
/* Although this says "word", it's actually 16 bit, i.e. half word on Xtensa */
static inline uint16_t pgm_read_word_inlined(const void* addr) {
register uint32_t res;
pgm_read_with_offset(addr, res);
return (uint16_t) res; /* This masks the lower half-word from the returned word */
}
#define pgm_read_byte(addr) pgm_read_byte_inlined(addr)
#define pgm_read_word(addr) pgm_read_word_inlined(addr)
#ifdef __cplusplus
#define pgm_read_dword(addr) (*reinterpret_cast<const uint32_t*>(addr))
#define pgm_read_float(addr) (*reinterpret_cast<const float*>(addr))
#define pgm_read_ptr(addr) (*reinterpret_cast<const void* const *>(addr))
#else
#define pgm_read_dword(addr) (*(const uint32_t*)(addr))
#define pgm_read_float(addr) (*(const float*)(addr))
#define pgm_read_ptr(addr) (*(const void* const*)(addr))
#ifndef ICACHE_RODATA_ATTR
#define ICACHE_RODATA_ATTR
#endif
#else // ESP8266
#ifndef PROGMEM
#define PROGMEM
#endif
#ifndef PGM_P
#define PGM_P const char *
#endif
#ifndef PGM_VOID_P
#define PGM_VOID_P const void *
#endif
#ifndef PSTR
#define PSTR
#endif
#ifdef __cplusplus
#define pgm_read_byte(addr) (*reinterpret_cast<const uint8_t*>(addr))
#define pgm_read_word(addr) (*reinterpret_cast<const uint16_t*>(addr))
#define pgm_read_dword(addr) (*reinterpret_cast<const uint32_t*>(addr))
#define pgm_read_float(addr) (*reinterpret_cast<const float>(addr))
#define pgm_read_ptr(addr) (*reinterpret_cast<const void* const *>(addr))
#define pgm_read_float(addr) (*reinterpret_cast<const float*>(addr))
#define pgm_read_ptr(addr) (*reinterpret_cast<const void const *>(addr))
#else
#define pgm_read_byte(addr) (*(const uint8_t*)(addr))
#define pgm_read_word(addr) (*(const uint16_t*)(addr))
#define pgm_read_dword(addr) (*(const uint32_t*)(addr))
#define pgm_read_float(addr) (*(const float)(addr))
#define pgm_read_ptr(addr) (*(const void* const *)(addr))
#define pgm_read_float(addr) (*(const float*)(addr))
#define pgm_read_ptr(addr) (*(const void const *)(addr))
#endif
#endif // ESP8266
#define pgm_read_byte_near(addr) pgm_read_byte(addr)
#define pgm_read_word_near(addr) pgm_read_word(addr)
#define pgm_read_dword_near(addr) pgm_read_dword(addr)
@ -119,24 +56,9 @@ static inline uint16_t pgm_read_word_inlined(const void* addr) {
#define pgm_read_float_far(addr) pgm_read_float(addr)
#define pgm_read_ptr_far(addr) pgm_read_ptr(addr)
#define _SFR_BYTE(n) (n)
#define memcpy_P memcpy
#define memcmp_P memcmp
#ifdef __PROG_TYPES_COMPAT__
typedef void prog_void;
typedef char prog_char;
typedef unsigned char prog_uchar;
typedef int8_t prog_int8_t;
typedef uint8_t prog_uint8_t;
typedef int16_t prog_int16_t;
typedef uint16_t prog_uint16_t;
typedef int32_t prog_int32_t;
typedef uint32_t prog_uint32_t;
#endif // defined(__PROG_TYPES_COMPAT__)
#ifdef __cplusplus
}
#endif
#endif // !ESP8266
#endif

View File

@ -114,7 +114,7 @@ br_rsa_pss_sig_unpad(const br_hash_class *hf_data,
* in the string.
*/
for (u = 0; u < hash_len; u ++) {
r |= tmp[u] ^ x[(xlen - salt_len - 1) + u];
r |= tmp[u] ^ x[(xlen - hash_len - 1) + u];
}
return EQ0(r);

View File

@ -1232,6 +1232,21 @@ void
br_ssl_engine_close(br_ssl_engine_context *cc)
{
if (!br_ssl_engine_closed(cc)) {
/*
* If we are not already closed, then we need to
* initiate the closure. Once closing, any incoming
* application data is discarded; we should also discard
* application data which is already there but has not
* been acknowledged by the application yet (this mimics
* usual semantics on BSD sockets: you cannot read()
* once you called close(), even if there was some
* unread data already buffered).
*/
size_t len;
if (br_ssl_engine_recvapp_buf(cc, &len) != NULL && len != 0) {
br_ssl_engine_recvapp_ack(cc, len);
}
jump_handshake(cc, 1);
}
}

View File

@ -136,7 +136,7 @@ cbc_decrypt(br_sslrec_in_cbc_context *cc,
/*
* Use the last decrypted byte to compute the actual payload
* length. Take care not to underflow (we use unsigned types).
* length. Take care not to overflow (we use unsigned types).
*/
pad_len = buf[max_len];
good = LE(pad_len, (uint32_t)(max_len - min_len));

View File

@ -137,9 +137,13 @@
#include "t_bearssl_x509.h"
#include "t_bearssl_pem.h"
#ifdef __cplusplus
extern "C" {
#endif
/** \brief Type for a configuration option.
*
* A "t_configuration option" is a value that is selected when the BearSSL
* A "configuration option" is a value that is selected when the BearSSL
* library itself is compiled. Most options are boolean; their value is
* then either 1 (option is enabled) or 0 (option is disabled). Some
* values have other integer values. Option names correspond to macro
@ -167,4 +171,13 @@ typedef struct {
*/
const br_config_option *br_get_config(void);
/* ======================================================================= */
/** \brief Version feature: support for time callback. */
#define BR_FEATURE_X509_TIME_CALLBACK 1
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1251,8 +1251,8 @@ static inline void
br_ssl_engine_set_versions(br_ssl_engine_context *cc,
unsigned version_min, unsigned version_max)
{
cc->version_min = version_min;
cc->version_max = version_max;
cc->version_min = (uint16_t)version_min;
cc->version_max = (uint16_t)version_max;
}
/**
@ -1325,7 +1325,7 @@ br_ssl_engine_set_protocol_names(br_ssl_engine_context *ctx,
const char **names, size_t num)
{
ctx->protocol_names = names;
ctx->protocol_names_num = num;
ctx->protocol_names_num = (uint16_t)num;
}
/**

View File

@ -890,7 +890,10 @@ void br_x509_minimal_init_full(br_x509_minimal_context *ctx,
* - Seconds are counted since midnight, from 0 to 86400 (a count of
* 86400 is possible only if a leap second happened).
*
* The validation date and time is understood in the UTC time zone.
* The validation date and time is understood in the UTC time zone. The
* "Unix Epoch" (January 1st, 1970, 00:00 UTC) corresponds to days=719528
* and seconds=0; the "Windows Epoch" (January 1st, 1601, 00:00 UTC) is
* days=584754, seconds=0.
*
* If the validation date and time are not explicitly set, but BearSSL
* was compiled with support for the system clock on the underlying

View File

@ -325,9 +325,20 @@
* values are documented on:
* https://sourceforge.net/p/predef/wiki/OperatingSystems/
*
* TODO: enrich the list of detected system. Also add detection for
* alternate system calls like getentropy(), which are usually
* preferable when available.
* Win32's CryptGenRandom() should be available on Windows systems.
*
* /dev/urandom should work on all Unix-like systems (including macOS X).
*
* getentropy() is present on Linux (Glibc 2.25+), FreeBSD (12.0+) and
* OpenBSD (5.6+). For OpenBSD, there does not seem to be easy to use
* macros to test the minimum version, so we just assume that it is
* recent enough (last version without getentropy() has gone out of
* support in May 2015).
*
* Ideally we should use getentropy() on macOS (10.12+) too, but I don't
* know how to test the exact OS version with preprocessor macros.
*
* TODO: enrich the list of detected system.
*/
#ifndef BR_USE_URANDOM
@ -344,6 +355,15 @@
#endif
#endif
#ifndef BR_USE_GETENTROPY
#if (defined __linux__ \
&& (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 25))) \
|| (defined __FreeBSD__ && __FreeBSD__ >= 12) \
|| defined __OpenBSD__
#define BR_USE_GETENTROPY 1
#endif
#endif
#ifndef BR_USE_WIN32_RAND
#if defined _WIN32 || defined _WIN64
#define BR_USE_WIN32_RAND 1

View File

@ -525,7 +525,7 @@ static const unsigned char t0_codeblock[] PROGMEM = {
0x00, 0x01, 0x00, 0x0D, 0x00, 0x00, 0x01, 0x00, 0x10, 0x00, 0x00, 0x01,
0x00, 0x11, 0x00, 0x00, 0x01, 0x01, 0x09, 0x00, 0x00, 0x01, 0x01, 0x0A,
0x00, 0x00, 0x24, 0x24, 0x00, 0x00, 0x01,
0x00, 0x00, 0x25, 0x25, 0x00, 0x00, 0x01,
T0_INT1(BR_ERR_X509_BAD_BOOLEAN), 0x00, 0x00, 0x01,
T0_INT1(BR_ERR_X509_BAD_DN), 0x00, 0x00, 0x01,
T0_INT1(BR_ERR_X509_BAD_SERVER_NAME), 0x00, 0x00, 0x01,
@ -563,227 +563,224 @@ static const unsigned char t0_codeblock[] PROGMEM = {
T0_INT2(offsetof(CONTEXT_NAME, next_dn_hash)), 0x00, 0x00, 0x01,
T0_INT2(offsetof(CONTEXT_NAME, num_certs)), 0x00, 0x00, 0x01,
T0_INT2(offsetof(CONTEXT_NAME, pad)), 0x00, 0x00, 0x01,
T0_INT2(offsetof(CONTEXT_NAME, saved_dn_hash)), 0x00, 0x00, 0xC9, 0x71,
0x00, 0x00, 0x01, 0x80, 0x73, 0x00, 0x00, 0x01, 0x80, 0x7C, 0x00, 0x00,
0x01, 0x81, 0x02, 0x00, 0x00, 0x92, 0x05, 0x05, 0x34, 0x42, 0x01, 0x00,
0x00, 0x34, 0x01, 0x0A, 0x0E, 0x09, 0x01, 0x9A, 0xFF, 0xB8, 0x00, 0x0A,
0x00, 0x00, 0x01, 0x82, 0x19, 0x00, 0x00, 0x01, 0x82, 0x01, 0x00, 0x00,
0x01, 0x81, 0x68, 0x00, 0x04, 0x03, 0x00, 0x03, 0x01, 0x03, 0x02, 0x03,
0x03, 0x02, 0x03, 0x02, 0x01, 0x11, 0x06, 0x07, 0x02, 0x02, 0x02, 0x00,
0x0D, 0x04, 0x05, 0x02, 0x03, 0x02, 0x01, 0x0D, 0x00, 0x02, 0x03, 0x00,
0x03, 0x01, 0x25, 0x02, 0x01, 0x13, 0x3B, 0x02, 0x00, 0x0F, 0x15, 0x00,
0x00, 0x01, 0x81, 0x74, 0x00, 0x00, 0x05, 0x02, 0x52, 0x28, 0x00, 0x00,
0x06, 0x02, 0x53, 0x28, 0x00, 0x00, 0x01, 0x10, 0x77, 0x00, 0x00, 0x11,
0x05, 0x02, 0x56, 0x28, 0x74, 0x00, 0x00, 0x11, 0x05, 0x02, 0x56, 0x28,
0x75, 0x00, 0x00, 0x06, 0x02, 0x4C, 0x28, 0x00, 0x00, 0x01, 0x82, 0x11,
0x00, 0x00, 0x25, 0x20, 0x01, 0x08, 0x0E, 0x3B, 0x40, 0x20, 0x09, 0x00,
0x09, 0x03, 0x00, 0x5B, 0x2B, 0xAF, 0x39, 0xAF, 0xB3, 0x25, 0x01, 0x20,
0x11, 0x06, 0x11, 0x24, 0x74, 0xAD, 0xB3, 0x01, 0x02, 0x78, 0xB0, 0x01,
0x02, 0x12, 0x06, 0x02, 0x57, 0x28, 0x79, 0xB3, 0x01, 0x02, 0x78, 0xAE,
0xAF, 0xC2, 0x9C, 0x65, 0x61, 0x21, 0x16, 0xAF, 0xA7, 0x29, 0x69, 0x06,
0x02, 0x4B, 0x28, 0xA7, 0x29, 0x71, 0x06, 0x02, 0x4B, 0x28, 0x79, 0x02,
0x00, 0x06, 0x05, 0x9D, 0x03, 0x01, 0x04, 0x09, 0x9C, 0x61, 0x68, 0x21,
0x27, 0x05, 0x02, 0x4A, 0x28, 0x68, 0x65, 0x21, 0x16, 0xAF, 0xAF, 0x9E,
0x05, 0x02, 0x57, 0x28, 0xBC, 0x26, 0x06, 0x27, 0xC2, 0xA4, 0xAF, 0x63,
0xAA, 0x03, 0x03, 0x63, 0x3B, 0x02, 0x03, 0x09, 0x3B, 0x02, 0x03, 0x0A,
0xAA, 0x03, 0x04, 0x79, 0x64, 0x2A, 0x01, 0x81, 0x00, 0x09, 0x02, 0x03,
0x12, 0x06, 0x02, 0x58, 0x28, 0x79, 0x5A, 0x03, 0x02, 0x04, 0x3A, 0x88,
0x26, 0x06, 0x34, 0x9E, 0x05, 0x02, 0x57, 0x28, 0x6A, 0x26, 0x06, 0x04,
0x01, 0x17, 0x04, 0x12, 0x6B, 0x26, 0x06, 0x04, 0x01, 0x18, 0x04, 0x0A,
0x6C, 0x26, 0x06, 0x04, 0x01, 0x19, 0x04, 0x02, 0x57, 0x28, 0x03, 0x05,
0x79, 0xA4, 0x25, 0x03, 0x06, 0x25, 0x63, 0x34, 0x0D, 0x06, 0x02, 0x50,
0x28, 0xA5, 0x59, 0x03, 0x02, 0x04, 0x02, 0x57, 0x28, 0x79, 0x02, 0x00,
0x06, 0x21, 0x02, 0x02, 0x5A, 0x30, 0x11, 0x06, 0x08, 0x24, 0x02, 0x03,
0x02, 0x04, 0x1D, 0x04, 0x10, 0x59, 0x30, 0x11, 0x06, 0x08, 0x24, 0x02,
0x05, 0x02, 0x06, 0x1C, 0x04, 0x03, 0x57, 0x28, 0x24, 0x04, 0x24, 0x02,
0x02, 0x5A, 0x30, 0x11, 0x06, 0x08, 0x24, 0x02, 0x03, 0x02, 0x04, 0x23,
0x04, 0x10, 0x59, 0x30, 0x11, 0x06, 0x08, 0x24, 0x02, 0x05, 0x02, 0x06,
0x22, 0x04, 0x03, 0x57, 0x28, 0x24, 0x25, 0x06, 0x01, 0x28, 0x24, 0x01,
0x00, 0x03, 0x07, 0xB4, 0x01, 0x21, 0x8F, 0x01, 0x22, 0x8F, 0x25, 0x01,
0x23, 0x11, 0x06, 0x81, 0x20, 0x24, 0x74, 0xAD, 0xAF, 0x25, 0x06, 0x81,
0x14, 0x01, 0x00, 0x03, 0x08, 0xAF, 0x9E, 0x24, 0xB3, 0x25, 0x01, 0x01,
0x11, 0x06, 0x04, 0xA6, 0x03, 0x08, 0xB3, 0x01, 0x04, 0x78, 0xAD, 0x70,
0x26, 0x06, 0x0F, 0x02, 0x00, 0x06, 0x03, 0xC3, 0x04, 0x05, 0x99, 0x01,
0x7F, 0x03, 0x07, 0x04, 0x80, 0x66, 0x91, 0x26, 0x06, 0x06, 0x02, 0x00,
0x9B, 0x04, 0x80, 0x5C, 0xC5, 0x26, 0x06, 0x11, 0x02, 0x00, 0x06, 0x09,
0x01, 0x00, 0x03, 0x01, 0x98, 0x03, 0x01, 0x04, 0x01, 0xC3, 0x04, 0x80,
0x47, 0x73, 0x26, 0x06, 0x0A, 0x02, 0x08, 0x06, 0x03, 0x9A, 0x04, 0x01,
0xC3, 0x04, 0x39, 0x6F, 0x26, 0x06, 0x03, 0xC3, 0x04, 0x32, 0xC8, 0x26,
0x06, 0x03, 0xC3, 0x04, 0x2B, 0x90, 0x26, 0x06, 0x03, 0xC3, 0x04, 0x24,
0xC6, 0x26, 0x06, 0x03, 0xC3, 0x04, 0x1D, 0x7A, 0x26, 0x06, 0x03, 0xC3,
0x04, 0x16, 0x85, 0x26, 0x06, 0x03, 0xC3, 0x04, 0x0F, 0x6E, 0x26, 0x06,
0x03, 0xC3, 0x04, 0x08, 0xC7, 0x26, 0x06, 0x03, 0xC3, 0x04, 0x01, 0xC3,
0x79, 0x79, 0x04, 0xFE, 0x68, 0x79, 0x79, 0x04, 0x08, 0x01, 0x7F, 0x11,
0x05, 0x02, 0x56, 0x28, 0x24, 0x79, 0x3A, 0x02, 0x00, 0x06, 0x08, 0x02,
0x01, 0x3C, 0x2F, 0x05, 0x02, 0x45, 0x28, 0x02, 0x00, 0x06, 0x01, 0x17,
0x02, 0x00, 0x02, 0x07, 0x2F, 0x05, 0x02, 0x51, 0x28, 0xB3, 0x76, 0xAD,
0x9E, 0x06, 0x80, 0x77, 0xBD, 0x26, 0x06, 0x07, 0x01, 0x02, 0x5A, 0x8A,
0x04, 0x80, 0x5E, 0xBE, 0x26, 0x06, 0x07, 0x01, 0x03, 0x5A, 0x8B, 0x04,
0x80, 0x53, 0xBF, 0x26, 0x06, 0x07, 0x01, 0x04, 0x5A, 0x8C, 0x04, 0x80,
0x48, 0xC0, 0x26, 0x06, 0x06, 0x01, 0x05, 0x5A, 0x8D, 0x04, 0x3E, 0xC1,
0x26, 0x06, 0x06, 0x01, 0x06, 0x5A, 0x8E, 0x04, 0x34, 0x7F, 0x26, 0x06,
0x06, 0x01, 0x02, 0x59, 0x8A, 0x04, 0x2A, 0x80, 0x26, 0x06, 0x06, 0x01,
0x03, 0x59, 0x8B, 0x04, 0x20, 0x81, 0x26, 0x06, 0x06, 0x01, 0x04, 0x59,
0x8C, 0x04, 0x16, 0x82, 0x26, 0x06, 0x06, 0x01, 0x05, 0x59, 0x8D, 0x04,
0x0C, 0x83, 0x26, 0x06, 0x06, 0x01, 0x06, 0x59, 0x8E, 0x04, 0x02, 0x57,
0x28, 0x5E, 0x35, 0x60, 0x37, 0x1B, 0x25, 0x05, 0x02, 0x57, 0x28, 0x5D,
0x37, 0x04, 0x02, 0x57, 0x28, 0xC2, 0xA4, 0x25, 0x01,
T0_INT2(BR_X509_BUFSIZE_SIG), 0x12, 0x06, 0x02, 0x50, 0x28, 0x25, 0x5F,
0x35, 0x5C, 0xA5, 0x79, 0x79, 0x01, 0x00, 0x5B, 0x36, 0x18, 0x00, 0x00,
0x01, 0x30, 0x0A, 0x25, 0x01, 0x00, 0x01, 0x09, 0x72, 0x05, 0x02, 0x48,
0x28, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x01, 0x81, 0x08, 0x00, 0x00,
0x01, 0x81, 0x10, 0x00, 0x00, 0x01, 0x81, 0x19, 0x00, 0x00, 0x01, 0x81,
0x22, 0x00, 0x00, 0x01, 0x81, 0x2B, 0x00, 0x01, 0x7E, 0x01, 0x01, 0x11,
0x3B, 0x01, 0x83, 0xFD, 0x7F, 0x11, 0x15, 0x06, 0x03, 0x3B, 0x24, 0x00,
0x3B, 0x25, 0x03, 0x00, 0x25, 0xCA, 0x05, 0x04, 0x42, 0x01, 0x00, 0x00,
0x25, 0x01, 0x81, 0x00, 0x0D, 0x06, 0x04, 0x96, 0x04, 0x80, 0x49, 0x25,
0x01, 0x90, 0x00, 0x0D, 0x06, 0x0F, 0x01, 0x06, 0x14, 0x01, 0x81, 0x40,
0x2F, 0x96, 0x02, 0x00, 0x01, 0x00, 0x97, 0x04, 0x33, 0x25, 0x01, 0x83,
0xFF, 0x7F, 0x0D, 0x06, 0x14, 0x01, 0x0C, 0x14, 0x01, 0x81, 0x60, 0x2F,
0x96, 0x02, 0x00, 0x01, 0x06, 0x97, 0x02, 0x00, 0x01, 0x00, 0x97, 0x04,
0x17, 0x01, 0x12, 0x14, 0x01, 0x81, 0x70, 0x2F, 0x96, 0x02, 0x00, 0x01,
0x0C, 0x97, 0x02, 0x00, 0x01, 0x06, 0x97, 0x02, 0x00, 0x01, 0x00, 0x97,
0x00, 0x00, 0x01, 0x82, 0x15, 0x00, 0x00, 0x25, 0x01, 0x83, 0xB0, 0x00,
0x01, 0x83, 0xB7, 0x7F, 0x72, 0x00, 0x00, 0x01, 0x81, 0x34, 0x00, 0x00,
0x01, 0x80, 0x6B, 0x00, 0x00, 0x01, 0x81, 0x78, 0x00, 0x00, 0x01, 0x3D,
0x00, 0x00, 0x01, 0x80, 0x43, 0x00, 0x00, 0x01, 0x80, 0x4D, 0x00, 0x00,
0x01, 0x80, 0x57, 0x00, 0x00, 0x01, 0x80, 0x61, 0x00, 0x00, 0x30, 0x11,
0x06, 0x04, 0x42, 0xAD, 0xC2, 0xB4, 0x00, 0x00, 0x01, 0x82, 0x09, 0x00,
0x00, 0x01, 0x81, 0x6C, 0x00, 0x00, 0x25, 0x01, 0x83, 0xB8, 0x00, 0x01,
0x83, 0xBF, 0x7F, 0x72, 0x00, 0x00, 0x01, 0x30, 0x62, 0x37, 0x01, 0x7F,
0x7C, 0x19, 0x01, 0x00, 0x7C, 0x19, 0x04, 0x7A, 0x00, 0x01, 0x81, 0x38,
0x00, 0x01, 0x7E, 0x0D, 0x06, 0x02, 0x4F, 0x28, 0x25, 0x03, 0x00, 0x0A,
0x02, 0x00, 0x00, 0x00, 0x30, 0x25, 0x3F, 0x3B, 0x01, 0x82, 0x00, 0x13,
0x2F, 0x06, 0x04, 0x42, 0x01, 0x00, 0x00, 0x30, 0x67, 0x09, 0x37, 0x40,
0x00, 0x00, 0x14, 0x01, 0x3F, 0x15, 0x01, 0x81, 0x00, 0x2F, 0x96, 0x00,
0x02, 0x01, 0x00, 0x03, 0x00, 0xAF, 0x25, 0x06, 0x80, 0x59, 0xB3, 0x01,
0x20, 0x30, 0x11, 0x06, 0x17, 0x24, 0x74, 0xAD, 0x9E, 0x24, 0x01, 0x7F,
0x2E, 0x03, 0x01, 0xB3, 0x01, 0x20, 0x77, 0xAD, 0xB2, 0x02, 0x01, 0x1F,
0x79, 0x79, 0x04, 0x38, 0x01, 0x21, 0x30, 0x11, 0x06, 0x08, 0x24, 0x75,
0xB6, 0x01, 0x01, 0x1E, 0x04, 0x2A, 0x01, 0x22, 0x30, 0x11, 0x06, 0x11,
0x24, 0x75, 0xB6, 0x25, 0x06, 0x06, 0x2C, 0x02, 0x00, 0x2F, 0x03, 0x00,
0x01, 0x02, 0x1E, 0x04, 0x13, 0x01, 0x26, 0x30, 0x11, 0x06, 0x08, 0x24,
0x75, 0xB6, 0x01, 0x06, 0x1E, 0x04, 0x05, 0x42, 0xAE, 0x01, 0x00, 0x24,
0x04, 0xFF, 0x23, 0x79, 0x02, 0x00, 0x00, 0x00, 0xAF, 0xB4, 0x25, 0x01,
0x01, 0x11, 0x06, 0x08, 0xA6, 0x05, 0x02, 0x51, 0x28, 0xB4, 0x04, 0x02,
0x51, 0x28, 0x25, 0x01, 0x02, 0x11, 0x06, 0x0C, 0x24, 0x75, 0xB0, 0x66,
0x2B, 0x41, 0x0D, 0x06, 0x02, 0x51, 0x28, 0xB4, 0x01, 0x7F, 0x10, 0x06,
0x02, 0x56, 0x28, 0x24, 0x79, 0x00, 0x00, 0xAF, 0x25, 0x06, 0x1A, 0xAF,
0x9E, 0x24, 0x25, 0x06, 0x11, 0xAF, 0x25, 0x06, 0x0C, 0xAF, 0x9E, 0x24,
0x89, 0x26, 0x05, 0x02, 0x49, 0x28, 0xC2, 0x04, 0x71, 0x79, 0x79, 0x04,
0x63, 0x79, 0x00, 0x02, 0x03, 0x00, 0xB3, 0x01, 0x03, 0x78, 0xAD, 0xBA,
0x03, 0x01, 0x02, 0x01, 0x01, 0x07, 0x12, 0x06, 0x02, 0x56, 0x28, 0x25,
0x01, 0x00, 0x30, 0x11, 0x06, 0x05, 0x24, 0x4D, 0x28, 0x04, 0x15, 0x01,
0x01, 0x30, 0x11, 0x06, 0x0A, 0x24, 0xBA, 0x02, 0x01, 0x14, 0x02, 0x01,
0x0E, 0x04, 0x05, 0x24, 0xBA, 0x01, 0x00, 0x24, 0x02, 0x00, 0x06, 0x19,
0x01, 0x00, 0x30, 0x01, 0x38, 0x15, 0x06, 0x03, 0x01, 0x10, 0x2F, 0x3B,
0x01, 0x81, 0x40, 0x15, 0x06, 0x03, 0x01, 0x20, 0x2F, 0x62, 0x37, 0x04,
0x07, 0x01, 0x04, 0x15, 0x05, 0x02, 0x4D, 0x28, 0xC2, 0x00, 0x00, 0x38,
0xAF, 0xC2, 0x1A, 0x00, 0x03, 0x01, 0x00, 0x03, 0x00, 0x38, 0xAF, 0x25,
0x06, 0x30, 0xB3, 0x01, 0x11, 0x77, 0xAD, 0x25, 0x05, 0x02, 0x44, 0x28,
0x25, 0x06, 0x20, 0xAF, 0x9E, 0x24, 0x87, 0x26, 0x03, 0x01, 0x01, 0x00,
0x2E, 0x03, 0x02, 0xB2, 0x25, 0x02, 0x01, 0x15, 0x06, 0x07, 0x2C, 0x06,
0x04, 0x01, 0x7F, 0x03, 0x00, 0x02, 0x02, 0x1F, 0x79, 0x04, 0x5D, 0x79,
0x04, 0x4D, 0x79, 0x1A, 0x02, 0x00, 0x00, 0x00, 0xB3, 0x01, 0x06, 0x78,
0xB1, 0x00, 0x00, 0xB8, 0x86, 0x06, 0x0E, 0x3B, 0x25, 0x05, 0x06, 0x42,
0x01, 0x00, 0x01, 0x00, 0x00, 0xB8, 0x6D, 0x04, 0x08, 0x92, 0x06, 0x05,
0x24, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0xB9, 0x86, 0x06, 0x0E, 0x3B,
0x25, 0x05, 0x06, 0x42, 0x01, 0x00, 0x01, 0x00, 0x00, 0xB9, 0x6D, 0x04,
0x08, 0x92, 0x06, 0x05, 0x24, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0xBA,
0x25, 0x01, 0x81, 0x00, 0x0D, 0x06, 0x04, 0x00, 0x04, 0x80, 0x55, 0x25,
0x01, 0x81, 0x40, 0x0D, 0x06, 0x07, 0x24, 0x01, 0x00, 0x00, 0x04, 0x80,
0x47, 0x25, 0x01, 0x81, 0x60, 0x0D, 0x06, 0x0E, 0x01, 0x1F, 0x15, 0x01,
0x01, 0xA3, 0x01, 0x81, 0x00, 0x01, 0x8F, 0x7F, 0x04, 0x32, 0x25, 0x01,
0x81, 0x70, 0x0D, 0x06, 0x0F, 0x01, 0x0F, 0x15, 0x01, 0x02, 0xA3, 0x01,
0x90, 0x00, 0x01, 0x83, 0xFF, 0x7F, 0x04, 0x1C, 0x25, 0x01, 0x81, 0x78,
0x0D, 0x06, 0x11, 0x01, 0x07, 0x15, 0x01, 0x03, 0xA3, 0x01, 0x84, 0x80,
0x00, 0x01, 0x80, 0xC3, 0xFF, 0x7F, 0x04, 0x04, 0x24, 0x01, 0x00, 0x00,
0x72, 0x05, 0x03, 0x24, 0x01, 0x00, 0x00, 0x00, 0x3B, 0x25, 0x05, 0x06,
0x42, 0x01, 0x00, 0x01, 0x7F, 0x00, 0xBA, 0x34, 0x25, 0x3D, 0x06, 0x03,
0x3B, 0x24, 0x00, 0x01, 0x06, 0x0E, 0x3B, 0x25, 0x01, 0x06, 0x14, 0x01,
0x02, 0x10, 0x06, 0x04, 0x42, 0x01, 0x7F, 0x00, 0x01, 0x3F, 0x15, 0x09,
0x00, 0x00, 0x25, 0x06, 0x06, 0x0B, 0xA2, 0x34, 0x41, 0x04, 0x77, 0x24,
0x25, 0x00, 0x00, 0xB3, 0x01, 0x03, 0x78, 0xAD, 0xBA, 0x06, 0x02, 0x55,
0x28, 0x00, 0x00, 0x3B, 0x25, 0x06, 0x07, 0x31, 0x25, 0x06, 0x01, 0x19,
0x04, 0x76, 0x42, 0x00, 0x00, 0x01, 0x01, 0x78, 0xAC, 0x01, 0x01, 0x10,
0x06, 0x02, 0x43, 0x28, 0xBA, 0x3E, 0x00, 0x04, 0xB3, 0x25, 0x01, 0x17,
0x01, 0x18, 0x72, 0x05, 0x02, 0x48, 0x28, 0x01, 0x18, 0x11, 0x03, 0x00,
0x75, 0xAD, 0xA8, 0x02, 0x00, 0x06, 0x0C, 0x01, 0x80, 0x64, 0x08, 0x03,
0x01, 0xA8, 0x02, 0x01, 0x09, 0x04, 0x0E, 0x25, 0x01, 0x32, 0x0D, 0x06,
0x04, 0x01, 0x80, 0x64, 0x09, 0x01, 0x8E, 0x6C, 0x09, 0x03, 0x01, 0x02,
0x01, 0x01, 0x82, 0x6D, 0x08, 0x02, 0x01, 0x01, 0x03, 0x09, 0x01, 0x04,
0x0C, 0x09, 0x02, 0x01, 0x01, 0x80, 0x63, 0x09, 0x01, 0x80, 0x64, 0x0C,
0x0A, 0x02, 0x01, 0x01, 0x83, 0x0F, 0x09, 0x01, 0x83, 0x10, 0x0C, 0x09,
0x03, 0x03, 0x01, 0x01, 0x01, 0x0C, 0xA9, 0x41, 0x01, 0x01, 0x0E, 0x02,
0x01, 0x01, 0x04, 0x07, 0x3F, 0x02, 0x01, 0x01, 0x80, 0x64, 0x07, 0x3E,
0x02, 0x01, 0x01, 0x83, 0x10, 0x07, 0x3F, 0x2F, 0x15, 0x06, 0x03, 0x01,
0x18, 0x09, 0x94, 0x09, 0x7B, 0x25, 0x01, 0x05, 0x14, 0x02, 0x03, 0x09,
0x03, 0x03, 0x01, 0x1F, 0x15, 0x01, 0x01, 0x3B, 0xA9, 0x02, 0x03, 0x09,
0x41, 0x03, 0x03, 0x01, 0x00, 0x01, 0x17, 0xA9, 0x01, 0x9C, 0x10, 0x08,
0x03, 0x02, 0x01, 0x00, 0x01, 0x3B, 0xA9, 0x01, 0x3C, 0x08, 0x02, 0x02,
0x09, 0x03, 0x02, 0x01, 0x00, 0x01, 0x3C, 0xA9, 0x02, 0x02, 0x09, 0x03,
0x02, 0xBA, 0x25, 0x01, 0x2E, 0x11, 0x06, 0x0D, 0x24, 0xBA, 0x25, 0x01,
0x30, 0x01, 0x39, 0x72, 0x06, 0x03, 0x24, 0x04, 0x74, 0x01, 0x80, 0x5A,
0x10, 0x06, 0x02, 0x48, 0x28, 0x79, 0x02, 0x03, 0x02, 0x02, 0x00, 0x01,
0xBA, 0x7D, 0x01, 0x0A, 0x08, 0x03, 0x00, 0xBA, 0x7D, 0x02, 0x00, 0x09,
0x00, 0x02, 0x03, 0x00, 0x03, 0x01, 0xA8, 0x25, 0x02, 0x01, 0x02, 0x00,
0x72, 0x05, 0x02, 0x48, 0x28, 0x00, 0x00, 0x34, 0xB3, 0x01, 0x02, 0x78,
0x0B, 0xAB, 0x00, 0x03, 0x25, 0x03, 0x00, 0x03, 0x01, 0x03, 0x02, 0xAD,
0xBA, 0x25, 0x01, 0x81, 0x00, 0x13, 0x06, 0x02, 0x54, 0x28, 0x25, 0x01,
0x00, 0x11, 0x06, 0x0B, 0x24, 0x25, 0x05, 0x04, 0x24, 0x01, 0x00, 0x00,
0xBA, 0x04, 0x6F, 0x02, 0x01, 0x25, 0x05, 0x02, 0x50, 0x28, 0x41, 0x03,
0x01, 0x02, 0x02, 0x37, 0x02, 0x02, 0x40, 0x03, 0x02, 0x25, 0x06, 0x03,
0xBA, 0x04, 0x68, 0x24, 0x02, 0x00, 0x02, 0x01, 0x0A, 0x00, 0x01, 0xBA,
0x25, 0x01, 0x81, 0x00, 0x0D, 0x06, 0x01, 0x00, 0x01, 0x81, 0x00, 0x0A,
0x25, 0x05, 0x02, 0x4E, 0x28, 0x03, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01,
0x00, 0x12, 0x06, 0x19, 0x02, 0x00, 0x41, 0x03, 0x00, 0x25, 0x01, 0x83,
0xFF, 0xFF, 0x7F, 0x12, 0x06, 0x02, 0x4F, 0x28, 0x01, 0x08, 0x0E, 0x3B,
0xBA, 0x34, 0x09, 0x04, 0x60, 0x00, 0x00, 0xAC, 0x95, 0x00, 0x00, 0xAD,
0xC2, 0x00, 0x00, 0xB3, 0x76, 0xAD, 0x00, 0x01, 0xAD, 0x25, 0x05, 0x02,
0x54, 0x28, 0xBA, 0x25, 0x01, 0x81, 0x00, 0x13, 0x06, 0x02, 0x54, 0x28,
0x03, 0x00, 0x25, 0x06, 0x16, 0xBA, 0x02, 0x00, 0x25, 0x01, 0x87, 0xFF,
0xFF, 0x7F, 0x13, 0x06, 0x02, 0x54, 0x28, 0x01, 0x08, 0x0E, 0x09, 0x03,
0x00, 0x04, 0x67, 0x24, 0x02, 0x00, 0x00, 0x00, 0xAD, 0x25, 0x01, 0x81,
0x7F, 0x12, 0x06, 0x08, 0xC2, 0x01, 0x00, 0x67, 0x37, 0x01, 0x00, 0x00,
0x25, 0x67, 0x37, 0x67, 0x40, 0xA5, 0x01, 0x7F, 0x00, 0x00, 0xB3, 0x01,
0x0C, 0x30, 0x11, 0x06, 0x05, 0x24, 0x75, 0xB6, 0x04, 0x3E, 0x01, 0x12,
0x30, 0x11, 0x06, 0x05, 0x24, 0x75, 0xB7, 0x04, 0x33, 0x01, 0x13, 0x30,
0x11, 0x06, 0x05, 0x24, 0x75, 0xB7, 0x04, 0x28, 0x01, 0x14, 0x30, 0x11,
0x06, 0x05, 0x24, 0x75, 0xB7, 0x04, 0x1D, 0x01, 0x16, 0x30, 0x11, 0x06,
0x05, 0x24, 0x75, 0xB7, 0x04, 0x12, 0x01, 0x1E, 0x30, 0x11, 0x06, 0x05,
0x24, 0x75, 0xB5, 0x04, 0x07, 0x42, 0xAE, 0x01, 0x00, 0x01, 0x00, 0x24,
0x00, 0x01, 0xBA, 0x03, 0x00, 0x02, 0x00, 0x01, 0x05, 0x14, 0x01, 0x01,
0x15, 0x2D, 0x02, 0x00, 0x01, 0x06, 0x14, 0x25, 0x01, 0x01, 0x15, 0x06,
0x02, 0x46, 0x28, 0x01, 0x04, 0x0E, 0x02, 0x00, 0x01, 0x1F, 0x15, 0x25,
0x01, 0x1F, 0x11, 0x06, 0x02, 0x47, 0x28, 0x09, 0x00, 0x00, 0x25, 0x05,
0x05, 0x01, 0x00, 0x01, 0x7F, 0x00, 0xB3, 0x00, 0x01, 0xAD, 0x25, 0x05,
0x05, 0x67, 0x37, 0x01, 0x7F, 0x00, 0x01, 0x01, 0x03, 0x00, 0x9F, 0x25,
0x01, 0x83, 0xFF, 0x7E, 0x11, 0x06, 0x16, 0x24, 0x25, 0x06, 0x10, 0xA0,
0x25, 0x05, 0x05, 0x24, 0xC2, 0x01, 0x00, 0x00, 0x02, 0x00, 0x84, 0x03,
0x00, 0x04, 0x6D, 0x04, 0x1B, 0x25, 0x05, 0x05, 0x24, 0xC2, 0x01, 0x00,
0x00, 0x02, 0x00, 0x84, 0x03, 0x00, 0x25, 0x06, 0x0B, 0x9F, 0x25, 0x05,
0x05, 0x24, 0xC2, 0x01, 0x00, 0x00, 0x04, 0x6D, 0x24, 0x02, 0x00, 0x25,
0x05, 0x01, 0x00, 0x41, 0x67, 0x37, 0x01, 0x7F, 0x00, 0x01, 0xAD, 0x01,
0x01, 0x03, 0x00, 0x25, 0x06, 0x10, 0xA1, 0x25, 0x05, 0x05, 0x24, 0xC2,
0x01, 0x00, 0x00, 0x02, 0x00, 0x84, 0x03, 0x00, 0x04, 0x6D, 0x24, 0x02,
0x00, 0x25, 0x05, 0x01, 0x00, 0x41, 0x67, 0x37, 0x01, 0x7F, 0x00, 0x01,
0xAD, 0x01, 0x01, 0x03, 0x00, 0x25, 0x06, 0x10, 0xBA, 0x25, 0x05, 0x05,
0x24, 0xC2, 0x01, 0x00, 0x00, 0x02, 0x00, 0x84, 0x03, 0x00, 0x04, 0x6D,
0x24, 0x02, 0x00, 0x25, 0x05, 0x01, 0x00, 0x41, 0x67, 0x37, 0x01, 0x7F,
0x00, 0x00, 0xBA, 0x01, 0x08, 0x0E, 0x3B, 0xBA, 0x34, 0x09, 0x00, 0x00,
0xBA, 0x3B, 0xBA, 0x01, 0x08, 0x0E, 0x34, 0x09, 0x00, 0x00, 0x25, 0x05,
0x02, 0x4F, 0x28, 0x41, 0xBB, 0x00, 0x00, 0x32, 0x25, 0x01, 0x00, 0x13,
0x06, 0x01, 0x00, 0x24, 0x19, 0x04, 0x74, 0x00, 0x01, 0x01, 0x00, 0x00,
0x01, 0x0B, 0x00, 0x00, 0x01, 0x15, 0x00, 0x00, 0x01, 0x1F, 0x00, 0x00,
0x01, 0x29, 0x00, 0x00, 0x01, 0x33, 0x00, 0x00, 0xC3, 0x24, 0x00, 0x00,
0x25, 0x06, 0x07, 0xC4, 0x25, 0x06, 0x01, 0x19, 0x04, 0x76, 0x00, 0x00,
0x01, 0x00, 0x30, 0x31, 0x0B, 0x42, 0x00, 0x00, 0x01, 0x81, 0x70, 0x00,
0x00, 0x01, 0x82, 0x0D, 0x00, 0x00, 0x01, 0x82, 0x22, 0x00, 0x00, 0x01,
0x82, 0x05, 0x00, 0x00, 0x01, 0x03, 0x33, 0x01, 0x03, 0x33, 0x00, 0x00,
0x25, 0x01, 0x83, 0xFB, 0x50, 0x01, 0x83, 0xFB, 0x6F, 0x72, 0x06, 0x04,
0x24, 0x01, 0x00, 0x00, 0x25, 0x01, 0x83, 0xB0, 0x00, 0x01, 0x83, 0xBF,
0x7F, 0x72, 0x06, 0x04, 0x24, 0x01, 0x00, 0x00, 0x01, 0x83, 0xFF, 0x7F,
0x15, 0x01, 0x83, 0xFF, 0x7E, 0x0D, 0x00
T0_INT2(offsetof(CONTEXT_NAME, saved_dn_hash)), 0x00, 0x00, 0x01, 0x80,
0x73, 0x00, 0x00, 0x01, 0x80, 0x7C, 0x00, 0x00, 0x01, 0x81, 0x02, 0x00,
0x00, 0x8F, 0x05, 0x05, 0x33, 0x41, 0x01, 0x00, 0x00, 0x33, 0x01, 0x0A,
0x0E, 0x09, 0x01, 0x9A, 0xFF, 0xB8, 0x00, 0x0A, 0x00, 0x00, 0x01, 0x82,
0x19, 0x00, 0x00, 0x01, 0x82, 0x01, 0x00, 0x00, 0x01, 0x81, 0x68, 0x00,
0x02, 0x03, 0x00, 0x03, 0x01, 0x26, 0x02, 0x01, 0x13, 0x3A, 0x02, 0x00,
0x0F, 0x15, 0x00, 0x00, 0x01, 0x81, 0x74, 0x00, 0x00, 0x05, 0x02, 0x51,
0x29, 0x00, 0x00, 0x06, 0x02, 0x52, 0x29, 0x00, 0x00, 0x01, 0x10, 0x74,
0x00, 0x00, 0x11, 0x05, 0x02, 0x55, 0x29, 0x71, 0x00, 0x00, 0x11, 0x05,
0x02, 0x55, 0x29, 0x72, 0x00, 0x00, 0x06, 0x02, 0x4B, 0x29, 0x00, 0x00,
0x01, 0x82, 0x11, 0x00, 0x00, 0x26, 0x21, 0x01, 0x08, 0x0E, 0x3A, 0x3F,
0x21, 0x09, 0x00, 0x0B, 0x03, 0x00, 0x5A, 0x2B, 0xAC, 0x38, 0xAC, 0xB0,
0x26, 0x01, 0x20, 0x11, 0x06, 0x11, 0x25, 0x71, 0xAA, 0xB0, 0x01, 0x02,
0x75, 0xAD, 0x01, 0x02, 0x12, 0x06, 0x02, 0x56, 0x29, 0x76, 0xB0, 0x01,
0x02, 0x75, 0xAB, 0xAC, 0xBF, 0x99, 0x64, 0x60, 0x22, 0x16, 0xAC, 0xA4,
0x03, 0x01, 0x03, 0x02, 0xA4, 0x02, 0x02, 0x02, 0x01, 0x19, 0x06, 0x02,
0x4A, 0x29, 0x76, 0x02, 0x00, 0x06, 0x05, 0x9A, 0x03, 0x03, 0x04, 0x09,
0x99, 0x60, 0x67, 0x22, 0x28, 0x05, 0x02, 0x49, 0x29, 0x67, 0x64, 0x22,
0x16, 0xAC, 0xAC, 0x9B, 0x05, 0x02, 0x56, 0x29, 0xB9, 0x27, 0x06, 0x27,
0xBF, 0xA1, 0xAC, 0x62, 0xA7, 0x03, 0x05, 0x62, 0x3A, 0x02, 0x05, 0x09,
0x3A, 0x02, 0x05, 0x0A, 0xA7, 0x03, 0x06, 0x76, 0x63, 0x2A, 0x01, 0x81,
0x00, 0x09, 0x02, 0x05, 0x12, 0x06, 0x02, 0x57, 0x29, 0x76, 0x59, 0x03,
0x04, 0x04, 0x3A, 0x85, 0x27, 0x06, 0x34, 0x9B, 0x05, 0x02, 0x56, 0x29,
0x68, 0x27, 0x06, 0x04, 0x01, 0x17, 0x04, 0x12, 0x69, 0x27, 0x06, 0x04,
0x01, 0x18, 0x04, 0x0A, 0x6A, 0x27, 0x06, 0x04, 0x01, 0x19, 0x04, 0x02,
0x56, 0x29, 0x03, 0x07, 0x76, 0xA1, 0x26, 0x03, 0x08, 0x26, 0x62, 0x33,
0x0D, 0x06, 0x02, 0x4F, 0x29, 0xA2, 0x58, 0x03, 0x04, 0x04, 0x02, 0x56,
0x29, 0x76, 0x02, 0x00, 0x06, 0x21, 0x02, 0x04, 0x59, 0x30, 0x11, 0x06,
0x08, 0x25, 0x02, 0x05, 0x02, 0x06, 0x1E, 0x04, 0x10, 0x58, 0x30, 0x11,
0x06, 0x08, 0x25, 0x02, 0x07, 0x02, 0x08, 0x1D, 0x04, 0x03, 0x56, 0x29,
0x25, 0x04, 0x24, 0x02, 0x04, 0x59, 0x30, 0x11, 0x06, 0x08, 0x25, 0x02,
0x05, 0x02, 0x06, 0x24, 0x04, 0x10, 0x58, 0x30, 0x11, 0x06, 0x08, 0x25,
0x02, 0x07, 0x02, 0x08, 0x23, 0x04, 0x03, 0x56, 0x29, 0x25, 0x26, 0x06,
0x01, 0x29, 0x25, 0x01, 0x00, 0x03, 0x09, 0xB1, 0x01, 0x21, 0x8C, 0x01,
0x22, 0x8C, 0x26, 0x01, 0x23, 0x11, 0x06, 0x81, 0x26, 0x25, 0x71, 0xAA,
0xAC, 0x26, 0x06, 0x81, 0x1A, 0x01, 0x00, 0x03, 0x0A, 0xAC, 0x9B, 0x25,
0xB0, 0x26, 0x01, 0x01, 0x11, 0x06, 0x04, 0xA3, 0x03, 0x0A, 0xB0, 0x01,
0x04, 0x75, 0xAA, 0x6E, 0x27, 0x06, 0x0F, 0x02, 0x00, 0x06, 0x03, 0xC0,
0x04, 0x05, 0x96, 0x01, 0x7F, 0x03, 0x09, 0x04, 0x80, 0x6C, 0x8E, 0x27,
0x06, 0x06, 0x02, 0x00, 0x98, 0x04, 0x80, 0x62, 0xC2, 0x27, 0x06, 0x11,
0x02, 0x00, 0x06, 0x09, 0x01, 0x00, 0x03, 0x03, 0x95, 0x03, 0x03, 0x04,
0x01, 0xC0, 0x04, 0x80, 0x4D, 0x70, 0x27, 0x06, 0x0A, 0x02, 0x0A, 0x06,
0x03, 0x97, 0x04, 0x01, 0xC0, 0x04, 0x3F, 0x6D, 0x27, 0x06, 0x03, 0xC0,
0x04, 0x38, 0xC5, 0x27, 0x06, 0x03, 0xC0, 0x04, 0x31, 0x8D, 0x27, 0x06,
0x03, 0xC0, 0x04, 0x2A, 0xC3, 0x27, 0x06, 0x03, 0xC0, 0x04, 0x23, 0x77,
0x27, 0x06, 0x03, 0xC0, 0x04, 0x1C, 0x82, 0x27, 0x06, 0x03, 0xC0, 0x04,
0x15, 0x6C, 0x27, 0x06, 0x03, 0xC0, 0x04, 0x0E, 0xC4, 0x27, 0x06, 0x03,
0xC0, 0x04, 0x07, 0x02, 0x0A, 0x06, 0x02, 0x48, 0x29, 0xC0, 0x76, 0x76,
0x04, 0xFE, 0x62, 0x76, 0x76, 0x04, 0x08, 0x01, 0x7F, 0x11, 0x05, 0x02,
0x55, 0x29, 0x25, 0x76, 0x39, 0x02, 0x00, 0x06, 0x08, 0x02, 0x03, 0x3B,
0x2F, 0x05, 0x02, 0x44, 0x29, 0x02, 0x00, 0x06, 0x01, 0x17, 0x02, 0x00,
0x02, 0x09, 0x2F, 0x05, 0x02, 0x50, 0x29, 0xB0, 0x73, 0xAA, 0x9B, 0x06,
0x80, 0x77, 0xBA, 0x27, 0x06, 0x07, 0x01, 0x02, 0x59, 0x87, 0x04, 0x80,
0x5E, 0xBB, 0x27, 0x06, 0x07, 0x01, 0x03, 0x59, 0x88, 0x04, 0x80, 0x53,
0xBC, 0x27, 0x06, 0x07, 0x01, 0x04, 0x59, 0x89, 0x04, 0x80, 0x48, 0xBD,
0x27, 0x06, 0x06, 0x01, 0x05, 0x59, 0x8A, 0x04, 0x3E, 0xBE, 0x27, 0x06,
0x06, 0x01, 0x06, 0x59, 0x8B, 0x04, 0x34, 0x7C, 0x27, 0x06, 0x06, 0x01,
0x02, 0x58, 0x87, 0x04, 0x2A, 0x7D, 0x27, 0x06, 0x06, 0x01, 0x03, 0x58,
0x88, 0x04, 0x20, 0x7E, 0x27, 0x06, 0x06, 0x01, 0x04, 0x58, 0x89, 0x04,
0x16, 0x7F, 0x27, 0x06, 0x06, 0x01, 0x05, 0x58, 0x8A, 0x04, 0x0C, 0x80,
0x27, 0x06, 0x06, 0x01, 0x06, 0x58, 0x8B, 0x04, 0x02, 0x56, 0x29, 0x5D,
0x34, 0x5F, 0x36, 0x1C, 0x26, 0x05, 0x02, 0x56, 0x29, 0x5C, 0x36, 0x04,
0x02, 0x56, 0x29, 0xBF, 0xA1, 0x26, 0x01, T0_INT2(BR_X509_BUFSIZE_SIG),
0x12, 0x06, 0x02, 0x4F, 0x29, 0x26, 0x5E, 0x34, 0x5B, 0xA2, 0x76, 0x76,
0x01, 0x00, 0x5A, 0x35, 0x18, 0x00, 0x00, 0x01, 0x30, 0x0A, 0x26, 0x01,
0x00, 0x01, 0x09, 0x6F, 0x05, 0x02, 0x47, 0x29, 0x00, 0x00, 0x30, 0x30,
0x00, 0x00, 0x01, 0x81, 0x08, 0x00, 0x00, 0x01, 0x81, 0x10, 0x00, 0x00,
0x01, 0x81, 0x19, 0x00, 0x00, 0x01, 0x81, 0x22, 0x00, 0x00, 0x01, 0x81,
0x2B, 0x00, 0x01, 0x7B, 0x01, 0x01, 0x11, 0x3A, 0x01, 0x83, 0xFD, 0x7F,
0x11, 0x15, 0x06, 0x03, 0x3A, 0x25, 0x00, 0x3A, 0x26, 0x03, 0x00, 0x26,
0xC6, 0x05, 0x04, 0x41, 0x01, 0x00, 0x00, 0x26, 0x01, 0x81, 0x00, 0x0D,
0x06, 0x04, 0x93, 0x04, 0x80, 0x49, 0x26, 0x01, 0x90, 0x00, 0x0D, 0x06,
0x0F, 0x01, 0x06, 0x14, 0x01, 0x81, 0x40, 0x2F, 0x93, 0x02, 0x00, 0x01,
0x00, 0x94, 0x04, 0x33, 0x26, 0x01, 0x83, 0xFF, 0x7F, 0x0D, 0x06, 0x14,
0x01, 0x0C, 0x14, 0x01, 0x81, 0x60, 0x2F, 0x93, 0x02, 0x00, 0x01, 0x06,
0x94, 0x02, 0x00, 0x01, 0x00, 0x94, 0x04, 0x17, 0x01, 0x12, 0x14, 0x01,
0x81, 0x70, 0x2F, 0x93, 0x02, 0x00, 0x01, 0x0C, 0x94, 0x02, 0x00, 0x01,
0x06, 0x94, 0x02, 0x00, 0x01, 0x00, 0x94, 0x00, 0x00, 0x01, 0x82, 0x15,
0x00, 0x00, 0x26, 0x01, 0x83, 0xB0, 0x00, 0x01, 0x83, 0xB7, 0x7F, 0x6F,
0x00, 0x00, 0x01, 0x81, 0x34, 0x00, 0x00, 0x01, 0x80, 0x6B, 0x00, 0x00,
0x01, 0x81, 0x78, 0x00, 0x00, 0x01, 0x3D, 0x00, 0x00, 0x01, 0x80, 0x43,
0x00, 0x00, 0x01, 0x80, 0x4D, 0x00, 0x00, 0x01, 0x80, 0x57, 0x00, 0x00,
0x01, 0x80, 0x61, 0x00, 0x00, 0x30, 0x11, 0x06, 0x04, 0x41, 0xAA, 0xBF,
0xB1, 0x00, 0x00, 0x01, 0x82, 0x09, 0x00, 0x00, 0x01, 0x81, 0x6C, 0x00,
0x00, 0x26, 0x01, 0x83, 0xB8, 0x00, 0x01, 0x83, 0xBF, 0x7F, 0x6F, 0x00,
0x00, 0x01, 0x30, 0x61, 0x36, 0x01, 0x7F, 0x79, 0x1A, 0x01, 0x00, 0x79,
0x1A, 0x04, 0x7A, 0x00, 0x01, 0x81, 0x38, 0x00, 0x01, 0x7B, 0x0D, 0x06,
0x02, 0x4E, 0x29, 0x26, 0x03, 0x00, 0x0A, 0x02, 0x00, 0x00, 0x00, 0x30,
0x26, 0x3E, 0x3A, 0x01, 0x82, 0x00, 0x13, 0x2F, 0x06, 0x04, 0x41, 0x01,
0x00, 0x00, 0x30, 0x66, 0x09, 0x36, 0x3F, 0x00, 0x00, 0x14, 0x01, 0x3F,
0x15, 0x01, 0x81, 0x00, 0x2F, 0x93, 0x00, 0x02, 0x01, 0x00, 0x03, 0x00,
0xAC, 0x26, 0x06, 0x80, 0x59, 0xB0, 0x01, 0x20, 0x30, 0x11, 0x06, 0x17,
0x25, 0x71, 0xAA, 0x9B, 0x25, 0x01, 0x7F, 0x2E, 0x03, 0x01, 0xB0, 0x01,
0x20, 0x74, 0xAA, 0xAF, 0x02, 0x01, 0x20, 0x76, 0x76, 0x04, 0x38, 0x01,
0x21, 0x30, 0x11, 0x06, 0x08, 0x25, 0x72, 0xB3, 0x01, 0x01, 0x1F, 0x04,
0x2A, 0x01, 0x22, 0x30, 0x11, 0x06, 0x11, 0x25, 0x72, 0xB3, 0x26, 0x06,
0x06, 0x2C, 0x02, 0x00, 0x2F, 0x03, 0x00, 0x01, 0x02, 0x1F, 0x04, 0x13,
0x01, 0x26, 0x30, 0x11, 0x06, 0x08, 0x25, 0x72, 0xB3, 0x01, 0x06, 0x1F,
0x04, 0x05, 0x41, 0xAB, 0x01, 0x00, 0x25, 0x04, 0xFF, 0x23, 0x76, 0x02,
0x00, 0x00, 0x00, 0xAC, 0xB1, 0x26, 0x01, 0x01, 0x11, 0x06, 0x08, 0xA3,
0x05, 0x02, 0x50, 0x29, 0xB1, 0x04, 0x02, 0x50, 0x29, 0x26, 0x01, 0x02,
0x11, 0x06, 0x0C, 0x25, 0x72, 0xAD, 0x65, 0x2B, 0x40, 0x0D, 0x06, 0x02,
0x50, 0x29, 0xB1, 0x01, 0x7F, 0x10, 0x06, 0x02, 0x55, 0x29, 0x25, 0x76,
0x00, 0x00, 0xAC, 0x26, 0x06, 0x1A, 0xAC, 0x9B, 0x25, 0x26, 0x06, 0x11,
0xAC, 0x26, 0x06, 0x0C, 0xAC, 0x9B, 0x25, 0x86, 0x27, 0x05, 0x02, 0x48,
0x29, 0xBF, 0x04, 0x71, 0x76, 0x76, 0x04, 0x63, 0x76, 0x00, 0x02, 0x03,
0x00, 0xB0, 0x01, 0x03, 0x75, 0xAA, 0xB7, 0x03, 0x01, 0x02, 0x01, 0x01,
0x07, 0x12, 0x06, 0x02, 0x55, 0x29, 0x26, 0x01, 0x00, 0x30, 0x11, 0x06,
0x05, 0x25, 0x4C, 0x29, 0x04, 0x15, 0x01, 0x01, 0x30, 0x11, 0x06, 0x0A,
0x25, 0xB7, 0x02, 0x01, 0x14, 0x02, 0x01, 0x0E, 0x04, 0x05, 0x25, 0xB7,
0x01, 0x00, 0x25, 0x02, 0x00, 0x06, 0x19, 0x01, 0x00, 0x30, 0x01, 0x38,
0x15, 0x06, 0x03, 0x01, 0x10, 0x2F, 0x3A, 0x01, 0x81, 0x40, 0x15, 0x06,
0x03, 0x01, 0x20, 0x2F, 0x61, 0x36, 0x04, 0x07, 0x01, 0x04, 0x15, 0x05,
0x02, 0x4C, 0x29, 0xBF, 0x00, 0x00, 0x37, 0xAC, 0xBF, 0x1B, 0x00, 0x03,
0x01, 0x00, 0x03, 0x00, 0x37, 0xAC, 0x26, 0x06, 0x30, 0xB0, 0x01, 0x11,
0x74, 0xAA, 0x26, 0x05, 0x02, 0x43, 0x29, 0x26, 0x06, 0x20, 0xAC, 0x9B,
0x25, 0x84, 0x27, 0x03, 0x01, 0x01, 0x00, 0x2E, 0x03, 0x02, 0xAF, 0x26,
0x02, 0x01, 0x15, 0x06, 0x07, 0x2C, 0x06, 0x04, 0x01, 0x7F, 0x03, 0x00,
0x02, 0x02, 0x20, 0x76, 0x04, 0x5D, 0x76, 0x04, 0x4D, 0x76, 0x1B, 0x02,
0x00, 0x00, 0x00, 0xB0, 0x01, 0x06, 0x75, 0xAE, 0x00, 0x00, 0xB5, 0x83,
0x06, 0x0E, 0x3A, 0x26, 0x05, 0x06, 0x41, 0x01, 0x00, 0x01, 0x00, 0x00,
0xB5, 0x6B, 0x04, 0x08, 0x8F, 0x06, 0x05, 0x25, 0x01, 0x00, 0x04, 0x00,
0x00, 0x00, 0xB6, 0x83, 0x06, 0x0E, 0x3A, 0x26, 0x05, 0x06, 0x41, 0x01,
0x00, 0x01, 0x00, 0x00, 0xB6, 0x6B, 0x04, 0x08, 0x8F, 0x06, 0x05, 0x25,
0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0xB7, 0x26, 0x01, 0x81, 0x00, 0x0D,
0x06, 0x04, 0x00, 0x04, 0x80, 0x55, 0x26, 0x01, 0x81, 0x40, 0x0D, 0x06,
0x07, 0x25, 0x01, 0x00, 0x00, 0x04, 0x80, 0x47, 0x26, 0x01, 0x81, 0x60,
0x0D, 0x06, 0x0E, 0x01, 0x1F, 0x15, 0x01, 0x01, 0xA0, 0x01, 0x81, 0x00,
0x01, 0x8F, 0x7F, 0x04, 0x32, 0x26, 0x01, 0x81, 0x70, 0x0D, 0x06, 0x0F,
0x01, 0x0F, 0x15, 0x01, 0x02, 0xA0, 0x01, 0x90, 0x00, 0x01, 0x83, 0xFF,
0x7F, 0x04, 0x1C, 0x26, 0x01, 0x81, 0x78, 0x0D, 0x06, 0x11, 0x01, 0x07,
0x15, 0x01, 0x03, 0xA0, 0x01, 0x84, 0x80, 0x00, 0x01, 0x80, 0xC3, 0xFF,
0x7F, 0x04, 0x04, 0x25, 0x01, 0x00, 0x00, 0x6F, 0x05, 0x03, 0x25, 0x01,
0x00, 0x00, 0x00, 0x3A, 0x26, 0x05, 0x06, 0x41, 0x01, 0x00, 0x01, 0x7F,
0x00, 0xB7, 0x33, 0x26, 0x3C, 0x06, 0x03, 0x3A, 0x25, 0x00, 0x01, 0x06,
0x0E, 0x3A, 0x26, 0x01, 0x06, 0x14, 0x01, 0x02, 0x10, 0x06, 0x04, 0x41,
0x01, 0x7F, 0x00, 0x01, 0x3F, 0x15, 0x09, 0x00, 0x00, 0x26, 0x06, 0x06,
0x0B, 0x9F, 0x33, 0x40, 0x04, 0x77, 0x25, 0x26, 0x00, 0x00, 0xB0, 0x01,
0x03, 0x75, 0xAA, 0xB7, 0x06, 0x02, 0x54, 0x29, 0x00, 0x00, 0x3A, 0x26,
0x06, 0x07, 0x31, 0x26, 0x06, 0x01, 0x1A, 0x04, 0x76, 0x41, 0x00, 0x00,
0x01, 0x01, 0x75, 0xA9, 0x01, 0x01, 0x10, 0x06, 0x02, 0x42, 0x29, 0xB7,
0x3D, 0x00, 0x04, 0xB0, 0x26, 0x01, 0x17, 0x01, 0x18, 0x6F, 0x05, 0x02,
0x47, 0x29, 0x01, 0x18, 0x11, 0x03, 0x00, 0x72, 0xAA, 0xA5, 0x02, 0x00,
0x06, 0x0C, 0x01, 0x80, 0x64, 0x08, 0x03, 0x01, 0xA5, 0x02, 0x01, 0x09,
0x04, 0x0E, 0x26, 0x01, 0x32, 0x0D, 0x06, 0x04, 0x01, 0x80, 0x64, 0x09,
0x01, 0x8E, 0x6C, 0x09, 0x03, 0x01, 0x02, 0x01, 0x01, 0x82, 0x6D, 0x08,
0x02, 0x01, 0x01, 0x03, 0x09, 0x01, 0x04, 0x0C, 0x09, 0x02, 0x01, 0x01,
0x80, 0x63, 0x09, 0x01, 0x80, 0x64, 0x0C, 0x0A, 0x02, 0x01, 0x01, 0x83,
0x0F, 0x09, 0x01, 0x83, 0x10, 0x0C, 0x09, 0x03, 0x03, 0x01, 0x01, 0x01,
0x0C, 0xA6, 0x40, 0x01, 0x01, 0x0E, 0x02, 0x01, 0x01, 0x04, 0x07, 0x3E,
0x02, 0x01, 0x01, 0x80, 0x64, 0x07, 0x3D, 0x02, 0x01, 0x01, 0x83, 0x10,
0x07, 0x3E, 0x2F, 0x15, 0x06, 0x03, 0x01, 0x18, 0x09, 0x91, 0x09, 0x78,
0x26, 0x01, 0x05, 0x14, 0x02, 0x03, 0x09, 0x03, 0x03, 0x01, 0x1F, 0x15,
0x01, 0x01, 0x3A, 0xA6, 0x02, 0x03, 0x09, 0x40, 0x03, 0x03, 0x01, 0x00,
0x01, 0x17, 0xA6, 0x01, 0x9C, 0x10, 0x08, 0x03, 0x02, 0x01, 0x00, 0x01,
0x3B, 0xA6, 0x01, 0x3C, 0x08, 0x02, 0x02, 0x09, 0x03, 0x02, 0x01, 0x00,
0x01, 0x3C, 0xA6, 0x02, 0x02, 0x09, 0x03, 0x02, 0xB7, 0x26, 0x01, 0x2E,
0x11, 0x06, 0x0D, 0x25, 0xB7, 0x26, 0x01, 0x30, 0x01, 0x39, 0x6F, 0x06,
0x03, 0x25, 0x04, 0x74, 0x01, 0x80, 0x5A, 0x10, 0x06, 0x02, 0x47, 0x29,
0x76, 0x02, 0x03, 0x02, 0x02, 0x00, 0x01, 0xB7, 0x7A, 0x01, 0x0A, 0x08,
0x03, 0x00, 0xB7, 0x7A, 0x02, 0x00, 0x09, 0x00, 0x02, 0x03, 0x00, 0x03,
0x01, 0xA5, 0x26, 0x02, 0x01, 0x02, 0x00, 0x6F, 0x05, 0x02, 0x47, 0x29,
0x00, 0x00, 0x33, 0xB0, 0x01, 0x02, 0x75, 0x0B, 0xA8, 0x00, 0x03, 0x26,
0x03, 0x00, 0x03, 0x01, 0x03, 0x02, 0xAA, 0xB7, 0x26, 0x01, 0x81, 0x00,
0x13, 0x06, 0x02, 0x53, 0x29, 0x26, 0x01, 0x00, 0x11, 0x06, 0x0B, 0x25,
0x26, 0x05, 0x04, 0x25, 0x01, 0x00, 0x00, 0xB7, 0x04, 0x6F, 0x02, 0x01,
0x26, 0x05, 0x02, 0x4F, 0x29, 0x40, 0x03, 0x01, 0x02, 0x02, 0x36, 0x02,
0x02, 0x3F, 0x03, 0x02, 0x26, 0x06, 0x03, 0xB7, 0x04, 0x68, 0x25, 0x02,
0x00, 0x02, 0x01, 0x0A, 0x00, 0x01, 0xB7, 0x26, 0x01, 0x81, 0x00, 0x0D,
0x06, 0x01, 0x00, 0x01, 0x81, 0x00, 0x0A, 0x26, 0x05, 0x02, 0x4D, 0x29,
0x03, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x12, 0x06, 0x19, 0x02,
0x00, 0x40, 0x03, 0x00, 0x26, 0x01, 0x83, 0xFF, 0xFF, 0x7F, 0x12, 0x06,
0x02, 0x4E, 0x29, 0x01, 0x08, 0x0E, 0x3A, 0xB7, 0x33, 0x09, 0x04, 0x60,
0x00, 0x00, 0xA9, 0x92, 0x00, 0x00, 0xAA, 0xBF, 0x00, 0x00, 0xB0, 0x73,
0xAA, 0x00, 0x01, 0xAA, 0x26, 0x05, 0x02, 0x53, 0x29, 0xB7, 0x26, 0x01,
0x81, 0x00, 0x13, 0x06, 0x02, 0x53, 0x29, 0x03, 0x00, 0x26, 0x06, 0x16,
0xB7, 0x02, 0x00, 0x26, 0x01, 0x87, 0xFF, 0xFF, 0x7F, 0x13, 0x06, 0x02,
0x53, 0x29, 0x01, 0x08, 0x0E, 0x09, 0x03, 0x00, 0x04, 0x67, 0x25, 0x02,
0x00, 0x00, 0x00, 0xAA, 0x26, 0x01, 0x81, 0x7F, 0x12, 0x06, 0x08, 0xBF,
0x01, 0x00, 0x66, 0x36, 0x01, 0x00, 0x00, 0x26, 0x66, 0x36, 0x66, 0x3F,
0xA2, 0x01, 0x7F, 0x00, 0x00, 0xB0, 0x01, 0x0C, 0x30, 0x11, 0x06, 0x05,
0x25, 0x72, 0xB3, 0x04, 0x3E, 0x01, 0x12, 0x30, 0x11, 0x06, 0x05, 0x25,
0x72, 0xB4, 0x04, 0x33, 0x01, 0x13, 0x30, 0x11, 0x06, 0x05, 0x25, 0x72,
0xB4, 0x04, 0x28, 0x01, 0x14, 0x30, 0x11, 0x06, 0x05, 0x25, 0x72, 0xB4,
0x04, 0x1D, 0x01, 0x16, 0x30, 0x11, 0x06, 0x05, 0x25, 0x72, 0xB4, 0x04,
0x12, 0x01, 0x1E, 0x30, 0x11, 0x06, 0x05, 0x25, 0x72, 0xB2, 0x04, 0x07,
0x41, 0xAB, 0x01, 0x00, 0x01, 0x00, 0x25, 0x00, 0x01, 0xB7, 0x03, 0x00,
0x02, 0x00, 0x01, 0x05, 0x14, 0x01, 0x01, 0x15, 0x2D, 0x02, 0x00, 0x01,
0x06, 0x14, 0x26, 0x01, 0x01, 0x15, 0x06, 0x02, 0x45, 0x29, 0x01, 0x04,
0x0E, 0x02, 0x00, 0x01, 0x1F, 0x15, 0x26, 0x01, 0x1F, 0x11, 0x06, 0x02,
0x46, 0x29, 0x09, 0x00, 0x00, 0x26, 0x05, 0x05, 0x01, 0x00, 0x01, 0x7F,
0x00, 0xB0, 0x00, 0x01, 0xAA, 0x26, 0x05, 0x05, 0x66, 0x36, 0x01, 0x7F,
0x00, 0x01, 0x01, 0x03, 0x00, 0x9C, 0x26, 0x01, 0x83, 0xFF, 0x7E, 0x11,
0x06, 0x16, 0x25, 0x26, 0x06, 0x10, 0x9D, 0x26, 0x05, 0x05, 0x25, 0xBF,
0x01, 0x00, 0x00, 0x02, 0x00, 0x81, 0x03, 0x00, 0x04, 0x6D, 0x04, 0x1B,
0x26, 0x05, 0x05, 0x25, 0xBF, 0x01, 0x00, 0x00, 0x02, 0x00, 0x81, 0x03,
0x00, 0x26, 0x06, 0x0B, 0x9C, 0x26, 0x05, 0x05, 0x25, 0xBF, 0x01, 0x00,
0x00, 0x04, 0x6D, 0x25, 0x02, 0x00, 0x26, 0x05, 0x01, 0x00, 0x40, 0x66,
0x36, 0x01, 0x7F, 0x00, 0x01, 0xAA, 0x01, 0x01, 0x03, 0x00, 0x26, 0x06,
0x10, 0x9E, 0x26, 0x05, 0x05, 0x25, 0xBF, 0x01, 0x00, 0x00, 0x02, 0x00,
0x81, 0x03, 0x00, 0x04, 0x6D, 0x25, 0x02, 0x00, 0x26, 0x05, 0x01, 0x00,
0x40, 0x66, 0x36, 0x01, 0x7F, 0x00, 0x01, 0xAA, 0x01, 0x01, 0x03, 0x00,
0x26, 0x06, 0x10, 0xB7, 0x26, 0x05, 0x05, 0x25, 0xBF, 0x01, 0x00, 0x00,
0x02, 0x00, 0x81, 0x03, 0x00, 0x04, 0x6D, 0x25, 0x02, 0x00, 0x26, 0x05,
0x01, 0x00, 0x40, 0x66, 0x36, 0x01, 0x7F, 0x00, 0x00, 0xB7, 0x01, 0x08,
0x0E, 0x3A, 0xB7, 0x33, 0x09, 0x00, 0x00, 0xB7, 0x3A, 0xB7, 0x01, 0x08,
0x0E, 0x33, 0x09, 0x00, 0x00, 0x26, 0x05, 0x02, 0x4E, 0x29, 0x40, 0xB8,
0x00, 0x00, 0x32, 0x26, 0x01, 0x00, 0x13, 0x06, 0x01, 0x00, 0x25, 0x1A,
0x04, 0x74, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x0B, 0x00, 0x00, 0x01,
0x15, 0x00, 0x00, 0x01, 0x1F, 0x00, 0x00, 0x01, 0x29, 0x00, 0x00, 0x01,
0x33, 0x00, 0x00, 0xC0, 0x25, 0x00, 0x00, 0x26, 0x06, 0x07, 0xC1, 0x26,
0x06, 0x01, 0x1A, 0x04, 0x76, 0x00, 0x00, 0x01, 0x00, 0x30, 0x31, 0x0B,
0x41, 0x00, 0x00, 0x01, 0x81, 0x70, 0x00, 0x00, 0x01, 0x82, 0x0D, 0x00,
0x00, 0x01, 0x82, 0x22, 0x00, 0x00, 0x01, 0x82, 0x05, 0x00, 0x00, 0x26,
0x01, 0x83, 0xFB, 0x50, 0x01, 0x83, 0xFB, 0x6F, 0x6F, 0x06, 0x04, 0x25,
0x01, 0x00, 0x00, 0x26, 0x01, 0x83, 0xB0, 0x00, 0x01, 0x83, 0xBF, 0x7F,
0x6F, 0x06, 0x04, 0x25, 0x01, 0x00, 0x00, 0x01, 0x83, 0xFF, 0x7F, 0x15,
0x01, 0x83, 0xFF, 0x7E, 0x0D, 0x00
};
static const uint16_t t0_caddr[] PROGMEM = {
@ -833,106 +830,103 @@ static const uint16_t t0_caddr[] PROGMEM = {
188,
193,
198,
202,
207,
212,
217,
238,
243,
248,
253,
282,
297,
203,
208,
213,
234,
239,
244,
249,
264,
269,
275,
281,
286,
294,
302,
308,
314,
319,
327,
335,
341,
346,
357,
986,
1001,
1005,
1010,
1015,
1020,
1025,
1030,
1144,
1149,
1161,
1166,
1171,
1176,
1180,
1185,
1190,
1195,
1200,
1210,
1215,
1220,
1232,
1247,
1252,
1266,
1288,
1299,
1402,
1449,
1482,
1573,
1579,
1642,
1649,
1677,
1705,
1810,
1852,
313,
324,
960,
975,
979,
984,
989,
994,
999,
1004,
1118,
1123,
1135,
1140,
1145,
1150,
1154,
1159,
1164,
1169,
1174,
1184,
1189,
1194,
1206,
1221,
1226,
1240,
1262,
1273,
1376,
1423,
1456,
1547,
1553,
1616,
1623,
1651,
1679,
1784,
1826,
1839,
1851,
1865,
1877,
1891,
1906,
2126,
1880,
2100,
2114,
2131,
2140,
2157,
2166,
2233,
2289,
2293,
2297,
2302,
2207,
2263,
2267,
2271,
2276,
2324,
2350,
2376,
2452,
2496,
2507,
2592,
2630,
2668,
2678,
2426,
2470,
2481,
2566,
2604,
2642,
2652,
2662,
2671,
2684,
2688,
2697,
2710,
2714,
2718,
2722,
2726,
2730,
2734,
2738,
2750,
2758,
2763,
2768,
2773,
2778,
2786
2692,
2696,
2700,
2704,
2708,
2712,
2724,
2732,
2737,
2742,
2747,
2752
};
#define T0_INTERPRETED 61
#define T0_INTERPRETED 60
#define T0_ENTER(ip, rp, slot) do { \
const unsigned char *t0_newip; \
@ -953,7 +947,7 @@ name(void *ctx) \
T0_ENTER(t0ctx->ip, t0ctx->rp, slot); \
}
T0_DEFENTRY(br_x509_minimal_init_main, 147)
T0_DEFENTRY(br_x509_minimal_init_main, 144)
#define T0_NEXT(t0ipp) (pgm_read_byte((*t0ipp)++))
@ -1268,11 +1262,53 @@ br_x509_minimal_run(void *t0ctx)
}
break;
case 25: {
/* check-validity-range */
uint32_t nbs = T0_POP();
uint32_t nbd = T0_POP();
uint32_t nas = T0_POP();
uint32_t nad = T0_POP();
int r;
uint32_t vd = CTX->days;
uint32_t vs = CTX->seconds;
if (vd == 0 && vs == 0) {
#if BR_USE_UNIX_TIME
time_t x = time(NULL);
vd = (uint32_t)(x / 86400) + 719528;
vs = (uint32_t)(x % 86400);
#elif BR_USE_WIN32_TIME
FILETIME ft;
uint64_t x;
GetSystemTimeAsFileTime(&ft);
x = ((uint64_t)ft.dwHighDateTime << 32)
+ (uint64_t)ft.dwLowDateTime;
x = (x / 10000000);
vd = (uint32_t)(x / 86400) + 584754;
vs = (uint32_t)(x % 86400);
#else
CTX->err = BR_ERR_X509_TIME_UNKNOWN;
T0_CO();
#endif
}
if (vd < nbd || (vd == nbd && vs < nbs)) {
r = -1;
} else if (vd > nad || (vd == nad && vs > nas)) {
r = 1;
} else {
r = 0;
}
T0_PUSHi(r);
}
break;
case 26: {
/* co */
T0_CO();
}
break;
case 26: {
case 27: {
/* compute-dn-hash */
CTX->dn_hash_impl->out(&CTX->dn_hash.vtable, CTX->current_dn_hash);
@ -1280,7 +1316,7 @@ br_x509_minimal_run(void *t0ctx)
}
break;
case 27: {
case 28: {
/* compute-tbs-hash */
int id = T0_POPi();
@ -1290,7 +1326,7 @@ br_x509_minimal_run(void *t0ctx)
}
break;
case 28: {
case 29: {
/* copy-ee-ec-pkey */
size_t qlen = T0_POP();
@ -1303,7 +1339,7 @@ br_x509_minimal_run(void *t0ctx)
}
break;
case 29: {
case 30: {
/* copy-ee-rsa-pkey */
size_t elen = T0_POP();
@ -1317,7 +1353,7 @@ br_x509_minimal_run(void *t0ctx)
}
break;
case 30: {
case 31: {
/* copy-name-SAN */
unsigned tag = T0_POP();
@ -1343,7 +1379,7 @@ br_x509_minimal_run(void *t0ctx)
}
break;
case 31: {
case 32: {
/* copy-name-element */
size_t len;
@ -1369,7 +1405,7 @@ br_x509_minimal_run(void *t0ctx)
}
break;
case 32: {
case 33: {
/* data-get8 */
size_t addr = T0_POP();
@ -1377,14 +1413,14 @@ br_x509_minimal_run(void *t0ctx)
}
break;
case 33: {
case 34: {
/* dn-hash-length */
T0_PUSH(DNHASH_LEN);
}
break;
case 34: {
case 35: {
/* do-ecdsa-vrfy */
size_t qlen = T0_POP();
@ -1399,7 +1435,7 @@ br_x509_minimal_run(void *t0ctx)
}
break;
case 35: {
case 36: {
/* do-rsa-vrfy */
size_t elen = T0_POP();
@ -1415,17 +1451,17 @@ br_x509_minimal_run(void *t0ctx)
}
break;
case 36: {
case 37: {
/* drop */
(void)T0_POP();
}
break;
case 37: {
case 38: {
/* dup */
T0_PUSH(T0_PEEK(0));
}
break;
case 38: {
case 39: {
/* eqOID */
const unsigned char *a2 = &t0_datablock[T0_POP()];
@ -1441,7 +1477,7 @@ br_x509_minimal_run(void *t0ctx)
}
break;
case 39: {
case 40: {
/* eqblob */
size_t len = T0_POP();
@ -1451,42 +1487,12 @@ br_x509_minimal_run(void *t0ctx)
}
break;
case 40: {
case 41: {
/* fail */
CTX->err = T0_POPi();
T0_CO();
}
break;
case 41: {
/* get-system-date */
if (CTX->days == 0 && CTX->seconds == 0) {
#if BR_USE_UNIX_TIME
time_t x = time(NULL);
T0_PUSH((uint32_t)(x / 86400) + 719528);
T0_PUSH((uint32_t)(x % 86400));
#elif BR_USE_WIN32_TIME
FILETIME ft;
uint64_t x;
GetSystemTimeAsFileTime(&ft);
x = ((uint64_t)ft.dwHighDateTime << 32)
+ (uint64_t)ft.dwLowDateTime;
x = (x / 10000000);
T0_PUSH((uint32_t)(x / 86400) + 584754);
T0_PUSH((uint32_t)(x % 86400));
#else
CTX->err = BR_ERR_X509_TIME_UNKNOWN;
T0_CO();
#endif
} else {
T0_PUSH(CTX->days);
T0_PUSH(CTX->seconds);
}
}
break;
case 42: {
@ -1642,16 +1648,11 @@ br_x509_minimal_run(void *t0ctx)
}
break;
case 51: {
/* roll */
T0_ROLL(T0_POP());
}
break;
case 52: {
/* rot */
T0_ROT();
}
break;
case 53: {
case 52: {
/* set16 */
uint32_t addr = T0_POP();
@ -1659,7 +1660,7 @@ br_x509_minimal_run(void *t0ctx)
}
break;
case 54: {
case 53: {
/* set32 */
uint32_t addr = T0_POP();
@ -1667,7 +1668,7 @@ br_x509_minimal_run(void *t0ctx)
}
break;
case 55: {
case 54: {
/* set8 */
uint32_t addr = T0_POP();
@ -1675,7 +1676,7 @@ br_x509_minimal_run(void *t0ctx)
}
break;
case 56: {
case 55: {
/* start-dn-hash */
CTX->dn_hash_impl->init(&CTX->dn_hash.vtable);
@ -1683,7 +1684,7 @@ br_x509_minimal_run(void *t0ctx)
}
break;
case 57: {
case 56: {
/* start-tbs-hash */
br_multihash_init(&CTX->mhash);
@ -1691,19 +1692,19 @@ br_x509_minimal_run(void *t0ctx)
}
break;
case 58: {
case 57: {
/* stop-tbs-hash */
CTX->do_mhash = 0;
}
break;
case 59: {
case 58: {
/* swap */
T0_SWAP();
}
break;
case 60: {
case 59: {
/* zero-server-name */
T0_PUSHi(-(CTX->server_name == NULL));

File diff suppressed because it is too large Load Diff

View File

@ -41,6 +41,14 @@
**/
#define BE_USE_SINGLE_FLOAT 1 // use `float` not `double`
/* Macro: BE_BYTES_MAX_SIZE
* Maximum size in bytes of a `bytes()` object.
* Putting too much pressure on the memory allocator can do
* harm, so we limit the maximum size.
* Default: 32kb
**/
#define BE_BYTES_MAX_SIZE (32*1024) /* 32 kb default value */
/* Macro: BE_USE_PRECOMPILED_OBJECT
* Use precompiled objects to avoid creating these objects at
* runtime. Enable this macro can greatly optimize RAM usage.

View File

@ -889,12 +889,21 @@ extern const bcstring be_const_str_zip;
/* weak strings */
extern const bcstring be_const_str__X20for_X20_X27obj_X27_X3A;
extern const bcstring be_const_str__X21;
extern const bcstring be_const_str__X22Device_X22_X3A_X220x_X2504X_X22;
extern const bcstring be_const_str__X22Endpoint_X22_X3A_X25i;
extern const bcstring be_const_str__X22Group_X22_X3A_X220x_X2504X_X22;
extern const bcstring be_const_str__X22LinkQuality_X22_X3A_X25i;
extern const bcstring be_const_str__X23000000;
extern const bcstring be_const_str__X23FFFFFF;
extern const bcstring be_const_str__X2502d_X25s_X2502d;
extern const bcstring be_const_str__X2504X_X25s_X2502X;
extern const bcstring be_const_str__X2504X_X2F_X2504X;
extern const bcstring be_const_str__X27_X20not_X20found;
extern const bcstring be_const_str__X28_X25s_X29;
extern const bcstring be_const_str__X2C_X22text_X22_X3A;
extern const bcstring be_const_str__X2C_X22val_X22_X3A_X25i;
extern const bcstring be_const_str__X2C_X25s_X3A_X22_X2504X_X2F_X2504X_X22;
extern const bcstring be_const_str__X2D_X2D_X3A_X2D_X2D;
extern const bcstring be_const_str__X2Ep1;
extern const bcstring be_const_str__X2Ep2;
@ -902,6 +911,7 @@ extern const bcstring be_const_str_0;
extern const bcstring be_const_str_0x_X2504X;
extern const bcstring be_const_str_9;
extern const bcstring be_const_str__X3Cinstance_X3A_X20_X25s_X280x_X2504X_X2C_X200x_X2508X_X2508X_X2C_X20name_X3A_X27_X25s_X27_X2C_X20model_X3A_X27_X25s_X27_X2C_X20manufacturer_X3A_X27_X25s_X27_X29_X3E;
extern const bcstring be_const_str__X3Cundefined_X3E;
extern const bcstring be_const_str_A;
extern const bcstring be_const_str_AES_GCM;
extern const bcstring be_const_str_ALIGN_BOTTOM_MID;
@ -982,13 +992,27 @@ extern const bcstring be_const_str_TRUE;
extern const bcstring be_const_str_Tapp;
extern const bcstring be_const_str_X;
extern const bcstring be_const_str__action;
extern const bcstring be_const_str__anim_end;
extern const bcstring be_const_str__anim_start;
extern const bcstring be_const_str__arc_anim_end_angle;
extern const bcstring be_const_str__arc_anim_start_angle;
extern const bcstring be_const_str__attr_id;
extern const bcstring be_const_str__attr_ignore;
extern const bcstring be_const_str__attr_map;
extern const bcstring be_const_str__cluster;
extern const bcstring be_const_str__deinit;
extern const bcstring be_const_str__dir;
extern const bcstring be_const_str__direction;
extern const bcstring be_const_str__event_map;
extern const bcstring be_const_str__get_bytes;
extern const bcstring be_const_str__get_key;
extern const bcstring be_const_str__get_val;
extern const bcstring be_const_str__groupaddr;
extern const bcstring be_const_str__handlers;
extern const bcstring be_const_str__init;
extern const bcstring be_const_str__iscmd;
extern const bcstring be_const_str__load;
extern const bcstring be_const_str__lqi;
extern const bcstring be_const_str__lv_class;
extern const bcstring be_const_str__lv_label;
extern const bcstring be_const_str__lv_obj;
@ -1000,7 +1024,10 @@ extern const bcstring be_const_str__oh;
extern const bcstring be_const_str__page;
extern const bcstring be_const_str__page_id;
extern const bcstring be_const_str__set_bytes;
extern const bcstring be_const_str__set_key;
extern const bcstring be_const_str__set_val;
extern const bcstring be_const_str__splash;
extern const bcstring be_const_str__src_ep;
extern const bcstring be_const_str__text_rule;
extern const bcstring be_const_str__text_rule_format;
extern const bcstring be_const_str__text_rule_formula;
@ -1017,9 +1044,12 @@ extern const bcstring be_const_str_adv_block;
extern const bcstring be_const_str_adv_cb;
extern const bcstring be_const_str_adv_watch;
extern const bcstring be_const_str_angle;
extern const bcstring be_const_str_anim_get;
extern const bcstring be_const_str_anim_ntv;
extern const bcstring be_const_str_arc_dsc;
extern const bcstring be_const_str_area;
extern const bcstring be_const_str_atleast1;
extern const bcstring be_const_str_attr_id;
extern const bcstring be_const_str_attribute_error;
extern const bcstring be_const_str_auto_size;
extern const bcstring be_const_str_b0;
@ -1041,6 +1071,7 @@ extern const bcstring be_const_str_clear_flag;
extern const bcstring be_const_str_clear_state;
extern const bcstring be_const_str_clock;
extern const bcstring be_const_str_clock_icon;
extern const bcstring be_const_str_cluster;
extern const bcstring be_const_str_color;
extern const bcstring be_const_str_color_X24;
extern const bcstring be_const_str_comment;
@ -1057,6 +1088,7 @@ extern const bcstring be_const_str_del;
extern const bcstring be_const_str_depower;
extern const bcstring be_const_str_dim;
extern const bcstring be_const_str_dimmer;
extern const bcstring be_const_str_direction;
extern const bcstring be_const_str_dispatch;
extern const bcstring be_const_str_do_action;
extern const bcstring be_const_str_dots;
@ -1072,6 +1104,7 @@ extern const bcstring be_const_str_driver_name;
extern const bcstring be_const_str_encrypt;
extern const bcstring be_const_str_end_angle;
extern const bcstring be_const_str_end_angle1;
extern const bcstring be_const_str_end_value;
extern const bcstring be_const_str_event_dispatch;
extern const bcstring be_const_str_event_send;
extern const bcstring be_const_str_expand;
@ -1151,6 +1184,7 @@ extern const bcstring be_const_str_get_ver_res;
extern const bcstring be_const_str_get_width;
extern const bcstring be_const_str_get_x;
extern const bcstring be_const_str_get_y;
extern const bcstring be_const_str_groupaddr;
extern const bcstring be_const_str_has_flag;
extern const bcstring be_const_str_has_state;
extern const bcstring be_const_str_height;
@ -1168,6 +1202,9 @@ extern const bcstring be_const_str_io_erorr;
extern const bcstring be_const_str_ip;
extern const bcstring be_const_str_is_color_attribute;
extern const bcstring be_const_str_isrunning;
extern const bcstring be_const_str_key;
extern const bcstring be_const_str_key_suffix;
extern const bcstring be_const_str_key_tostring;
extern const bcstring be_const_str_layer_top;
extern const bcstring be_const_str_left;
extern const bcstring be_const_str_line_color;
@ -1179,6 +1216,7 @@ extern const bcstring be_const_str_long;
extern const bcstring be_const_str_longaddr;
extern const bcstring be_const_str_loop;
extern const bcstring be_const_str_lost;
extern const bcstring be_const_str_lqi;
extern const bcstring be_const_str_lv_anim;
extern const bcstring be_const_str_lv_arc;
extern const bcstring be_const_str_lv_bar;
@ -1246,6 +1284,8 @@ extern const bcstring be_const_str_match;
extern const bcstring be_const_str_minute;
extern const bcstring be_const_str_montserrat;
extern const bcstring be_const_str_montserrat_font;
extern const bcstring be_const_str_new_head;
extern const bcstring be_const_str_new_tail;
extern const bcstring be_const_str_no_bytes;
extern const bcstring be_const_str_obj;
extern const bcstring be_const_str_obj_event_base;
@ -1409,8 +1449,10 @@ extern const bcstring be_const_str_splash_init;
extern const bcstring be_const_str_splash_remove;
extern const bcstring be_const_str_splash_runner;
extern const bcstring be_const_str_src;
extern const bcstring be_const_str_src_ep;
extern const bcstring be_const_str_start_angle;
extern const bcstring be_const_str_start_angle1;
extern const bcstring be_const_str_start_value;
extern const bcstring be_const_str_started;
extern const bcstring be_const_str_style_;
extern const bcstring be_const_str_style_bg_color;
@ -1431,10 +1473,14 @@ extern const bcstring be_const_str_style_pad_top;
extern const bcstring be_const_str_style_radius;
extern const bcstring be_const_str_tag;
extern const bcstring be_const_str_target_search;
extern const bcstring be_const_str_test_attr;
extern const bcstring be_const_str_test_msg;
extern const bcstring be_const_str_text;
extern const bcstring be_const_str_text_rule_matched;
extern const bcstring be_const_str_theme_apply;
extern const bcstring be_const_str_theme_haspmota_init;
extern const bcstring be_const_str_time;
extern const bcstring be_const_str_tojson;
extern const bcstring be_const_str_touch_update;
extern const bcstring be_const_str_unable_X20to_X20parse_X20JSON_X20line;
extern const bcstring be_const_str_unknown_X20attribute_X20;
@ -1453,6 +1499,10 @@ extern const bcstring be_const_str_y1;
extern const bcstring be_const_str_zb_coord;
extern const bcstring be_const_str_zb_coord_ntv;
extern const bcstring be_const_str_zb_device;
extern const bcstring be_const_str_zcl_attribute;
extern const bcstring be_const_str_zcl_attribute_list;
extern const bcstring be_const_str_zcl_attribute_list_ntv;
extern const bcstring be_const_str_zcl_attribute_ntv;
extern const bcstring be_const_str_zcl_frame;
extern const bcstring be_const_str_zcl_frame_ntv;
extern const bcstring be_const_str__X7B_X22hasp_X22_X3A_X7B_X22p_X25i_X22_X3A_X22in_X22_X7D_X7D;

View File

@ -890,12 +890,21 @@ be_define_const_str(_X7D, "}", 4161554600u, 0, 1, NULL);
/* weak strings */
be_define_const_str(_X20for_X20_X27obj_X27_X3A, " for 'obj':", 0u, 0, 11, NULL);
be_define_const_str(_X21, "!", 0u, 0, 1, NULL);
be_define_const_str(_X22Device_X22_X3A_X220x_X2504X_X22, "\"Device\":\"0x%04X\"", 0u, 0, 17, NULL);
be_define_const_str(_X22Endpoint_X22_X3A_X25i, "\"Endpoint\":%i", 0u, 0, 13, NULL);
be_define_const_str(_X22Group_X22_X3A_X220x_X2504X_X22, "\"Group\":\"0x%04X\"", 0u, 0, 16, NULL);
be_define_const_str(_X22LinkQuality_X22_X3A_X25i, "\"LinkQuality\":%i", 0u, 0, 16, NULL);
be_define_const_str(_X23000000, "#000000", 0u, 0, 7, NULL);
be_define_const_str(_X23FFFFFF, "#FFFFFF", 0u, 0, 7, NULL);
be_define_const_str(_X2502d_X25s_X2502d, "%02d%s%02d", 0u, 0, 10, NULL);
be_define_const_str(_X2504X_X25s_X2502X, "%04X%s%02X", 0u, 0, 10, NULL);
be_define_const_str(_X2504X_X2F_X2504X, "%04X/%04X", 0u, 0, 9, NULL);
be_define_const_str(_X27_X20not_X20found, "' not found", 0u, 0, 11, NULL);
be_define_const_str(_X28_X25s_X29, "(%s)", 0u, 0, 4, NULL);
be_define_const_str(_X2C_X22text_X22_X3A, ",\"text\":", 0u, 0, 8, NULL);
be_define_const_str(_X2C_X22val_X22_X3A_X25i, ",\"val\":%i", 0u, 0, 9, NULL);
be_define_const_str(_X2C_X25s_X3A_X22_X2504X_X2F_X2504X_X22, ",%s:\"%04X/%04X\"", 0u, 0, 15, NULL);
be_define_const_str(_X2D_X2D_X3A_X2D_X2D, "--:--", 0u, 0, 5, NULL);
be_define_const_str(_X2Ep1, ".p1", 0u, 0, 3, NULL);
be_define_const_str(_X2Ep2, ".p2", 0u, 0, 3, NULL);
@ -903,6 +912,7 @@ be_define_const_str(0, "0", 0u, 0, 1, NULL);
be_define_const_str(0x_X2504X, "0x%04X", 0u, 0, 6, NULL);
be_define_const_str(9, "9", 0u, 0, 1, NULL);
be_define_const_str(_X3Cinstance_X3A_X20_X25s_X280x_X2504X_X2C_X200x_X2508X_X2508X_X2C_X20name_X3A_X27_X25s_X27_X2C_X20model_X3A_X27_X25s_X27_X2C_X20manufacturer_X3A_X27_X25s_X27_X29_X3E, "<instance: %s(0x%04X, 0x%08X%08X, name:'%s', model:'%s', manufacturer:'%s')>", 0u, 0, 76, NULL);
be_define_const_str(_X3Cundefined_X3E, "<undefined>", 0u, 0, 11, NULL);
be_define_const_str(A, "A", 0u, 0, 1, NULL);
be_define_const_str(AES_GCM, "AES_GCM", 0u, 0, 7, NULL);
be_define_const_str(ALIGN_BOTTOM_MID, "ALIGN_BOTTOM_MID", 0u, 0, 16, NULL);
@ -983,13 +993,27 @@ be_define_const_str(TRUE, "TRUE", 0u, 0, 4, NULL);
be_define_const_str(Tapp, "Tapp", 0u, 0, 4, NULL);
be_define_const_str(X, "X", 0u, 0, 1, NULL);
be_define_const_str(_action, "_action", 0u, 0, 7, NULL);
be_define_const_str(_anim_end, "_anim_end", 0u, 0, 9, NULL);
be_define_const_str(_anim_start, "_anim_start", 0u, 0, 11, NULL);
be_define_const_str(_arc_anim_end_angle, "_arc_anim_end_angle", 0u, 0, 19, NULL);
be_define_const_str(_arc_anim_start_angle, "_arc_anim_start_angle", 0u, 0, 21, NULL);
be_define_const_str(_attr_id, "_attr_id", 0u, 0, 8, NULL);
be_define_const_str(_attr_ignore, "_attr_ignore", 0u, 0, 12, NULL);
be_define_const_str(_attr_map, "_attr_map", 0u, 0, 9, NULL);
be_define_const_str(_cluster, "_cluster", 0u, 0, 8, NULL);
be_define_const_str(_deinit, "_deinit", 0u, 0, 7, NULL);
be_define_const_str(_dir, "_dir", 0u, 0, 4, NULL);
be_define_const_str(_direction, "_direction", 0u, 0, 10, NULL);
be_define_const_str(_event_map, "_event_map", 0u, 0, 10, NULL);
be_define_const_str(_get_bytes, "_get_bytes", 0u, 0, 10, NULL);
be_define_const_str(_get_key, "_get_key", 0u, 0, 8, NULL);
be_define_const_str(_get_val, "_get_val", 0u, 0, 8, NULL);
be_define_const_str(_groupaddr, "_groupaddr", 0u, 0, 10, NULL);
be_define_const_str(_handlers, "_handlers", 0u, 0, 9, NULL);
be_define_const_str(_init, "_init", 0u, 0, 5, NULL);
be_define_const_str(_iscmd, "_iscmd", 0u, 0, 6, NULL);
be_define_const_str(_load, "_load", 0u, 0, 5, NULL);
be_define_const_str(_lqi, "_lqi", 0u, 0, 4, NULL);
be_define_const_str(_lv_class, "_lv_class", 0u, 0, 9, NULL);
be_define_const_str(_lv_label, "_lv_label", 0u, 0, 9, NULL);
be_define_const_str(_lv_obj, "_lv_obj", 0u, 0, 7, NULL);
@ -1001,7 +1025,10 @@ be_define_const_str(_oh, "_oh", 0u, 0, 3, NULL);
be_define_const_str(_page, "_page", 0u, 0, 5, NULL);
be_define_const_str(_page_id, "_page_id", 0u, 0, 8, NULL);
be_define_const_str(_set_bytes, "_set_bytes", 0u, 0, 10, NULL);
be_define_const_str(_set_key, "_set_key", 0u, 0, 8, NULL);
be_define_const_str(_set_val, "_set_val", 0u, 0, 8, NULL);
be_define_const_str(_splash, "_splash", 0u, 0, 7, NULL);
be_define_const_str(_src_ep, "_src_ep", 0u, 0, 7, NULL);
be_define_const_str(_text_rule, "_text_rule", 0u, 0, 10, NULL);
be_define_const_str(_text_rule_format, "_text_rule_format", 0u, 0, 17, NULL);
be_define_const_str(_text_rule_formula, "_text_rule_formula", 0u, 0, 18, NULL);
@ -1018,9 +1045,12 @@ be_define_const_str(adv_block, "adv_block", 0u, 0, 9, NULL);
be_define_const_str(adv_cb, "adv_cb", 0u, 0, 6, NULL);
be_define_const_str(adv_watch, "adv_watch", 0u, 0, 9, NULL);
be_define_const_str(angle, "angle", 0u, 0, 5, NULL);
be_define_const_str(anim_get, "anim_get", 0u, 0, 8, NULL);
be_define_const_str(anim_ntv, "anim_ntv", 0u, 0, 8, NULL);
be_define_const_str(arc_dsc, "arc_dsc", 0u, 0, 7, NULL);
be_define_const_str(area, "area", 0u, 0, 4, NULL);
be_define_const_str(atleast1, "atleast1", 0u, 0, 8, NULL);
be_define_const_str(attr_id, "attr_id", 0u, 0, 7, NULL);
be_define_const_str(attribute_error, "attribute_error", 0u, 0, 15, NULL);
be_define_const_str(auto_size, "auto_size", 0u, 0, 9, NULL);
be_define_const_str(b0, "b0", 0u, 0, 2, NULL);
@ -1042,6 +1072,7 @@ be_define_const_str(clear_flag, "clear_flag", 0u, 0, 10, NULL);
be_define_const_str(clear_state, "clear_state", 0u, 0, 11, NULL);
be_define_const_str(clock, "clock", 0u, 0, 5, NULL);
be_define_const_str(clock_icon, "clock_icon", 0u, 0, 10, NULL);
be_define_const_str(cluster, "cluster", 0u, 0, 7, NULL);
be_define_const_str(color, "color", 0u, 0, 5, NULL);
be_define_const_str(color_X24, "color$", 0u, 0, 6, NULL);
be_define_const_str(comment, "comment", 0u, 0, 7, NULL);
@ -1058,6 +1089,7 @@ be_define_const_str(del, "del", 0u, 0, 3, NULL);
be_define_const_str(depower, "depower", 0u, 0, 7, NULL);
be_define_const_str(dim, "dim", 0u, 0, 3, NULL);
be_define_const_str(dimmer, "dimmer", 0u, 0, 6, NULL);
be_define_const_str(direction, "direction", 0u, 0, 9, NULL);
be_define_const_str(dispatch, "dispatch", 0u, 0, 8, NULL);
be_define_const_str(do_action, "do_action", 0u, 0, 9, NULL);
be_define_const_str(dots, "dots", 0u, 0, 4, NULL);
@ -1073,6 +1105,7 @@ be_define_const_str(driver_name, "driver_name", 0u, 0, 11, NULL);
be_define_const_str(encrypt, "encrypt", 0u, 0, 7, NULL);
be_define_const_str(end_angle, "end_angle", 0u, 0, 9, NULL);
be_define_const_str(end_angle1, "end_angle1", 0u, 0, 10, NULL);
be_define_const_str(end_value, "end_value", 0u, 0, 9, NULL);
be_define_const_str(event_dispatch, "event_dispatch", 0u, 0, 14, NULL);
be_define_const_str(event_send, "event_send", 0u, 0, 10, NULL);
be_define_const_str(expand, "expand", 0u, 0, 6, NULL);
@ -1152,6 +1185,7 @@ be_define_const_str(get_ver_res, "get_ver_res", 0u, 0, 11, NULL);
be_define_const_str(get_width, "get_width", 0u, 0, 9, NULL);
be_define_const_str(get_x, "get_x", 0u, 0, 5, NULL);
be_define_const_str(get_y, "get_y", 0u, 0, 5, NULL);
be_define_const_str(groupaddr, "groupaddr", 0u, 0, 9, NULL);
be_define_const_str(has_flag, "has_flag", 0u, 0, 8, NULL);
be_define_const_str(has_state, "has_state", 0u, 0, 9, NULL);
be_define_const_str(height, "height", 0u, 0, 6, NULL);
@ -1169,6 +1203,9 @@ be_define_const_str(io_erorr, "io_erorr", 0u, 0, 8, NULL);
be_define_const_str(ip, "ip", 0u, 0, 2, NULL);
be_define_const_str(is_color_attribute, "is_color_attribute", 0u, 0, 18, NULL);
be_define_const_str(isrunning, "isrunning", 0u, 0, 9, NULL);
be_define_const_str(key, "key", 0u, 0, 3, NULL);
be_define_const_str(key_suffix, "key_suffix", 0u, 0, 10, NULL);
be_define_const_str(key_tostring, "key_tostring", 0u, 0, 12, NULL);
be_define_const_str(layer_top, "layer_top", 0u, 0, 9, NULL);
be_define_const_str(left, "left", 0u, 0, 4, NULL);
be_define_const_str(line_color, "line_color", 0u, 0, 10, NULL);
@ -1180,6 +1217,7 @@ be_define_const_str(long, "long", 0u, 0, 4, NULL);
be_define_const_str(longaddr, "longaddr", 0u, 0, 8, NULL);
be_define_const_str(loop, "loop", 0u, 0, 4, NULL);
be_define_const_str(lost, "lost", 0u, 0, 4, NULL);
be_define_const_str(lqi, "lqi", 0u, 0, 3, NULL);
be_define_const_str(lv_anim, "lv_anim", 0u, 0, 7, NULL);
be_define_const_str(lv_arc, "lv_arc", 0u, 0, 6, NULL);
be_define_const_str(lv_bar, "lv_bar", 0u, 0, 6, NULL);
@ -1247,6 +1285,8 @@ be_define_const_str(match, "match", 0u, 0, 5, NULL);
be_define_const_str(minute, "minute", 0u, 0, 6, NULL);
be_define_const_str(montserrat, "montserrat", 0u, 0, 10, NULL);
be_define_const_str(montserrat_font, "montserrat_font", 0u, 0, 15, NULL);
be_define_const_str(new_head, "new_head", 0u, 0, 8, NULL);
be_define_const_str(new_tail, "new_tail", 0u, 0, 8, NULL);
be_define_const_str(no_bytes, "no_bytes", 0u, 0, 8, NULL);
be_define_const_str(obj, "obj", 0u, 0, 3, NULL);
be_define_const_str(obj_event_base, "obj_event_base", 0u, 0, 14, NULL);
@ -1410,8 +1450,10 @@ be_define_const_str(splash_init, "splash_init", 0u, 0, 11, NULL);
be_define_const_str(splash_remove, "splash_remove", 0u, 0, 13, NULL);
be_define_const_str(splash_runner, "splash_runner", 0u, 0, 13, NULL);
be_define_const_str(src, "src", 0u, 0, 3, NULL);
be_define_const_str(src_ep, "src_ep", 0u, 0, 6, NULL);
be_define_const_str(start_angle, "start_angle", 0u, 0, 11, NULL);
be_define_const_str(start_angle1, "start_angle1", 0u, 0, 12, NULL);
be_define_const_str(start_value, "start_value", 0u, 0, 11, NULL);
be_define_const_str(started, "started", 0u, 0, 7, NULL);
be_define_const_str(style_, "style_", 0u, 0, 6, NULL);
be_define_const_str(style_bg_color, "style_bg_color", 0u, 0, 14, NULL);
@ -1432,10 +1474,14 @@ be_define_const_str(style_pad_top, "style_pad_top", 0u, 0, 13, NULL);
be_define_const_str(style_radius, "style_radius", 0u, 0, 12, NULL);
be_define_const_str(tag, "tag", 0u, 0, 3, NULL);
be_define_const_str(target_search, "target_search", 0u, 0, 13, NULL);
be_define_const_str(test_attr, "test_attr", 0u, 0, 9, NULL);
be_define_const_str(test_msg, "test_msg", 0u, 0, 8, NULL);
be_define_const_str(text, "text", 0u, 0, 4, NULL);
be_define_const_str(text_rule_matched, "text_rule_matched", 0u, 0, 17, NULL);
be_define_const_str(theme_apply, "theme_apply", 0u, 0, 11, NULL);
be_define_const_str(theme_haspmota_init, "theme_haspmota_init", 0u, 0, 19, NULL);
be_define_const_str(time, "time", 0u, 0, 4, NULL);
be_define_const_str(tojson, "tojson", 0u, 0, 6, NULL);
be_define_const_str(touch_update, "touch_update", 0u, 0, 12, NULL);
be_define_const_str(unable_X20to_X20parse_X20JSON_X20line, "unable to parse JSON line", 0u, 0, 25, NULL);
be_define_const_str(unknown_X20attribute_X20, "unknown attribute ", 0u, 0, 18, NULL);
@ -1454,6 +1500,10 @@ be_define_const_str(y1, "y1", 0u, 0, 2, NULL);
be_define_const_str(zb_coord, "zb_coord", 0u, 0, 8, NULL);
be_define_const_str(zb_coord_ntv, "zb_coord_ntv", 0u, 0, 12, NULL);
be_define_const_str(zb_device, "zb_device", 0u, 0, 9, NULL);
be_define_const_str(zcl_attribute, "zcl_attribute", 0u, 0, 13, NULL);
be_define_const_str(zcl_attribute_list, "zcl_attribute_list", 0u, 0, 18, NULL);
be_define_const_str(zcl_attribute_list_ntv, "zcl_attribute_list_ntv", 0u, 0, 22, NULL);
be_define_const_str(zcl_attribute_ntv, "zcl_attribute_ntv", 0u, 0, 17, NULL);
be_define_const_str(zcl_frame, "zcl_frame", 0u, 0, 9, NULL);
be_define_const_str(zcl_frame_ntv, "zcl_frame_ntv", 0u, 0, 13, NULL);
be_define_const_str(_X7B_X22hasp_X22_X3A_X7B_X22p_X25i_X22_X3A_X22in_X22_X7D_X7D, "{\"hasp\":{\"p%i\":\"in\"}}", 0u, 0, 21, NULL);

View File

@ -0,0 +1,20 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_lv_anim_map) {
{ be_const_key_weak(init, -1), be_const_func(lv_be_anim_init) },
{ be_const_key_weak(tostring, -1), be_const_func(lv_x_tostring) },
{ be_const_key_weak(_p, -1), be_const_var(0) },
{ be_const_key_weak(member, 0), be_const_func(lv_x_member) },
};
static be_define_const_map(
be_class_lv_anim_map,
4
);
BE_EXPORT_VARIABLE be_define_const_class(
be_class_lv_anim,
1,
NULL,
lv_anim
);

View File

@ -0,0 +1,18 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_lv_arc_map) {
{ be_const_key_weak(_class, -1), be_const_comptr(&lv_arc_class) },
{ be_const_key_weak(init, -1), be_const_func(be_ntv_lv_arc_init) },
};
static be_define_const_map(
be_class_lv_arc_map,
2
);
BE_EXPORT_VARIABLE be_define_const_class(
be_class_lv_arc,
0,
(bclass *)&be_class_lv_obj,
lv_arc
);

View File

@ -0,0 +1,18 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_lv_bar_map) {
{ be_const_key_weak(_class, -1), be_const_comptr(&lv_bar_class) },
{ be_const_key_weak(init, -1), be_const_func(be_ntv_lv_bar_init) },
};
static be_define_const_map(
be_class_lv_bar_map,
2
);
BE_EXPORT_VARIABLE be_define_const_class(
be_class_lv_bar,
0,
(bclass *)&be_class_lv_obj,
lv_bar
);

View File

@ -0,0 +1,18 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_lv_btn_map) {
{ be_const_key_weak(_class, -1), be_const_comptr(&lv_btn_class) },
{ be_const_key_weak(init, -1), be_const_func(be_ntv_lv_btn_init) },
};
static be_define_const_map(
be_class_lv_btn_map,
2
);
BE_EXPORT_VARIABLE be_define_const_class(
be_class_lv_btn,
0,
(bclass *)&be_class_lv_obj,
lv_btn
);

View File

@ -0,0 +1,18 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_lv_btnmatrix_map) {
{ be_const_key_weak(_class, -1), be_const_comptr(&lv_btnmatrix_class) },
{ be_const_key_weak(init, -1), be_const_func(be_ntv_lv_btnmatrix_init) },
};
static be_define_const_map(
be_class_lv_btnmatrix_map,
2
);
BE_EXPORT_VARIABLE be_define_const_class(
be_class_lv_btnmatrix,
0,
(bclass *)&be_class_lv_obj,
lv_btnmatrix
);

View File

@ -0,0 +1,18 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_lv_canvas_map) {
{ be_const_key_weak(_class, -1), be_const_comptr(&lv_canvas_class) },
{ be_const_key_weak(init, -1), be_const_func(be_ntv_lv_canvas_init) },
};
static be_define_const_map(
be_class_lv_canvas_map,
2
);
BE_EXPORT_VARIABLE be_define_const_class(
be_class_lv_canvas,
0,
(bclass *)&be_class_lv_img,
lv_canvas
);

View File

@ -0,0 +1,18 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_lv_chart_map) {
{ be_const_key_weak(_class, -1), be_const_comptr(&lv_chart_class) },
{ be_const_key_weak(init, -1), be_const_func(be_ntv_lv_chart_init) },
};
static be_define_const_map(
be_class_lv_chart_map,
2
);
BE_EXPORT_VARIABLE be_define_const_class(
be_class_lv_chart,
0,
(bclass *)&be_class_lv_obj,
lv_chart
);

View File

@ -0,0 +1,18 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_lv_checkbox_map) {
{ be_const_key_weak(_class, -1), be_const_comptr(&lv_checkbox_class) },
{ be_const_key_weak(init, -1), be_const_func(be_ntv_lv_checkbox_init) },
};
static be_define_const_map(
be_class_lv_checkbox_map,
2
);
BE_EXPORT_VARIABLE be_define_const_class(
be_class_lv_checkbox,
0,
(bclass *)&be_class_lv_obj,
lv_checkbox
);

View File

@ -0,0 +1,20 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_lv_color_map) {
{ be_const_key_weak(toint, -1), be_const_func(lco_toint) },
{ be_const_key_weak(tostring, 0), be_const_func(lco_tostring) },
{ be_const_key_weak(_p, -1), be_const_var(0) },
{ be_const_key_weak(init, -1), be_const_func(lco_init) },
};
static be_define_const_map(
be_class_lv_color_map,
4
);
BE_EXPORT_VARIABLE be_define_const_class(
be_class_lv_color,
1,
NULL,
lv_color
);

View File

@ -0,0 +1,18 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_lv_colorwheel_map) {
{ be_const_key_weak(_class, -1), be_const_comptr(&lv_colorwheel_class) },
{ be_const_key_weak(init, -1), be_const_func(be_ntv_lv_colorwheel_init) },
};
static be_define_const_map(
be_class_lv_colorwheel_map,
2
);
BE_EXPORT_VARIABLE be_define_const_class(
be_class_lv_colorwheel,
0,
(bclass *)&be_class_lv_obj,
lv_colorwheel
);

View File

@ -0,0 +1,20 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_lv_disp_map) {
{ be_const_key_weak(init, -1), be_const_func(lv0_init) },
{ be_const_key_weak(tostring, -1), be_const_func(lv_x_tostring) },
{ be_const_key_weak(_p, -1), be_const_var(0) },
{ be_const_key_weak(member, 0), be_const_func(lv_x_member) },
};
static be_define_const_map(
be_class_lv_disp_map,
4
);
BE_EXPORT_VARIABLE be_define_const_class(
be_class_lv_disp,
1,
NULL,
lv_disp
);

View File

@ -0,0 +1,18 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_lv_dropdown_map) {
{ be_const_key_weak(_class, -1), be_const_comptr(&lv_dropdown_class) },
{ be_const_key_weak(init, -1), be_const_func(be_ntv_lv_dropdown_init) },
};
static be_define_const_map(
be_class_lv_dropdown_map,
2
);
BE_EXPORT_VARIABLE be_define_const_class(
be_class_lv_dropdown,
0,
(bclass *)&be_class_lv_obj,
lv_dropdown
);

View File

@ -0,0 +1,19 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_lv_font_map) {
{ be_const_key_weak(init, -1), be_const_func(lvbe_font_create) },
{ be_const_key_weak(tostring, -1), be_const_func(lv_x_tostring) },
{ be_const_key_weak(_p, -1), be_const_var(0) },
};
static be_define_const_map(
be_class_lv_font_map,
3
);
BE_EXPORT_VARIABLE be_define_const_class(
be_class_lv_font,
1,
NULL,
lv_font
);

View File

@ -0,0 +1,20 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_lv_group_map) {
{ be_const_key_weak(init, -1), be_const_func(be_ntv_lv_group_init) },
{ be_const_key_weak(tostring, -1), be_const_func(lv_x_tostring) },
{ be_const_key_weak(_p, -1), be_const_var(0) },
{ be_const_key_weak(member, 0), be_const_func(lv_x_member) },
};
static be_define_const_map(
be_class_lv_group_map,
4
);
BE_EXPORT_VARIABLE be_define_const_class(
be_class_lv_group,
1,
NULL,
lv_group
);

View File

@ -0,0 +1,18 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_lv_img_map) {
{ be_const_key_weak(_class, -1), be_const_comptr(&lv_img_class) },
{ be_const_key_weak(init, -1), be_const_func(be_ntv_lv_img_init) },
};
static be_define_const_map(
be_class_lv_img_map,
2
);
BE_EXPORT_VARIABLE be_define_const_class(
be_class_lv_img,
0,
(bclass *)&be_class_lv_obj,
lv_img
);

View File

@ -0,0 +1,18 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_lv_imgbtn_map) {
{ be_const_key_weak(_class, -1), be_const_comptr(&lv_imgbtn_class) },
{ be_const_key_weak(init, -1), be_const_func(be_ntv_lv_imgbtn_init) },
};
static be_define_const_map(
be_class_lv_imgbtn_map,
2
);
BE_EXPORT_VARIABLE be_define_const_class(
be_class_lv_imgbtn,
0,
(bclass *)&be_class_lv_obj,
lv_imgbtn
);

View File

@ -0,0 +1,20 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_lv_indev_map) {
{ be_const_key_weak(init, -1), be_const_func(lv0_init) },
{ be_const_key_weak(tostring, -1), be_const_func(lv_x_tostring) },
{ be_const_key_weak(_p, -1), be_const_var(0) },
{ be_const_key_weak(member, 0), be_const_func(lv_x_member) },
};
static be_define_const_map(
be_class_lv_indev_map,
4
);
BE_EXPORT_VARIABLE be_define_const_class(
be_class_lv_indev,
1,
NULL,
lv_indev
);

View File

@ -0,0 +1,18 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_lv_label_map) {
{ be_const_key_weak(_class, -1), be_const_comptr(&lv_label_class) },
{ be_const_key_weak(init, -1), be_const_func(be_ntv_lv_label_init) },
};
static be_define_const_map(
be_class_lv_label_map,
2
);
BE_EXPORT_VARIABLE be_define_const_class(
be_class_lv_label,
0,
(bclass *)&be_class_lv_obj,
lv_label
);

View File

@ -0,0 +1,18 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_lv_led_map) {
{ be_const_key_weak(_class, -1), be_const_comptr(&lv_led_class) },
{ be_const_key_weak(init, -1), be_const_func(be_ntv_lv_led_init) },
};
static be_define_const_map(
be_class_lv_led_map,
2
);
BE_EXPORT_VARIABLE be_define_const_class(
be_class_lv_led,
0,
(bclass *)&be_class_lv_obj,
lv_led
);

View File

@ -0,0 +1,18 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_lv_line_map) {
{ be_const_key_weak(_class, -1), be_const_comptr(&lv_line_class) },
{ be_const_key_weak(init, -1), be_const_func(be_ntv_lv_line_init) },
};
static be_define_const_map(
be_class_lv_line_map,
2
);
BE_EXPORT_VARIABLE be_define_const_class(
be_class_lv_line,
0,
(bclass *)&be_class_lv_obj,
lv_line
);

View File

@ -0,0 +1,18 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_lv_meter_map) {
{ be_const_key_weak(_class, -1), be_const_comptr(&lv_meter_class) },
{ be_const_key_weak(init, -1), be_const_func(be_ntv_lv_meter_init) },
};
static be_define_const_map(
be_class_lv_meter_map,
2
);
BE_EXPORT_VARIABLE be_define_const_class(
be_class_lv_meter,
0,
(bclass *)&be_class_lv_obj,
lv_meter
);

View File

@ -0,0 +1,18 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_lv_msgbox_map) {
{ be_const_key_weak(_class, -1), be_const_comptr(&lv_msgbox_class) },
{ be_const_key_weak(init, -1), be_const_func(be_ntv_lv_msgbox_init) },
};
static be_define_const_map(
be_class_lv_msgbox_map,
2
);
BE_EXPORT_VARIABLE be_define_const_class(
be_class_lv_msgbox,
0,
(bclass *)&be_class_lv_obj,
lv_msgbox
);

View File

@ -0,0 +1,21 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_lv_obj_map) {
{ be_const_key_weak(tostring, 3), be_const_func(lv_x_tostring) },
{ be_const_key_weak(member, -1), be_const_func(lv_x_member) },
{ be_const_key_weak(_p, -1), be_const_var(0) },
{ be_const_key_weak(init, 4), be_const_func(be_ntv_lv_obj_init) },
{ be_const_key_weak(_class, -1), be_const_comptr(&lv_obj_class) },
};
static be_define_const_map(
be_class_lv_obj_map,
5
);
BE_EXPORT_VARIABLE be_define_const_class(
be_class_lv_obj,
1,
NULL,
lv_obj
);

View File

@ -0,0 +1,18 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_lv_qrcode_map) {
{ be_const_key_weak(_class, -1), be_const_comptr(&lv_qrcode_class) },
{ be_const_key_weak(init, -1), be_const_func(be_ntv_lv_qrcode_init) },
};
static be_define_const_map(
be_class_lv_qrcode_map,
2
);
BE_EXPORT_VARIABLE be_define_const_class(
be_class_lv_qrcode,
0,
(bclass *)&be_class_lv_obj,
lv_qrcode
);

View File

@ -0,0 +1,18 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_lv_roller_map) {
{ be_const_key_weak(_class, -1), be_const_comptr(&lv_roller_class) },
{ be_const_key_weak(init, -1), be_const_func(be_ntv_lv_roller_init) },
};
static be_define_const_map(
be_class_lv_roller_map,
2
);
BE_EXPORT_VARIABLE be_define_const_class(
be_class_lv_roller,
0,
(bclass *)&be_class_lv_obj,
lv_roller
);

View File

@ -0,0 +1,18 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_lv_slider_map) {
{ be_const_key_weak(_class, -1), be_const_comptr(&lv_slider_class) },
{ be_const_key_weak(init, -1), be_const_func(be_ntv_lv_slider_init) },
};
static be_define_const_map(
be_class_lv_slider_map,
2
);
BE_EXPORT_VARIABLE be_define_const_class(
be_class_lv_slider,
0,
(bclass *)&be_class_lv_obj,
lv_slider
);

View File

@ -0,0 +1,18 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_lv_spinbox_map) {
{ be_const_key_weak(_class, -1), be_const_comptr(&lv_spinbox_class) },
{ be_const_key_weak(init, -1), be_const_func(be_ntv_lv_spinbox_init) },
};
static be_define_const_map(
be_class_lv_spinbox_map,
2
);
BE_EXPORT_VARIABLE be_define_const_class(
be_class_lv_spinbox,
0,
(bclass *)&be_class_lv_textarea,
lv_spinbox
);

View File

@ -0,0 +1,20 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_lv_spinner_map) {
{ be_const_key_weak(_arc_anim_end_angle, -1), be_const_comptr(&arc_anim_end_angle) },
{ be_const_key_weak(_arc_anim_start_angle, -1), be_const_comptr(&arc_anim_start_angle) },
{ be_const_key_weak(_class, -1), be_const_comptr(&lv_spinner_class) },
{ be_const_key_weak(init, -1), be_const_func(be_ntv_lv_spinner_init) },
};
static be_define_const_map(
be_class_lv_spinner_map,
4
);
BE_EXPORT_VARIABLE be_define_const_class(
be_class_lv_spinner,
0,
(bclass *)&be_class_lv_arc,
lv_spinner
);

View File

@ -0,0 +1,20 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_lv_style_map) {
{ be_const_key_weak(init, -1), be_const_func(lv_be_style_init) },
{ be_const_key_weak(tostring, -1), be_const_func(lv_x_tostring) },
{ be_const_key_weak(_p, -1), be_const_var(0) },
{ be_const_key_weak(member, 0), be_const_func(lv_x_member) },
};
static be_define_const_map(
be_class_lv_style_map,
4
);
BE_EXPORT_VARIABLE be_define_const_class(
be_class_lv_style,
1,
NULL,
lv_style
);

View File

@ -0,0 +1,18 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_lv_switch_map) {
{ be_const_key_weak(_class, -1), be_const_comptr(&lv_switch_class) },
{ be_const_key_weak(init, -1), be_const_func(be_ntv_lv_switch_init) },
};
static be_define_const_map(
be_class_lv_switch_map,
2
);
BE_EXPORT_VARIABLE be_define_const_class(
be_class_lv_switch,
0,
(bclass *)&be_class_lv_obj,
lv_switch
);

View File

@ -0,0 +1,18 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_lv_table_map) {
{ be_const_key_weak(_class, -1), be_const_comptr(&lv_table_class) },
{ be_const_key_weak(init, -1), be_const_func(be_ntv_lv_table_init) },
};
static be_define_const_map(
be_class_lv_table_map,
2
);
BE_EXPORT_VARIABLE be_define_const_class(
be_class_lv_table,
0,
(bclass *)&be_class_lv_obj,
lv_table
);

View File

@ -0,0 +1,18 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_lv_textarea_map) {
{ be_const_key_weak(_class, -1), be_const_comptr(&lv_textarea_class) },
{ be_const_key_weak(init, -1), be_const_func(be_ntv_lv_textarea_init) },
};
static be_define_const_map(
be_class_lv_textarea_map,
2
);
BE_EXPORT_VARIABLE be_define_const_class(
be_class_lv_textarea,
0,
(bclass *)&be_class_lv_obj,
lv_textarea
);

View File

@ -0,0 +1,19 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_lv_theme_map) {
{ be_const_key_weak(init, -1), be_const_func(lvbe_theme_create) },
{ be_const_key_weak(tostring, -1), be_const_func(lv_x_tostring) },
{ be_const_key_weak(_p, -1), be_const_var(0) },
};
static be_define_const_map(
be_class_lv_theme_map,
3
);
BE_EXPORT_VARIABLE be_define_const_class(
be_class_lv_theme,
1,
NULL,
lv_theme
);

View File

@ -0,0 +1,20 @@
#include "be_constobj.h"
static be_define_const_map_slots(be_class_lv_timer_map) {
{ be_const_key_weak(init, -1), be_const_func(lv0_init) },
{ be_const_key_weak(tostring, -1), be_const_func(lv_x_tostring) },
{ be_const_key_weak(_p, -1), be_const_var(0) },
{ be_const_key_weak(member, 0), be_const_func(lv_x_member) },
};
static be_define_const_map(
be_class_lv_timer_map,
4
);
BE_EXPORT_VARIABLE be_define_const_class(
be_class_lv_timer,
1,
NULL,
lv_timer
);

Some files were not shown because too many files have changed in this diff Show More