OTAU Client implementation.
Copyright (c) 2019 Microchip Technology Inc. and its subsidiaries.
#include "stddef.h"
#include "string.h"
#include "stdint.h"
#include "client_debug.h"
#include "common_nvm.h"
#include "otau_debug.h"
#include "circularBuffer.h"
#include "io.h"
Functions | |
void | otau_log (uint8_t log_type, module_id_t module_id, error_code_t error_code, uint8_t len, uint8_t *user_log) |
void | otau_trace (trace_type_t trace_type) |
void | otauDebugInit (void) |
void | otauDebugRcvdFrame (addr_mode_t addr_mode, uint8_t *src_addr, uint16_t length, uint8_t *payload) |
void | otauDebugSentFrame (uint8_t messageId, addr_mode_t addr_mode, uint8_t *addr, uint8_t status) |
void | otauDebugTimerHandler (SYS_Timer_t *timer) |
Variables | |
debug_timer_state_t | curr_debug_timer_state = DEBUG_TIMER_IDLE |
uint8_t | curr_trace_mode = 0 |
uint8_t | debug_confirm_wait = 0 |
uint8_t | debugTraceEnable = 0 |
uint8_t | log_bitmap = 0x00 |
circularBuffer_t | logBuffer |
uint8_t | logBufferMem [BUF_SIZE] |
uint8_t | req_log_addr_mode = NATIVE_ADDR_MODE |
circularBuffer_t | traceBuffer |
uint8_t | traceBufferMem [BUF_SIZE] |
void otau_log | ( | uint8_t | log_type, |
module_id_t | module_id, | ||
error_code_t | error_code, | ||
uint8_t | len, | ||
uint8_t * | user_log | ||
) |
References log_header_t::addr, log_header_t::error_code, log_bitmap, log_header_t::log_len, log_header_t::log_type, log_header_t::module_id, NULL, log_header_t::sof, and writeCircularBuffer().
Referenced by appSendData().
void otau_trace | ( | trace_type_t | trace_type | ) |
References trace_t::addr, trace_t::eof, trace_t::length, trace_t::sof, trace_t::trace_type, and writeCircularBuffer().
Referenced by appSendData().
void otauDebugInit | ( | void | ) |
References BUF_SIZE, curr_debug_timer_state, DEBUG_TIMER_IDLE, initCircularBuffer(), logBufferMem, and traceBufferMem.
Referenced by otauInit().
void otauDebugRcvdFrame | ( | addr_mode_t | addr_mode, |
uint8_t * | src_addr, | ||
uint16_t | length, | ||
uint8_t * | payload | ||
) |
References BUF_SIZE, curr_debug_timer_state, curr_trace_mode, debug_confirm_wait, DEBUG_LOG_STATE, DEBUG_TRACE_STATE, debugTraceEnable, DOMAIN_OTAU_DEBUG, read_mem_indication_t::domainId, write_mem_indication_t::domainId, EXTENDED_ADDR_MODE, initCircularBuffer(), log_bitmap, LOG_INTERVAL_MS, LOG_MASK, logBufferMem, read_memory_req_t::mem_addr, read_mem_indication_t::mem_addr, write_memory_req_t::mem_addr, write_mem_indication_t::mem_addr, read_mem_indication_t::mem_content, write_memory_req_t::mem_content, read_memory_req_t::mem_len, read_mem_indication_t::mem_len, write_memory_req_t::mem_len, write_mem_indication_t::mem_len, read_memory_req_t::mem_type, read_mem_indication_t::mem_type, write_memory_req_t::mem_type, write_mem_indication_t::mem_type, read_mem_indication_t::msg_id, write_mem_indication_t::msg_id, OTA_LOG_REQUEST, OTA_READ_MEMORY_INDICATION, OTA_READ_MEMORY_REQUEST, OTA_TRACE_REQUEST, OTA_WRITE_MEMORY_INDICATION, OTA_WRITE_MEMORY_REQUEST, OTAU_SUCCESS, otauDataSend(), otauTimerStart(), req_log_addr_mode, read_mem_indication_t::status, write_mem_indication_t::status, TIMER_MODE_PERIODIC, and TRACE_INTERVAL_MS.
Referenced by otauRcvdFrame().
void otauDebugSentFrame | ( | uint8_t | messageId, |
addr_mode_t | addr_mode, | ||
uint8_t * | addr, | ||
uint8_t | status | ||
) |
References debug_confirm_wait.
Referenced by otauDataConf(), and otauDataSend().
void otauDebugTimerHandler | ( | SYS_Timer_t * | timer | ) |
References APP_MAX_PAYLOAD_SIZE, curr_debug_timer_state, curr_trace_mode, debug_confirm_wait, DEBUG_LOG_STATE, DEBUG_TRACE_STATE, debugTraceEnable, DOMAIN_OTAU_DEBUG, log_indication_t::domainId, trace_indication_t::domainId, EXTENDED_ADDR_MODE, log_bitmap, log_indication_t::log_content, LOG_INTERVAL_MS, log_indication_t::msg_id, trace_indication_t::msg_id, NATIVE_ADDR_MODE, NULL, OTA_LOG_INDICATION, OTA_TRACE_INDICATION, otauDataSend(), otauTimerStart(), otauTimerStop(), PHY_MAX_PAYLOAD_SIZE, readCircularBuffer(), req_log_addr_mode, TIMER_MODE_PERIODIC, trace_indication_t::trace_content, and trace_indication_t::trace_end.
Referenced by otauTimerStart().
debug_timer_state_t curr_debug_timer_state = DEBUG_TIMER_IDLE |
Referenced by otauDebugInit(), otauDebugRcvdFrame(), and otauDebugTimerHandler().
uint8_t curr_trace_mode = 0 |
Referenced by otauDebugRcvdFrame(), and otauDebugTimerHandler().
uint8_t debug_confirm_wait = 0 |
Referenced by otauDebugRcvdFrame(), otauDebugSentFrame(), and otauDebugTimerHandler().
uint8_t debugTraceEnable = 0 |
Referenced by otauDebugRcvdFrame(), and otauDebugTimerHandler().
uint8_t log_bitmap = 0x00 |
Referenced by otau_log(), otauDebugRcvdFrame(), and otauDebugTimerHandler().
circularBuffer_t logBuffer |
uint8_t logBufferMem[BUF_SIZE] |
Referenced by otauDebugInit(), and otauDebugRcvdFrame().
uint8_t req_log_addr_mode = NATIVE_ADDR_MODE |
Referenced by otauDebugRcvdFrame(), and otauDebugTimerHandler().
circularBuffer_t traceBuffer |
uint8_t traceBufferMem[BUF_SIZE] |
Referenced by otauDebugInit().