/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. *//* ... */#ifndefH_BLECSC_SENSOR_#defineH_BLECSC_SENSOR_#include"modlog/modlog.h"#include"nimble/ble.h"#ifdef__cplusplusextern"C"{#endif/* Cycling Speed and Cadence configuration */#defineGATT_CSC_UUID0x1816#defineGATT_CSC_MEASUREMENT_UUID0x2A5B#defineGATT_CSC_FEATURE_UUID0x2A5C#defineGATT_SENSOR_LOCATION_UUID0x2A5D#defineGATT_SC_CONTROL_POINT_UUID0x2A55/* Device Information configuration */#defineGATT_DEVICE_INFO_UUID0x180A#defineGATT_MANUFACTURER_NAME_UUID0x2A29#defineGATT_MODEL_NUMBER_UUID0x2A24/*CSC Measurement flags*/#defineCSC_MEASUREMENT_WHEEL_REV_PRESENT0x01#defineCSC_MEASUREMENT_CRANK_REV_PRESENT0x02/* CSC feature flags */#defineCSC_FEATURE_WHEEL_REV_DATA0x01#defineCSC_FEATURE_CRANK_REV_DATA0x02#defineCSC_FEATURE_MULTIPLE_SENSOR_LOC0x04/* Sensor location enum */#defineSENSOR_LOCATION_OTHER0#defineSENSOR_LOCATION_TOP_OF_SHOE1#defineSENSOR_LOCATION_IN_SHOE2#defineSENSOR_LOCATION_HIP3#defineSENSOR_LOCATION_FRONT_WHEEL4#defineSENSOR_LOCATION_LEFT_CRANK5#defineSENSOR_LOCATION_RIGHT_CRANK6#defineSENSOR_LOCATION_LEFT_PEDAL7#defineSENSOR_LOCATION_RIGHT_PEDAL8#defineSENSOR_LOCATION_FROT_HUB9#defineSENSOR_LOCATION_REAR_DROPOUT10#defineSENSOR_LOCATION_CHAINSTAY11#defineSENSOR_LOCATION_REAR_WHEEL12#defineSENSOR_LOCATION_REAR_HUB13#defineSENSOR_LOCATION_CHEST14#defineSENSOR_LOCATION_SPIDER15#defineSENSOR_LOCATION_CHAIN_RING16/* SC Control Point op codes */#defineSC_CP_OP_SET_CUMULATIVE_VALUE1#defineSC_CP_OP_START_SENSOR_CALIBRATION2#defineSC_CP_OP_UPDATE_SENSOR_LOCATION3#defineSC_CP_OP_REQ_SUPPORTED_SENSOR_LOCATIONS4#defineSC_CP_OP_RESPONSE16/*SC Control Point response values */#defineSC_CP_RESPONSE_SUCCESS1#defineSC_CP_RESPONSE_OP_NOT_SUPPORTED2#defineSC_CP_RESPONSE_INVALID_PARAM3#defineSC_CP_RESPONSE_OP_FAILED4/* CSC simulation configuration */#defineCSC_FEATURES(CSC_FEATURE_WHEEL_REV_DATA|\CSC_FEATURE_CRANK_REV_DATA|\CSC_FEATURE_MULTIPLE_SENSOR_LOC)...40 definesstructble_csc_measurement_state{uint32_tcumulative_wheel_rev;uint16_tlast_wheel_evt_time;uint16_tcumulative_crank_rev;uint16_tlast_crank_evt_time;}{ ... };externuint16_tcsc_measurement_handle;externuint16_tcsc_control_point_handle;intgatt_svr_init(structble_csc_measurement_state*csc_measurement_state);intgatt_svr_chr_notify_csc_measurement(uint16_tconn_handle);voidgatt_svr_set_cp_indicate(uint8_tindication_status);#ifdef__cplusplus}{...}#endif/* ... */#endif
Details
Show: from
Types: Columns:
All items filtered out
All items filtered out
This file uses the notable symbols shown below. Click anywhere in the file to view more details.