ESPHome  2024.4.1
Data Structures | Namespaces | Enumerations | Functions | Variables
bedjet_codec.h File Reference

Go to the source code of this file.

Data Structures

struct  esphome::bedjet::BedjetPacket
 
struct  esphome::bedjet::BedjetStatusPacket
 The format of a BedJet V3 status packet. More...
 
class  esphome::bedjet::BedjetCodec
 This class is responsible for encoding command packets and decoding status packets. More...
 

Namespaces

 esphome
 This is a workaround until we can figure out a way to get the tflite-micro idf component code available in CI.
 
 esphome::bedjet
 

Enumerations

enum  esphome::bedjet::BedjetPacketFormat : uint8_t { esphome::bedjet::PACKET_FORMAT_DEBUG = 0x05, esphome::bedjet::PACKET_FORMAT_V3_HOME = 0x56 }
 
enum  esphome::bedjet::BedjetPacketType : uint8_t { esphome::bedjet::PACKET_TYPE_STATUS = 0x1, esphome::bedjet::PACKET_TYPE_DEBUG = 0x2 }
 
enum  esphome::bedjet::BedjetNotification : uint8_t {
  esphome::bedjet::NOTIFY_NONE = 0, esphome::bedjet::NOTIFY_FILTER = 1, esphome::bedjet::NOTIFY_UPDATE = 2, esphome::bedjet::NOTIFY_UPDATE_FAIL = 3,
  esphome::bedjet::NOTIFY_BIO_FAIL_CLOCK_NOT_SET = 4, esphome::bedjet::NOTIFY_BIO_FAIL_TOO_LONG = 5
}
 

Functions

struct esphome::bedjet::BedjetStatusPacket esphome::bedjet::__attribute__ ((packed))
 

Variables

int unused_1
 
int unused_2
 
bool conn_test_passed
 (0x20) Bit is set 1 if the last connection test passed. More...
 
bool leds_enabled
 (0x10) Bit is set 1 if the LEDs on the device are enabled. More...
 
int unused_3
 
bool units_setup
 (0x04) Bit is set 1 if the device's units have been configured. More...
 
int unused_4
 
bool beeps_muted
 (0x01) Bit is set 1 if the device's sound output is muted. More...
 
bool is_partial
 1 indicates that this is a partial packet, and more data can be read directly from the characteristic. More...
 
BedjetPacketFormat packet_format
 BedjetPacketFormat::PACKET_FORMAT_V3_HOME for BedJet V3 status packet format. More...
 
uint8_t expecting_length
 The expected total length of the status packet after merging the extra packet. More...
 
BedjetPacketType packet_type
 Typically BedjetPacketType::PACKET_TYPE_STATUS for BedJet V3 status packet. More...
 
uint8_t time_remaining_hrs
 Hours remaining in program runtime. More...
 
uint8_t time_remaining_mins
 Minutes remaining in program runtime. More...
 
uint8_t time_remaining_secs
 Seconds remaining in program runtime. More...
 
uint8_t actual_temp_step
 Actual temp of the air blown by the BedJet fan; value represents 2 * degrees_celsius. More...
 
uint8_t target_temp_step
 Target temp that the BedJet will try to heat to. See actual_temp_step. More...
 
BedjetMode mode
 BedJet operating mode. More...
 
