B4R Question SerialNative2 and AsyncStreams

Discussion in 'B4R Questions' started by rodmcm, Sep 18, 2018.

  1. rodmcm

    rodmcm Member Licensed User

    I am trying to attach astreams to SerialNative 2 to catch incoming messages. Tried lots of combinations, but at limit of understanding.
    This is the compile error file

    Verifying...
    In file included from C:\RODSFI~1\RODSPL~1\RODTOO~1\B4A\RODSRP~1\SERIAL~1\Objects\bin\sketch\B4RDefines.h:25:0,
    from C:\RODSFI~1\RODSPL~1\RODTOO~1\B4A\RODSRP~1\SERIAL~1\Objects\bin\sketch\AsyncStreams.cpp:1:
    C:\RODSFI~1\RODSPL~1\RODTOO~1\B4A\RODSRP~1\SERIAL~1\Objects\bin\sketch\AsyncStreams.cpp: In static member function 'static void B4R::AsyncStreams::checkForData(void*)':
    rCore.h:580: error: no matching function for call to 'operator new(sizetype, byte*)'
    #define CreateStackMemoryObject(type) new (StackMemory::buffer + AlignCP) type(); StackMemory::cp += sizeof(type)
    ^
    C:\RODSFI~1\RODSPL~1\RODTOO~1\B4A\RODSRP~1\SERIAL~1\Objects\bin\sketch\AsyncStreams.cpp:27:20: note: in expansion of macro 'CreateStackMemoryObject'
    ArrayByte* arr = CreateStackMemoryObject(ArrayByte);
    ^
    <built-in>: note: candidate: void* operator new(unsigned int)
    <built-in>: note: candidate expects 1 argument, 2 provided
    exit status 1
     

    Attached Files:

  2. Erel

    Erel Administrator Staff Member Licensed User

    Please edit your post. It is very difficult to read the error message.

    Why have you added this line:
    Code:
    #DefineExtra: #define SKIP_B4RNEW
    What happens if you remove it?
     
  3. rodmcm

    rodmcm Member Licensed User

    Works fine without SKIP_B4RNEW

    Thanks.. I left it in as you had told me on a previous post to include it for B4r compile problems

    Would you mind if I post the complete (and running) program to 'code snippets' there may be others looking at the other hardware serials
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Good idea!
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice