• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ device_send_request函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中device_send_request函数的典型用法代码示例。如果您正苦于以下问题:C++ device_send_request函数的具体用法?C++ device_send_request怎么用?C++ device_send_request使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了device_send_request函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: io4_get_monoflop

int io4_get_monoflop(IO4 *io4, uint8_t pin, uint8_t *ret_value, uint32_t *ret_time, uint32_t *ret_time_remaining) {
	DevicePrivate *device_p = io4->p;
	GetMonoflop_ request;
	GetMonoflopResponse_ response;
	int ret;

	ret = packet_header_create(&request.header, sizeof(request), IO4_FUNCTION_GET_MONOFLOP, device_p->ipcon_p, device_p);

	if (ret < 0) {
		return ret;
	}

	request.pin = pin;

	ret = device_send_request(device_p, (Packet *)&request, (Packet *)&response);

	if (ret < 0) {
		return ret;
	}
	*ret_value = response.value;
	*ret_time = leconvert_uint32_from(response.time);
	*ret_time_remaining = leconvert_uint32_from(response.time_remaining);



	return ret;
}
开发者ID:JoneXie,项目名称:macchina.io,代码行数:27,代码来源:bricklet_io4.c


示例2: servo_get_current_velocity

int servo_get_current_velocity(Servo *servo, uint8_t servo_num, uint16_t *ret_velocity) {
	DevicePrivate *device_p = servo->p;
	GetCurrentVelocity_ request;
	GetCurrentVelocityResponse_ response;
	int ret;

	ret = packet_header_create(&request.header, sizeof(request), SERVO_FUNCTION_GET_CURRENT_VELOCITY, device_p->ipcon_p, device_p);

	if (ret < 0) {
		return ret;
	}

	request.servo_num = servo_num;

	ret = device_send_request(device_p, (Packet *)&request, (Packet *)&response);

	if (ret < 0) {
		return ret;
	}
	*ret_velocity = leconvert_uint16_from(response.velocity);



	return ret;
}
开发者ID:bbilger,项目名称:libtinkerforge,代码行数:25,代码来源:brick_servo.c


示例3: servo_get_pulse_width

int servo_get_pulse_width(Servo *servo, uint8_t servo_num, uint16_t *ret_min, uint16_t *ret_max) {
	DevicePrivate *device_p = servo->p;
	GetPulseWidth_ request;
	GetPulseWidthResponse_ response;
	int ret;

	ret = packet_header_create(&request.header, sizeof(request), SERVO_FUNCTION_GET_PULSE_WIDTH, device_p->ipcon_p, device_p);

	if (ret < 0) {
		return ret;
	}

	request.servo_num = servo_num;

	ret = device_send_request(device_p, (Packet *)&request, (Packet *)&response);

	if (ret < 0) {
		return ret;
	}
	*ret_min = leconvert_uint16_from(response.min);
	*ret_max = leconvert_uint16_from(response.max);



	return ret;
}
开发者ID:bbilger,项目名称:libtinkerforge,代码行数:26,代码来源:brick_servo.c


示例4: servo_get_protocol1_bricklet_name

int servo_get_protocol1_bricklet_name(Servo *servo, char port, uint8_t *ret_protocol_version, uint8_t ret_firmware_version[3], char ret_name[40]) {
	DevicePrivate *device_p = servo->p;
	GetProtocol1BrickletName_ request;
	GetProtocol1BrickletNameResponse_ response;
	int ret;

	ret = packet_header_create(&request.header, sizeof(request), SERVO_FUNCTION_GET_PROTOCOL1_BRICKLET_NAME, device_p->ipcon_p, device_p);

	if (ret < 0) {
		return ret;
	}

	request.port = port;

	ret = device_send_request(device_p, (Packet *)&request, (Packet *)&response);

	if (ret < 0) {
		return ret;
	}
	*ret_protocol_version = response.protocol_version;
	memcpy(ret_firmware_version, response.firmware_version, 3 * sizeof(uint8_t));
	strncpy(ret_name, response.name, 40);



	return ret;
}
开发者ID:bbilger,项目名称:libtinkerforge,代码行数:27,代码来源:brick_servo.c


示例5: servo_is_enabled

