Hi
Two-way Bluetooth communication is implemented through the "FRDM-KW36" board.
I am using the examples using "KW36 SDK", especially the 'BLE_temp sens' and 'BLE_temp coll' examples.
Based on the example, two FRDM-KW36 boards are required (board A and board b), and it seems that board A, which acts as a sensor, transmits temperature data to board B, which acts as a collector, through Bluetooth communication.
I ask a question here.
Is it possible to transmit data from board B, which acts as a collector, to board A, which acts as a sensor, through Bluetooth communication?
For example, if the temperature received from the sensor is between 25 and 30, is it possible to send integer data '1' back to the sensor?
If this is not possible, please let me know of an example that can be used among the examples in the KW36 SDK.
I'm waiting for your reply. thank you.
Solved! Go to Solution.
Hi,
If you take a look at the following function from temperature_sensor.c file:
bleResult_t Tms_RecordTemperatureMeasurement(uint16_t serviceHandle, int16_t temperature)
you will notice that the value is handled as an integer; however, both Client and Server must know how to interpret these Attributes.
GATT Server must define a Service that must be the same as in the GATT Client. If the new service is not the same, Client and Server will not be able to communicate each other.
Please, take a look at the information described in the KW38 Custom Profile. You will find more information on this in the Server section.
Also, you can refer to the BLE Application Developer's Guide:
Section 6: The document describes the usage of the GATT Database APIs that allow the application to manipulate data stored in the GATT Server database.
Section 7: This section describes a user-friendly method to statically build a GATT Database. The method involves the use of a predefined set of macros that the application may include to build the database at application compile time.
Section 8: This section contains instructions on how to build a custom profile.
Regards,
Eduardo.
Hello @SeokJin
Hope you are doing well.
I would recommend you checking the Wireless UART example. This example implements both the GATT client and server for the custom Wireless UART profile and services.
This example might be helpful for your application, as it can change from a central to peripheral mode. More information on this application can be found in the BLE Demo Applications User's Guide from KW36 SDK documentation > docs > wireless > Bluetooth.
Regards,
Eduardo.
Hi,
It should be possible. GATT layer is responsible of the procedures for data transfer between two connected devices. GAP roles (Central and Peripheral) are different from GATT roles (Client and Server); Central device could also act as GATT Server and expose its Attributes so the Client can discover, read and write them.
For more information, please refer to the BLE Application Developer's Guide from KW36 SDK documentation > docs > wireless > Bluetooth. Chapter 5 describes GATT layer.
Regards,
Eduardo.
Oh, thank you for your very detailed and kind reply. I think you could be my lifesaver.
Lastly, I think I should go over what you answered. Because this matter is very important to me.
Does this mean that data can be transmitted from ‘temp collector’ to ‘temp sensor’ by modifying the basic example codes of ‘BLE_temp sens’ and ‘BLE_temp coll’ in the KW36 SDK???
For example, if the temperature data received by the 'temp collector' from the 'temp sensor' is above 30°C, is it possible to implement a system with the condition of transmitting the number 10 from the 'temp collector' to the 'temp sensor'?? Is what I understood correct?
Please answer with certainty whether what I asked is correct. This is a very, very important issue to me.
I'm waiting for your reply. thank you.
Hi,
Would you consider evaluating the temperature directly on the Temperature Sensor side and perform the corresponding actions if the conditions are met?
Also, perhaps you may find some useful information in the following Community artocle KW38 Custom Profile - NXP Community.
Regards,
Eduardo.
Hello.
I received a good reply. However, I am not yet considering your answer.
What I'm curious about right now is what kind of data can be transferred from the "temp collector device" to the "temp sensor device".
For example, if the temperature data received by the "temp collector device" from the "temp sensor device" is above 30 degrees Celsius, I wonder if the "temp collector device" can send the 'int 10' to the "temp sensor device".
- This means implementing it by modifying the basic example code.
I'm not considering any other options right now, I'm just curious about the question I asked above.
Please answer “possible” or “impossible”. I would really appreciate it then.
Best Regards,
SeokJin.
Hi,
If you take a look at the following function from temperature_sensor.c file:
bleResult_t Tms_RecordTemperatureMeasurement(uint16_t serviceHandle, int16_t temperature)
you will notice that the value is handled as an integer; however, both Client and Server must know how to interpret these Attributes.
GATT Server must define a Service that must be the same as in the GATT Client. If the new service is not the same, Client and Server will not be able to communicate each other.
Please, take a look at the information described in the KW38 Custom Profile. You will find more information on this in the Server section.
Also, you can refer to the BLE Application Developer's Guide:
Section 6: The document describes the usage of the GATT Database APIs that allow the application to manipulate data stored in the GATT Server database.
Section 7: This section describes a user-friendly method to statically build a GATT Database. The method involves the use of a predefined set of macros that the application may include to build the database at application compile time.
Section 8: This section contains instructions on how to build a custom profile.
Regards,
Eduardo.