0

Bluefruit Data Transfer from Arduino
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Bluefruit Data Transfer from Arduino

by yunus e on Fri Sep 19, 2014 12:58 pm

Hello,

I am having a bad luck concerning data transfers from arduino to my iOS device using the bluefruit LE software. I want to transmit many lines in a row, i.e.

Code: Select all | TOGGLE FULL SIZE
for(int i=0; i<20; i++)
{
String s="a";
uint8_t sendbuffer[20];
s.getBytes(sendbuffer, 20);
char sendbuffersize = min(20, s.length());
BTLEserial.write(sendbuffer, sendbuffersize);
}

and after 12-13 rows I get error on serial monitor:

"ACI Evt Pipe Error: Pipe #:3 Pipe Error Code: 0x91"

From the Nordic datasheet (http://www.google.com/url?sa=t&rct=j&q= ... 8935,d.aWc)


0x91 ACI_STATUS_ERROR_CREDIT_NOT_AVAILABLE Pipe Error Event : Credit not available


I need a way of increasing credit before sending each consecutive line, and it seems it is possible from looking at the Adafruit_BLE_UART.cpp file. However, this is the point were I fail to understand what to do. Your help is greatly appreciated.


Code: Select all | TOGGLE FULL SIZE
error codes */
        if (debugMode) {
          Serial.print(F("ACI Evt Pipe Error: Pipe #:"));
          Serial.print(aci_evt->params.pipe_error.pipe_number, DEC);
          Serial.print(F("  Pipe Error Code: 0x"));
          Serial.println(aci_evt->params.pipe_error.error_code, HEX);
        }

        /* Increment the credit available as the data packet was not sent */
        aci_state.data_credit_available++;
        break;
    }
  }
yunus e
 
Posts: 2
Joined: Thu Sep 05, 2013 3:02 pm

Re: Bluefruit Data Transfer from Arduino

by yunus e on Fri Sep 19, 2014 1:06 pm

Works:

Add this code between lines:

Code: Select all | TOGGLE FULL SIZE
BTLEserial.pollACI();
yunus e
 
Posts: 2
Joined: Thu Sep 05, 2013 3:02 pm

Please be positive and constructive with your questions and comments.