ryanglscott / bluetoothtest Goto Github PK
View Code? Open in Web Editor NEWA proof of concept demonstrating that and Android app and a BlueCove server can communicate with each other.
A proof of concept demonstrating that and Android app and a BlueCove server can communicate with each other.
hi, i add main function in bluez_server.c like this
int main(int argc, char **argv)
{
init_server();
return 0;
}
and use gcc compile,but run find the error,can you help me?
pi@raspberrypi:/zzw/BluezServer $ gcc -o bluez_server bluez_server.c -lbluetooth/zzw/BluezServer $
bluez_server.c: In function ‘read_server’:
bluez_server.c:172:3: warning: function returns address of local variable [-Wreturn-local-addr]
return input;
^
pi@raspberrypi:
pi@raspberrypi:/zzw/BluezServer $ ./bluez_server/zzw/BluezServer $ gdb ./bluez_server
Registering UUID 00001101-0000-1000-8000-00805f9b34fb
Segmentation fault
pi@raspberrypi:
GNU gdb (Raspbian 7.7.1+dfsg-5+rpi1) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./bluez_server...(no debugging symbols found)...done.
(gdb) r
Starting program: /home/pi/zzw/BluezServer/bluez_server
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
Registering UUID 00001101-0000-1000-8000-00805f9b34fb
Program received signal SIGSEGV, Segmentation fault.
0x76f96a0c in sdp_device_record_register_binary ()
from /usr/lib/arm-linux-gnueabihf/libbluetooth.so.3
(gdb)
If you have hard to find crashes using this code, this is probably why:
char *read_server(int client) {
// read data from the client
char input[1024] = { 0 };
......
return input;
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.