-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing hon_simulator to support nes status packet size
- Loading branch information
Pavlo Dudnytskyi
committed
Jun 17, 2024
1 parent
7bab6a4
commit 3737689
Showing
2 changed files
with
49 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,5 +25,6 @@ | |
] | ||
}, | ||
"license": "MIT", | ||
"frameworks": "*" | ||
"frameworks": "*", | ||
"platforms": "*" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,48 @@ | ||
#pragma once | ||
|
||
#include <stdint.h> | ||
#include "protocol/haier_protocol.h" | ||
#include "hon_packet.h" | ||
|
||
struct HvacFullStatus { | ||
esphome::haier::hon_protocol::HaierPacketControl control; | ||
esphome::haier::hon_protocol::HaierPacketSensors sensors; | ||
uint8_t spare[4]; | ||
esphome::haier::hon_protocol::HaierPacketBigData big_data; | ||
}; | ||
|
||
constexpr size_t ALARM_BUF_SIZE = 8; | ||
|
||
constexpr size_t USER_DATA_SIZE = sizeof(esphome::haier::hon_protocol::HaierPacketControl) + sizeof(esphome::haier::hon_protocol::HaierPacketSensors); | ||
|
||
constexpr size_t BIG_DATA_SIZE = sizeof(HvacFullStatus); | ||
|
||
void process_alarms(haier_protocol::ProtocolHandler* protocol_handler); | ||
|
||
HvacFullStatus& get_ac_state_ref(); | ||
|
||
bool start_alarm(uint8_t alarm_id); | ||
|
||
void reset_alarms(); | ||
|
||
bool is_in_configuration_mode(); | ||
|
||
haier_protocol::HandlerError get_device_version_handler(haier_protocol::ProtocolHandler* protocol_handler, haier_protocol::FrameType type, const uint8_t* buffer, size_t size); | ||
|
||
haier_protocol::HandlerError get_device_id_handler(haier_protocol::ProtocolHandler* protocol_handler, haier_protocol::FrameType type, const uint8_t* buffer, size_t size); | ||
|
||
haier_protocol::HandlerError status_request_handler(haier_protocol::ProtocolHandler* protocol_handler, haier_protocol::FrameType type, const uint8_t* buffer, size_t size); | ||
|
||
haier_protocol::HandlerError alarm_status_handler(haier_protocol::ProtocolHandler* protocol_handler, haier_protocol::FrameType type, const uint8_t* buffer, size_t size); | ||
|
||
haier_protocol::HandlerError get_management_information_handler(haier_protocol::ProtocolHandler* protocol_handler, haier_protocol::FrameType type, const uint8_t* buffer, size_t size); | ||
|
||
haier_protocol::HandlerError report_network_status_handler(haier_protocol::ProtocolHandler* protocol_handler, haier_protocol::FrameType type, const uint8_t* buffer, size_t size); | ||
|
||
haier_protocol::HandlerError stop_alarm_handler(haier_protocol::ProtocolHandler* protocol_handler, haier_protocol::FrameType type, const uint8_t* buffer, size_t size); | ||
|
||
haier_protocol::HandlerError process_single_parameter(haier_protocol::ProtocolHandler* protocol_handler, uint8_t parameter, uint16_t value); | ||
|
||
#pragma once | ||
|
||
#include <stdint.h> | ||
#include "protocol/haier_protocol.h" | ||
#include "hon_packet.h" | ||
|
||
constexpr size_t SENSORS_SPARE_SIZE = 4; | ||
|
||
struct HvacFullStatus { | ||
esphome::haier::hon_protocol::HaierPacketControl control; | ||
esphome::haier::hon_protocol::HaierPacketSensors sensors; | ||
uint8_t spare[SENSORS_SPARE_SIZE]; | ||
esphome::haier::hon_protocol::HaierPacketBigData big_data; | ||
}; | ||
|
||
constexpr size_t ALARM_BUF_SIZE = 8; | ||
|
||
constexpr size_t USER_DATA_SIZE = sizeof(esphome::haier::hon_protocol::HaierPacketControl) + sizeof(esphome::haier::hon_protocol::HaierPacketSensors) + SENSORS_SPARE_SIZE; | ||
|
||
constexpr size_t BIG_DATA_SIZE = sizeof(HvacFullStatus); | ||
|
||
void process_alarms(haier_protocol::ProtocolHandler* protocol_handler); | ||
|
||
HvacFullStatus& get_ac_state_ref(); | ||
|
||
bool start_alarm(uint8_t alarm_id); | ||
|
||
void reset_alarms(); | ||
|
||
bool is_in_configuration_mode(); | ||
|
||
haier_protocol::HandlerError get_device_version_handler(haier_protocol::ProtocolHandler* protocol_handler, haier_protocol::FrameType type, const uint8_t* buffer, size_t size); | ||
|
||
haier_protocol::HandlerError get_device_id_handler(haier_protocol::ProtocolHandler* protocol_handler, haier_protocol::FrameType type, const uint8_t* buffer, size_t size); | ||
|
||
haier_protocol::HandlerError status_request_handler(haier_protocol::ProtocolHandler* protocol_handler, haier_protocol::FrameType type, const uint8_t* buffer, size_t size); | ||
|
||
haier_protocol::HandlerError alarm_status_handler(haier_protocol::ProtocolHandler* protocol_handler, haier_protocol::FrameType type, const uint8_t* buffer, size_t size); | ||
|
||
haier_protocol::HandlerError get_management_information_handler(haier_protocol::ProtocolHandler* protocol_handler, haier_protocol::FrameType type, const uint8_t* buffer, size_t size); | ||
|
||
haier_protocol::HandlerError report_network_status_handler(haier_protocol::ProtocolHandler* protocol_handler, haier_protocol::FrameType type, const uint8_t* buffer, size_t size); | ||
|
||
haier_protocol::HandlerError stop_alarm_handler(haier_protocol::ProtocolHandler* protocol_handler, haier_protocol::FrameType type, const uint8_t* buffer, size_t size); | ||
|
||
haier_protocol::HandlerError process_single_parameter(haier_protocol::ProtocolHandler* protocol_handler, uint8_t parameter, uint16_t value); | ||
|
||
haier_protocol::HandlerError alarm_status_report_answer_handler(haier_protocol::ProtocolHandler* protocol_handler, haier_protocol::FrameType request_type, haier_protocol::FrameType message_type, const uint8_t* data, size_t data_size); |