rusEFI
The most advanced open source ECU
tunerstudio.h
Go to the documentation of this file.
1 /**
2  * @file tunerstudio.h
3  *
4  * @date Aug 26, 2013
5  * @author Andrey Belomutskiy, (c) 2012-2020
6  */
7 
8 #pragma once
9 #include "global.h"
10 #include "tunerstudio_io.h"
11 
12 typedef struct {
24 
25  // overall counter, not all of this errors are reported back to TS
27  // by type error counters reported to TS
35 
37 
38 void tunerStudioDebug(TsChannelBase* tsChannel, const char *msg);
39 void tunerStudioError(TsChannelBase* tsChannel, const char *msg);
40 #define DO_NOT_LOG nullptr
41 void sendErrorCode(TsChannelBase *tsChannel, uint8_t code, /*empty line by default, use nullptr not to log*/const char *msg="");
42 
43 uint8_t* getWorkingPageAddr();
44 
45 void requestBurn();
46 // Lua script might want to know how long since last TS request to see if unit is being actively monitored
48 
49 #if EFI_TUNER_STUDIO
50 #include "thread_controller.h"
51 #include "thread_priority.h"
52 
54 
56 
57 typedef struct {
58  short int offset;
59  short int count;
61 
62 #if EFI_PROD_CODE || EFI_SIMULATOR
63 #define CONNECTIVITY_THREAD_STACK (3 * UTILITY_THREAD_STACK_SIZE)
64 
65 class TunerstudioThread : public ThreadController<CONNECTIVITY_THREAD_STACK> {
66 public:
67  TunerstudioThread(const char* name)
68  : ThreadController(name, PRIO_CONSOLE)
69  {
70  }
71 
72  // Initialize and return the channel to use for this thread.
73  virtual TsChannelBase* setupChannel() = 0;
74 
75  void ThreadTask() override;
76 
77 };
78 #endif
79 
80 #endif /* EFI_TUNER_STUDIO */
uint8_t code
Definition: bluetooth.cpp:39
A base class for a controller that requires its own thread.
TunerstudioThread(const char *name)
Definition: tunerstudio.h:67
void ThreadTask() override
virtual TsChannelBase * setupChannel()=0
This file sets the thread priority for the threads running on rusEFI.
tunerstudio_counters_s tsState
void updateTunerStudioState()
void startTunerStudioConnectivity(void)
void sendErrorCode(TsChannelBase *tsChannel, uint8_t code, const char *msg="")
void requestBurn()
void tunerStudioDebug(TsChannelBase *tsChannel, const char *msg)
uint8_t * getWorkingPageAddr()
int getSecondsSinceChannelsRequest()
void tunerStudioError(TsChannelBase *tsChannel, const char *msg)