MeterLogger
|
Go to the source code of this file.
Macros | |
#define | KMP_START_BYTE_IDX 0 |
#define | KMP_DST_IDX 1 |
#define | KMP_CID_IDX 2 |
#define | KMP_DATA_IDX 3 |
Functions | |
ICACHE_FLASH_ATTR unsigned int | kmp_get_type (unsigned char *frame) |
ICACHE_FLASH_ATTR unsigned int | kmp_get_serial (unsigned char *frame) |
ICACHE_FLASH_ATTR unsigned int | kmp_set_clock (unsigned char *frame, uint64_t unix_time) |
ICACHE_FLASH_ATTR unsigned int | kmp_get_register (unsigned char *frame, uint16_t *register_list, uint16_t register_list_length) |
ICACHE_FLASH_ATTR int | kmp_decode_frame (unsigned char *frame, unsigned char frame_length, kmp_response_t *response) |
ICACHE_FLASH_ATTR uint16_t | kmp_crc16 () |
ICACHE_FLASH_ATTR double | kmp_value_to_double (int32_t value, uint8_t si_ex) |
ICACHE_FLASH_ATTR void | kmp_value_to_string (int32_t value, uint8_t si_ex, unsigned char *value_string) |
ICACHE_FLASH_ATTR void | kmp_unit_to_string (uint8_t unit, unsigned char *unit_string) |
ICACHE_FLASH_ATTR void | kmp_byte_stuff () |
ICACHE_FLASH_ATTR void | kmp_byte_unstuff () |
Variables | |
unsigned char * | kmp_frame |
unsigned int | kmp_frame_length |
unsigned int | kmp_data_length |
kmp_response_t * | kmp_response |
#define KMP_CID_IDX 2 |
Definition at line 91 of file kmp.c.
Referenced by kmp_decode_frame(), kmp_get_register(), kmp_get_serial(), and kmp_get_type().
#define KMP_DATA_IDX 3 |
Definition at line 92 of file kmp.c.
Referenced by kmp_decode_frame(), and kmp_get_register().
#define KMP_DST_IDX 1 |
Definition at line 90 of file kmp.c.
Referenced by kmp_byte_stuff(), kmp_byte_unstuff(), kmp_crc16(), kmp_get_register(), kmp_get_serial(), and kmp_get_type().
#define KMP_START_BYTE_IDX 0 |
Definition at line 89 of file kmp.c.
Referenced by kmp_get_register(), kmp_get_serial(), and kmp_get_type().
ICACHE_FLASH_ATTR void kmp_byte_stuff | ( | ) |
Definition at line 580 of file kmp.c.
References ICACHE_FLASH_ATTR, kmp_data_length, KMP_DST_IDX, kmp_frame, KMP_FRAME_L, kmp_frame_length, memcpy, and memset.
Referenced by kmp_get_register(), kmp_get_serial(), and kmp_get_type().
ICACHE_FLASH_ATTR void kmp_byte_unstuff | ( | ) |
Definition at line 602 of file kmp.c.
References kmp_data_length, KMP_DST_IDX, kmp_frame, KMP_FRAME_L, kmp_frame_length, and memcpy.
Referenced by kmp_decode_frame().
ICACHE_FLASH_ATTR uint16_t kmp_crc16 | ( | ) |
Definition at line 352 of file kmp.c.
References ccit_crc16(), ICACHE_FLASH_ATTR, kmp_data_length, KMP_DST_IDX, and kmp_frame.
Referenced by kmp_decode_frame(), kmp_get_register(), kmp_get_serial(), and kmp_get_type().
ICACHE_FLASH_ATTR int kmp_decode_frame | ( | unsigned char * | frame, |
unsigned char | frame_length, | ||
kmp_response_t * | response | ||
) |
Definition at line 239 of file kmp.c.
References frame, frame_length, ICACHE_FLASH_ATTR, kmp_byte_unstuff(), KMP_CID_IDX, kmp_crc16(), KMP_DATA_IDX, kmp_data_length, kmp_frame, kmp_frame_length, kmp_response_t::kmp_response_meter_type, kmp_response_t::kmp_response_register_list, kmp_response_t::kmp_response_serial, kmp_response_t::kmp_response_sw_revision, memset, and response.
Referenced by kmp_received_task().
ICACHE_FLASH_ATTR unsigned int kmp_get_register | ( | unsigned char * | frame, |
uint16_t * | register_list, | ||
uint16_t | register_list_length | ||
) |
Definition at line 181 of file kmp.c.
References frame, ICACHE_FLASH_ATTR, kmp_byte_stuff(), KMP_CID_IDX, kmp_crc16(), KMP_DATA_IDX, kmp_data_length, KMP_DST_IDX, kmp_frame, KMP_FRAME_L, kmp_frame_length, KMP_START_BYTE_IDX, and memset.
Referenced by kmp_get_register_timer_func().
ICACHE_FLASH_ATTR unsigned int kmp_get_serial | ( | unsigned char * | frame | ) |
Definition at line 139 of file kmp.c.
References frame, ICACHE_FLASH_ATTR, kmp_byte_stuff(), KMP_CID_IDX, kmp_crc16(), kmp_data_length, KMP_DST_IDX, kmp_frame, KMP_FRAME_L, kmp_frame_length, KMP_START_BYTE_IDX, and memset.
Referenced by kmp_get_serial_timer_func().
ICACHE_FLASH_ATTR unsigned int kmp_get_type | ( | unsigned char * | frame | ) |
Definition at line 103 of file kmp.c.
References frame, ICACHE_FLASH_ATTR, kmp_byte_stuff(), KMP_CID_IDX, kmp_crc16(), kmp_data_length, KMP_DST_IDX, kmp_frame, KMP_FRAME_L, kmp_frame_length, KMP_START_BYTE_IDX, and memset.
ICACHE_FLASH_ATTR unsigned int kmp_set_clock | ( | unsigned char * | frame, |
uint64_t | unix_time | ||
) |
Definition at line 175 of file kmp.c.
References ICACHE_FLASH_ATTR.
ICACHE_FLASH_ATTR void kmp_unit_to_string | ( | uint8_t | unit, |
unsigned char * | unit_string | ||
) |
Definition at line 442 of file kmp.c.
References ICACHE_FLASH_ATTR, and strcpy.
Referenced by kmp_get_received_energy_kwh(), and kmp_received_task().
ICACHE_FLASH_ATTR double kmp_value_to_double | ( | int32_t | value, |
uint8_t | si_ex | ||
) |
Definition at line 366 of file kmp.c.
References ICACHE_FLASH_ATTR, and int_pow().
ICACHE_FLASH_ATTR void kmp_value_to_string | ( | int32_t | value, |
uint8_t | si_ex, | ||
unsigned char * | value_string | ||
) |
Definition at line 394 of file kmp.c.
References decimal_number_length(), ICACHE_FLASH_ATTR, int_pow(), strcat, strcpy, and tfp_snprintf().
Referenced by kmp_get_received_energy_kwh(), and kmp_received_task().
unsigned int kmp_data_length |
Definition at line 96 of file kmp.c.
Referenced by kmp_byte_stuff(), kmp_byte_unstuff(), kmp_crc16(), kmp_decode_frame(), kmp_get_register(), kmp_get_serial(), and kmp_get_type().
unsigned char* kmp_frame |
Definition at line 94 of file kmp.c.
Referenced by kmp_byte_stuff(), kmp_byte_unstuff(), kmp_crc16(), kmp_decode_frame(), kmp_get_register(), kmp_get_serial(), and kmp_get_type().
unsigned int kmp_frame_length |
Definition at line 95 of file kmp.c.
Referenced by kmp_byte_stuff(), kmp_byte_unstuff(), kmp_decode_frame(), kmp_get_register(), kmp_get_serial(), and kmp_get_type().
kmp_response_t* kmp_response |