本文整理汇总了C++中packet_header_create函数的典型用法代码示例。如果您正苦于以下问题:C++ packet_header_create函数的具体用法?C++ packet_header_create怎么用?C++ packet_header_create使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了packet_header_create函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: imu_set_quaternion_period
int imu_set_quaternion_period(IMU *imu, uint32_t period) {
SetQuaternionPeriod_ request;
int ret;
ret = packet_header_create(&request.header, sizeof(request), IMU_FUNCTION_SET_QUATERNION_PERIOD, imu->ipcon, imu);
if (ret < 0) {
return ret;
}
request.period = leconvert_uint32_to(period);
ret = device_send_request(imu, (Packet *)&request, NULL);
return ret;
}
示例2: imu_set_angular_velocity_period
int imu_set_angular_velocity_period(IMU *imu, uint32_t period) {
SetAngularVelocityPeriod_ request;
int ret;
ret = packet_header_create(&request.header, sizeof(request), IMU_FUNCTION_SET_ANGULAR_VELOCITY_PERIOD, imu->ipcon, imu);
if (ret < 0) {
return ret;
}
request.period = leconvert_uint32_to(period);
ret = device_send_request(imu, (Packet *)&request, NULL);
return ret;
}
示例3: imu_set_all_data_period
int imu_set_all_data_period(IMU *imu, uint32_t period) {
SetAllDataPeriod_ request;
int ret;
ret = packet_header_create(&request.header, sizeof(request), IMU_FUNCTION_SET_ALL_DATA_PERIOD, imu->ipcon, imu);
if (ret < 0) {
return ret;
}
request.period = leconvert_uint32_to(period);
ret = device_send_request(imu, (Packet *)&request, NULL);
return ret;
}
示例4: imu_set_magnetic_field_period
int imu_set_magnetic_field_period(IMU *imu, uint32_t period) {
SetMagneticFieldPeriod_ request;
int ret;
ret = packet_header_create(&request.header, sizeof(request), IMU_FUNCTION_SET_MAGNETIC_FIELD_PERIOD, imu->ipcon, imu);
if (ret < 0) {
return ret;
}
request.period = leconvert_uint32_to(period);
ret = device_send_request(imu, (Packet *)&request, NULL);
return ret;
}
示例5: uv_light_set_debounce_period
int uv_light_set_debounce_period(UVLight *uv_light, uint32_t debounce) {
DevicePrivate *device_p = uv_light->p;
SetDebouncePeriod_Request request;
int ret;
ret = packet_header_create(&request.header, sizeof(request), UV_LIGHT_FUNCTION_SET_DEBOUNCE_PERIOD, device_p->ipcon_p, device_p);
if (ret < 0) {
return ret;
}
request.debounce = leconvert_uint32_to(debounce);
ret = device_send_request(device_p, (Packet *)&request, NULL);
return ret;
}
示例6: uv_light_set_uv_light_callback_period
int uv_light_set_uv_light_callback_period(UVLight *uv_light, uint32_t period) {
DevicePrivate *device_p = uv_light->p;
SetUVLightCallbackPeriod_Request request;
int ret;
ret = packet_header_create(&request.header, sizeof(request), UV_LIGHT_FUNCTION_SET_UV_LIGHT_CALLBACK_PERIOD, device_p->ipcon_p, device_p);
if (ret < 0) {
return ret;
}
request.period = leconvert_uint32_to(period);
ret = device_send_request(device_p, (Packet *)&request, NULL);
return ret;
}
示例7: imu_set_acceleration_range
int imu_set_acceleration_range(IMU *imu, uint8_t range) {
SetAccelerationRange_ request;
int ret;
ret = packet_header_create(&request.header, sizeof(request), IMU_FUNCTION_SET_ACCELERATION_RANGE, imu->ipcon, imu);
if (ret < 0) {
return ret;
}
request.range = range;
ret = device_send_request(imu, (Packet *)&request, NULL);
return ret;
}
示例8: imu_set_magnetometer_range
int imu_set_magnetometer_range(IMU *imu, uint8_t range) {
SetMagnetometerRange_ request;
int ret;
ret = packet_header_create(&request.header, sizeof(request), IMU_FUNCTION_SET_MAGNETOMETER_RANGE, imu->ipcon, imu);
if (ret < 0) {
return ret;
}
request.range = range;
ret = device_send_request(imu, (Packet *)&request, NULL);
return ret;
}
示例9: voltage_set_analog_value_callback_period
int voltage_set_analog_value_callback_period(Voltage *voltage, uint32_t period) {
DevicePrivate *device_p = voltage->p;
SetAnalogValueCallbackPeriod_Request request;
int ret;
ret = packet_header_create(&request.header, sizeof(request), VOLTAGE_FUNCTION_SET_ANALOG_VALUE_CALLBACK_PERIOD, device_p->ipcon_p, device_p);
if (ret < 0) {
return ret;
}
request.period = leconvert_uint32_to(period);
ret = device_send_request(device_p, (Packet *)&request, NULL);
return ret;
}
示例10: voltage_set_debounce_period
int voltage_set_debounce_period(Voltage *voltage, uint32_t debounce) {
DevicePrivate *device_p = voltage->p;
SetDebouncePeriod_Request request;
int ret;
ret = packet_header_create(&request.header, sizeof(request), VOLTAGE_FUNCTION_SET_DEBOUNCE_PERIOD, device_p->ipcon_p, device_p);
if (ret < 0) {
return ret;
}
request.debounce = leconvert_uint32_to(debounce);
ret = device_send_request(device_p, (Packet *)&request, NULL);
return ret;
}
示例11: gps_set_date_time_callback_period
int gps_set_date_time_callback_period(GPS *gps, uint32_t period) {
DevicePrivate *device_p = gps->p;
SetDateTimeCallbackPeriod_ request;
int ret;
ret = packet_header_create(&request.header, sizeof(request), GPS_FUNCTION_SET_DATE_TIME_CALLBACK_PERIOD, device_p->ipcon_p, device_p);
if (ret < 0) {
return ret;
}
request.period = leconvert_uint32_to(period);
ret = device_send_request(device_p, (Packet *)&request, NULL);
return ret;
}
示例12: gps_restart
int gps_restart(GPS *gps, uint8_t restart_type) {
DevicePrivate *device_p = gps->p;
Restart_ request;
int ret;
ret = packet_header_create(&request.header, sizeof(request), GPS_FUNCTION_RESTART, device_p->ipcon_p, device_p);
if (ret < 0) {
return ret;
}
request.restart_type = restart_type;
ret = device_send_request(device_p, (Packet *)&request, NULL);
return ret;
}
示例13: ambient_light_v2_set_illuminance_callback_period
int ambient_light_v2_set_illuminance_callback_period(AmbientLightV2 *ambient_light_v2, uint32_t period) {
DevicePrivate *device_p = ambient_light_v2->p;
SetIlluminanceCallbackPeriod_ request;
int ret;
ret = packet_header_create(&request.header, sizeof(request), AMBIENT_LIGHT_V2_FUNCTION_SET_ILLUMINANCE_CALLBACK_PERIOD, device_p->ipcon_p, device_p);
if (ret < 0) {
return ret;
}
request.period = leconvert_uint32_to(period);
ret = device_send_request(device_p, (Packet *)&request, NULL);
return ret;
}
示例14: led_strip_set_clock_frequency
int led_strip_set_clock_frequency(LEDStrip *led_strip, uint32_t frequency) {
DevicePrivate *device_p = led_strip->p;
SetClockFrequency_ request;
int ret;
ret = packet_header_create(&request.header, sizeof(request), LED_STRIP_FUNCTION_SET_CLOCK_FREQUENCY, device_p->ipcon_p, device_p);
if (ret < 0) {
return ret;
}
request.frequency = leconvert_uint32_to(frequency);
ret = device_send_request(device_p, (Packet *)&request, NULL);
return ret;
}
示例15: temperature_ir_set_debounce_period
int temperature_ir_set_debounce_period(TemperatureIR *temperature_ir, uint32_t debounce) {
DevicePrivate *device_p = temperature_ir->p;
SetDebouncePeriod_ request;
int ret;
ret = packet_header_create(&request.header, sizeof(request), TEMPERATURE_IR_FUNCTION_SET_DEBOUNCE_PERIOD, device_p->ipcon_p, device_p);
if (ret < 0) {
return ret;
}
request.debounce = leconvert_uint32_to(debounce);
ret = device_send_request(device_p, (Packet *)&request, NULL);
return ret;
}