Rainer Raul / hc_05

Dependents:   Nucleo_bt

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers hc05.h Source File

hc05.h

00001 #ifndef HC05_H
00002 #define HC05_H
00003 
00004 #define B9600 "9600, 0,0"
00005 #define B19200 "19200, 0,0"
00006 #define B38400 "38400, 0,0"
00007 #define B57600 "57600, 0,0"
00008 #define B115200 "115200, 0,0"
00009 
00010 enum UART {UART1, UART6};
00011 enum CMODE {FIXED, ANY, CSLOOP};
00012 enum ROLE {SLAVE, MASTER, RSLOOP};
00013 
00014 class bt_modul_hc05
00015 {
00016 public :
00017     void initUART(UART num, unsigned long baudrate, _IRQ interrupt);
00018     char *get_version();
00019     char *get_modul_address();
00020     char *get_modul_name();
00021     char *get_device_name();
00022     char *get_modul_role();
00023     char *get_device_class();
00024     char *get_modul_giac();
00025     char *get_modul_inquiry();
00026     char *get_modul_pincode();
00027     char *get_modul_uart();
00028     char *get_modul_inqm();
00029     char *get_modul_init();
00030     char *get_modul_state();
00031     char *get_addr_mode();
00032     char *get_fixed_addr();
00033     
00034     char *set_reset();
00035     char *set_default_settings();
00036     char *set_modul_role(ROLE role);
00037     char *set_device_class(int dclass);
00038     char *set_modul_giac(char *giac);
00039     char *set_modul_pincode(char *pin);
00040     char *set_modul_inquiry(char *inqparams);
00041     char *set_modul_inqc();
00042     char *set_modul_name(char *name);
00043     char *set_modul_uart(char *uartparams);
00044     char *set_addr_fixed(char *address);
00045     char *set_addr_mode(CMODE mode);
00046     char *search_device(char *address);
00047     char *set_device_paired(char *address, int timeout);
00048     char *delete_device(char *address);
00049     char *delete_all();
00050     char *connect_device(char *address);
00051     char *disconnect_device(char *address);
00052     
00053     bool data_send(char *data);
00054     char *data_receive();
00055     void flush();
00056     
00057     char *search_device();
00058     
00059     char *link_device_any(char *address);
00060     char *link_device_fixed(char *address);
00061     char *link_device_paired(char *address);
00062     void init_master_fixed(char *address);
00063     void init_slave();
00064 private :
00065     _IRQ t_interrupt;
00066     _IRQ t_interrupt1;
00067     UART t_uart;
00068 };
00069 
00070 #endif