Is it possible to port this example on a BLED112 module? I would like to connect one BM111 module and one BLED112 module
Thank you best regards
@Gio63 I have BLED112 version of the "SPP client" almost completed, I hope I can make it available within next two weeks. This will allow you connect BLED112 and BGM111 so that BLED112 is the client that does most of the work (scanning for devices, parsing advertising data etc) and BGM111 is the SPP server.
Thank you it is a good new for me. I would like if it is possible to change payload size on BLED112 size. I need to have 256 byte payload size.
Let's continue the payload size discussion in the other thread that you started here:
Thank you for posting this. Is there a C-based (BGAPI) version of this example available, or an alternative (C-based) example of implementing a BLE central with the BGM111?
@laser_dude sorry for the long response time, I did not notice your question earlier.
In our BLE SDK 18.104.22.168 that is installed on top of Simplicity Studio v3.3 there is a cable replacement example that is somewhat similar to the BGScript example in this article. There are two sample projects: cable replacement - server role and cable replacement -client role.
Below are instructions how to modify this example to work on BGM113 kit (radio board BRD4301A):
First, change the device type from bgm111 to bgm113 in the project file (*.bgproj).
Additionally, you need to modify the pin configurations related to LEDs and UART as follows:
in BGM113 board the LEDs are mapped to pins PD14, PD15. In the script files you need to edit the LED pin/bank defines:
# LEDs for BGM113 board: # LED0 is mapped to pin D14 const led0_bank = 3 const led0_pin_mask = $4000 # LED1 is mapped to pin D15 const led1_bank = 3 const led1_pin_mask = $8000
And the corresponding changes need to be done in hardware.xml:
<!-- GPIO configuration needed for WSTK UART to work--> <!--gpio port="A" pin="5" mode="pushpull" out="1"/--> <!-- pin PF9 = VCOM_RTS on BGM113 kit --> <gpio port="F" pin="9" mode="pushpull" out="0"/> <!-- GPIO configuration for LEDs --> <gpio port="D" pin="14" mode="pushpull" out="0"/> <gpio port="D" pin="15" mode="pushpull" out="0"/>
Note also the changes in UART signals: in BGM113 carrier board the VCOM_ENABLE pin is tied high so it is not needed to drive pin PA5. (In fact, that pin is not even available in BGM113).
And the VCOM_RTS pin is mapped to pin PF9 in BGM113 kit.
Thank you it is very useful I think I am supposed to use BGM113 in my application.
Just another question. In my application I need to use UART with IRDA coding so I cannot use BGSCRIPT. I think I am going to use C-SDK. Can I use the same API I used in BGSCRIPT (*.bgs files) ?
@Gio63 yes, the API is basically the same in C and BGscript applications, the syntax is just different. If you go through the API documentation you will notice that for each command there is a BGScript prototype and a C prototype. There are generally no API calls that would be BGSCript-only or C-only.
Hope this helps,
Yes it helps Thank you. How can I handle the events in C Functions? I need to handle the endpoint_data event to receive data from serial port.
In API documentation it is written
/* Event id */
/* Event structure */
What is the C function whom check that event?