int servo_is_enabled(Servo *servo, uint8_t servo_num, bool *ret_enabled) {
	DevicePrivate *device_p = servo->p;
	IsEnabled_ request;
	IsEnabledResponse_ response;
	int ret;

	ret = packet_header_create(&request.header, sizeof(request), SERVO_FUNCTION_IS_ENABLED, device_p->ipcon_p, device_p);

	if (ret < 0) {
		return ret;
	}

	request.servo_num = servo_num;

	ret = device_send_request(device_p, (Packet *)&request, (Packet *)&response);

	if (ret < 0) {
		return ret;
	}
	*ret_enabled = response.enabled;



	return ret;
}
开发者ID:bbilger,项目名称:libtinkerforge,代码行数:25,代码来源:brick_servo.c


示例6: industrial_digital_in_4_get_identity

int industrial_digital_in_4_get_identity(IndustrialDigitalIn4 *industrial_digital_in_4, char ret_uid[8], char ret_connected_uid[8], char *ret_position, uint8_t ret_hardware_version[3], uint8_t ret_firmware_version[3], uint16_t *ret_device_identifier) {
	DevicePrivate *device_p = industrial_digital_in_4->p;
	GetIdentity_ request;
	GetIdentityResponse_ response;
	int ret;

	ret = packet_header_create(&request.header, sizeof(request), INDUSTRIAL_DIGITAL_IN_4_FUNCTION_GET_IDENTITY, device_p->ipcon_p, device_p);

	if (ret < 0) {
		return ret;
	}


	ret = device_send_request(device_p, (Packet *)&request, (Packet *)&response);

	if (ret < 0) {
		return ret;
	}
	strncpy(ret_uid, response.uid, 8);
	strncpy(ret_connected_uid, response.connected_uid, 8);
	*ret_position = response.position;
	memcpy(ret_hardware_version, response.hardware_version, 3 * sizeof(uint8_t));
	memcpy(ret_firmware_version, response.firmware_version, 3 * sizeof(uint8_t));
	*ret_device_identifier = leconvert_uint16_from(response.device_identifier);



	return ret;
}
开发者ID:JoneXie,项目名称:macchina.io,代码行数:29,代码来源:bricklet_industrial_digital_in_4.c


示例7: humidity_v2_get_spitfp_error_count

int humidity_v2_get_spitfp_error_count(HumidityV2 *humidity_v2, uint32_t *ret_error_count_ack_checksum, uint32_t *ret_error_count_message_checksum, uint32_t *ret_error_count_frame, uint32_t *ret_error_count_overflow) {
	DevicePrivate *device_p = humidity_v2->p;
	GetSPITFPErrorCount_Request request;
	GetSPITFPErrorCount_Response response;
	int ret;

	ret = packet_header_create(&request.header, sizeof(request), HUMIDITY_V2_FUNCTION_GET_SPITFP_ERROR_COUNT, device_p->ipcon_p, device_p);

	if (ret < 0) {
		return ret;
	}

	ret = device_send_request(device_p, (Packet *)&request, (Packet *)&response);

	if (ret < 0) {
		return ret;
	}

	*ret_error_count_ack_checksum = leconvert_uint32_from(response.error_count_ack_checksum);
	*ret_error_count_message_checksum = leconvert_uint32_from(response.error_count_message_checksum);
	*ret_error_count_frame = leconvert_uint32_from(response.error_count_frame);
	*ret_error_count_overflow = leconvert_uint32_from(response.error_count_overflow);

	return ret;
}
开发者ID:PlayWithIt,项目名称:TFStubserver,代码行数:25,代码来源:bricklet_humidity_v2.cpp


示例8: imu_get_angular_velocity

int imu_get_angular_velocity(IMU *imu, int16_t *ret_x, int16_t *ret_y, int16_t *ret_z) {
	GetAngularVelocity_ request;
	GetAngularVelocityResponse_ response;
	int ret;

	ret = packet_header_create(&request.header, sizeof(request), IMU_FUNCTION_GET_ANGULAR_VELOCITY, imu->ipcon, imu);

	if (ret < 0) {
		return ret;
	}


	ret = device_send_request(imu, (Packet *)&request, (Packet *)&response);

	if (ret < 0) {
		return ret;
	}
	*ret_x = leconvert_int16_from(response.x);
	*ret_y = leconvert_int16_from(response.y);
	*ret_z = leconvert_int16_from(response.z);



	return ret;
}
开发者ID:wopl,项目名称:fhem,代码行数:25,代码来源:brick_imu.c


