More changes.

This commit is contained in:
Simon Wilks
2013-04-26 22:28:31 +02:00
parent b666bbb55c
commit 0af9b60db7
2 changed files with 26 additions and 4 deletions
+24 -2
View File
@@ -73,8 +73,8 @@ build_eam_response(uint8_t *buffer, size_t *size)
*size = sizeof(msg);
msg.start = START_BYTE;
msg.eam_sensor_id = ELECTRIC_AIR_MODULE;
msg.sensor_id = EAM_SENSOR_ID;
msg.eam_sensor_id = EAM_SENSOR_ID;
msg.sensor_id = EAM_SENSOR_TEXT_ID;
msg.temperature1 = (uint8_t)(raw.baro_temp_celcius + 20);
msg.temperature2 = msg.temperature1 - BOARD_TEMP_OFFSET_DEG;
@@ -89,6 +89,28 @@ build_eam_response(uint8_t *buffer, size_t *size)
// TODO: climb rate
msg.stop = STOP_BYTE;
memcpy(buffer, &msg, *size);
}
void
build_gps_response(uint8_t *buffer, size_t *size)
{
/* get a local copy of the current sensor values */
struct sensor_combined_s raw = { 0 };
orb_copy(ORB_ID(sensor_combined), sensor_sub, &raw);
struct gps_module_msg msg = { 0 };
*size = sizeof(msg);
msg.start = START_BYTE;
msg.eam_sensor_id = GPS_SENSOR_ID;
msg.sensor_id = GPS_SENSOR_TEXT_ID;
// TODO(sjwilks): Complete.
msg.stop = STOP_BYTE;
memcpy(buffer, &msg, *size);
+2 -2
View File
@@ -60,8 +60,8 @@
#define TEMP_ZERO_CELSIUS 0x14
/* Electric Air Module (EAM) constants. */
#define ELECTRIC_AIR_MODULE 0x8e
#define EAM_SENSOR_ID 0xe0
#define EAM_SENSOR_ID 0x8e
#define EAM_SENSOR_TEXT_ID 0xe0
/* The Electric Air Module message. */
struct eam_module_msg {