cleaning up

This commit is contained in:
matthias.ringwald 2009-04-29 22:02:52 +00:00
parent 2078b31ac4
commit a25a14904c
6 changed files with 0 additions and 165 deletions

View File

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

View File

@ -1,14 +0,0 @@
/*
* 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);

View File

@ -1,62 +0,0 @@
/*
* 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
};

View File

@ -1,11 +0,0 @@
/*
* 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;

View File

@ -1,31 +0,0 @@
/*
* 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;

View File

@ -1,36 +0,0 @@
/*
* main.c
*
* Simple tests
*
* Created by Matthias Ringwald on 4/29/09.
*/
#include <stdio.h>
#include <stdlib.h>
#include "hci.h"
#include "hci_h4_transport.h"
int main (int argc, const char * argv[]) {
//
if (argc <= 1){
printf("HCI Daemon tester. Specify device name for Ericsson ROK 101 007\n");
exit(1);
}
// H4 UART
hci_transport_t * transport = &hci_h4_transport;
// Ancient Ericsson ROK 101 007 (ca. 2001)
hci_uart_config_t config;
config.device_name = argv[1];
config.baudrate = 57600;
config.flowcontrol = 1;
// Go
hci_run(transport, &config);
return 0;
}