示例9: imu_get_all_data

int imu_get_all_data(IMU *imu, int16_t *ret_acc_x, int16_t *ret_acc_y, int16_t *ret_acc_z, int16_t *ret_mag_x, int16_t *ret_mag_y, int16_t *ret_mag_z, int16_t *ret_ang_x, int16_t *ret_ang_y, int16_t *ret_ang_z, int16_t *ret_temperature) {
	GetAllData_ request;
	GetAllDataResponse_ response;
	int ret;

	ret = packet_header_create(&request.header, sizeof(request), IMU_FUNCTION_GET_ALL_DATA, imu->ipcon, imu);

	if (ret < 0) {
		return ret;
	}


	ret = device_send_request(imu, (Packet *)&request, (Packet *)&response);

	if (ret < 0) {
		return ret;
	}
	*ret_acc_x = leconvert_int16_from(response.acc_x);
	*ret_acc_y = leconvert_int16_from(response.acc_y);
	*ret_acc_z = leconvert_int16_from(response.acc_z);
	*ret_mag_x = leconvert_int16_from(response.mag_x);
	*ret_mag_y = leconvert_int16_from(response.mag_y);
	*ret_mag_z = leconvert_int16_from(response.mag_z);
	*ret_ang_x = leconvert_int16_from(response.ang_x);
	*ret_ang_y = leconvert_int16_from(response.ang_y);
	*ret_ang_z = leconvert_int16_from(response.ang_z);
	*ret_temperature = leconvert_int16_from(response.temperature);



	return ret;
}
开发者ID:wopl,项目名称:fhem,代码行数:32,代码来源:brick_imu.c


示例10: imu_get_acceleration

int imu_get_acceleration(IMU *imu, int16_t *ret_x, int16_t *ret_y, int16_t *ret_z) {
	GetAcceleration_ request;
	GetAccelerationResponse_ response;
	int ret;

	ret = packet_header_create(&request.header, sizeof(request), IMU_FUNCTION_GET_ACCELERATION, imu->ipcon, imu);

	if (ret < 0) {
		return ret;
	}


	ret = device_send_request(imu, (Packet *)&request, (Packet *)&response);

	if (ret < 0) {
		return ret;
	}
	*ret_x = leconvert_int16_from(response.x);
	*ret_y = leconvert_int16_from(response.y);
	*ret_z = leconvert_int16_from(response.z);



	return ret;
}
开发者ID:wopl,项目名称:fhem,代码行数:25,代码来源:brick_imu.c


示例11: imu_get_magnetic_field

int imu_get_magnetic_field(IMU *imu, int16_t *ret_x, int16_t *ret_y, int16_t *ret_z) {
	GetMagneticField_ request;
	GetMagneticFieldResponse_ response;
	int ret;

	ret = packet_header_create(&request.header, sizeof(request), IMU_FUNCTION_GET_MAGNETIC_FIELD, imu->ipcon, imu);

	if (ret < 0) {
		return ret;
	}


	ret = device_send_request(imu, (Packet *)&request, (Packet *)&response);

	if (ret < 0) {
		return ret;
	}
	*ret_x = leconvert_int16_from(response.x);
	*ret_y = leconvert_int16_from(response.y);
	*ret_z = leconvert_int16_from(response.z);



	return ret;
}
开发者ID:wopl,项目名称:fhem,代码行数:25,代码来源:brick_imu.c


示例12: imu_get_protocol1_bricklet_name

int imu_get_protocol1_bricklet_name(IMU *imu, char port, uint8_t *ret_protocol_version, uint8_t ret_firmware_version[3], char ret_name[40]) {
	GetProtocol1BrickletName_ request;
	GetProtocol1BrickletNameResponse_ response;
	int ret;

	ret = packet_header_create(&request.header, sizeof(request), IMU_FUNCTION_GET_PROTOCOL1_BRICKLET_NAME, imu->ipcon, imu);

	if (ret < 0) {
		return ret;
	}

	request.port = port;

	ret = device_send_request(imu, (Packet *)&request, (Packet *)&response);

	if (ret < 0) {
		return ret;
	}
	*ret_protocol_version = response.protocol_version;
	memcpy(ret_firmware_version, response.firmware_version, 3 * sizeof(uint8_t));
	strncpy(ret_name, response.name, 40);



	return ret;
}
开发者ID:wopl,项目名称:fhem,代码行数:26,代码来源:brick_imu.c


