Continuous data transfer with flutter blue plus?

112 Views Asked by At

so i am trying to make an app to amongst other things controll an rc car.

i have a normal slider (code here):

child: SliderTheme(
                data: SliderTheme.of(context).copyWith(
                  trackHeight: 10.0,
                  trackShape: const RoundedRectSliderTrackShape(),
                  activeTrackColor: const Color.fromARGB(255, 96, 66, 144),
                  inactiveTrackColor: const Color.fromARGB(255, 96, 66, 144),
                  thumbShape: const RoundSliderThumbShape(
                    enabledThumbRadius: 14.0,
                  ),
                  thumbColor: const Color.fromARGB(255, 56, 41, 81),
                ),
                child: Slider(
                  min: 0.0,
                  max: 180.0,
                  value: servoValue,
                  onChanged: (value) {
                    setState(() {
                      servoValue = value;
                      widget.mycharacteristic
                          .write(utf8.encode("xsrv${servoValue.round()}"));
                    });
                  },
                ),
              ),

but when i hold down the slider it doesn't start sending the data over bluetooth untill i let go of the slider, and then it sends it all at once. is there a way to continuesly send data with flutter blue plus?

i am sending everything to an arduino bluno beetle

edit: i figured out the issue most likely lies at the bluno beetle. as i noticed the rx LED starts blinking the instant the app sends the data, but the tx LED only blinks after there is no new data.

so new question: How do i make the board send the data to the serialport continuesly, without waiting for the incoming trafic to stop?

another edit:

i found the answer here

0

There are 0 best solutions below