sample_service.h
Go to the documentation of this file.
1 
56 #ifndef _SAMPLE_PROFILE_H_
57 #define _SAMPLE_PROFILE_H_
58 
59 #include "gr55xx_sys.h"
60 #include "custom_config.h"
61 #include <stdbool.h>
62 #include <stdint.h>
63 
68 #define SAMPLES_INSTANCE_MAX 0x01
69 #define SAMPLES_CONNECTION_MAX (10 < CFG_MAX_CONNECTIONS ?\
70  10 : CFG_MAX_CONNECTIONS)
71 #define SAMPLES_MAX_DATA_LEN 244
72 #define SAMPLES_SERVICE_UUID 0x1B, 0xD7, 0x90, 0xEC, 0xE8, 0xB9, 0x75, 0x80,\
73  0x0A, 0x46, 0x44, 0xD3, 0x01, 0x01, 0xED, 0xA6
81 typedef enum
82 {
83  SAMPLES_EVT_INVALID,
84  SAMPLES_EVT_TX_NOTIFICATION_ENABLED,
85  SAMPLES_EVT_TX_NOTIFICATION_DISABLED,
86  SAMPLES_EVT_RX_RECEIVE_DATA,
87  SAMPLES_EVT_TX_NOTIFY_COMPLETE,
96 typedef struct
97 {
99  uint8_t conn_idx;
100  uint8_t *p_data;
101  uint16_t length;
102 } samples_evt_t;
110 typedef void (*samples_evt_handler_t)(samples_evt_t *p_evt);
118 typedef struct
119 {
138 sdk_err_t samples_service_init(samples_init_t samples_init[], uint8_t ins_num);
139 
152 sdk_err_t samples_notify_tx_data(uint8_t conn_idx, uint8_t ins_idx, uint8_t *p_data, uint16_t length);
155 #endif
156 
samples_init_t::evt_handler
samples_evt_handler_t evt_handler
Definition: sample_service.h:120
samples_evt_handler_t
void(* samples_evt_handler_t)(samples_evt_t *p_evt)
Sample Service event handler type.
Definition: sample_service.h:110
samples_init_t
Sample Service init stucture. This contains all option and data needed for initialization of the serv...
Definition: sample_service.h:119
gr55xx_sys.h
GR55XX System API.
samples_evt_t
Sample Service event.
Definition: sample_service.h:97
samples_notify_tx_data
sdk_err_t samples_notify_tx_data(uint8_t conn_idx, uint8_t ins_idx, uint8_t *p_data, uint16_t length)
Send data to peer device.
sdk_err_t
uint16_t sdk_err_t
SDK API result type.
Definition: ble_error.h:243
samples_evt_t::conn_idx
uint8_t conn_idx
Definition: sample_service.h:99
samples_evt_t::length
uint16_t length
Definition: sample_service.h:101
samples_service_init
sdk_err_t samples_service_init(samples_init_t samples_init[], uint8_t ins_num)
Initialize Sample Service instances and add in the DB.
samples_evt_t::evt_type
samples_evt_type_t evt_type
Definition: sample_service.h:98
samples_evt_type_t
samples_evt_type_t
Sample Service event type.
Definition: sample_service.h:82
samples_evt_t::p_data
uint8_t * p_data
Definition: sample_service.h:100