Bluetooth hc05 library
hc05.h@12:4a779fa69f6b, 2018-08-21 (annotated)
- Committer:
- rainerraul
- Date:
- Tue Aug 21 15:36:58 2018 +0000
- Revision:
- 12:4a779fa69f6b
- Parent:
- 11:770663228ced
- Child:
- 13:85c3dac25599
add link_device_fixed and link_device_any routine
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 | 11:770663228ced | 41 | char *set_modul_name(char *name); |
rainerraul | 11:770663228ced | 42 | char *set_modul_uart(char *uartparams); |
rainerraul | 11:770663228ced | 43 | char *set_fixed_addr(char *address); |
rainerraul | 11:770663228ced | 44 | char *set_addr_mode(CMODE mode); |
rainerraul | 11:770663228ced | 45 | char *search_device(char *address); |
rainerraul | 11:770663228ced | 46 | char *delete_device(char *address); |
rainerraul | 11:770663228ced | 47 | char *delete_all(); |
rainerraul | 11:770663228ced | 48 | char *connect_device(char *address); |
rainerraul | 11:770663228ced | 49 | char *disconnect_device(char *address); |
rainerraul | 11:770663228ced | 50 | |
rainerraul | 11:770663228ced | 51 | bool data_send(char *data); |
rainerraul | 11:770663228ced | 52 | char *data_receive(); |
rainerraul | 11:770663228ced | 53 | void flush(); |
rainerraul | 11:770663228ced | 54 | char *search(); |
rainerraul | 12:4a779fa69f6b | 55 | char *link_device_any(char *address); |
rainerraul | 12:4a779fa69f6b | 56 | char *link_device_fixed(char *address); |
rainerraul | 12:4a779fa69f6b | 57 | |
rainerraul | 0:15a264bf1590 | 58 | private : |
rainerraul | 0:15a264bf1590 | 59 | _IRQ t_interrupt; |
rainerraul | 0:15a264bf1590 | 60 | _IRQ t_interrupt1; |
rainerraul | 11:770663228ced | 61 | UART t_uart; |
rainerraul | 0:15a264bf1590 | 62 | }; |
rainerraul | 0:15a264bf1590 | 63 | |
rainerraul | 0:15a264bf1590 | 64 | #endif |