MeterLogger
|
Go to the source code of this file.
Macros | |
#define | en61107_received_task_prio USER_TASK_PRIO_2 |
#define | en61107_received_task_queue_length 64 |
Typedefs | |
typedef void(* | meter_is_ready_cb) (void) |
Variables | |
os_event_t | en61107_received_task_queue [en61107_received_task_queue_length] |
#define en61107_received_task_prio USER_TASK_PRIO_2 |
Definition at line 7 of file en61107_request.h.
Referenced by en61107_request_init(), and uart0_rx_intr_handler().
#define en61107_received_task_queue_length 64 |
Definition at line 8 of file en61107_request.h.
Referenced by en61107_request_init().
typedef void(* meter_is_ready_cb) (void) |
Definition at line 10 of file en61107_request.h.
ICACHE_FLASH_ATTR void en61107_delayed_uart_change_setting_timer_func | ( | UartDevice * | uart_settings | ) |
Definition at line 83 of file en61107_request.c.
References UartDevice::baut_rate, ICACHE_FLASH_ATTR, UartDevice::stop_bits, UART0, uart_set_baudrate(), and uart_set_stop_bits().
Referenced by en61107_uart_send_en61107(), en61107_uart_send_en61107_ident(), en61107_uart_send_inst_values(), en61107_uart_send_standard_data_1(), and en61107_uart_send_standard_data_2().
ICACHE_FLASH_ATTR unsigned char en61107_fifo_get | ( | unsigned char * | c | ) |
Definition at line 583 of file en61107_request.c.
References en61107_fifo_in_use(), fifo_buffer, fifo_tail, ICACHE_FLASH_ATTR, and QUEUE_SIZE.
Referenced by en61107_received_task(), and en61107_request_send().
ICACHE_FLASH_ATTR unsigned int en61107_fifo_in_use | ( | ) |
Definition at line 563 of file en61107_request.c.
References fifo_head, and fifo_tail.
Referenced by en61107_fifo_get(), en61107_fifo_put(), and en61107_fifo_snoop().
|
inline |
Definition at line 568 of file en61107_request.c.
References en61107_fifo_in_use(), fifo_buffer, fifo_head, ICACHE_FLASH_ATTR, and QUEUE_SIZE.
Referenced by uart0_rx_intr_handler().
ICACHE_FLASH_ATTR unsigned char en61107_fifo_snoop | ( | unsigned char * | c, |
unsigned int | pos | ||
) |
Definition at line 598 of file en61107_request.c.
References en61107_fifo_in_use(), fifo_buffer, fifo_tail, and QUEUE_SIZE.
ICACHE_FLASH_ATTR unsigned int en61107_get_received_energy_kwh | ( | ) |
Definition at line 320 of file en61107_request.c.
References en61107_response_t::e1, EN61107_UNIT_L, EN61107_VALUE_L, mw_to_w_str(), strncmp, en61107_response_register_t::unit, and en61107_response_register_t::value.
ICACHE_FLASH_ATTR unsigned int en61107_get_received_serial | ( | ) |
|
inline |
Definition at line 330 of file en61107_request.c.
References en61107_eod, en61107_etx_received, and ICACHE_FLASH_ATTR.
Referenced by uart0_rx_intr_handler().
ICACHE_FLASH_ATTR void en61107_meter_wake_up_timer_func | ( | void * | arg | ) |
Definition at line 91 of file en61107_request.c.
References en61107_uart_send_en61107_ident(), and ICACHE_FLASH_ATTR.
Referenced by en61107_receive_timeout_timer_func(), and en61107_request_send().
ICACHE_FLASH_ATTR void en61107_receive_timeout_timer_func | ( | void * | arg | ) |
Definition at line 49 of file en61107_request.c.
References en61107_meter_wake_up_timer, en61107_meter_wake_up_timer_func(), en61107_request_num, en61107_uart_send_en61107_ident(), en61107_uart_send_inst_values(), en61107_uart_send_standard_data_1(), en61107_uart_send_standard_data_2(), en61107_uart_state, ICACHE_FLASH_ATTR, led_blink(), NULL, os_timer_arm, os_timer_disarm, os_timer_func_t, os_timer_setfn, UART_STATE_EN61107, UART_STATE_EN61107_IDENT, UART_STATE_INST_VALUES, UART_STATE_STANDARD_DATA_1, and UART_STATE_STANDARD_DATA_2.
Referenced by en61107_uart_send_en61107(), en61107_uart_send_en61107_ident(), en61107_uart_send_inst_values(), en61107_uart_send_standard_data_1(), and en61107_uart_send_standard_data_2().
ICACHE_FLASH_ATTR void en61107_register_meter_is_ready_cb | ( | meter_is_ready_cb | cb | ) |
Definition at line 308 of file en61107_request.c.
References en61107_meter_is_ready_cb, and ICACHE_FLASH_ATTR.
ICACHE_FLASH_ATTR void en61107_request_init | ( | ) |
Definition at line 286 of file en61107_request.c.
References en61107_etx_received, en61107_received_task(), en61107_received_task_prio, en61107_received_task_queue, en61107_received_task_queue_length, en61107_request_num, en61107_uart_state, fifo_head, fifo_tail, ICACHE_FLASH_ATTR, memset, system_os_task(), and UART_STATE_NONE.
ICACHE_FLASH_ATTR void en61107_request_send | ( | ) |
Definition at line 354 of file en61107_request.c.
References en61107_fifo_get(), EN61107_FRAME_L, en61107_meter_wake_up_timer, en61107_meter_wake_up_timer_func(), en61107_request_num, en61107_serial, en61107_uart_state, encrypt_aes_hmac_combined(), get_unix_time(), ICACHE_FLASH_ATTR, memset, MQTT_Publish(), NULL, os_memset, os_sprintf, os_strncpy, os_timer_arm, os_timer_disarm, os_timer_func_t, os_timer_setfn, strlen, and UART_STATE_NONE.
ICACHE_FLASH_ATTR void en61107_set_mqtt_client | ( | MQTT_Client * | client | ) |
ICACHE_FLASH_ATTR void en61107_uart_send_en61107 | ( | ) |
Definition at line 434 of file en61107_request.c.
References UartDevice::baut_rate, BIT_RATE_300, en61107_delayed_uart_change_setting_timer, en61107_delayed_uart_change_setting_timer_func(), en61107_eod, en61107_etx_received, en61107_receive_timeout_timer, en61107_receive_timeout_timer_func(), en61107_uart_state, EVEN_BITS, frame, frame_length, ICACHE_FLASH_ATTR, NULL, ONE_STOP_BIT, os_timer_arm, os_timer_disarm, os_timer_func_t, os_timer_setfn, SEVEN_BITS, UartDevice::stop_bits, strcpy, strlen, TWO_STOP_BIT, UART0, uart0_tx_buffer(), uart_set_baudrate(), uart_set_parity(), uart_set_stop_bits(), uart_set_word_length(), and UART_STATE_EN61107.
Referenced by en61107_received_task().
ICACHE_FLASH_ATTR void en61107_uart_send_en61107_ident | ( | ) |
Definition at line 402 of file en61107_request.c.
References UartDevice::baut_rate, BIT_RATE_300, en61107_delayed_uart_change_setting_timer, en61107_delayed_uart_change_setting_timer_func(), en61107_eod, en61107_etx_received, en61107_receive_timeout_timer, en61107_receive_timeout_timer_func(), en61107_uart_state, EVEN_BITS, frame, frame_length, ICACHE_FLASH_ATTR, NULL, ONE_STOP_BIT, os_timer_arm, os_timer_disarm, os_timer_func_t, os_timer_setfn, SEVEN_BITS, UartDevice::stop_bits, strcpy, strlen, TWO_STOP_BIT, UART0, uart0_tx_buffer(), uart_set_baudrate(), uart_set_parity(), uart_set_stop_bits(), uart_set_word_length(), and UART_STATE_EN61107_IDENT.
Referenced by en61107_meter_wake_up_timer_func(), and en61107_receive_timeout_timer_func().
ICACHE_FLASH_ATTR void en61107_uart_send_inst_values | ( | ) |
Definition at line 529 of file en61107_request.c.
References UartDevice::baut_rate, BIT_RATE_1200, BIT_RATE_300, en61107_delayed_uart_change_setting_timer, en61107_delayed_uart_change_setting_timer_func(), en61107_eod, en61107_receive_timeout_timer, en61107_receive_timeout_timer_func(), en61107_uart_state, EVEN_BITS, frame, frame_length, ICACHE_FLASH_ATTR, NULL, ONE_STOP_BIT, os_timer_arm, os_timer_disarm, os_timer_func_t, os_timer_setfn, SEVEN_BITS, UartDevice::stop_bits, strcpy, strlen, TWO_STOP_BIT, UART0, uart0_tx_buffer(), uart_set_baudrate(), uart_set_parity(), uart_set_stop_bits(), uart_set_word_length(), and UART_STATE_INST_VALUES.
Referenced by en61107_receive_timeout_timer_func(), and en61107_received_task().
ICACHE_FLASH_ATTR void en61107_uart_send_standard_data_1 | ( | ) |
Definition at line 466 of file en61107_request.c.
References UartDevice::baut_rate, BIT_RATE_1200, BIT_RATE_300, en61107_delayed_uart_change_setting_timer, en61107_delayed_uart_change_setting_timer_func(), en61107_eod, en61107_receive_timeout_timer, en61107_receive_timeout_timer_func(), en61107_uart_state, EVEN_BITS, frame, frame_length, ICACHE_FLASH_ATTR, NULL, ONE_STOP_BIT, os_timer_arm, os_timer_disarm, os_timer_func_t, os_timer_setfn, SEVEN_BITS, UartDevice::stop_bits, strcpy, strlen, TWO_STOP_BIT, UART0, uart0_tx_buffer(), uart_set_baudrate(), uart_set_parity(), uart_set_stop_bits(), uart_set_word_length(), and UART_STATE_STANDARD_DATA_1.
Referenced by en61107_receive_timeout_timer_func(), and en61107_received_task().
ICACHE_FLASH_ATTR void en61107_uart_send_standard_data_2 | ( | ) |
Definition at line 497 of file en61107_request.c.
References UartDevice::baut_rate, BIT_RATE_1200, BIT_RATE_300, en61107_delayed_uart_change_setting_timer, en61107_delayed_uart_change_setting_timer_func(), en61107_eod, en61107_receive_timeout_timer, en61107_receive_timeout_timer_func(), en61107_uart_state, EVEN_BITS, frame, frame_length, ICACHE_FLASH_ATTR, NULL, ONE_STOP_BIT, os_timer_arm, os_timer_disarm, os_timer_func_t, os_timer_setfn, SEVEN_BITS, UartDevice::stop_bits, strcpy, strlen, TWO_STOP_BIT, UART0, uart0_tx_buffer(), uart_set_baudrate(), uart_set_parity(), uart_set_stop_bits(), uart_set_word_length(), and UART_STATE_STANDARD_DATA_2.
Referenced by en61107_receive_timeout_timer_func(), and en61107_received_task().
os_event_t en61107_received_task_queue[en61107_received_task_queue_length] |
Definition at line 12 of file en61107_request.h.
Referenced by en61107_request_init().