示例13: io4_get_edge_count_config

int io4_get_edge_count_config(IO4 *io4, uint8_t pin, uint8_t *ret_edge_type, uint8_t *ret_debounce) {
	DevicePrivate *device_p = io4->p;
	GetEdgeCountConfig_ request;
	GetEdgeCountConfigResponse_ response;
	int ret;

	ret = packet_header_create(&request.header, sizeof(request), IO4_FUNCTION_GET_EDGE_COUNT_CONFIG, device_p->ipcon_p, device_p);

	if (ret < 0) {
		return ret;
	}

	request.pin = pin;

	ret = device_send_request(device_p, (Packet *)&request, (Packet *)&response);

	if (ret < 0) {
		return ret;
	}
	*ret_edge_type = response.edge_type;
	*ret_debounce = response.debounce;



	return ret;
}
开发者ID:JoneXie,项目名称:macchina.io,代码行数:26,代码来源:bricklet_io4.c


示例14: io4_get_edge_count

int io4_get_edge_count(IO4 *io4, uint8_t pin, bool reset_counter, uint32_t *ret_count) {
	DevicePrivate *device_p = io4->p;
	GetEdgeCount_ request;
	GetEdgeCountResponse_ response;
	int ret;

	ret = packet_header_create(&request.header, sizeof(request), IO4_FUNCTION_GET_EDGE_COUNT, device_p->ipcon_p, device_p);

	if (ret < 0) {
		return ret;
	}

	request.pin = pin;
	request.reset_counter = reset_counter;

	ret = device_send_request(device_p, (Packet *)&request, (Packet *)&response);

	if (ret < 0) {
		return ret;
	}
	*ret_count = leconvert_uint32_from(response.count);



	return ret;
}
开发者ID:JoneXie,项目名称:macchina.io,代码行数:26,代码来源:bricklet_io4.c


示例15: industrial_digital_in_4_get_edge_count

int industrial_digital_in_4_get_edge_count(IndustrialDigitalIn4 *industrial_digital_in_4, uint8_t pin, bool reset_counter, uint32_t *ret_count) {
	DevicePrivate *device_p = industrial_digital_in_4->p;
	GetEdgeCount_ request;
	GetEdgeCountResponse_ response;
	int ret;

	ret = packet_header_create(&request.header, sizeof(request), INDUSTRIAL_DIGITAL_IN_4_FUNCTION_GET_EDGE_COUNT, device_p->ipcon_p, device_p);

	if (ret < 0) {
		return ret;
	}

	request.pin = pin;
	request.reset_counter = reset_counter;

	ret = device_send_request(device_p, (Packet *)&request, (Packet *)&response);

	if (ret < 0) {
		return ret;
	}
	*ret_count = leconvert_uint32_from(response.count);



	return ret;
}
开发者ID:JoneXie,项目名称:macchina.io,代码行数:26,代码来源:bricklet_industrial_digital_in_4.c


示例16: imu_get_orientation

int imu_get_orientation(IMU *imu, int16_t *ret_roll, int16_t *ret_pitch, int16_t *ret_yaw) {
	GetOrientation_ request;
	GetOrientationResponse_ response;
	int ret;

	ret = packet_header_create(&request.header, sizeof(request), IMU_FUNCTION_GET_ORIENTATION, imu->ipcon, imu);

	if (ret < 0) {
		return ret;
	}


	ret = device_send_request(imu, (Packet *)&request, (Packet *)&response);

	if (ret < 0) {
		return ret;
	}
	*ret_roll = leconvert_int16_from(response.roll);
	*ret_pitch = leconvert_int16_from(response.pitch);
	*ret_yaw = leconvert_int16_from(response.yaw);



	return ret;
}
开发者ID:wopl,项目名称:fhem,代码行数:25,代码来源:brick_imu.c


