Community
cancel
Showing results for 
Search instead for 
Did you mean: 
振王3
Beginner
905 Views

get BT SPP data from python then transfer to my C process use.

Jump to solution

hi

i have used "SPP-loopback.py " get the BT datas, but now i want transfer to my C process.

how can i do?

thanks for your solution

0 Kudos

Accepted Solutions
idata
Community Manager
37 Views

Hello 王振,

 

 

Thanks for reaching out!

 

 

I'm not sure transferring data from Python to C would be the best approach, I mean, this would bring a lot of issues at the time of sharing the data. So, my first suggestion is that you reconsider using this approach and instead use a more traditional approach, meaning using only Python or only C. For Python, you can modify the SPP-Loopback example to transform it into your project. For C, I would suggest you to read this book: https://people.csail.mit.edu/albert/bluez-intro/c404.html https://people.csail.mit.edu/albert/bluez-intro/c404.html to learn how to program Bluetooth using C and BlueZ's API.

 

 

If you still want to transfer data from Python to C, then I'd suggest you to read the following documents which might be of help:

 

 

https://stackoverflow.com/questions/4961267/pass-many-pieces-of-data-from-python-to-c-program https://stackoverflow.com/questions/4961267/pass-many-pieces-of-data-from-python-to-c-program

 

https://stackoverflow.com/questions/4743748/how-do-i-connect-a-python-and-a-c-program https://stackoverflow.com/questions/4743748/how-do-i-connect-a-python-and-a-c-program

 

https://stackoverflow.com/questions/4997831/a-way-to-pass-milions-of-items-in-python-to-c-program-ma... https://stackoverflow.com/questions/4997831/a-way-to-pass-milions-of-items-in-python-to-c-program-ma...

 

https://docs.python.org/3/extending/extending.html https://docs.python.org/3/extending/extending.html

 

 

I hope this information helps you,

 

Pedro M.

View solution in original post

1 Reply
idata
Community Manager
38 Views

Hello 王振,

 

 

Thanks for reaching out!

 

 

I'm not sure transferring data from Python to C would be the best approach, I mean, this would bring a lot of issues at the time of sharing the data. So, my first suggestion is that you reconsider using this approach and instead use a more traditional approach, meaning using only Python or only C. For Python, you can modify the SPP-Loopback example to transform it into your project. For C, I would suggest you to read this book: https://people.csail.mit.edu/albert/bluez-intro/c404.html https://people.csail.mit.edu/albert/bluez-intro/c404.html to learn how to program Bluetooth using C and BlueZ's API.

 

 

If you still want to transfer data from Python to C, then I'd suggest you to read the following documents which might be of help:

 

 

https://stackoverflow.com/questions/4961267/pass-many-pieces-of-data-from-python-to-c-program https://stackoverflow.com/questions/4961267/pass-many-pieces-of-data-from-python-to-c-program

 

https://stackoverflow.com/questions/4743748/how-do-i-connect-a-python-and-a-c-program https://stackoverflow.com/questions/4743748/how-do-i-connect-a-python-and-a-c-program

 

https://stackoverflow.com/questions/4997831/a-way-to-pass-milions-of-items-in-python-to-c-program-ma... https://stackoverflow.com/questions/4997831/a-way-to-pass-milions-of-items-in-python-to-c-program-ma...

 

https://docs.python.org/3/extending/extending.html https://docs.python.org/3/extending/extending.html

 

 

I hope this information helps you,

 

Pedro M.

View solution in original post