ESPHome 2025.5.0
Loading...
Searching...
No Matches
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

namespace  esphome
 Providing packet encoding functions for exchanging data with a remote host.
 
namespace  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))
 
float esphome::bedjet::bedjet_temp_to_c (uint8_t temp)
 Converts a BedJet temp step into degrees Celsius.
 

Variables

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

Variable Documentation

◆ [union]

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 14 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 33 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 8 of file bedjet_codec.h.

◆ bio_sequence_step

uint8_t bio_sequence_step

Definition at line 81 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 3 of file bedjet_codec.h.

◆ [struct]

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 5 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 22 of file bedjet_codec.h.

◆ flags_packed

uint8_t flags_packed

Definition at line 66 of file bedjet_codec.h.

◆ is_dual_zone

bool is_dual_zone

Definition at line 51 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 1 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 4 of file bedjet_codec.h.

◆ max_hrs

uint8_t max_hrs

Max hours of mode runtime.

Definition at line 24 of file bedjet_codec.h.

◆ max_mins

uint8_t max_mins

Max minutes of mode runtime.

Definition at line 25 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 27 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 26 of file bedjet_codec.h.

◆ mode

BedjetMode mode

BedJet operating mode.

Definition at line 19 of file bedjet_codec.h.

◆ notify_code

BedjetNotification notify_code

Biorhythm sequence step number.

Definition at line 83 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 3 of file bedjet_codec.h.

◆ packet_type

BedjetPacketType packet_type

Typically BedjetPacketType::PACKET_TYPE_STATUS for BedJet V3 status packet.

Definition at line 6 of file bedjet_codec.h.

◆ shutdown_reason

uint8_t shutdown_reason

The reason for the last device shutdown.

Definition at line 35 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 16 of file bedjet_codec.h.

◆ time_remaining_hrs

uint8_t time_remaining_hrs

Hours remaining in program runtime.

Definition at line 9 of file bedjet_codec.h.

◆ time_remaining_mins

uint8_t time_remaining_mins

Minutes remaining in program runtime.

Definition at line 10 of file bedjet_codec.h.

◆ time_remaining_secs

uint8_t time_remaining_secs

Seconds remaining in program runtime.

Definition at line 11 of file bedjet_codec.h.

◆ turbo_time

uint16_t turbo_time

Time remaining in BedjetMode::MODE_TURBO.

Definition at line 30 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 6 of file bedjet_codec.h.

◆ unused_1

int unused_1

Definition at line 1 of file bedjet_codec.h.

◆ unused_2

int unused_2

Definition at line 2 of file bedjet_codec.h.

◆ unused_3

int unused_3

Definition at line 5 of file bedjet_codec.h.

◆ unused_4

int unused_4

Definition at line 7 of file bedjet_codec.h.

◆ unused_5

uint8_t unused_5

Definition at line 49 of file bedjet_codec.h.

◆ unused_6

uint8_t unused_6

Definition at line 50 of file bedjet_codec.h.

◆ unused_7

uint16_t unused_7

Is part of a Dual Zone configuration.

See BedjetNotification.

Definition at line 52 of file bedjet_codec.h.

◆ update_phase

uint8_t update_phase

The current status/phase of a firmware update.

Definition at line 62 of file bedjet_codec.h.