Bluetooth hc05 library
hc05.h@17:444cd587d30b, 2018-09-01 (annotated)
- Committer:
- rainerraul
- Date:
- Sat Sep 01 18:41:50 2018 +0000
- Revision:
- 17:444cd587d30b
- Parent:
- 16:8c5c8d0a1cfb
transmit adc value on bluetooth to a raspi
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
rainerraul | 0:15a264bf1590 | 1 | #ifndef HC05_H |
rainerraul | 0:15a264bf1590 | 2 | #define HC05_H |
rainerraul | 0:15a264bf1590 | 3 | |
rainerraul | 7:8b004c3d7e89 | 4 | #define B9600 "9600, 0,0" |
rainerraul | 7:8b004c3d7e89 | 5 | #define B19200 "19200, 0,0" |
rainerraul | 7:8b004c3d7e89 | 6 | #define B38400 "38400, 0,0" |
rainerraul | 7:8b004c3d7e89 | 7 | #define B57600 "57600, 0,0" |
rainerraul | 7:8b004c3d7e89 | 8 | #define B115200 "115200, 0,0" |
rainerraul | 0:15a264bf1590 | 9 | |
rainerraul | 0:15a264bf1590 | 10 | enum UART {UART1, UART6}; |
rainerraul | 6:fed08834891c | 11 | enum CMODE {FIXED, ANY, CSLOOP}; |
rainerraul | 6:fed08834891c | 12 | enum ROLE {SLAVE, MASTER, RSLOOP}; |
rainerraul | 0:15a264bf1590 | 13 | |
rainerraul | 0:15a264bf1590 | 14 | class bt_modul_hc05 |
rainerraul | 0:15a264bf1590 | 15 | { |
rainerraul | 0:15a264bf1590 | 16 | public : |
rainerraul | 0:15a264bf1590 | 17 | void initUART(UART num, unsigned long baudrate, _IRQ interrupt); |
rainerraul | 11:770663228ced | 18 | char *get_version(); |
rainerraul | 11:770663228ced | 19 | char *get_modul_address(); |
rainerraul | 11:770663228ced | 20 | char *get_modul_name(); |
rainerraul | 11:770663228ced | 21 | char *get_device_name(); |
rainerraul | 11:770663228ced | 22 | char *get_modul_role(); |
rainerraul | 11:770663228ced | 23 | char *get_device_class(); |
rainerraul | 11:770663228ced | 24 | char *get_modul_giac(); |
rainerraul | 11:770663228ced | 25 | char *get_modul_inquiry(); |
rainerraul | 11:770663228ced | 26 | char *get_modul_pincode(); |
rainerraul | 11:770663228ced | 27 | char *get_modul_uart(); |
rainerraul | 11:770663228ced | 28 | char *get_modul_inqm(); |
rainerraul | 11:770663228ced | 29 | char *get_modul_init(); |
rainerraul | 11:770663228ced | 30 | char *get_modul_state(); |
rainerraul | 11:770663228ced | 31 | char *get_addr_mode(); |
rainerraul | 11:770663228ced | 32 | char *get_fixed_addr(); |
rainerraul | 1:8d4296aafa55 | 33 | |
rainerraul | 11:770663228ced | 34 | char *set_reset(); |
rainerraul | 11:770663228ced | 35 | char *set_default_settings(); |
rainerraul | 11:770663228ced | 36 | char *set_modul_role(ROLE role); |
rainerraul | 11:770663228ced | 37 | char *set_device_class(int dclass); |
rainerraul | 11:770663228ced | 38 | char *set_modul_giac(char *giac); |
rainerraul | 11:770663228ced | 39 | char *set_modul_pincode(char *pin); |
rainerraul | 11:770663228ced | 40 | char *set_modul_inquiry(char *inqparams); |
rainerraul | 16:8c5c8d0a1cfb | 41 | char *set_modul_inqc(); |
rainerraul | 11:770663228ced | 42 | char *set_modul_name(char *name); |
rainerraul | 11:770663228ced | 43 | char *set_modul_uart(char *uartparams); |
rainerraul | 14:1b81b957214a | 44 | char *set_addr_fixed(char *address); |
rainerraul | 11:770663228ced | 45 | char *set_addr_mode(CMODE mode); |
rainerraul | 11:770663228ced | 46 | char *search_device(char *address); |
rainerraul | 13:85c3dac25599 | 47 | char *set_device_paired(char *address, int timeout); |
rainerraul | 11:770663228ced | 48 | char *delete_device(char *address); |
rainerraul | 11:770663228ced | 49 | char *delete_all(); |
rainerraul | 11:770663228ced | 50 | char *connect_device(char *address); |
rainerraul | 11:770663228ced | 51 | char *disconnect_device(char *address); |
rainerraul | 13:85c3dac25599 | 52 | |
rainerraul | 11:770663228ced | 53 | bool data_send(char *data); |
rainerraul | 11:770663228ced | 54 | char *data_receive(); |
rainerraul | 11:770663228ced | 55 | void flush(); |
rainerraul | 14:1b81b957214a | 56 | |
rainerraul | 14:1b81b957214a | 57 | char *search_device(); |
rainerraul | 13:85c3dac25599 | 58 | |
rainerraul | 12:4a779fa69f6b | 59 | char *link_device_any(char *address); |
rainerraul | 12:4a779fa69f6b | 60 | char *link_device_fixed(char *address); |
rainerraul | 13:85c3dac25599 | 61 | char *link_device_paired(char *address); |
rainerraul | 17:444cd587d30b | 62 | void init_master_fixed(char *address); |
rainerraul | 17:444cd587d30b | 63 | void init_slave(); |
rainerraul | 0:15a264bf1590 | 64 | private : |
rainerraul | 0:15a264bf1590 | 65 | _IRQ t_interrupt; |
rainerraul | 0:15a264bf1590 | 66 | _IRQ t_interrupt1; |
rainerraul | 11:770663228ced | 67 | UART t_uart; |
rainerraul | 0:15a264bf1590 | 68 | }; |
rainerraul | 0:15a264bf1590 | 69 | |
rainerraul | 0:15a264bf1590 | 70 | #endif |