cleaning up the tree

This commit is contained in:
matthias.ringwald 2009-04-29 22:00:24 +00:00
parent 7810600589
commit 1f504dbd51
5 changed files with 129 additions and 0 deletions

11
src/hci.c Normal file
View File

@ -0,0 +1,11 @@
/*
* hci.c
*
* Created by Matthias Ringwald on 4/29/09.
*
*/
#include "hci.h"
void hci_run(hci_transport_t *transport, void *config){
}

14
src/hci.h Normal file
View File

@ -0,0 +1,14 @@
/*
* hci.h
*
* Created by Matthias Ringwald on 4/29/09.
*
*/
#pragma once
#include "hci_transport.h"
// run the hci daemon loop
void hci_run(hci_transport_t *transport, void *config);

62
src/hci_h4_transport.c Normal file
View File

@ -0,0 +1,62 @@
/*
* hci_h4_transport.c
* project
*
* Created by Matthias Ringwald on 4/29/09.
* Copyright 2009 Dybuster AG. All rights reserved.
*
*/
#include "hci_h4_transport.h"
// prototypes
static int open(void *transport_config){
return 0;
}
static int close(){
return 0;
}
static int send_cmd_packet(void *packet, int size){
return 0;
}
static int send_acl_packet(void *packet, int size){
return 0;
}
static void register_event_packet_handler(void (*handler)(void *packet, int size)){
}
static void register_acl_packet_handler (void (*handler)(void *packet, int size)){
}
static int get_fd() {
return -1;
}
static int handle_data() {
return 0;
}
static const char * get_transport_name(){
return "H4";
}
// private data
typedef struct {
} hci_h4_transport_private_t;
// single instance
hci_transport_t hci_h4_transport = {
open,
close,
send_cmd_packet,
send_acl_packet,
register_acl_packet_handler,
register_event_packet_handler,
get_fd,
handle_data,
get_transport_name
};

11
src/hci_h4_transport.h Normal file
View File

@ -0,0 +1,11 @@
/*
* hci_h4_transport.h
*
* Created by Matthias Ringwald on 4/29/09.
*
*/
#pragma once
#include "hci_transport.h"
extern hci_transport_t hci_h4_transport;

31
src/hci_transport.h Normal file
View File

@ -0,0 +1,31 @@
/*
* hci_transport.h
*
* HCI Transport API -- allows hcid to use different transport protcols
*
* Created by Matthias Ringwald on 4/29/09.
*
*/
#pragma once
typedef struct {
int (*open)(void *transport_config);
int (*close)();
int (*send_cmd_packet)(void *packet, int size);
int (*send_acl_packet)(void *packet, int size);
void (*register_event_packet_handler)(void (*handler)(void *packet, int size));
void (*register_acl_packet_handler) (void (*handler)(void *packet, int size));
int (*get_fd)(); // <-- only used for select(..) call
int (*handle_data)(); // -- to be called when select( .. ) returns for the fd
const char * (*get_transport_name)();
} hci_transport_t;
typedef struct {
const char *device_name;
int baudrate;
int flowcontrol; //
} hci_uart_config_t;
typedef struct {
// unique usb device identifier
} hci_libusb_config_t;