Bowls Eye  1.0
bluetoothController.h
Go to the documentation of this file.
1 
8 #ifndef BLUETOOTHCONTROLLER_H_
9 #define BLUETOOTHCONTROLLER_H_
10 
11 #include <stdio.h>
12 #include <unistd.h>
13 #include <sys/socket.h>
14 #include <bluetooth/bluetooth.h>
15 #include <bluetooth/rfcomm.h>
16 
17 extern char PC_ADDRESS_[18];
18 
22 typedef struct{
23 
24  struct sockaddr_rc locAddr;
25  struct sockaddr_rc remAddr;
26  char buf[1024];
27  int sock, client;
28  char recData[1024];
29  socklen_t opt;
31 
35 typedef struct{
36 
37  struct sockaddr_rc addr;
38  int sock, status;
39  char *dst;
41 
42 
46 void BluetoothServer_readInt(BluetoothServer_t *server, int *dst);
47 void BluetoothServer_readFloat(BluetoothServer_t *server, float *dst);
48 void BluetoothServer_readChar(BluetoothServer_t *server, char *dst);
49 
53 void BluetoothClient_sendString(BluetoothClient_t *client, char *data, int size);
55 
56 
57 
58 #endif /* BLUETOOTHCONTROLLER_H_ */
void BluetoothServer_disable(BluetoothServer_t *server)
void BluetoothClient_disable(BluetoothClient_t *client)
void BluetoothClient_enable(BluetoothClient_t *client)
void BluetoothServer_construct(BluetoothServer_t *server)
void BluetoothClient_checkError(BluetoothClient_t *client)
void BluetoothClient_sendString(BluetoothClient_t *client, char *data, int size)
Structure for creating a Bluetooth server.
Structure for creating a Bluetooth client.
void BluetoothServer_readChar(BluetoothServer_t *server, char *dst)
void BluetoothServer_enable(BluetoothServer_t *server)
void BluetoothServer_readInt(BluetoothServer_t *server, int *dst)
void BluetoothClient_construct(BluetoothClient_t *client)