Belt tensioner - En...
 
Notifications
Clear all

[Solved] Belt tensioner - Encountering RingBuffer errors using FlowSerialRead.h

2 Posts
1 Users
0 Reactions
111 Views
(@drv3r)
Active Member
Joined: 2 months ago
Posts: 5
Topic starter  

Hello,

I am trying to control a belt tensioner via an Arduino Due using a custom serial device. My difficulty is "listening" to SimHub data.

I have included some SimHub add-ons in my Arduino folder: ArqSerial.h, FlowSerialRead.h, and RingBuffer.h. I have also made a simple code for debugging :

#include "simhub removed link "
ARQSerial arqserial;

void setup() {
		Serial.begin(115200);
}


void loop() {
			
	String message = arqserial.ReadStringUntil('\n');
	arqserial.DebugPrintLn("Message received : " + message);

}

But I am encountering many errors, especially in the RingBuffer file :

Spoiler
Errors
In file included from C:\Users\BST\Downloads\debug_get_data\simhub\ArqSerial.h:6:0,
from C:\Users\BST\Downloads\debug_get_data\debug_get_data.ino:1:
C:\Users\BST\Downloads\debug_get_data\simhub\RingBuffer.h:51:7: error: 'RingBuffer' is not a template type
class RingBuffer
^
C:\Users\BST\Downloads\debug_get_data\simhub\RingBuffer.h:93:19: error: expected initializer before '<' token
uint8_t RingBuffer<rg_element_t, __maxSize__>::writeIndex()
^
C:\Users\BST\Downloads\debug_get_data\simhub\RingBuffer.h:101:1: error: 'RingBuffer' is not a template
RingBuffer<rg_element_t, __maxSize__>::RingBuffer() :
^
C:\Users\BST\Downloads\debug_get_data\simhub\RingBuffer.h:101:51: error: explicit qualification in declaration of 'RingBuffer RingBuffer()'
RingBuffer<rg_element_t, __maxSize__>::RingBuffer() :
^
C:\Users\BST\Downloads\debug_get_data\simhub\RingBuffer.h: In function 'RingBuffer RingBuffer()':
C:\Users\BST\Downloads\debug_get_data\simhub\RingBuffer.h:102:1: error: only constructors take member initializers
mReadIndex(0),
^
C:\Users\BST\Downloads\debug_get_data\simhub\RingBuffer.h: At global scope:
C:\Users\BST\Downloads\debug_get_data\simhub\RingBuffer.h:108:43: error: expected initializer before '::' token
bool RingBuffer<rg_element_t, __maxSize__>::push(const rg_element_t inElement)
^
C:\Users\BST\Downloads\debug_get_data\simhub\RingBuffer.h:117:43: error: expected initializer before '::' token
bool RingBuffer<rg_element_t, __maxSize__>::push(const rg_element_t* inElements, uint8_t length)
^
C:\Users\BST\Downloads\debug_get_data\simhub\RingBuffer.h:126:43: error: expected initializer before '::' token
bool RingBuffer<rg_element_t, __maxSize__>::push(const rg_element_t * const inElement)
^
C:\Users\BST\Downloads\debug_get_data\simhub\RingBuffer.h:135:43: error: expected initializer before '::' token
bool RingBuffer<rg_element_t, __maxSize__>::lockedPush(const rg_element_t inElement)
^
C:\Users\BST\Downloads\debug_get_data\simhub\RingBuffer.h:144:43: error: expected initializer before '::' token
bool RingBuffer<rg_element_t, __maxSize__>::lockedPush(const rg_element_t * const inElement)
^
C:\Users\BST\Downloads\debug_get_data\simhub\RingBuffer.h:153:43: error: expected initializer before '::' token
bool RingBuffer<rg_element_t, __maxSize__>::pop(rg_element_t &outElement)
^
C:\Users\BST\Downloads\debug_get_data\simhub\RingBuffer.h:164:43: error: expected initializer before '::' token
bool RingBuffer<rg_element_t, __maxSize__>::pop()
^
C:\Users\BST\Downloads\debug_get_data\simhub\RingBuffer.h:174:43: error: expected initializer before '::' token
bool RingBuffer<rg_element_t, __maxSize__>::lockedPop(rg_element_t &outElement)
^
C:\Users\BST\Downloads\debug_get_data\simhub\RingBuffer.h:183:52: error: expected initializer before '::' token
rg_element_t &RingBuffer<rg_element_t, __maxSize__>::operator[](uint8_t inIndex)
^
In file included from C:\Users\BST\Downloads\debug_get_data\debug_get_data.ino:1:0:
C:\Users\BST\Downloads\debug_get_data\simhub\ArqSerial.h:19:2: error: 'RingBuffer<uint8_t, 32>' does not name a type
RingBuffer<uint8_t, 32> DataBuffer;
^
C:\Users\BST\Downloads\debug_get_data\simhub\ArqSerial.h: In member function 'void ARQSerial::ProcessIncomingData()':
C:\Users\BST\Downloads\debug_get_data\simhub\ArqSerial.h:113:8: error: 'DataBuffer' was not declared in this scope
DataBuffer.push(partialdatabuffer[i]);
^
C:\Users\BST\Downloads\debug_get_data\simhub\ArqSerial.h: In member function 'int ARQSerial::read()':
C:\Users\BST\Downloads\debug_get_data\simhub\ArqSerial.h:174:8: error: 'DataBuffer' was not declared in this scope
if (DataBuffer.size() > 0) {
^
C:\Users\BST\Downloads\debug_get_data\simhub\ArqSerial.h:181:48: error: 'DataBuffer' was not declared in this scope
} while (millis() - fsr_startMillis < 400 || DataBuffer.size() > 0);
^
C:\Users\BST\Downloads\debug_get_data\simhub\ArqSerial.h: In member function 'int ARQSerial::Available()':
C:\Users\BST\Downloads\debug_get_data\simhub\ArqSerial.h:189:7: error: 'DataBuffer' was not declared in this scope
if (DataBuffer.size() == 0) {
^
C:\Users\BST\Downloads\debug_get_data\simhub\ArqSerial.h:192:10: error: 'DataBuffer' was not declared in this scope
return DataBuffer.size();
^

exit status 1

Compilation error: 'RingBuffer' is not a template type

However, addons are vanilla

Thank you for your help


   
Quote
(@drv3r)
Active Member
Joined: 2 months ago
Posts: 5
Topic starter  

Solved
I download the last version from Arduino IDE
The new declaration is "RingBuf<uint8_t, 8> DataBuffer;" instead of "RingBuffer<uint8_t, 8> DataBuffer;"


   
ReplyQuote
Share: