OpenBIC
OpenSource Bridge-IC
plat_log.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#include "plat_modbus.h"
17
18#define IS_NORMAL_VAL true
19#define IS_ABNORMAL_VAL false
20
21uint16_t error_log_count(void);
22void log_transfer_to_modbus_data(uint16_t *modbus_data, uint8_t cmd_size, uint16_t order);
23void error_log_event(uint8_t sensor_num, bool val_normal);
24void init_load_eeprom_log(void);
25void modbus_clear_log();
26
28 uint16_t index;
29 uint16_t err_code;
30 uint32_t sys_time;
31 uint16_t pump_duty;
32 uint16_t fan_duty;
33 uint16_t outlet_temp;
34 uint16_t outlet_press;
35 uint16_t flow_rate;
36 uint16_t volt;
37 uint8_t reserved[12];
39
87};
88
89typedef struct _err_sensor_mapping {
90 uint16_t err_code;
91 uint8_t sen_num;
void error_log_event(uint8_t sensor_num, bool val_normal)
Definition: plat_log.c:152
void init_load_eeprom_log(void)
Definition: plat_log.c:206
struct _modbus_err_log_mapping modbus_err_log_mapping
uint16_t error_log_count(void)
Definition: plat_log.c:86
struct _err_sensor_mapping err_sensor_mapping
LOG_ERROR_CODE
Definition: plat_log.h:40
@ PUMP_2_SPEED_RECOVER
Definition: plat_log.h:58
@ LOG_ERR_FB_7_FAN_TACH_RPM
Definition: plat_log.h:79
@ LOG_ERR_BPB_RACK_PRESSURE_3_P_KPA
Definition: plat_log.h:65
@ LOG_ERR_FB_11_FAN_TACH_RPM
Definition: plat_log.h:83
@ LEAK_CHASSIS_2
Definition: plat_log.h:43
@ LEAK_MAN_HOT
Definition: plat_log.h:47
@ LEAK_CHASSIS_0
Definition: plat_log.h:41
@ LOG_ERR_SB_HEX_PRESSURE_1_P_KPA
Definition: plat_log.h:67
@ LOG_ERR_FB_9_FAN_TACH_RPM
Definition: plat_log.h:81
@ LOG_ERR_SB_HEX_AIR_INLET_AVG_TEMP_C
Definition: plat_log.h:72
@ LOG_ERR_HEX_EXTERNAL_Y_FILTER
Definition: plat_log.h:63
@ PUMP_1_SPEED_RECOVER
Definition: plat_log.h:57
@ LOG_ERR_SB_HEX_PRESSURE_2_P_KPA
Definition: plat_log.h:68
@ LOG_ERR_BPB_HEX_WATER_INLET_TEMP_C
Definition: plat_log.h:71
@ LOG_ERR_FB_4_FAN_TACH_RPM
Definition: plat_log.h:76
@ LOG_ERR_FB_8_FAN_TACH_RPM
Definition: plat_log.h:80
@ LOG_ERR_FB_2_FAN_TACH_RPM
Definition: plat_log.h:74
@ LOG_ERR_BPB_RPU_COOLANT_OUTLET_TEMP_C
Definition: plat_log.h:70
@ PUMP_2_SPEED_ABNORMAL
Definition: plat_log.h:55
@ LOG_ERR_BPB_RPU_COOLANT_INLET_P_KPA
Definition: plat_log.h:64
@ HIGH_PRESS_DETECTED
Definition: plat_log.h:60
@ LOG_ERR_FB_5_FAN_TACH_RPM
Definition: plat_log.h:77
@ LOW_WATER_LEVEL
Definition: plat_log.h:53
@ PUMP_1_SPEED_ABNORMAL
Definition: plat_log.h:54
@ LOG_ERR_FB_12_FAN_TACH_RPM
Definition: plat_log.h:84
@ LEAK_MAN_FLOOR_GPO
Definition: plat_log.h:50
@ FLOW_RATE_SENSOR_TRIGGERED
Definition: plat_log.h:61
@ LOG_ERR_FB_3_FAN_TACH_RPM
Definition: plat_log.h:75
@ LEAK_MAN_PAN_GPO
Definition: plat_log.h:49
@ LOG_ERR_FB_6_FAN_TACH_RPM
Definition: plat_log.h:78
@ EMERGENCY_BUTTON_TRIGGERED
Definition: plat_log.h:62
@ LEAK_CHASSIS_3
Definition: plat_log.h:44
@ LOG_ERR_BPB_RPU_COOLANT_INLET_TEMP_C
Definition: plat_log.h:69
@ LEAK_MAN_PAN_RELAY
Definition: plat_log.h:51
@ PUMP_3_SPEED_RECOVER
Definition: plat_log.h:59
@ LEAK_RPU_EXT
Definition: plat_log.h:46
@ LOG_ERR_BPB_RACK_PRESSURE_4_P_KPA
Definition: plat_log.h:66
@ LEAK_RPU_INT
Definition: plat_log.h:45
@ PUMP_3_SPEED_ABNORMAL
Definition: plat_log.h:56
@ LOG_ERR_FB_13_FAN_TACH_RPM
Definition: plat_log.h:85
@ LEAK_MAN_COLD
Definition: plat_log.h:48
@ LEAK_CHASSIS_1
Definition: plat_log.h:42
@ LEAK_MAN_FLOOR_RELAY
Definition: plat_log.h:52
@ LOG_ERR_FB_14_FAN_TACH_RPM
Definition: plat_log.h:86
@ LOG_ERR_FB_1_FAN_TACH_RPM
Definition: plat_log.h:73
@ LOG_ERR_FB_10_FAN_TACH_RPM
Definition: plat_log.h:82
void log_transfer_to_modbus_data(uint16_t *modbus_data, uint8_t cmd_size, uint16_t order)
Definition: plat_log.c:122
void modbus_clear_log()
Definition: plat_log.c:134
uint8_t sensor_num
Definition: storage_handler.h:6
Definition: plat_log.h:89
uint16_t err_code
Definition: plat_log.h:90
uint8_t sen_num
Definition: plat_log.h:91
Definition: plat_log.h:27
uint16_t fan_duty
Definition: plat_log.h:32
uint32_t sys_time
Definition: plat_log.h:30
uint8_t reserved[12]
Definition: plat_log.h:37
uint16_t index
Definition: plat_log.h:28
uint16_t flow_rate
Definition: plat_log.h:35
uint16_t outlet_press
Definition: plat_log.h:34
uint16_t pump_duty
Definition: plat_log.h:31
uint16_t err_code
Definition: plat_log.h:29
uint16_t outlet_temp
Definition: plat_log.h:33
uint16_t volt
Definition: plat_log.h:36