Go to the source code of this file.
|
| bool | serialTransmitInProgress (void) |
| | Is a serial write in progress?
|
| |
| bool | serialRecieveInProgress (void) |
| | Is a non-blocking serial receive operation in progress?
|
| |
| void | legacySerialCommand (void) |
| |
| void | legacySerialHandler (byte cmd, Stream &targetPort, SerialStatus &targetStatusFlag) |
| |
| void | sendValues (uint16_t offset, uint16_t packetLength, byte cmd, Stream &targetPort, SerialStatus &targetStatusFlag) |
| |
| void | sendValues (uint16_t offset, uint16_t packetLength, byte cmd, Stream &targetPort, SerialStatus &targetStatusFlag, uint8_t(*logFunction)(uint16_t)) |
| |
| void | sendValuesLegacy (void) |
| |
| void | sendPageASCII (void) |
| |
| void | testComm (void) |
| |
| void | sendToothLog_legacy (byte startOffset) |
| |
| void | sendCompositeLog_legacy (byte startOffset) |
| |
◆ SerialStatus
The current state of serial communication.
| Enumerator |
|---|
| SERIAL_INACTIVE | No serial comms is in progress
|
| SERIAL_TRANSMIT_INPROGRESS | A partial write is in progress.
|
| SERIAL_TRANSMIT_INPROGRESS_LEGACY | A partial write is in progress (legacy send).
|
| SERIAL_TRANSMIT_TOOTH_INPROGRESS | We are part way through transmitting the tooth log
|
| SERIAL_TRANSMIT_TOOTH_INPROGRESS_LEGACY | We are part way through transmitting the tooth log (legacy send)
|
| SERIAL_TRANSMIT_COMPOSITE_INPROGRESS | We are part way through transmitting the composite log
|
| SERIAL_TRANSMIT_COMPOSITE_INPROGRESS_LEGACY | We are part way through transmitting the composite log (legacy send)
|
| SERIAL_RECEIVE_INPROGRESS | Whether or not a serial request has only been partially received. This occurs when a the length has been received in the serial buffer, but not all of the payload or CRC has yet been received.
Expectation is that serialReceive is called until the status reverts to SERIAL_INACTIVE
|
| SERIAL_COMMAND_INPROGRESS_LEGACY | We are part way through processing a legacy serial commang: call serialReceive
|
◆ legacySerialCommand()
| void legacySerialCommand |
( |
void |
| ) |
|
Processes the incoming data on the serial buffer based on the command sent. Can be either data for a new command or a continuation of data for command that is already in progress:
- cmdPending = If a command has started but is waiting on further data to complete
- chunkPending = Specifically for the new receive value method where TS will send a known number of contiguous bytes to be written to a table
Commands are single byte (letter symbol) commands.
◆ legacySerialHandler()
| void legacySerialHandler |
( |
byte |
cmd, |
|
|
Stream & |
targetPort, |
|
|
SerialStatus & |
targetStatusFlag |
|
) |
| |
◆ sendCompositeLog_legacy()
| void sendCompositeLog_legacy |
( |
byte |
startOffset | ) |
|
◆ sendPageASCII()
| void sendPageASCII |
( |
void |
| ) |
|
Send page as ASCII for debugging purposes. Similar to sendPage(), however data is sent in human readable format. Sends page given in currentPage.
This is used for testing only (Not used by TunerStudio) in order to see current map and config data without the need for TunerStudio.
◆ sendToothLog_legacy()
| void sendToothLog_legacy |
( |
byte |
startOffset | ) |
|
Send 256 tooth log entries to primarySerial. if useChar is true, the values are sent as chars to be printed out by a terminal emulator if useChar is false, the values are sent as a 2 byte integer which is readable by TunerStudios tooth logger
◆ sendValues() [1/2]
| void sendValues |
( |
uint16_t |
offset, |
|
|
uint16_t |
packetLength, |
|
|
byte |
cmd, |
|
|
Stream & |
targetPort, |
|
|
SerialStatus & |
targetStatusFlag |
|
) |
| |
◆ sendValues() [2/2]
| void sendValues |
( |
uint16_t |
offset, |
|
|
uint16_t |
packetLength, |
|
|
byte |
cmd, |
|
|
Stream & |
targetPort, |
|
|
SerialStatus & |
targetStatusFlag, |
|
|
uint8_t(*)(uint16_t) |
logFunction |
|
) |
| |
Send a status record back to tuning/logging SW. This will "live" information from currentStatus struct.
- Parameters
-
| offset | - Start field number |
| packetLength | - Length of actual message (after possible ack/confirm headers) |
| cmd | - ??? - Will be used as some kind of ack on secondarySerial |
| targetPort | - The HardwareSerial device that will be transmitted to |
| targetStatusFlag | - The status flag that will be set to indicate the status of the transmission |
| logFunction | - The function that should be called to retrieve the log value E.g. tuning sw command 'A' (Send all values) will send data from field number 0, LOG_ENTRY_SIZE fields. |
◆ sendValuesLegacy()
| void sendValuesLegacy |
( |
void |
| ) |
|
◆ serialRecieveInProgress()
| bool serialRecieveInProgress |
( |
void |
| ) |
|
|
inline |
Is a non-blocking serial receive operation in progress?
Expectation is the serialReceive is called until this returns false.
◆ serialTransmitInProgress()
| bool serialTransmitInProgress |
( |
void |
| ) |
|
|
inline |
Is a serial write in progress?
Expectation is that serialTransmit is called until this returns false
◆ testComm()
◆ firstCommsRequest
The number of times the A command has been issued. This is used to track whether a reset has recently been performed on the controller
◆ inProgressLength
◆ logItemsTransmitted
◆ serialSecondaryStatusFlag
◆ serialStatusFlag
Current status of serial comms.