示例17: industrial_digital_in_4_get_edge_count_config

int industrial_digital_in_4_get_edge_count_config(IndustrialDigitalIn4 *industrial_digital_in_4, uint8_t pin, uint8_t *ret_edge_type, uint8_t *ret_debounce) {
	DevicePrivate *device_p = industrial_digital_in_4->p;
	GetEdgeCountConfig_ request;
	GetEdgeCountConfigResponse_ response;
	int ret;

	ret = packet_header_create(&request.header, sizeof(request), INDUSTRIAL_DIGITAL_IN_4_FUNCTION_GET_EDGE_COUNT_CONFIG, device_p->ipcon_p, device_p);

	if (ret < 0) {
		return ret;
	}

	request.pin = pin;

	ret = device_send_request(device_p, (Packet *)&request, (Packet *)&response);

	if (ret < 0) {
		return ret;
	}
	*ret_edge_type = response.edge_type;
	*ret_debounce = response.debounce;



	return ret;
}
开发者ID:JoneXie,项目名称:macchina.io,代码行数:26,代码来源:bricklet_industrial_digital_in_4.c


示例18: imu_get_quaternion

int imu_get_quaternion(IMU *imu, float *ret_x, float *ret_y, float *ret_z, float *ret_w) {
	GetQuaternion_ request;
	GetQuaternionResponse_ response;
	int ret;

	ret = packet_header_create(&request.header, sizeof(request), IMU_FUNCTION_GET_QUATERNION, imu->ipcon, imu);

	if (ret < 0) {
		return ret;
	}


	ret = device_send_request(imu, (Packet *)&request, (Packet *)&response);

	if (ret < 0) {
		return ret;
	}
	*ret_x = leconvert_float_from(response.x);
	*ret_y = leconvert_float_from(response.y);
	*ret_z = leconvert_float_from(response.z);
	*ret_w = leconvert_float_from(response.w);



	return ret;
}
开发者ID:wopl,项目名称:fhem,代码行数:26,代码来源:brick_imu.c


示例19: humidity_v2_get_temperature_callback_configuration

int humidity_v2_get_temperature_callback_configuration(HumidityV2 *humidity_v2, uint32_t *ret_period, bool *ret_value_has_to_change, char *ret_option, int16_t *ret_min, int16_t *ret_max) {
	DevicePrivate *device_p = humidity_v2->p;
	GetTemperatureCallbackConfiguration_Request request;
	GetTemperatureCallbackConfiguration_Response response;
	int ret;

	ret = packet_header_create(&request.header, sizeof(request), HUMIDITY_V2_FUNCTION_GET_TEMPERATURE_CALLBACK_CONFIGURATION, device_p->ipcon_p, device_p);

	if (ret < 0) {
		return ret;
	}

	ret = device_send_request(device_p, (Packet *)&request, (Packet *)&response);

	if (ret < 0) {
		return ret;
	}

	*ret_period = leconvert_uint32_from(response.period);
	*ret_value_has_to_change = response.value_has_to_change != 0;
	*ret_option = response.option;
	*ret_min = leconvert_int16_from(response.min);
	*ret_max = leconvert_int16_from(response.max);

	return ret;
}
开发者ID:PlayWithIt,项目名称:TFStubserver,代码行数:26,代码来源:bricklet_humidity_v2.cpp


示例20: imu_get_calibration

int imu_get_calibration(IMU *imu, uint8_t typ, int16_t ret_data[10]) {
	GetCalibration_ request;
	GetCalibrationResponse_ response;
	int ret;
	int i;

	ret = packet_header_create(&request.header, sizeof(request), IMU_FUNCTION_GET_CALIBRATION, imu->ipcon, imu);

	if (ret < 0) {
		return ret;
	}

	request.typ = typ;

	ret = device_send_request(imu, (Packet *)&request, (Packet *)&response);

	if (ret < 0) {
		return ret;
	}
	for (i = 0; i < 10; i++) ret_data[i] = leconvert_int16_from(response.data[i]);



	return ret;
}
开发者ID:wopl,项目名称:fhem,代码行数:25,代码来源:brick_imu.c



注:本文中的device_send_request函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ device_set_desc函数代码示例发布时间:2022-05-30
下一篇:
C++ device_reset函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap