Skip to content

Commit

Permalink
changed again device info period to 3600000s, or when a change is sen…
Browse files Browse the repository at this point in the history
…t to any client
  • Loading branch information
txubelaxu committed Aug 11, 2024
1 parent 40d7006 commit a312ccc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/jk_rs485_sniffer/jk_rs485_sniffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ static const uint16_t MIN_SILENCE_NEEDED_BEFORE_SPEAKING_MILLISECONDS = 250;

static const uint32_t TIME_BETWEEN_CELL_INFO_REQUESTS_MILLISECONDS = 5000;
static const uint32_t TIME_BETWEEN_DEVICE_SETTINGS_REQUESTS_MILLISECONDS = 10000; //5000
static const uint32_t TIME_BETWEEN_DEVICE_INFO_REQUESTS_MILLISECONDS = 300000; //3600000
static const uint32_t TIME_BETWEEN_DEVICE_INFO_REQUESTS_MILLISECONDS = 3600000; //3600000

static const uint16_t SILENCE_BEFORE_ACTING_AS_MASTER = 2000;
static const uint16_t SILENCE_BEFORE_REUSING_NETWORK_ACTING_AS_MASTER=400;
Expand Down Expand Up @@ -156,13 +156,15 @@ void JkRS485Sniffer::handle_bms2sniffer_switch_or_number_uint16_event(std::uint8

if (rs485_network_node[slave_address].available) {
send_command_switch_or_number_to_slave_uint16(slave_address,third_element_of_frame,register_address,value);
rs485_network_node[slave_address].last_device_info_request_received_OK=0;
}

if (this->broadcast_to_all_bms_==true){
for (uint8_t j = 1; j < 16; ++j) {
if (rs485_network_node[j].available && slave_address!=j) {
delayMicroseconds(50000);
send_command_switch_or_number_to_slave_uint16(j,third_element_of_frame,register_address,value);
rs485_network_node[j].last_device_info_request_received_OK=0;
}
}
}
Expand Down
1 change: 1 addition & 0 deletions esp32-S3-example-jkpb-rs485_0master_2slaves.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ uart:
rx_buffer_size: 500
tx_pin: ${tx_pin_uart_0}
rx_pin: ${rx_pin_uart_0}

jk_rs485_sniffer:
- id: sniffer0
protocol_version: "JK02_32S"
Expand Down

0 comments on commit a312ccc

Please sign in to comment.