mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-23 19:20:51 +00:00
more compiler warning fixes
This commit is contained in:
parent
1567055bc8
commit
549e6ebe45
@ -67,7 +67,7 @@ int getDeviceIndexForAddress( bd_addr_t addr){
|
||||
return -1;
|
||||
}
|
||||
|
||||
void next(){
|
||||
void next(void){
|
||||
int i;
|
||||
int found = 0;
|
||||
|
||||
@ -226,4 +226,5 @@ int main (int argc, const char * argv[]){
|
||||
bt_send_cmd(&btstack_set_power_mode, HCI_POWER_ON );
|
||||
run_loop_execute();
|
||||
bt_close();
|
||||
return 0;
|
||||
}
|
@ -191,4 +191,5 @@ int main (int argc, const char * argv[]){
|
||||
bt_send_cmd(&btstack_set_power_mode, HCI_POWER_ON );
|
||||
run_loop_execute();
|
||||
bt_close();
|
||||
return 0;
|
||||
}
|
@ -53,11 +53,11 @@ uint32_t counter = 0;
|
||||
|
||||
timer_source_t timer;
|
||||
|
||||
void update_packet(){
|
||||
void update_packet(void){
|
||||
net_store_32( packet, 0, counter++);
|
||||
}
|
||||
|
||||
void prepare_packet(){
|
||||
void prepare_packet(void){
|
||||
int i;
|
||||
counter = 0;
|
||||
net_store_32( packet, 0, 0);
|
||||
@ -223,4 +223,5 @@ int main (int argc, const char * argv[]){
|
||||
|
||||
run_loop_execute();
|
||||
bt_close();
|
||||
return 0;
|
||||
}
|
@ -59,12 +59,7 @@ char pin[17];
|
||||
void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){
|
||||
bd_addr_t event_addr;
|
||||
uint16_t mtu;
|
||||
uint16_t psm;
|
||||
uint16_t rfcomm_channel_id;
|
||||
uint16_t rfcomm_channel_nr;
|
||||
uint8_t credits;
|
||||
static uint32_t packet_counter = 0;
|
||||
static char packet_info[30]; // "packets: 1234567890"
|
||||
|
||||
switch (packet_type) {
|
||||
|
||||
@ -104,8 +99,6 @@ void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint
|
||||
rfcomm_channel_id = READ_BT_16(packet, 12);
|
||||
mtu = READ_BT_16(packet, 14);
|
||||
printf("RFCOMM channel open succeeded. New RFCOMM Channel ID %u, max frame size %u\n", rfcomm_channel_id, mtu);
|
||||
uint8_t message[] = "Hello World from BTstack!\n";
|
||||
// bt_send_rfcomm(rfcomm_channel_id, message, sizeof(message));
|
||||
}
|
||||
break;
|
||||
|
||||
@ -150,7 +143,6 @@ int main (int argc, const char * argv[]){
|
||||
}
|
||||
} else if (!strcmp(argv[arg], "-p") || !strcmp(argv[arg], "--pin")) {
|
||||
arg++;
|
||||
int pin1,pin2,pin3,pin4;
|
||||
if(arg >= argc) {
|
||||
usage(argv[0]);
|
||||
return 1;
|
||||
|
@ -124,12 +124,8 @@ void create_spp_service(uint8_t *service, int service_id){
|
||||
void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){
|
||||
bd_addr_t event_addr;
|
||||
uint16_t mtu;
|
||||
uint16_t psm;
|
||||
uint8_t rfcomm_channel_nr;
|
||||
uint16_t rfcomm_channel_nr;
|
||||
uint16_t rfcomm_channel_id;
|
||||
uint8_t credits;
|
||||
static uint32_t packet_counter = 0;
|
||||
static char packet_info[30]; // "packets: 1234567890"
|
||||
|
||||
switch (packet_type) {
|
||||
|
||||
@ -213,7 +209,7 @@ void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint
|
||||
|
||||
printf("RFCOMM channel open succeeded. New RFCOMM Channel ID %u, max frame size %u\n", rfcomm_channel_id, mtu);
|
||||
uint8_t message[] = "Hello World from BTstack!\n";
|
||||
// bt_send_rfcomm(rfcomm_channel_id, message, sizeof(message));
|
||||
bt_send_rfcomm(rfcomm_channel_id, message, sizeof(message));
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -174,4 +174,5 @@ int main (int argc, const char * argv[]){
|
||||
bt_send_cmd(&btstack_set_power_mode, HCI_POWER_ON );
|
||||
run_loop_execute();
|
||||
bt_close();
|
||||
return 0;
|
||||
}
|
@ -121,7 +121,7 @@ static void dummy_bluetooth_status_handler(BLUETOOTH_STATE state){
|
||||
log_dbg("Bluetooth status: %u\n", state);
|
||||
};
|
||||
|
||||
static void daemon_no_connections_timeout(void){
|
||||
static void daemon_no_connections_timeout(struct timer *ts){
|
||||
if (clients_require_power_on()) return; // false alarm :)
|
||||
log_dbg("No active client connection for %u seconds -> POWER OFF\n", DAEMON_NO_ACTIVE_CLIENT_TIMEOUT/1000);
|
||||
hci_power_control(HCI_POWER_OFF);
|
||||
@ -460,10 +460,12 @@ static void usage(const char * name) {
|
||||
log_dbg(" --tcp use TCP server socket instead of local unix socket\n");
|
||||
}
|
||||
|
||||
#ifdef USE_BLUETOOL
|
||||
static void * run_loop_thread(void *context){
|
||||
run_loop_execute();
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
int main (int argc, char * const * argv){
|
||||
|
||||
|
@ -42,6 +42,10 @@
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifndef EMBEDDED
|
||||
#include <unistd.h> // gethostbyname
|
||||
#endif
|
||||
|
||||
#include "debug.h"
|
||||
#include "hci_dump.h"
|
||||
|
||||
|
@ -192,7 +192,7 @@ static int h4_open(void *transport_config){
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int h4_close(void){
|
||||
static int h4_close(void *transport_config){
|
||||
// first remove run loop handler
|
||||
run_loop_remove_data_source(hci_transport_h4->ds);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user