jrowberg / bglib

BGLib implementation for Bluegiga BLE Bluetooth Smart modules
Other
239 stars 170 forks source link

BGLib version of serial cable replacement? #14

Closed zrecore closed 10 years ago

zrecore commented 10 years ago

Would anyone have pointers on getting a wireless serial connection working between two BLE113 modules? the closest I could find was a BGScript only implementation, ...though I'm not sure how it translates to BGLib equivalent calls. This is what im trying to translate: https://bluegiga.zendesk.com/entries/27615486-Tested-cable-replacement-sample-for-ble113-

jrowberg commented 10 years ago

Hi @zrecommerce,

The cable replacement example implemented in BGScript and the SPP-over-BLE project on the BG knowledge base are designed specifically to be transparent. If you try to replicate this functionality using BGAPI/BGLib, then by definition the communication is no longer transparent, since everything is wrapped in binary protocol packet encapsulation.

zrecore commented 10 years ago

Thank you Jeff, I appreciate the quick response.

So what options would be available with a BGLib implementation that would allow sending small amounts of changing data continuously? Would that just be custom advertising data?

jrowberg commented 10 years ago

Custom advertising would allow you to broadcast (very!) small amounts of data, but not to any specific devices. That would require connecting first, and then probably using notifications or indications. This KB article discusses how data transfers work:

https://bluegiga.zendesk.com/entries/25053373--REFERENCE-BLE-master-slave-GATT-client-server-and-data-RX-TX-basics

zrecore commented 10 years ago

Looks promising. I'll try implementing a GATT server/client set up example when I get home from work this evening.