uint8_t fan_step
 BedJet fan speed; value is in the 0-19 range, representing 5% increments (5%-100%): `5 + 5. More...
 
uint8_t max_hrs
 Max hours of mode runtime. More...
 
uint8_t max_mins
 Max minutes of mode runtime. More...
 
uint8_t min_temp_step
 Min temp allowed in mode. See actual_temp_step. More...
 
uint8_t max_temp_step
 Max temp allowed in mode. See actual_temp_step. More...
 
uint16_t turbo_time
 Time remaining in BedjetMode::MODE_TURBO. More...
 
uint8_t ambient_temp_step
 Current ambient air temp. More...
 
uint8_t shutdown_reason
 The reason for the last device shutdown. More...
 
struct {
   int   unused_1: 1
 
   int   unused_2: 1
 
   int   unused_3: 1
 
   int   unused_4: 1
 
   int   unused_5: 1
 
   int   unused_6: 1
 
   bool   is_dual_zone: 1
 
   int   unused_7: 1
 Is part of a Dual Zone configuration. More...
 
dual_zone_flags
 
uint8_t update_phase
 The current status/phase of a firmware update. More...
 
union {
   uint8_t   flags_packed
 
}; 
 
uint8_t bio_sequence_step
 
BedjetNotification notify_code
 Biorhythm sequence step number. More...
 
class esphome::bedjet::BedjetCodec esphome::bedjet::__attribute__
 

Variable Documentation

◆ @10

union { ... }

◆ actual_temp_step

uint8_t actual_temp_step

Actual temp of the air blown by the BedJet fan; value represents 2 * degrees_celsius.

See #bedjet_temp_to_c and #bedjet_temp_to_f

Definition at line 146 of file bedjet_codec.h.

◆ ambient_temp_step

uint8_t ambient_temp_step

Current ambient air temp.

This is the coldest air the BedJet can blow. See actual_temp_step.

Definition at line 165 of file bedjet_codec.h.

◆ beeps_muted

bool beeps_muted

(0x01) Bit is set 1 if the device's sound output is muted.

Definition at line 115 of file bedjet_codec.h.

◆ bio_sequence_step

uint8_t bio_sequence_step

Definition at line 213 of file bedjet_codec.h.

◆ conn_test_passed

bool conn_test_passed

(0x20) Bit is set 1 if the last connection test passed.

Definition at line 110 of file bedjet_codec.h.

◆ dual_zone_flags

struct { ... } dual_zone_flags

◆ expecting_length

uint8_t expecting_length

The expected total length of the status packet after merging the extra packet.

Definition at line 137 of file bedjet_codec.h.

◆ fan_step

uint8_t fan_step

BedJet fan speed; value is in the 0-19 range, representing 5% increments (5%-100%): `5 + 5.

  • fan_step`

Definition at line 154 of file bedjet_codec.h.

◆ flags_packed

uint8_t flags_packed

Definition at line 198 of file bedjet_codec.h.

◆ is_dual_zone

bool is_dual_zone

Definition at line 183 of file bedjet_codec.h.

◆ is_partial

bool is_partial

1 indicates that this is a partial packet, and more data can be read directly from the characteristic.

Definition at line 133 of file bedjet_codec.h.

◆ leds_enabled

bool leds_enabled

(0x10) Bit is set 1 if the LEDs on the device are enabled.

Definition at line 111 of file bedjet_codec.h.

◆ max_hrs

uint8_t max_hrs

Max hours of mode runtime.

Definition at line 156 of file bedjet_codec.h.

◆ max_mins

uint8_t max_mins

Max minutes of mode runtime.

Definition at line 157 of file bedjet_codec.h.

◆ max_temp_step

uint8_t max_temp_step

Max temp allowed in mode. See actual_temp_step.

Definition at line 159 of file bedjet_codec.h.

◆ min_temp_step

uint8_t min_temp_step

Min temp allowed in mode. See actual_temp_step.

Definition at line 158 of file bedjet_codec.h.

◆ mode

BedjetMode mode

BedJet operating mode.

Definition at line 151 of file bedjet_codec.h.

◆ notify_code

BedjetNotification notify_code

Biorhythm sequence step number.

Definition at line 215 of file bedjet_codec.h.

◆ packet_format

BedjetPacketFormat packet_format

BedjetPacketFormat::PACKET_FORMAT_V3_HOME for BedJet V3 status packet format.

BedjetPacketFormat::PACKET_FORMAT_DEBUG for debugging packets.

Definition at line 135 of file bedjet_codec.h.

◆ packet_type

BedjetPacketType packet_type

Typically BedjetPacketType::PACKET_TYPE_STATUS for BedJet V3 status packet.

Definition at line 138 of file bedjet_codec.h.

◆ shutdown_reason

uint8_t shutdown_reason

The reason for the last device shutdown.

Definition at line 167 of file bedjet_codec.h.

◆ target_temp_step

uint8_t target_temp_step

Target temp that the BedJet will try to heat to. See actual_temp_step.

Definition at line 148 of file bedjet_codec.h.

◆ time_remaining_hrs

uint8_t time_remaining_hrs

Hours remaining in program runtime.

Definition at line 141 of file bedjet_codec.h.

◆ time_remaining_mins

uint8_t time_remaining_mins

Minutes remaining in program runtime.

Definition at line 142 of file bedjet_codec.h.

◆ time_remaining_secs

uint8_t time_remaining_secs

Seconds remaining in program runtime.

Definition at line 143 of file bedjet_codec.h.

◆ turbo_time

uint16_t turbo_time

Time remaining in BedjetMode::MODE_TURBO.

Definition at line 162 of file bedjet_codec.h.

◆ units_setup

bool units_setup

(0x04) Bit is set 1 if the device's units have been configured.

Definition at line 113 of file bedjet_codec.h.

◆ unused_1

int unused_1

Definition at line 108 of file bedjet_codec.h.

◆ unused_2

int unused_2

Definition at line 109 of file bedjet_codec.h.

◆ unused_3

int unused_3

Definition at line 112 of file bedjet_codec.h.

◆ unused_4

int unused_4

Definition at line 114 of file bedjet_codec.h.

◆ unused_5

uint8_t unused_5

Definition at line 181 of file bedjet_codec.h.

◆ unused_6

uint8_t unused_6

Definition at line 182 of file bedjet_codec.h.

◆ unused_7

uint16_t unused_7

Is part of a Dual Zone configuration.

See BedjetNotification.

Definition at line 184 of file bedjet_codec.h.

◆ update_phase

uint8_t update_phase

The current status/phase of a firmware update.

Definition at line 194 of file bedjet_codec.h.