Giter VIP home page Giter VIP logo

Comments (4)

KurtE avatar KurtE commented on August 17, 2024 1

Thanks

from opencm9.04.

KurtE avatar KurtE commented on August 17, 2024

I should mention this causes other parts of the Arduino Stream code to not work as well.

That is if you do something like: Note: XBSerial is defined as Serial2

XBeeSerial.print(F("+++")); 
XBeeSerial.flush();
XBeeSerial.setTimeout(20);  // give a little extra time
if (XBeeSerial.readBytesUntil('\r', ab, 10) > 0) {

The call to readBytesUntil will not work properly as it loops calling timedRead

int c = timedRead();

Which in Stream.cpp is defined as:

int Stream::timedRead()
{
  int c;
  startMillis = millis();
  do {
    c = read();
    if (c >= 0) return c;
  } while(millis() - _startMillis < _timeout);
  return -1;     // -1 indicates timeout
}

from opencm9.04.

OpusK avatar OpusK commented on August 17, 2024

Hello, @KurtE
Thank you for letting us know about this issue.

you're right.
In order to be compatible with existing Arduino codes, the following must be fulfilled.

The first byte of incoming serial data available (or -1 if no data is available) - int.

But we were just returning the size of the data. That is, if there is no data, it returns 0.
We will fix this and we will test out what you have mentioned and release it as soon as possible.

And,
The reason we did not include the source file is to reduce the build time.
Therefore, the source file is converted to a library file (.a).
If you want a source file, you can get it from this repository.

from opencm9.04.

OpusK avatar OpusK commented on August 17, 2024

@KurtE

I have modified the code and confirmed that it works.
However, it may take some time to release.

If you need to use it right away, please copy the lib_f103.a file in the develop branch to the location(refer to picture below) where the ArduinoBoard package is installed.

1

from opencm9.04.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.