123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- /**
- * @file
- * @author chipsea
- * @brief
- * @version 0.1
- * @date 2020-11-30
- * @copyright Copyright (c) 2020, CHIPSEA Co., Ltd.
- * @note
- */
- #ifndef SCANPARAMSERVICE_H
- #define SCANPARAMSERVICE_H
- #ifdef __cplusplus
- extern "C"
- {
- #endif
- /*********************************************************************
- * INCLUDES
- */
- /*********************************************************************
- * CONSTANTS
- */
- // Scan Characteristic Lengths
- #define SCAN_INTERVAL_WINDOW_CHAR_LEN 4
- #define SCAN_PARAM_REFRESH_LEN 1
- // Scan Parameter Refresh Values
- #define SCAN_PARAM_REFRESH_REQ 0x00
- // Callback events
- #define SCAN_INTERVAL_WINDOW_SET 1
- // Get/Set parameters
- #define SCAN_PARAM_PARAM_INTERVAL 0
- #define SCAN_PARAM_PARAM_WINDOW 1
- /*********************************************************************
- * TYPEDEFS
- */
- /*********************************************************************
- * MACROS
- */
- /*********************************************************************
- * Profile Callbacks
- */
- // Scan Parameters Service callback function
- typedef void (*scanParamServiceCB_t)( uint8 event );
- /*********************************************************************
- * API FUNCTIONS
- */
- /*********************************************************************
- * @fn ScanParam_AddService
- *
- * @brief Initializes the Service by registering
- * GATT attributes with the GATT server.
- *
- * @return Success or Failure
- */
- extern bStatus_t ScanParam_AddService( void );
- /*********************************************************************
- * @fn ScanParam_Register
- *
- * @brief Register a callback function with the Scan Parameters Service.
- *
- * @param pfnServiceCB - Callback function.
- *
- * @return None.
- */
- extern void ScanParam_Register( scanParamServiceCB_t pfnServiceCB );
- /*********************************************************************
- * @fn ScanParam_SetParameter
- *
- * @brief Set a Scan Parameters Service parameter.
- *
- * @param param - Profile parameter ID
- * @param len - length of data to right
- * @param value - pointer to data to write. This is dependent on
- * the parameter ID and WILL be cast to the appropriate
- * data type (example: data type of uint16 will be cast to
- * uint16 pointer).
- *
- * @return bStatus_t
- */
- extern bStatus_t ScanParam_SetParameter( uint8 param, uint8 len, void *value );
-
- /*********************************************************************
- * @fn ScanParam_GetParameter
- *
- * @brief Get a Scan Parameters Service parameter.
- *
- * @param param - Profile parameter ID
- * @param value - pointer to data to get. This is dependent on
- * the parameter ID and WILL be cast to the appropriate
- * data type (example: data type of uint16 will be cast to
- * uint16 pointer).
- *
- * @return bStatus_t
- */
- extern bStatus_t ScanParam_GetParameter( uint8 param, void *value );
- /*********************************************************************
- * @fn ScanParam_RefreshNotify
- *
- * @brief Notify the peer to refresh the scan parameters.
- *
- * @param connHandle - connection handle
- *
- * @return None
- */
- extern void ScanParam_RefreshNotify( uint16 connHandle );
- /*********************************************************************
- * @fn ScanParam_HandleConnStatusCB
- *
- * @brief Service link status change handler function.
- *
- * @param connHandle - connection handle
- * @param changeType - type of change
- *
- * @return none
- */
- void ScanParam_HandleConnStatusCB( uint16 connHandle, uint8 changeType );
- /*********************************************************************
- *********************************************************************/
- #ifdef __cplusplus
- }
- #endif
- #endif /* SCANPARAMSERVICE_H */
|