Программа считывает показания датчиков и управляет сервомашинками.
Fork of NUCLEO_BLUENRG by
sample_service.h@1:fb307cfca15c, 2014-08-25 (annotated)
- Committer:
- Sergeev
- Date:
- Mon Aug 25 09:45:34 2014 +0000
- Revision:
- 1:fb307cfca15c
- Parent:
- 0:aa1e012ec210
Final
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ostapsky | 0:aa1e012ec210 | 1 | #ifndef _SAMPLE_SERVICE_H_ |
ostapsky | 0:aa1e012ec210 | 2 | #define _SAMPLE_SERVICE_H_ |
ostapsky | 0:aa1e012ec210 | 3 | |
ostapsky | 0:aa1e012ec210 | 4 | #ifdef __cplusplus |
ostapsky | 0:aa1e012ec210 | 5 | extern "C" { |
ostapsky | 0:aa1e012ec210 | 6 | #endif |
ostapsky | 0:aa1e012ec210 | 7 | |
ostapsky | 0:aa1e012ec210 | 8 | #include "cube_hal.h" |
ostapsky | 0:aa1e012ec210 | 9 | #include "hal_types.h" |
ostapsky | 0:aa1e012ec210 | 10 | #include "gatt_server.h" |
ostapsky | 0:aa1e012ec210 | 11 | #include "gap.h" |
ostapsky | 0:aa1e012ec210 | 12 | #include "string.h" |
ostapsky | 0:aa1e012ec210 | 13 | #include "bluenrg_hci.h" |
ostapsky | 0:aa1e012ec210 | 14 | #include "hci_internal.h" |
ostapsky | 0:aa1e012ec210 | 15 | #include "gp_timer.h" |
ostapsky | 0:aa1e012ec210 | 16 | #include "bluenrg_hci_internal.h" |
ostapsky | 0:aa1e012ec210 | 17 | #include "hci.h" |
ostapsky | 0:aa1e012ec210 | 18 | #include "hal.h" |
ostapsky | 0:aa1e012ec210 | 19 | #include "sm.h" |
ostapsky | 0:aa1e012ec210 | 20 | |
ostapsky | 0:aa1e012ec210 | 21 | #define TX_HANDLE 0x0011 |
ostapsky | 0:aa1e012ec210 | 22 | |
ostapsky | 0:aa1e012ec210 | 23 | #define RX_HANDLE 0x0014 |
ostapsky | 0:aa1e012ec210 | 24 | |
ostapsky | 0:aa1e012ec210 | 25 | #define READ_TIMEOUT 100000 |
ostapsky | 0:aa1e012ec210 | 26 | |
ostapsky | 0:aa1e012ec210 | 27 | void Make_Connection(void); |
ostapsky | 0:aa1e012ec210 | 28 | void receiveData(uint8_t* data_buffer, uint8_t Nb_bytes); |
ostapsky | 0:aa1e012ec210 | 29 | void sendData(uint16_t handle, uint8_t* data_buffer, uint8_t Nb_bytes); |
ostapsky | 0:aa1e012ec210 | 30 | void enableNotification(void); |
ostapsky | 0:aa1e012ec210 | 31 | void GAP_ConnectionComplete_CB(uint8_t addr[6], uint16_t handle); |
ostapsky | 0:aa1e012ec210 | 32 | void GAP_DisconnectionComplete_CB(void); |
ostapsky | 0:aa1e012ec210 | 33 | void GATT_Notification_CB(uint16_t attr_handle, uint8_t attr_len, uint8_t *attr_value); |
ostapsky | 0:aa1e012ec210 | 34 | void GATT_Read_CB(uint16_t attr_handle, uint8_t attr_len, uint8_t *attr_value); |
ostapsky | 0:aa1e012ec210 | 35 | void HCI_Event_CB(void *pckt); |
ostapsky | 0:aa1e012ec210 | 36 | uint8_t *readValue(unsigned short handle, uint8_t* len); |
ostapsky | 0:aa1e012ec210 | 37 | void moveMouse(int8_t x, int8_t y); |
ostapsky | 0:aa1e012ec210 | 38 | |
ostapsky | 0:aa1e012ec210 | 39 | #ifdef __cplusplus |
ostapsky | 0:aa1e012ec210 | 40 | } |
ostapsky | 0:aa1e012ec210 | 41 | #endif |
ostapsky | 0:aa1e012ec210 | 42 | |
ostapsky | 0:aa1e012ec210 | 43 | #endif /* _SAMPLE_SERVICE_H_ */ |