mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-05 09:40:00 +00:00
daemon: fix example compile
This commit is contained in:
parent
b9dcd1cc6b
commit
fa968b9965
@ -49,7 +49,12 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "btstack_client.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "btstack_run_loop_posix.h"
|
||||
#else
|
||||
#include "btstack_run_loop_posix.h"
|
||||
#endif
|
||||
|
||||
#define MAX_DEVICES 10
|
||||
struct device {
|
||||
@ -239,9 +244,9 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe
|
||||
int main (int argc, const char * argv[]){
|
||||
// start stack
|
||||
#ifdef _WIN32
|
||||
btstack_run_loop_init(btstack_run_loop_posix_get_instance());
|
||||
#else
|
||||
btstack_run_loop_init(btstack_run_loop_windows_get_instance());
|
||||
#else
|
||||
btstack_run_loop_init(btstack_run_loop_posix_get_instance());
|
||||
#endif
|
||||
int err = bt_open();
|
||||
if (err) {
|
||||
|
@ -49,10 +49,15 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "btstack_client.h"
|
||||
#include "btstack_run_loop_posix.h"
|
||||
#include "hci_cmd.h"
|
||||
#include "classic/sdp_util.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "btstack_run_loop_posix.h"
|
||||
#else
|
||||
#include "btstack_run_loop_posix.h"
|
||||
#endif
|
||||
|
||||
int l2cap_reg_fail = 0;
|
||||
|
||||
hci_con_handle_t con_handle;
|
||||
@ -200,9 +205,9 @@ void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint
|
||||
|
||||
int main (int argc, const char * argv[]){
|
||||
#ifdef _WIN32
|
||||
btstack_run_loop_init(btstack_run_loop_posix_get_instance());
|
||||
#else
|
||||
btstack_run_loop_init(btstack_run_loop_windows_get_instance());
|
||||
#else
|
||||
btstack_run_loop_init(btstack_run_loop_posix_get_instance());
|
||||
#endif
|
||||
int err = bt_open();
|
||||
if (err) {
|
||||
|
@ -49,9 +49,14 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "btstack_client.h"
|
||||
#include "btstack_run_loop_posix.h"
|
||||
#include "hci_cmd.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "btstack_run_loop_posix.h"
|
||||
#else
|
||||
#include "btstack_run_loop_posix.h"
|
||||
#endif
|
||||
|
||||
#define PSM_TEST 0xdead
|
||||
#define PACKET_SIZE 1000
|
||||
|
||||
@ -208,9 +213,9 @@ int main (int argc, const char * argv[]){
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
btstack_run_loop_init(btstack_run_loop_posix_get_instance());
|
||||
#else
|
||||
btstack_run_loop_init(btstack_run_loop_windows_get_instance());
|
||||
#else
|
||||
btstack_run_loop_init(btstack_run_loop_posix_get_instance());
|
||||
#endif
|
||||
int err = bt_open();
|
||||
if (err) {
|
||||
|
@ -47,7 +47,12 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "btstack_client.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "btstack_run_loop_posix.h"
|
||||
#else
|
||||
#include "btstack_run_loop_posix.h"
|
||||
#endif
|
||||
|
||||
static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){
|
||||
|
||||
@ -82,9 +87,9 @@ int main (int argc, const char * argv[]){
|
||||
printf("- connecting to BTstack Daemon\n");
|
||||
// start stack
|
||||
#ifdef _WIN32
|
||||
btstack_run_loop_init(btstack_run_loop_posix_get_instance());
|
||||
#else
|
||||
btstack_run_loop_init(btstack_run_loop_windows_get_instance());
|
||||
#else
|
||||
btstack_run_loop_init(btstack_run_loop_posix_get_instance());
|
||||
#endif
|
||||
int err = bt_open();
|
||||
if (err) {
|
||||
|
@ -56,9 +56,14 @@
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "btstack_client.h"
|
||||
#include "btstack_run_loop_posix.h"
|
||||
#include "classic/sdp_util.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "btstack_run_loop_posix.h"
|
||||
#else
|
||||
#include "btstack_run_loop_posix.h"
|
||||
#endif
|
||||
|
||||
// input from command line arguments
|
||||
bd_addr_t addr = { };
|
||||
hci_con_handle_t con_handle;
|
||||
@ -166,9 +171,9 @@ int main (int argc, const char * argv[]){
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
btstack_run_loop_init(btstack_run_loop_posix_get_instance());
|
||||
#else
|
||||
btstack_run_loop_init(btstack_run_loop_windows_get_instance());
|
||||
#else
|
||||
btstack_run_loop_init(btstack_run_loop_posix_get_instance());
|
||||
#endif
|
||||
int err = bt_open();
|
||||
if (err) {
|
||||
|
@ -52,9 +52,14 @@
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "btstack_client.h"
|
||||
#include "btstack_run_loop_posix.h"
|
||||
#include "classic/sdp_util.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "btstack_run_loop_posix.h"
|
||||
#else
|
||||
#include "btstack_run_loop_posix.h"
|
||||
#endif
|
||||
|
||||
// input from command line arguments
|
||||
bd_addr_t addr = { };
|
||||
hci_con_handle_t con_handle;
|
||||
@ -153,7 +158,11 @@ void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint
|
||||
|
||||
int main (int argc, const char * argv[]){
|
||||
|
||||
#ifdef _WIN32
|
||||
btstack_run_loop_init(btstack_run_loop_windows_get_instance());
|
||||
#else
|
||||
btstack_run_loop_init(btstack_run_loop_posix_get_instance());
|
||||
#endif
|
||||
int err = bt_open();
|
||||
if (err) {
|
||||
fprintf(stderr,"Failed to open connection to BTdaemon, err %d\n",err);
|
||||
|
@ -52,9 +52,14 @@
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "btstack_client.h"
|
||||
#include "btstack_run_loop_posix.h"
|
||||
#include "classic/sdp_util.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "btstack_run_loop_posix.h"
|
||||
#else
|
||||
#include "btstack_run_loop_posix.h"
|
||||
#endif
|
||||
|
||||
#define NUM_ROWS 25
|
||||
#define NUM_COLS 80
|
||||
|
||||
@ -178,9 +183,9 @@ int main (int argc, const char * argv[]){
|
||||
printf("created test data: \n%s\n", test_data);
|
||||
|
||||
#ifdef _WIN32
|
||||
btstack_run_loop_init(btstack_run_loop_posix_get_instance());
|
||||
#else
|
||||
btstack_run_loop_init(btstack_run_loop_windows_get_instance());
|
||||
#else
|
||||
btstack_run_loop_init(btstack_run_loop_posix_get_instance());
|
||||
#endif
|
||||
int err = bt_open();
|
||||
if (err) {
|
||||
|
@ -50,9 +50,14 @@
|
||||
|
||||
#include "btstack_client.h"
|
||||
#include "btstack_run_loop.h"
|
||||
#include "btstack_run_loop_posix.h"
|
||||
#include "hci_cmd.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "btstack_run_loop_posix.h"
|
||||
#else
|
||||
#include "btstack_run_loop_posix.h"
|
||||
#endif
|
||||
|
||||
// bd_addr_t addr = {0x00, 0x03, 0xc9, 0x3d, 0x77, 0x43 }; // Think Outside Keyboard
|
||||
// bd_addr_t addr = {0x00, 0x19, 0x1d, 0x90, 0x44, 0x68 }; // WiiMote
|
||||
// bd_addr_t addr = {0x76, 0x6d, 0x62, 0xdb, 0xca, 0x73 }; // iPad
|
||||
@ -103,9 +108,9 @@ void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint
|
||||
|
||||
int main (int argc, const char * argv[]){
|
||||
#ifdef _WIN32
|
||||
btstack_run_loop_init(btstack_run_loop_posix_get_instance());
|
||||
#else
|
||||
btstack_run_loop_init(btstack_run_loop_windows_get_instance());
|
||||
#else
|
||||
btstack_run_loop_init(btstack_run_loop_posix_get_instance());
|
||||
#endif
|
||||
int err = bt_open();
|
||||
if (err) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user