mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-29 04:20:20 +00:00
fix compile of examples using stdin_support
This commit is contained in:
parent
6ffdae7780
commit
4af4141bbd
@ -56,8 +56,10 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include "btstack.h"
|
||||
#ifdef HAVE_STDIO
|
||||
#include "stdin_support.h"
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
uint8_t hfp_service_buffer[150];
|
||||
const uint8_t rfcomm_channel_nr = 1;
|
||||
@ -325,7 +327,7 @@ static void show_usage(void){
|
||||
printf("---\n");
|
||||
}
|
||||
|
||||
static int stdin_process(struct data_source *ds){
|
||||
static void stdin_process(btstack_data_source_t *ds, btstack_data_source_callback_type_t callback_type){
|
||||
read(ds->fd, &cmd, 1);
|
||||
switch (cmd){
|
||||
case 'a':
|
||||
@ -542,8 +544,6 @@ static int stdin_process(struct data_source *ds){
|
||||
show_usage();
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -56,9 +56,12 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "btstack.h"
|
||||
#ifdef HAVE_STDIO
|
||||
#include "stdin_support.h"
|
||||
#endif
|
||||
|
||||
uint8_t hfp_service_buffer[150];
|
||||
const uint8_t rfcomm_channel_nr = 1;
|
||||
@ -161,13 +164,13 @@ static void show_usage(void){
|
||||
printf("---\n");
|
||||
}
|
||||
|
||||
static int stdin_process(struct data_source *ds){
|
||||
static void stdin_process(btstack_data_source_t *ds, btstack_data_source_callback_type_t callback_type){
|
||||
read(ds->fd, &cmd, 1);
|
||||
|
||||
if (cmd >= '0' && cmd <= '9'){
|
||||
printf("DTMF Code: %c\n", cmd);
|
||||
hfp_hf_send_dtmf_code(device_addr, cmd);
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
|
||||
switch (cmd){
|
||||
@ -438,8 +441,6 @@ static int stdin_process(struct data_source *ds){
|
||||
show_usage();
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -59,6 +59,9 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include "btstack.h"
|
||||
#ifdef HAVE_STDIO
|
||||
#include "stdin_support.h"
|
||||
#endif
|
||||
|
||||
#define SCO_REPORT_PERIOD 255
|
||||
|
||||
@ -130,7 +133,7 @@ static void show_usage(void){
|
||||
}
|
||||
|
||||
#ifdef HAVE_STDIO
|
||||
static int stdin_process(struct data_source *ds){
|
||||
static void stdin_process(btstack_data_source_t *ds, btstack_data_source_callback_type_t callback_type){
|
||||
char buffer;
|
||||
read(ds->fd, &buffer, 1);
|
||||
|
||||
@ -184,7 +187,6 @@ static int stdin_process(struct data_source *ds){
|
||||
break;
|
||||
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -59,6 +59,9 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include "btstack.h"
|
||||
#ifdef HAVE_STDIO
|
||||
#include "stdin_support.h"
|
||||
#endif
|
||||
|
||||
#define SCO_REPORT_PERIOD 255
|
||||
|
||||
@ -130,7 +133,7 @@ static void show_usage(void){
|
||||
}
|
||||
|
||||
#ifdef HAVE_STDIO
|
||||
static int stdin_process(struct data_source *ds){
|
||||
static void stdin_process(btstack_data_source_t *ds, btstack_data_source_callback_type_t callback_type){
|
||||
char buffer;
|
||||
read(ds->fd, &buffer, 1);
|
||||
|
||||
@ -184,7 +187,6 @@ static int stdin_process(struct data_source *ds){
|
||||
show_usage();
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user