PSOC 4 BLE and a LUX Sensor as our first project!

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
ChGa_3545231
Level 2
Level 2
First like given

Hello there,

we are currently working on a project.

In this project, our very first with a psoc 4 ble kit, we want to make a connection from a lus sensor to our psoc 4 ble kit.

On the psoc kit we want to read the data that the sensor sends.

The problem here is that we have never worked before with a bluetooth kit and do not have any idea of how to get this whole thing started.

I worked myself through the most sheets and hings that come along from cypress but I just can't get the hang of how this thing should work in the end.

Is there something out there that could help me getting a better understand what we have to do?

Regards

Chris

0 Likes
1 Solution

Hello Chris,

1. The BLE Component requires that you define a callback function for handling BLE stack events. This is passed as a parameter to the CyBle_Start() API. Here the callback function is Stackeventhandler (which is user defined).

The callback function is of type CYBLE_CALLBACK_T, as defined by:-

void (* CYBLE_CALLBACK_T)(uint32 eventCode, void *eventParam);

where

▪ eventCode: The stack event code

▪ eventParam : Stack event parameters

2. Similarly there are some BLE Service_Specific functions like CyBle_IasRegisterAttrCallback (CYBLE_CALLBACK_T callbackFunc) here IAShandler is used as callback function. These are user defined callback functions.

Please refer the section Callback Functions in the document for more information on APIs.

Thanks,

P Yugandhar.

View solution in original post

3 Replies
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello Chris,

Please refer the code examples on PSoC 4 BLE in PSoC Creator. This will give some information on BLE component and how BLE communication takes place.

Thanks,

P Yugandhar.

0 Likes

Hi,

I already looked at all your code examples but I still can’t figure out what the thing is behind it.

There is no real explanation for how to implement the services of an existing sensor.

Also there are no real documentations that help me to understand when I have to use the Stackeventhandler or the processeventhandler ot the IAShandler.

Regards

Chris

Sent from Mail for Windows 10

0 Likes

Hello Chris,

1. The BLE Component requires that you define a callback function for handling BLE stack events. This is passed as a parameter to the CyBle_Start() API. Here the callback function is Stackeventhandler (which is user defined).

The callback function is of type CYBLE_CALLBACK_T, as defined by:-

void (* CYBLE_CALLBACK_T)(uint32 eventCode, void *eventParam);

where

▪ eventCode: The stack event code

▪ eventParam : Stack event parameters

2. Similarly there are some BLE Service_Specific functions like CyBle_IasRegisterAttrCallback (CYBLE_CALLBACK_T callbackFunc) here IAShandler is used as callback function. These are user defined callback functions.

Please refer the section Callback Functions in the document for more information on APIs.

Thanks,

P Yugandhar.