foxBMS - Unit Tests  1.3.0
The foxBMS Unit Tests API Documentation
debug_default.h File Reference

Header for the driver of the fake AFE driver. More...

#include "general.h"
#include "database_cfg.h"
Include dependency graph for debug_default.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  FAKE_DATABASE_ENTRIES_s
 
struct  FAKE_STATE_s
 

Enumerations

enum  FAKE_FSM_STATES_e {
  FAKE_FSM_STATE_DUMMY , FAKE_FSM_STATE_HAS_NEVER_RUN , FAKE_FSM_STATE_UNINITIALIZED , FAKE_FSM_STATE_INITIALIZATION ,
  FAKE_FSM_STATE_RUNNING , FAKE_FSM_STATE_ERROR
}
 
enum  FAKE_FSM_SUBSTATES_e {
  FAKE_FSM_SUBSTATE_DUMMY , FAKE_FSM_SUBSTATE_ENTRY , FAKE_FSM_SUBSTATE_INITIALIZATION_FINISH_FIRST_MEASUREMENT , FAKE_FSM_SUBSTATE_INITIALIZATION_FIRST_MEASUREMENT_FINISHED ,
  FAKE_FSM_SUBSTATE_INITIALIZATION_EXIT , FAKE_FSM_SUBSTATE_RUNNING_SAVE_VOLTAGE_MEASUREMENT_DATA , FAKE_FSM_SUBSTATE_RUNNING_SAVE_TEMPERATURE_MEASUREMENT_DATA
}
 

Functions

STD_RETURN_TYPE_e FAKE_Initialize (void)
 initialize driver More...
 
bool FAKE_IsFirstMeasurementCycleFinished (FAKE_STATE_s *pFakeState)
 return whether the first measurement cycle is finished More...
 
STD_RETURN_TYPE_e FAKE_TriggerAfe (FAKE_STATE_s *pFakeState)
 Trigger function for the driver, called to advance the state machine. More...
 
bool TEST_FAKE_CheckMultipleCalls (FAKE_STATE_s *pFakeState)
 
void TEST_FAKE_SetFirstMeasurementCycleFinished (FAKE_STATE_s *pFakeState)
 
void TEST_FAKE_SetState (FAKE_STATE_s *pFakeState, FAKE_FSM_STATES_e nextState, FAKE_FSM_SUBSTATES_e nextSubstate, uint16_t idleTime)
 
STD_RETURN_TYPE_e TEST_FAKE_SaveFakeVoltageMeasurementData (FAKE_STATE_s *pFakeState)
 
STD_RETURN_TYPE_e TEST_FAKE_SaveFakeTemperatureMeasurementData (FAKE_STATE_s *pFakeState)
 

Variables

FAKE_STATE_s fake_state
 

Detailed Description

Header for the driver of the fake AFE driver.

SPDX-License-Identifier: BSD-3-Clause

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

We kindly request you to use one or more of the following phrases to refer to foxBMS in your hardware, software, documentation or advertising materials:

  • ″This product uses parts of foxBMS®″
  • ″This product includes parts of foxBMS®″
  • ″This product is derived from foxBMS®″
Author
foxBMS Team
Date
2020-09-17 (date of creation)
Updated
2022-05-30 (date of last update)
Version
v1.3.0
Prefix
FAKE

Definition in file debug_default.h.

Enumeration Type Documentation

◆ FAKE_FSM_STATES_e

States of the state machine

Enumerator
FAKE_FSM_STATE_DUMMY 

dummy state - always the first state

FAKE_FSM_STATE_HAS_NEVER_RUN 

never run state - always the second state

FAKE_FSM_STATE_UNINITIALIZED 

uninitialized state

FAKE_FSM_STATE_INITIALIZATION 

initializing the state machine

FAKE_FSM_STATE_RUNNING 

operational mode of the state machine

FAKE_FSM_STATE_ERROR 

state for error processing

Definition at line 66 of file debug_default.h.

◆ FAKE_FSM_SUBSTATES_e

Substates of the state machine

Enumerator
FAKE_FSM_SUBSTATE_DUMMY 

dummy state - always the first substate

FAKE_FSM_SUBSTATE_ENTRY 

entry state - always the second substate

FAKE_FSM_SUBSTATE_INITIALIZATION_FINISH_FIRST_MEASUREMENT 

finish the first fake measurement

FAKE_FSM_SUBSTATE_INITIALIZATION_FIRST_MEASUREMENT_FINISHED 

cleanup substate after the first fake measurement

FAKE_FSM_SUBSTATE_INITIALIZATION_EXIT 

last initialization substate

FAKE_FSM_SUBSTATE_RUNNING_SAVE_VOLTAGE_MEASUREMENT_DATA 

state to continuously save the measurement data

FAKE_FSM_SUBSTATE_RUNNING_SAVE_TEMPERATURE_MEASUREMENT_DATA 

state to continuously save the measurement data

Definition at line 76 of file debug_default.h.

Function Documentation

◆ FAKE_Initialize()

STD_RETURN_TYPE_e FAKE_Initialize ( void  )

initialize driver

Definition at line 516 of file debug_default.c.

◆ FAKE_IsFirstMeasurementCycleFinished()

bool FAKE_IsFirstMeasurementCycleFinished ( FAKE_STATE_s pFakeState)

return whether the first measurement cycle is finished

Parameters
pFakeStatecurrent state of the fake driver
Returns
true if the first measurement cycle was successfully finished, false otherwise

Definition at line 520 of file debug_default.c.

Here is the call graph for this function:

◆ FAKE_TriggerAfe()

STD_RETURN_TYPE_e FAKE_TriggerAfe ( FAKE_STATE_s pFakeState)

Trigger function for the driver, called to advance the state machine.

Parameters
pFakeStatecurrent state of the fake driver
Returns
returns always STD_OK

Definition at line 529 of file debug_default.c.

Here is the call graph for this function:

◆ TEST_FAKE_CheckMultipleCalls()

bool TEST_FAKE_CheckMultipleCalls ( FAKE_STATE_s pFakeState)

Definition at line 560 of file debug_default.c.

Here is the call graph for this function:

◆ TEST_FAKE_SaveFakeTemperatureMeasurementData()

STD_RETURN_TYPE_e TEST_FAKE_SaveFakeTemperatureMeasurementData ( FAKE_STATE_s pFakeState)

Definition at line 580 of file debug_default.c.

Here is the call graph for this function:

◆ TEST_FAKE_SaveFakeVoltageMeasurementData()

STD_RETURN_TYPE_e TEST_FAKE_SaveFakeVoltageMeasurementData ( FAKE_STATE_s pFakeState)

Definition at line 576 of file debug_default.c.

Here is the call graph for this function:

◆ TEST_FAKE_SetFirstMeasurementCycleFinished()

void TEST_FAKE_SetFirstMeasurementCycleFinished ( FAKE_STATE_s pFakeState)

Definition at line 564 of file debug_default.c.

Here is the call graph for this function:

◆ TEST_FAKE_SetState()

void TEST_FAKE_SetState ( FAKE_STATE_s pFakeState,
FAKE_FSM_STATES_e  nextState,
FAKE_FSM_SUBSTATES_e  nextSubstate,
uint16_t  idleTime 
)

Definition at line 568 of file debug_default.c.

Here is the call graph for this function:

Variable Documentation

◆ fake_state

FAKE_STATE_s fake_state
extern

state of the fake state machine

local instance of the driver-state

Definition at line 115 of file debug_default.c.