123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200 |
- #ifndef BATTSERVICE_H
- #define BATTSERVICE_H
- #ifdef __cplusplus
- extern "C"
- {
- #endif
- #define BATT_PARAM_LEVEL 0
- #define BATT_PARAM_CRITICAL_LEVEL 1
- #define BATT_PARAM_SERVICE_HANDLE 2
- #define BATT_PARAM_BATT_LEVEL_IN_REPORT 3
- #define BATT_LEVEL_NOTI_ENABLED 1
- #define BATT_LEVEL_NOTI_DISABLED 2
- #define HID_RPT_ID_BATT_LEVEL_IN 4
- #ifdef HID_VOICE_SPEC
- #define GATT_DESC_LENGTH_UUID 0x3111
- #endif
- typedef void (*battServiceCB_t)(uint8 event);
- typedef void (*battServiceSetupCB_t)(void);
- typedef uint8 (*battServiceCalcCB_t)(uint16 adcVal);
- typedef void (*battServiceTeardownCB_t)(void);
- extern bStatus_t Batt_AddService( void );
- extern void Batt_Register( battServiceCB_t pfnServiceCB );
- extern bStatus_t Batt_SetParameter( uint8 param, uint8 len, void *value );
- extern bStatus_t Batt_GetParameter( uint8 param, void *value );
- extern bStatus_t Batt_MeasLevel( void );
- extern void Batt_Setup( uint8 adc_ch, uint16 minVal, uint16 maxVal,
- battServiceSetupCB_t sCB, battServiceTeardownCB_t tCB,
- battServiceCalcCB_t cCB );
- void Batt_HandleConnStatusCB( uint16 connHandle, uint8 changeType );
- #ifdef __cplusplus
- }
- #endif
- #endif
|