Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TinyDuino BGLib_stub_slave.ino and ble_cmd_gap_set_adv_data #12

Open
schrockblock opened this issue Apr 4, 2014 · 2 comments
Open

TinyDuino BGLib_stub_slave.ino and ble_cmd_gap_set_adv_data #12

schrockblock opened this issue Apr 4, 2014 · 2 comments

Comments

@schrockblock
Copy link

Hi there, not sure if this is the right place to put this, but here goes.

I'm developing a simple sketch for a TinyDuino with the BLE rev2 board based on the BGLib_stub_slave found here:

http://tiny-circuits.com/learn/using-the-bluetooth-low-energy-tinyshield/

I've adjusted the adv_data to be 30 bytes long, however, when I call

ble112.ble_cmd_gap_set_adv_data(0, 0x1e, adv_data);

none of my devices detect BLE packets from the device. Only when I lower it from 0x1e to 0x1c does the data get (mostly) advertised; obviously, 0x1c cuts off the last two bytes of my data. I'm a mobile app dev by trade, so I'm not familiar with BlueGiga or C++ (which is what it looks like the BGLib is written in), but looking at the code it appears a byte or three are added to the front of the payload to account for length, or some sort of BLE command. Since advertising packets are limited to 31 bytes, I believe that's what's cutting off my packet... how can I fix this issue? I was considering adjusting the BGLib::ble_cmd_gap_set_adv_data or BGLib::sendCommand methods in some way, but I have no idea what I'm doing, so it'd just be trial and error. Am I doing something wrong? Is this use case not supported? How can I get this working?

@mjbrown
Copy link

mjbrown commented Apr 4, 2014

The company sponsored BGLib is straight C. I've created an example which sets up a BlueGiga in advertisement mode with user data. It is using the BGLib that Jeff created for Python. However, the code looks very, very similar to the C and with some effort you can figure it out, at least to see the sequence of events and sample parameters.

The example is in my fork at:
https://github.com/mjbrown/bglib/blob/master/Python/Examples/bglib_test_advertising.py

An example of reading the received advertising data is at:
https://github.com/mjbrown/bglib/blob/master/Python/Examples/bglib_test_attribute_write.py

@sahilsobti
Copy link

Hello, I have a project to advertise the packets through bluegiga ble112 bluettoth in c# and read the data from the client. Any idea how to do it? please help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants