You are here

API error 100 and 300: CYBLE_ERROR_INVALID_PARAMETER at connect | Cypress Semiconductor

API error 100 and 300: CYBLE_ERROR_INVALID_PARAMETER at connect

Summary: 5 Replies, Latest post by schwarz on 12 Nov 2016 10:48 AM PST
Verified Answers: 0
Last post
Log in to post new comments.
schwarz's picture
User
22 posts

Hi,

I'm stucking in my project (see attachment) and need your help. My project is based on the BLE_HID_Joystick example with some changes for my requirements. I did not change the BLE modul and copied the BLE code, but I get an api error 100 (CYBLE_ERROR_INVALID_PARAMETER) and 300 after connecting to CySmart. My hardware is the CY8CKIT-042-BLE with the black PRoC board.

I couldn't find what error 300 is and I don't know how to solve error 100 (CYBLE_ERROR_INVALID_PARAMETER). It would be great if anyone would help me. I used PSoc creator 3.3 and 4.0.

The UART output:

BLE HID Keyboard Example Project <\r><\n>
Bluetooth On, StartAdvertisement with addr: c04929199580<\r><\n>
EVT_ADVERTISING, state: 3 <\r><\n>
EVT_ADVERTISING, state: 3 <\r><\n>
EVT_ADVERTISING, state: 3 <\r><\n>
EVT_GATT_CONNECT_IND: 0, 4 <\r><\n>
EVT_GAP_DEVICE_CONNECTED: connIntv = 0 ms <\r><\n>
API Error: 300 <\r><\n>
API Error: 10<\0>API Error:<\0>API Erro?API Error: 300 <\r><\n>
API Error: 300 <\r><\n>
CYBLE_EVT_GATTS_XCNHG_MTU_REQ, final mtu=<\0>API Erro<2>
mady's picture
Cypress Employee
967 posts

Hi,

There is a small issue in your code:

 Before you enable Battery notification from the Central / Client, the "fbatteryMeasureNotify" is 0.

You define the error code as  CYBLE_API_RESULT_T apiResult; When you do this, a garbage value may be stored in apiResult. This can be 300 or 100. So before you enable the notification, the following part of code alone gets executed in BatteryService_Cyclic () function:

 if(apiResult != CYBLE_ERROR_OK)
    {
     DBG_PRINTF("API Error: %x \r\n", apiResult);
      fbatteryMeasureNotify = false;
   
    }

 

Here because of garbage value in apiResult, it will print as 300 or 100.

So, please change the declaration of apiResult as "CYBLE_API_RESULT_T apiResult = CYBLE_ERROR_OK;"

Also, please leave your E-mail ID for our internal records.

Regards,

-Madhu Sudhan

 

 

schwarz's picture
User
22 posts

Hi,

thanks, now there is no error at connecting. But after enabling all notifications I get api error 1 (CYBLE_ERROR_INVALID_PARAMETER) once. If I hit the button often sometimes I get one or two notifications. I'll try to find where it happens.

Where should I leave my mail address?

Kind regards,

schwarz

schwarz's picture
User
22 posts

OK, I found the error: my batteryLevel was over 100, but only 100 % are allowed. Now it works and I can start to go on. Thank you very much.

mady's picture
Cypress Employee
967 posts

Please leave your E-,mail Address here in the forum.

Regards,

-Madhu

schwarz's picture
User
22 posts

Hi Madhu,

it is christian.weiss at lnt-automation.de

Regards,

schwarz

Log in to post new comments.