diff --git a/system/uorb/sensor/accel.c b/system/uorb/sensor/accel.c new file mode 100644 index 000000000..2b15cf5ac --- /dev/null +++ b/system/uorb/sensor/accel.c @@ -0,0 +1,51 @@ +/**************************************************************************** + * apps/system/uorb/sensor/accel.c + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_UORB +static void print_sensor_accel_message(FAR const struct orb_metadata *meta, + FAR const void *buffer) +{ + FAR const struct sensor_accel *message = buffer; + const orb_abstime now = orb_absolute_time(); + + uorbinfo_raw("%s:\ttimestamp: %" PRIu64 " (%" PRIu64 " us ago) " + "temperature: %.2f x: %.2f y: %.2f z: %.2f", + meta->o_name, message->timestamp, now - message->timestamp, + message->temperature, message->x, message->y, message->z); +} +#endif + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +ORB_DEFINE(sensor_accel, struct sensor_accel, print_sensor_accel_message); +ORB_DEFINE(sensor_accel_uncal, struct sensor_accel, + print_sensor_accel_message); diff --git a/system/uorb/sensor/accel.h b/system/uorb/sensor/accel.h new file mode 100644 index 000000000..43d22af48 --- /dev/null +++ b/system/uorb/sensor/accel.h @@ -0,0 +1,39 @@ +/**************************************************************************** + * apps/system/uorb/sensor/accel.h + * + * 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. + * + ****************************************************************************/ + +#ifndef __APPS_SYSTEM_UORB_SENSOR_ACCEL_H +#define __APPS_SYSTEM_UORB_SENSOR_ACCEL_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* register this as object request broker structure */ + +ORB_DECLARE(sensor_accel); +ORB_DECLARE(sensor_accel_uncal); + +#endif diff --git a/system/uorb/sensor/baro.c b/system/uorb/sensor/baro.c new file mode 100644 index 000000000..fab5d321f --- /dev/null +++ b/system/uorb/sensor/baro.c @@ -0,0 +1,49 @@ +/**************************************************************************** + * apps/system/uorb/sensor/baro.c + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_UORB +static void print_sensor_baro_message(FAR const struct orb_metadata *meta, + FAR const void *buffer) +{ + FAR const struct sensor_baro *message = buffer; + const orb_abstime now = orb_absolute_time(); + + uorbinfo_raw("%s:\ttimestamp: %" PRIu64 " (%" PRIu64 " us ago) " + "temperature: %.2f pressure: %.2f", + meta->o_name, message->timestamp, now - message->timestamp, + message->temperature, message->pressure); +} +#endif + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +ORB_DEFINE(sensor_baro, struct sensor_baro, print_sensor_baro_message); diff --git a/system/uorb/sensor/baro.h b/system/uorb/sensor/baro.h new file mode 100644 index 000000000..b5c8f930b --- /dev/null +++ b/system/uorb/sensor/baro.h @@ -0,0 +1,38 @@ +/**************************************************************************** + * apps/system/uorb/sensor/baro.h + * + * 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. + * + ****************************************************************************/ + +#ifndef __APPS_SYSTEM_UORB_SENSOR_BARO_H +#define __APPS_SYSTEM_UORB_SENSOR_BARO_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* register this as object request broker structure */ + +ORB_DECLARE(sensor_baro); + +#endif diff --git a/system/uorb/sensor/cap.c b/system/uorb/sensor/cap.c new file mode 100644 index 000000000..e3a809a4d --- /dev/null +++ b/system/uorb/sensor/cap.c @@ -0,0 +1,51 @@ +/**************************************************************************** + * apps/system/uorb/sensor/cap.c + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_UORB +static void print_sensor_cap_message(FAR const struct orb_metadata *meta, + FAR const void *buffer) +{ + FAR const struct sensor_cap *message = buffer; + const orb_abstime now = orb_absolute_time(); + + uorbinfo_raw("%s:\ttimestamp: %" PRIu64 " (%" PRIu64 " us ago) " + "status: %" PRIu32 " rawdata0: %" PRIu32 " rawdata1: " + "%" PRIu32 " rawdata2: %" PRIu32 " rawdata3: %" PRIu32 "", + meta->o_name, message->timestamp, now - message->timestamp, + message->status, message->rawdata[0], message->rawdata[1], + message->rawdata[2], message->rawdata[3]); +} +#endif + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +ORB_DEFINE(sensor_cap, struct sensor_cap, print_sensor_cap_message); diff --git a/system/uorb/sensor/cap.h b/system/uorb/sensor/cap.h new file mode 100644 index 000000000..b4dd55372 --- /dev/null +++ b/system/uorb/sensor/cap.h @@ -0,0 +1,38 @@ +/**************************************************************************** + * apps/system/uorb/sensor/cap.h + * + * 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. + * + ****************************************************************************/ + +#ifndef __APPS_SYSTEM_UORB_SENSOR_CAP_H +#define __APPS_SYSTEM_UORB_SENSOR_CAP_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* register this as object request broker structure */ + +ORB_DECLARE(sensor_cap); + +#endif diff --git a/system/uorb/sensor/co2.c b/system/uorb/sensor/co2.c new file mode 100644 index 000000000..8dd09f425 --- /dev/null +++ b/system/uorb/sensor/co2.c @@ -0,0 +1,48 @@ +/**************************************************************************** + * apps/system/uorb/sensor/co2.c + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_UORB +static void print_sensor_co2_message(FAR const struct orb_metadata *meta, + FAR const void *buffer) +{ + FAR const struct sensor_co2 *message = buffer; + const orb_abstime now = orb_absolute_time(); + + uorbinfo_raw("%s:\ttimestamp: %" PRIu64 " (%" PRIu64 " us ago) co2: %.2f", + meta->o_name, message->timestamp, now - message->timestamp, + message->co2); +} +#endif + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +ORB_DEFINE(sensor_co2, struct sensor_co2, print_sensor_co2_message); diff --git a/system/uorb/sensor/co2.h b/system/uorb/sensor/co2.h new file mode 100644 index 000000000..a4692f9fa --- /dev/null +++ b/system/uorb/sensor/co2.h @@ -0,0 +1,38 @@ +/**************************************************************************** + * apps/system/uorb/sensor/co2.h + * + * 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. + * + ****************************************************************************/ + +#ifndef __APPS_SYSTEM_UORB_SENSOR_CO2_H +#define __APPS_SYSTEM_UORB_SENSOR_CO2_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* register this as object request broker structure */ + +ORB_DECLARE(sensor_co2); + +#endif diff --git a/system/uorb/sensor/dust.c b/system/uorb/sensor/dust.c new file mode 100644 index 000000000..c205952fa --- /dev/null +++ b/system/uorb/sensor/dust.c @@ -0,0 +1,48 @@ +/**************************************************************************** + * apps/system/uorb/sensor/dust.c + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_UORB +static void print_sensor_dust_message(FAR const struct orb_metadata *meta, + FAR const void *buffer) +{ + FAR const struct sensor_dust *message = buffer; + const orb_abstime now = orb_absolute_time(); + + uorbinfo_raw("%s:\ttimestamp: %" PRIu64 " (%" PRIu64 " us ago) dust: %.2f", + meta->o_name, message->timestamp, now - message->timestamp, + message->dust); +} +#endif + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +ORB_DEFINE(sensor_dust, struct sensor_dust, print_sensor_dust_message); diff --git a/system/uorb/sensor/dust.h b/system/uorb/sensor/dust.h new file mode 100644 index 000000000..0be558d15 --- /dev/null +++ b/system/uorb/sensor/dust.h @@ -0,0 +1,38 @@ +/**************************************************************************** + * apps/system/uorb/sensor/dust.h + * + * 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. + * + ****************************************************************************/ + +#ifndef __APPS_SYSTEM_UORB_SENSOR_DUST_H +#define __APPS_SYSTEM_UORB_SENSOR_DUST_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* register this as object request broker structure */ + +ORB_DECLARE(sensor_dust); + +#endif diff --git a/system/uorb/sensor/ecg.c b/system/uorb/sensor/ecg.c new file mode 100644 index 000000000..fdc050e83 --- /dev/null +++ b/system/uorb/sensor/ecg.c @@ -0,0 +1,48 @@ +/**************************************************************************** + * apps/system/uorb/sensor/ecg.c + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_UORB +static void print_sensor_ecg_message(FAR const struct orb_metadata *meta, + FAR const void *buffer) +{ + FAR const struct sensor_ecg *message = buffer; + const orb_abstime now = orb_absolute_time(); + + uorbinfo_raw("%s:\ttimestamp: %" PRIu64 " (%" PRIu64 " us ago) ecg: %.4f", + meta->o_name, message->timestamp, now - message->timestamp, + message->ecg); +} +#endif + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +ORB_DEFINE(sensor_ecg, struct sensor_ecg, print_sensor_ecg_message); diff --git a/system/uorb/sensor/ecg.h b/system/uorb/sensor/ecg.h new file mode 100644 index 000000000..c190e2407 --- /dev/null +++ b/system/uorb/sensor/ecg.h @@ -0,0 +1,38 @@ +/**************************************************************************** + * apps/system/uorb/sensor/ecg.h + * + * 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. + * + ****************************************************************************/ + +#ifndef __APPS_SYSTEM_UORB_SENSOR_ECG_H +#define __APPS_SYSTEM_UORB_SENSOR_ECG_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* register this as object request broker structure */ + +ORB_DECLARE(sensor_ecg); + +#endif diff --git a/system/uorb/sensor/gesture.c b/system/uorb/sensor/gesture.c new file mode 100644 index 000000000..e012adbd7 --- /dev/null +++ b/system/uorb/sensor/gesture.c @@ -0,0 +1,52 @@ +/**************************************************************************** + * apps/system/uorb/sensor/gesture.c + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_UORB +static void +print_sensor_wake_gesture_message(FAR const struct orb_metadata *meta, + FAR const void *buffer) +{ + FAR const struct sensor_wake_gesture *message = buffer; + const orb_abstime now = orb_absolute_time(); + + uorbinfo_raw("%s:\ttimestamp: %" PRIu64 " (%" PRIu64 " us ago)" + " event: %" PRIu32 "", meta->o_name, message->timestamp, + now - message->timestamp, message->event); +} +#endif + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +ORB_DEFINE(sensor_wake_gesture, struct sensor_wake_gesture, + print_sensor_wake_gesture_message); +ORB_DEFINE(sensor_wake_gesture_uncal, struct sensor_wake_gesture, + print_sensor_wake_gesture_message); diff --git a/system/uorb/sensor/gesture.h b/system/uorb/sensor/gesture.h new file mode 100644 index 000000000..521f7d8b3 --- /dev/null +++ b/system/uorb/sensor/gesture.h @@ -0,0 +1,39 @@ +/**************************************************************************** + * apps/system/uorb/sensor/gesture.h + * + * 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. + * + ****************************************************************************/ + +#ifndef __APPS_SYSTEM_UORB_SENSOR_GESTURE_H +#define __APPS_SYSTEM_UORB_SENSOR_GESTURE_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* register this as object request broker structure */ + +ORB_DECLARE(sensor_wake_gesture); +ORB_DECLARE(sensor_wake_gesture_uncal); + +#endif diff --git a/system/uorb/sensor/gps.c b/system/uorb/sensor/gps.c new file mode 100644 index 000000000..565e9d2b5 --- /dev/null +++ b/system/uorb/sensor/gps.c @@ -0,0 +1,82 @@ +/**************************************************************************** + * apps/system/uorb/sensor/gps.c + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_UORB +static void print_sensor_gps_message(FAR const struct orb_metadata *meta, + FAR const void *buffer) +{ + FAR const struct sensor_gps *message = buffer; + const orb_abstime now = orb_absolute_time(); + + uorbinfo_raw("%s:\ttimestamp: %" PRIu64 " (%" PRIu64 " us ago) " + "time_utc: %" PRIu64 " latitude: %.4f longitude: %.4f", + meta->o_name, message->timestamp, now - message->timestamp, + message->time_utc, message->latitude, message->longitude); + + uorbinfo_raw("%s:\taltitude: %.4f altitude_ellipsoid: %.4f " + "ground_speed: %.4f course: %.4f", + meta->o_name, message->altitude, message->altitude_ellipsoid, + message->ground_speed, message->course); + + uorbinfo_raw("%s:\teph: %.4f epv: %.4f hdop: %.4f vdop: %.4f", + meta->o_name, message->eph, message->epv, + message->hdop, message->vdop); +} + +static void +print_sensor_gps_satellite_message(FAR const struct orb_metadata *meta, + FAR const void *buffer) +{ + FAR const struct sensor_gps_satellite *message = buffer; + const orb_abstime now = orb_absolute_time(); + int i; + + uorbinfo_raw("%s:\ttimestamp: %" PRIu64 " (%" PRIu64 " us ago)", + meta->o_name, message->timestamp, now - message->timestamp); + + for (i = 0; i < message->count; i++) + { + uorbinfo_raw("%s:\tnumber:%d svid: %" PRIu32 + "elevation: %" PRIu32 "azimuth: %" PRIu32 + " snr: %" PRIu32 "", + meta->o_name, i, message->info[i].svid, + message->info[i].elevation, message->info[i].azimuth, + message->info[i].snr); + } +} +#endif + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +ORB_DEFINE(sensor_gps, struct sensor_gps, print_sensor_gps_message); +ORB_DEFINE(sensor_gps_satellite, struct sensor_gps_satellite, + print_sensor_gps_satellite_message); diff --git a/system/uorb/sensor/gps.h b/system/uorb/sensor/gps.h new file mode 100644 index 000000000..1c0300ae1 --- /dev/null +++ b/system/uorb/sensor/gps.h @@ -0,0 +1,39 @@ +/**************************************************************************** + * apps/system/uorb/sensor/gps.h + * + * 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. + * + ****************************************************************************/ + +#ifndef __APPS_SYSTEM_UORB_SENSOR_GPS_H +#define __APPS_SYSTEM_UORB_SENSOR_GPS_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* register this as object request broker structure */ + +ORB_DECLARE(sensor_gps); +ORB_DECLARE(sensor_gps_satellite); + +#endif diff --git a/system/uorb/sensor/gyro.c b/system/uorb/sensor/gyro.c new file mode 100644 index 000000000..d0df6a3d4 --- /dev/null +++ b/system/uorb/sensor/gyro.c @@ -0,0 +1,51 @@ +/**************************************************************************** + * apps/system/uorb/sensor/gyro.c + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_UORB +static void print_sensor_gyro_message(FAR const struct orb_metadata *meta, + FAR const void *buffer) +{ + FAR const struct sensor_gyro *message = buffer; + const orb_abstime now = orb_absolute_time(); + + uorbinfo_raw("%s:\ttimestamp: %" PRIu64 " (%" PRIu64 " us ago) " + "temperature: %.2f x: %.2f y: %.2f z: %.2f", + meta->o_name, message->timestamp, now - message->timestamp, + message->temperature, message->x, message->y, message->z); +} +#endif + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +ORB_DEFINE(sensor_gyro, struct sensor_gyro, print_sensor_gyro_message); +ORB_DEFINE(sensor_gyro_uncal, struct sensor_gyro, + print_sensor_gyro_message); diff --git a/system/uorb/sensor/gyro.h b/system/uorb/sensor/gyro.h new file mode 100644 index 000000000..aeb6b9361 --- /dev/null +++ b/system/uorb/sensor/gyro.h @@ -0,0 +1,39 @@ +/**************************************************************************** + * apps/system/uorb/sensor/gyro.h + * + * 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. + * + ****************************************************************************/ + +#ifndef __APPS_SYSTEM_UORB_SENSOR_GYRO_H +#define __APPS_SYSTEM_UORB_SENSOR_GYRO_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* register this as object request broker structure */ + +ORB_DECLARE(sensor_gyro); +ORB_DECLARE(sensor_gyro_uncal); + +#endif diff --git a/system/uorb/sensor/hall.c b/system/uorb/sensor/hall.c new file mode 100644 index 000000000..f55409ff6 --- /dev/null +++ b/system/uorb/sensor/hall.c @@ -0,0 +1,48 @@ +/**************************************************************************** + * apps/system/uorb/sensor/hall.c + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_UORB +static void print_sensor_hall_message(FAR const struct orb_metadata *meta, + FAR const void *buffer) +{ + FAR const struct sensor_hall *message = buffer; + const orb_abstime now = orb_absolute_time(); + + uorbinfo_raw("%s:\ttimestamp: %" PRIu64 " (%" PRIu64 " us ago) hall: %d", + meta->o_name, message->timestamp, now - message->timestamp, + message->hall); +} +#endif + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +ORB_DEFINE(sensor_hall, struct sensor_hall, print_sensor_hall_message); diff --git a/system/uorb/sensor/hall.h b/system/uorb/sensor/hall.h new file mode 100644 index 000000000..01792d70f --- /dev/null +++ b/system/uorb/sensor/hall.h @@ -0,0 +1,38 @@ +/**************************************************************************** + * apps/system/uorb/sensor/hall.h + * + * 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. + * + ****************************************************************************/ + +#ifndef __APPS_SYSTEM_UORB_SENSOR_HALL_H +#define __APPS_SYSTEM_UORB_SENSOR_HALL_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* register this as object request broker structure */ + +ORB_DECLARE(sensor_hall); + +#endif diff --git a/system/uorb/sensor/hbeat.c b/system/uorb/sensor/hbeat.c new file mode 100644 index 000000000..ead4d409a --- /dev/null +++ b/system/uorb/sensor/hbeat.c @@ -0,0 +1,48 @@ +/**************************************************************************** + * apps/system/uorb/sensor/hbeat.c + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_UORB +static void print_sensor_hbeat_message(FAR const struct orb_metadata *meta, + FAR const void *buffer) +{ + FAR const struct sensor_hbeat *message = buffer; + const orb_abstime now = orb_absolute_time(); + + uorbinfo_raw("%s:\ttimestamp: %" PRIu64 " (%" PRIu64 " us ago) " + "heart beat: %.4f", meta->o_name, message->timestamp, + now - message->timestamp, message->beat); +} +#endif + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +ORB_DEFINE(sensor_hbeat, struct sensor_hbeat, print_sensor_hbeat_message); diff --git a/system/uorb/sensor/hbeat.h b/system/uorb/sensor/hbeat.h new file mode 100644 index 000000000..493743fc1 --- /dev/null +++ b/system/uorb/sensor/hbeat.h @@ -0,0 +1,38 @@ +/**************************************************************************** + * apps/system/uorb/sensor/hbeat.h + * + * 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. + * + ****************************************************************************/ + +#ifndef __APPS_SYSTEM_UORB_SENSOR_HBEAT_H +#define __APPS_SYSTEM_UORB_SENSOR_HBEAT_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* register this as object request broker structure */ + +ORB_DECLARE(sensor_hbeat); + +#endif diff --git a/system/uorb/sensor/hcho.c b/system/uorb/sensor/hcho.c new file mode 100644 index 000000000..704cbe6c3 --- /dev/null +++ b/system/uorb/sensor/hcho.c @@ -0,0 +1,48 @@ +/**************************************************************************** + * apps/system/uorb/sensor/hcho.c + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_UORB +static void print_sensor_hcho_message(FAR const struct orb_metadata *meta, + FAR const void *buffer) +{ + FAR const struct sensor_hcho *message = buffer; + const orb_abstime now = orb_absolute_time(); + + uorbinfo_raw("%s:\ttimestamp: %" PRIu64 " (%" PRIu64 " us ago) hcho: %.4f", + meta->o_name, message->timestamp, now - message->timestamp, + message->hcho); +} +#endif + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +ORB_DEFINE(sensor_hcho, struct sensor_hcho, print_sensor_hcho_message); diff --git a/system/uorb/sensor/hcho.h b/system/uorb/sensor/hcho.h new file mode 100644 index 000000000..d52d0b8d6 --- /dev/null +++ b/system/uorb/sensor/hcho.h @@ -0,0 +1,38 @@ +/**************************************************************************** + * apps/system/uorb/sensor/hcho.h + * + * 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. + * + ****************************************************************************/ + +#ifndef __APPS_SYSTEM_UORB_SENSOR_HCHO_H +#define __APPS_SYSTEM_UORB_SENSOR_HCHO_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* register this as object request broker structure */ + +ORB_DECLARE(sensor_hcho); + +#endif diff --git a/system/uorb/sensor/hrate.c b/system/uorb/sensor/hrate.c new file mode 100644 index 000000000..04961b305 --- /dev/null +++ b/system/uorb/sensor/hrate.c @@ -0,0 +1,48 @@ +/**************************************************************************** + * apps/system/uorb/sensor/hrate.c + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_UORB +static void print_sensor_hrate_message(FAR const struct orb_metadata *meta, + FAR const void *buffer) +{ + FAR const struct sensor_hrate *message = buffer; + const orb_abstime now = orb_absolute_time(); + + uorbinfo_raw("%s:\ttimestamp: %" PRIu64 " (%" PRIu64 " us ago) " + "heart rate: %.4f", meta->o_name, message->timestamp, + now - message->timestamp, message->bpm); +} +#endif + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +ORB_DEFINE(sensor_hrate, struct sensor_hrate, print_sensor_hrate_message); diff --git a/system/uorb/sensor/hrate.h b/system/uorb/sensor/hrate.h new file mode 100644 index 000000000..d7b5e5266 --- /dev/null +++ b/system/uorb/sensor/hrate.h @@ -0,0 +1,38 @@ +/**************************************************************************** + * apps/system/uorb/sensor/hrate.h + * + * 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. + * + ****************************************************************************/ + +#ifndef __APPS_SYSTEM_UORB_SENSOR_HRATE_H +#define __APPS_SYSTEM_UORB_SENSOR_HRATE_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* register this as object request broker structure */ + +ORB_DECLARE(sensor_hrate); + +#endif diff --git a/system/uorb/sensor/humi.c b/system/uorb/sensor/humi.c new file mode 100644 index 000000000..a765d85bd --- /dev/null +++ b/system/uorb/sensor/humi.c @@ -0,0 +1,48 @@ +/**************************************************************************** + * apps/system/uorb/sensor/humi.c + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_UORB +static void print_sensor_humi_message(FAR const struct orb_metadata *meta, + FAR const void *buffer) +{ + FAR const struct sensor_humi *message = buffer; + const orb_abstime now = orb_absolute_time(); + + uorbinfo_raw("%s:\ttimestamp: %" PRIu64 " (%" PRIu64 " us ago) humi: %.4f", + meta->o_name, message->timestamp, now - message->timestamp, + message->humidity); +} +#endif + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +ORB_DEFINE(sensor_humi, struct sensor_humi, print_sensor_humi_message); diff --git a/system/uorb/sensor/humi.h b/system/uorb/sensor/humi.h new file mode 100644 index 000000000..32eaf4c0b --- /dev/null +++ b/system/uorb/sensor/humi.h @@ -0,0 +1,38 @@ +/**************************************************************************** + * apps/system/uorb/sensor/humi.h + * + * 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. + * + ****************************************************************************/ + +#ifndef __APPS_SYSTEM_UORB_SENSOR_HUMI_H +#define __APPS_SYSTEM_UORB_SENSOR_HUMI_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* register this as object request broker structure */ + +ORB_DECLARE(sensor_humi); + +#endif diff --git a/system/uorb/sensor/impd.c b/system/uorb/sensor/impd.c new file mode 100644 index 000000000..00ea5f5cc --- /dev/null +++ b/system/uorb/sensor/impd.c @@ -0,0 +1,49 @@ +/**************************************************************************** + * apps/system/uorb/sensor/impd.c + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_UORB +static void print_sensor_impd_message(FAR const struct orb_metadata *meta, + FAR const void *buffer) +{ + FAR const struct sensor_impd *message = buffer; + const orb_abstime now = orb_absolute_time(); + + uorbinfo_raw("%s:\ttimestamp: %" PRIu64 " (%" PRIu64 " us ago) " + "real: %.2f imaginary: %.2f", meta->o_name, + message->timestamp, now - message->timestamp, + message->real, message->imag); +} +#endif + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +ORB_DEFINE(sensor_impd, struct sensor_impd, print_sensor_impd_message); diff --git a/system/uorb/sensor/impd.h b/system/uorb/sensor/impd.h new file mode 100644 index 000000000..b2bedb62c --- /dev/null +++ b/system/uorb/sensor/impd.h @@ -0,0 +1,38 @@ +/**************************************************************************** + * apps/system/uorb/sensor/impd.h + * + * 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. + * + ****************************************************************************/ + +#ifndef __APPS_SYSTEM_UORB_SENSOR_IMPD_H +#define __APPS_SYSTEM_UORB_SENSOR_IMPD_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* register this as object request broker structure */ + +ORB_DECLARE(sensor_impd); + +#endif diff --git a/system/uorb/sensor/ir.c b/system/uorb/sensor/ir.c new file mode 100644 index 000000000..1ee57f8a7 --- /dev/null +++ b/system/uorb/sensor/ir.c @@ -0,0 +1,48 @@ +/**************************************************************************** + * apps/system/uorb/sensor/ir.c + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_UORB +static void print_sensor_ir_message(FAR const struct orb_metadata *meta, + FAR const void *buffer) +{ + FAR const struct sensor_ir *message = buffer; + const orb_abstime now = orb_absolute_time(); + + uorbinfo_raw("%s:\ttimestamp: %" PRIu64 " (%" PRIu64 " us ago) ir: %.4f", + meta->o_name, message->timestamp, now - message->timestamp, + message->ir); +} +#endif + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +ORB_DEFINE(sensor_ir, struct sensor_ir, print_sensor_ir_message); diff --git a/system/uorb/sensor/ir.h b/system/uorb/sensor/ir.h new file mode 100644 index 000000000..2fba17607 --- /dev/null +++ b/system/uorb/sensor/ir.h @@ -0,0 +1,38 @@ +/**************************************************************************** + * apps/system/uorb/sensor/ir.h + * + * 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. + * + ****************************************************************************/ + +#ifndef __APPS_SYSTEM_UORB_SENSOR_IR_H +#define __APPS_SYSTEM_UORB_SENSOR_IR_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* register this as object request broker structure */ + +ORB_DECLARE(sensor_ir); + +#endif diff --git a/system/uorb/sensor/light.c b/system/uorb/sensor/light.c new file mode 100644 index 000000000..89b2fd530 --- /dev/null +++ b/system/uorb/sensor/light.c @@ -0,0 +1,50 @@ +/**************************************************************************** + * apps/system/uorb/sensor/light.c + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_UORB +static void print_sensor_light_message(FAR const struct orb_metadata *meta, + FAR const void *buffer) +{ + FAR const struct sensor_light *message = buffer; + const orb_abstime now = orb_absolute_time(); + + uorbinfo_raw("%s:\ttimestamp: %" PRIu64 " (%" PRIu64 " us ago) " + "light: %.2f ir: %.2f", meta->o_name, message->timestamp, + now - message->timestamp, message->light, message->ir); +} +#endif + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +ORB_DEFINE(sensor_light, struct sensor_light, print_sensor_light_message); +ORB_DEFINE(sensor_light_uncal, struct sensor_light, + print_sensor_light_message); diff --git a/system/uorb/sensor/light.h b/system/uorb/sensor/light.h new file mode 100644 index 000000000..c2a7c6f7b --- /dev/null +++ b/system/uorb/sensor/light.h @@ -0,0 +1,39 @@ +/**************************************************************************** + * apps/system/uorb/sensor/light.h + * + * 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. + * + ****************************************************************************/ + +#ifndef __APPS_SYSTEM_UORB_SENSOR_LIGHT_H +#define __APPS_SYSTEM_UORB_SENSOR_LIGHT_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* register this as object request broker structure */ + +ORB_DECLARE(sensor_light); +ORB_DECLARE(sensor_light_uncal); + +#endif diff --git a/system/uorb/sensor/mag.c b/system/uorb/sensor/mag.c new file mode 100644 index 000000000..c68fd71c5 --- /dev/null +++ b/system/uorb/sensor/mag.c @@ -0,0 +1,51 @@ +/**************************************************************************** + * apps/system/uorb/sensor/mag.c + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_UORB +static void print_sensor_mag_message(FAR const struct orb_metadata *meta, + FAR const void *buffer) +{ + FAR const struct sensor_mag *message = buffer; + const orb_abstime now = orb_absolute_time(); + + uorbinfo_raw("%s:\ttimestamp: %" PRIu64 " (%" PRIu64 " us ago) " + "temperature: %.2f x: %.2f y: %.2f z: %.2f", + meta->o_name, message->timestamp, now - message->timestamp, + message->temperature, message->x, message->y, message->z); +} +#endif + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +ORB_DEFINE(sensor_mag, struct sensor_mag, print_sensor_mag_message); +ORB_DEFINE(sensor_mag_uncal, struct sensor_mag, + print_sensor_mag_message); diff --git a/system/uorb/sensor/mag.h b/system/uorb/sensor/mag.h new file mode 100644 index 000000000..972e3f83e --- /dev/null +++ b/system/uorb/sensor/mag.h @@ -0,0 +1,39 @@ +/**************************************************************************** + * apps/system/uorb/sensor/mag.h + * + * 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. + * + ****************************************************************************/ + +#ifndef __APPS_SYSTEM_UORB_SENSOR_MAG_H +#define __APPS_SYSTEM_UORB_SENSOR_MAG_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* register this as object request broker structure */ + +ORB_DECLARE(sensor_mag); +ORB_DECLARE(sensor_mag_uncal); + +#endif diff --git a/system/uorb/sensor/noise.c b/system/uorb/sensor/noise.c new file mode 100644 index 000000000..46420e363 --- /dev/null +++ b/system/uorb/sensor/noise.c @@ -0,0 +1,48 @@ +/**************************************************************************** + * apps/system/uorb/sensor/noise.c + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_UORB +static void print_sensor_noise_message(FAR const struct orb_metadata *meta, + FAR const void *buffer) +{ + FAR const struct sensor_noise *message = buffer; + const orb_abstime now = orb_absolute_time(); + + uorbinfo_raw("%s:\ttimestamp: %" PRIu64 " (%" PRIu64 " us ago) " + "noise: %.4f", meta->o_name, message->timestamp, + now - message->timestamp, message->db); +} +#endif + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +ORB_DEFINE(sensor_noise, struct sensor_noise, print_sensor_noise_message); diff --git a/system/uorb/sensor/noise.h b/system/uorb/sensor/noise.h new file mode 100644 index 000000000..5f0504164 --- /dev/null +++ b/system/uorb/sensor/noise.h @@ -0,0 +1,38 @@ +/**************************************************************************** + * apps/system/uorb/sensor/noise.h + * + * 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. + * + ****************************************************************************/ + +#ifndef __APPS_SYSTEM_UORB_SENSOR_NOISE_H +#define __APPS_SYSTEM_UORB_SENSOR_NOISE_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* register this as object request broker structure */ + +ORB_DECLARE(sensor_noise); + +#endif diff --git a/system/uorb/sensor/ots.c b/system/uorb/sensor/ots.c new file mode 100644 index 000000000..100054c07 --- /dev/null +++ b/system/uorb/sensor/ots.c @@ -0,0 +1,49 @@ +/**************************************************************************** + * apps/system/uorb/sensor/ots.c + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_UORB +static void print_sensor_ots_message(FAR const struct orb_metadata *meta, + FAR const void *buffer) +{ + FAR const struct sensor_ots *message = buffer; + const orb_abstime now = orb_absolute_time(); + + uorbinfo_raw("%s:\ttimestamp: %" PRIu64 " (%" PRIu64 " us ago) " + "x: % " PRIi32 " y: % " PRIi32 "", + meta->o_name, message->timestamp, now - message->timestamp, + message->x, message->y); +} +#endif + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +ORB_DEFINE(sensor_ots, struct sensor_ots, print_sensor_ots_message); diff --git a/system/uorb/sensor/ots.h b/system/uorb/sensor/ots.h new file mode 100644 index 000000000..9a8c1ecb7 --- /dev/null +++ b/system/uorb/sensor/ots.h @@ -0,0 +1,38 @@ +/**************************************************************************** + * apps/system/uorb/sensor/ots.h + * + * 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. + * + ****************************************************************************/ + +#ifndef __APPS_SYSTEM_UORB_SENSOR_OTS_H +#define __APPS_SYSTEM_UORB_SENSOR_OTS_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* register this as object request broker structure */ + +ORB_DECLARE(sensor_ots); + +#endif diff --git a/system/uorb/sensor/ph.c b/system/uorb/sensor/ph.c new file mode 100644 index 000000000..06028869e --- /dev/null +++ b/system/uorb/sensor/ph.c @@ -0,0 +1,48 @@ +/**************************************************************************** + * apps/system/uorb/sensor/ph.c + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_UORB +static void print_sensor_ph_message(FAR const struct orb_metadata *meta, + FAR const void *buffer) +{ + FAR const struct sensor_ph *message = buffer; + const orb_abstime now = orb_absolute_time(); + + uorbinfo_raw("%s:\ttimestamp: %" PRIu64 " (%" PRIu64 " us ago) ph: %.4f", + meta->o_name, message->timestamp, now - message->timestamp, + message->ph); +} +#endif + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +ORB_DEFINE(sensor_ph, struct sensor_ph, print_sensor_ph_message); diff --git a/system/uorb/sensor/ph.h b/system/uorb/sensor/ph.h new file mode 100644 index 000000000..57d1e79e4 --- /dev/null +++ b/system/uorb/sensor/ph.h @@ -0,0 +1,38 @@ +/**************************************************************************** + * apps/system/uorb/sensor/ph.h + * + * 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. + * + ****************************************************************************/ + +#ifndef __APPS_SYSTEM_UORB_SENSOR_PH_H +#define __APPS_SYSTEM_UORB_SENSOR_PH_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* register this as object request broker structure */ + +ORB_DECLARE(sensor_ph); + +#endif diff --git a/system/uorb/sensor/pm10.c b/system/uorb/sensor/pm10.c new file mode 100644 index 000000000..b2e57f197 --- /dev/null +++ b/system/uorb/sensor/pm10.c @@ -0,0 +1,48 @@ +/**************************************************************************** + * apps/system/uorb/sensor/pm10.c + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_UORB +static void print_sensor_pm10_message(FAR const struct orb_metadata *meta, + FAR const void *buffer) +{ + FAR const struct sensor_pm10 *message = buffer; + const orb_abstime now = orb_absolute_time(); + + uorbinfo_raw("%s:\ttimestamp: %" PRIu64 " (%" PRIu64 " us ago) pm10: %.4f", + meta->o_name, message->timestamp, now - message->timestamp, + message->pm10); +} +#endif + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +ORB_DEFINE(sensor_pm10, struct sensor_pm10, print_sensor_pm10_message); diff --git a/system/uorb/sensor/pm10.h b/system/uorb/sensor/pm10.h new file mode 100644 index 000000000..6cba6edd7 --- /dev/null +++ b/system/uorb/sensor/pm10.h @@ -0,0 +1,38 @@ +/**************************************************************************** + * apps/system/uorb/sensor/pm10.h + * + * 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. + * + ****************************************************************************/ + +#ifndef __APPS_SYSTEM_UORB_SENSOR_PM10_H +#define __APPS_SYSTEM_UORB_SENSOR_PM10_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* register this as object request broker structure */ + +ORB_DECLARE(sensor_pm10); + +#endif diff --git a/system/uorb/sensor/pm1p0.c b/system/uorb/sensor/pm1p0.c new file mode 100644 index 000000000..31a1db77e --- /dev/null +++ b/system/uorb/sensor/pm1p0.c @@ -0,0 +1,48 @@ +/**************************************************************************** + * apps/system/uorb/sensor/pm1p0.c + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_UORB +static void print_sensor_pm1p0_message(FAR const struct orb_metadata *meta, + FAR const void *buffer) +{ + FAR const struct sensor_pm1p0 *message = buffer; + const orb_abstime now = orb_absolute_time(); + + uorbinfo_raw("%s:\ttimestamp: %" PRIu64 " (%" PRIu64 " us ago) " + "pm1p0: %.4f", meta->o_name, message->timestamp, + now - message->timestamp, message->pm1p0); +} +#endif + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +ORB_DEFINE(sensor_pm1p0, struct sensor_pm1p0, print_sensor_pm1p0_message); diff --git a/system/uorb/sensor/pm1p0.h b/system/uorb/sensor/pm1p0.h new file mode 100644 index 000000000..dca018507 --- /dev/null +++ b/system/uorb/sensor/pm1p0.h @@ -0,0 +1,38 @@ +/**************************************************************************** + * apps/system/uorb/sensor/pm1p0.h + * + * 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. + * + ****************************************************************************/ + +#ifndef __APPS_SYSTEM_UORB_SENSOR_PM1P0_H +#define __APPS_SYSTEM_UORB_SENSOR_PM1P0_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* register this as object request broker structure */ + +ORB_DECLARE(sensor_pm1p0); + +#endif diff --git a/system/uorb/sensor/pm25.c b/system/uorb/sensor/pm25.c new file mode 100644 index 000000000..83dee92cc --- /dev/null +++ b/system/uorb/sensor/pm25.c @@ -0,0 +1,48 @@ +/**************************************************************************** + * apps/system/uorb/sensor/pm25.c + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_UORB +static void print_sensor_pm25_message(FAR const struct orb_metadata *meta, + FAR const void *buffer) +{ + FAR const struct sensor_pm25 *message = buffer; + const orb_abstime now = orb_absolute_time(); + + uorbinfo_raw("%s:\ttimestamp: %" PRIu64 " (%" PRIu64 " us ago) pm25: %.4f", + meta->o_name, message->timestamp, now - message->timestamp, + message->pm25); +} +#endif + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +ORB_DEFINE(sensor_pm25, struct sensor_pm25, print_sensor_pm25_message); diff --git a/system/uorb/sensor/pm25.h b/system/uorb/sensor/pm25.h new file mode 100644 index 000000000..b62fb9d7c --- /dev/null +++ b/system/uorb/sensor/pm25.h @@ -0,0 +1,38 @@ +/**************************************************************************** + * apps/system/uorb/sensor/pm25.h + * + * 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. + * + ****************************************************************************/ + +#ifndef __APPS_SYSTEM_UORB_SENSOR_PM25_H +#define __APPS_SYSTEM_UORB_SENSOR_PM25_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* register this as object request broker structure */ + +ORB_DECLARE(sensor_pm25); + +#endif diff --git a/system/uorb/sensor/ppgd.c b/system/uorb/sensor/ppgd.c new file mode 100644 index 000000000..9c6bceba1 --- /dev/null +++ b/system/uorb/sensor/ppgd.c @@ -0,0 +1,51 @@ +/**************************************************************************** + * apps/system/uorb/sensor/ppgd.c + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_UORB +static void print_sensor_ppgd_message(FAR const struct orb_metadata *meta, + FAR const void *buffer) +{ + FAR const struct sensor_ppgd *message = buffer; + const orb_abstime now = orb_absolute_time(); + + uorbinfo_raw("%s:\ttimestamp: %" PRIu64 " (%" PRIu64 " us ago) " + "ppg1: %" PRIu32 " ppg2: %" PRIu32 " current: %" PRIu32 " " + "gain1: %" PRIu16 " gain2: %" PRIu16 "", + meta->o_name, message->timestamp, now - message->timestamp, + message->ppg[0], message->ppg[1], message->current, + message->gain[0], message->gain[1]); +} +#endif + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +ORB_DEFINE(sensor_ppgd, struct sensor_ppgd, print_sensor_ppgd_message); diff --git a/system/uorb/sensor/ppgd.h b/system/uorb/sensor/ppgd.h new file mode 100644 index 000000000..d326c50bd --- /dev/null +++ b/system/uorb/sensor/ppgd.h @@ -0,0 +1,38 @@ +/**************************************************************************** + * apps/system/uorb/sensor/ppgd.h + * + * 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. + * + ****************************************************************************/ + +#ifndef __APPS_SYSTEM_UORB_SENSOR_PPGD_H +#define __APPS_SYSTEM_UORB_SENSOR_PPGD_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* register this as object request broker structure */ + +ORB_DECLARE(sensor_ppgd); + +#endif diff --git a/system/uorb/sensor/ppgq.c b/system/uorb/sensor/ppgq.c new file mode 100644 index 000000000..92563ceb7 --- /dev/null +++ b/system/uorb/sensor/ppgq.c @@ -0,0 +1,53 @@ +/**************************************************************************** + * apps/system/uorb/sensor/ppgq.c + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_UORB +static void print_sensor_ppgq_message(FAR const struct orb_metadata *meta, + FAR const void *buffer) +{ + FAR const struct sensor_ppgq *message = buffer; + const orb_abstime now = orb_absolute_time(); + + uorbinfo_raw("%s:\ttimestamp: %" PRIu64 " (%" PRIu64 " us ago) " + "ppg1: %" PRIu32 " ppg2: %" PRIu32 " ppg3: %" PRIu32 " " + "ppg4: %" PRIu32 "current: %" PRIu32 " gain1: %" PRIu16 " " + "gain2: %" PRIu16 " gain3: %" PRIu16 " gain4: %" PRIu16 "", + meta->o_name, message->timestamp, now - message->timestamp, + message->ppg[0], message->ppg[1], message->ppg[2], + message->ppg[3], message->current, message->gain[0], + message->gain[1], message->gain[2], message->gain[3]); +} +#endif + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +ORB_DEFINE(sensor_ppgq, struct sensor_ppgq, print_sensor_ppgq_message); diff --git a/system/uorb/sensor/ppgq.h b/system/uorb/sensor/ppgq.h new file mode 100644 index 000000000..9816fcc8e --- /dev/null +++ b/system/uorb/sensor/ppgq.h @@ -0,0 +1,38 @@ +/**************************************************************************** + * apps/system/uorb/sensor/ppgq.h + * + * 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. + * + ****************************************************************************/ + +#ifndef __APPS_SYSTEM_UORB_SENSOR_PPGQ_H +#define __APPS_SYSTEM_UORB_SENSOR_PPGQ_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* register this as object request broker structure */ + +ORB_DECLARE(sensor_ppgq); + +#endif diff --git a/system/uorb/sensor/prox.c b/system/uorb/sensor/prox.c new file mode 100644 index 000000000..cc373d936 --- /dev/null +++ b/system/uorb/sensor/prox.c @@ -0,0 +1,48 @@ +/**************************************************************************** + * apps/system/uorb/sensor/prox.c + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_UORB +static void print_sensor_prox_message(FAR const struct orb_metadata *meta, + FAR const void *buffer) +{ + FAR const struct sensor_prox *message = buffer; + const orb_abstime now = orb_absolute_time(); + + uorbinfo_raw("%s:\ttimestamp: %" PRIu64 " (%" PRIu64 " us ago) " + "proximity: %.4f", meta->o_name, message->timestamp, + now - message->timestamp, message->proximity); +} +#endif + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +ORB_DEFINE(sensor_prox, struct sensor_prox, print_sensor_prox_message); diff --git a/system/uorb/sensor/prox.h b/system/uorb/sensor/prox.h new file mode 100644 index 000000000..b4d8eb9a3 --- /dev/null +++ b/system/uorb/sensor/prox.h @@ -0,0 +1,38 @@ +/**************************************************************************** + * apps/system/uorb/sensor/prox.h + * + * 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. + * + ****************************************************************************/ + +#ifndef __APPS_SYSTEM_UORB_SENSOR_PROX_H +#define __APPS_SYSTEM_UORB_SENSOR_PROX_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* register this as object request broker structure */ + +ORB_DECLARE(sensor_prox); + +#endif diff --git a/system/uorb/sensor/rgb.c b/system/uorb/sensor/rgb.c new file mode 100644 index 000000000..f5363a3fe --- /dev/null +++ b/system/uorb/sensor/rgb.c @@ -0,0 +1,48 @@ +/**************************************************************************** + * apps/system/uorb/sensor/rgb.c + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_UORB +static void print_sensor_rgb_message(FAR const struct orb_metadata *meta, + FAR const void *buffer) +{ + FAR const struct sensor_rgb *message = buffer; + const orb_abstime now = orb_absolute_time(); + + uorbinfo_raw("%s:\ttimestamp: %" PRIu64 " (%" PRIu64 " us ago) red: %.2f" + " green: %.2f blue: %.2f\n", meta->o_name, message->timestamp, + now - message->timestamp, message->r, message->g, message->b); +} +#endif + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +ORB_DEFINE(sensor_rgb, struct sensor_rgb, print_sensor_rgb_message); diff --git a/system/uorb/sensor/rgb.h b/system/uorb/sensor/rgb.h new file mode 100644 index 000000000..3eee8ec21 --- /dev/null +++ b/system/uorb/sensor/rgb.h @@ -0,0 +1,38 @@ +/**************************************************************************** + * apps/system/uorb/sensor/rgb.h + * + * 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. + * + ****************************************************************************/ + +#ifndef __APPS_SYSTEM_UORB_SENSOR_RGB_H +#define __APPS_SYSTEM_UORB_SENSOR_RGB_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* register this as object request broker structure */ + +ORB_DECLARE(sensor_rgb); + +#endif diff --git a/system/uorb/sensor/temp.c b/system/uorb/sensor/temp.c new file mode 100644 index 000000000..428d51c6d --- /dev/null +++ b/system/uorb/sensor/temp.c @@ -0,0 +1,48 @@ +/**************************************************************************** + * apps/system/uorb/sensor/temp.c + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_UORB +static void print_sensor_temp_message(FAR const struct orb_metadata *meta, + FAR const void *buffer) +{ + FAR const struct sensor_temp *message = buffer; + const orb_abstime now = orb_absolute_time(); + + uorbinfo_raw("%s:\ttimestamp: %" PRIu64 " (%" PRIu64 " us ago) " + "temperature: %.4f", meta->o_name, message->timestamp, + now - message->timestamp, message->temperature); +} +#endif + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +ORB_DEFINE(sensor_temp, struct sensor_temp, print_sensor_temp_message); diff --git a/system/uorb/sensor/temp.h b/system/uorb/sensor/temp.h new file mode 100644 index 000000000..3d0f9301e --- /dev/null +++ b/system/uorb/sensor/temp.h @@ -0,0 +1,38 @@ +/**************************************************************************** + * apps/system/uorb/sensor/temp.h + * + * 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. + * + ****************************************************************************/ + +#ifndef __APPS_SYSTEM_UORB_SENSOR_TEMP_H +#define __APPS_SYSTEM_UORB_SENSOR_TEMP_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* register this as object request broker structure */ + +ORB_DECLARE(sensor_temp); + +#endif diff --git a/system/uorb/sensor/tvoc.c b/system/uorb/sensor/tvoc.c new file mode 100644 index 000000000..b3cf21846 --- /dev/null +++ b/system/uorb/sensor/tvoc.c @@ -0,0 +1,48 @@ +/**************************************************************************** + * apps/system/uorb/sensor/tvoc.c + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_UORB +static void print_sensor_tvoc_message(FAR const struct orb_metadata *meta, + FAR const void *buffer) +{ + FAR const struct sensor_tvoc *message = buffer; + const orb_abstime now = orb_absolute_time(); + + uorbinfo_raw("%s:\ttimestamp: %" PRIu64 " (%" PRIu64 " us ago) tvoc: %.4f", + meta->o_name, message->timestamp, now - message->timestamp, + message->tvoc); +} +#endif + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +ORB_DEFINE(sensor_tvoc, struct sensor_tvoc, print_sensor_tvoc_message); diff --git a/system/uorb/sensor/tvoc.h b/system/uorb/sensor/tvoc.h new file mode 100644 index 000000000..9c8f9889e --- /dev/null +++ b/system/uorb/sensor/tvoc.h @@ -0,0 +1,38 @@ +/**************************************************************************** + * apps/system/uorb/sensor/tvoc.h + * + * 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. + * + ****************************************************************************/ + +#ifndef __APPS_SYSTEM_UORB_SENSOR_TVOC_H +#define __APPS_SYSTEM_UORB_SENSOR_TVOC_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* register this as object request broker structure */ + +ORB_DECLARE(sensor_tvoc); + +#endif diff --git a/system/uorb/sensor/uv.c b/system/uorb/sensor/uv.c new file mode 100644 index 000000000..0e827c675 --- /dev/null +++ b/system/uorb/sensor/uv.c @@ -0,0 +1,48 @@ +/**************************************************************************** + * apps/system/uorb/sensor/uv.c + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_UORB +static void print_sensor_uv_message(FAR const struct orb_metadata *meta, + FAR const void *buffer) +{ + FAR const struct sensor_uv *message = buffer; + const orb_abstime now = orb_absolute_time(); + + uorbinfo_raw("%s:\ttimestamp: %" PRIu64 " (%" PRIu64 " us ago) uvi: %.4f", + meta->o_name, message->timestamp, now - message->timestamp, + message->uvi); +} +#endif + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +ORB_DEFINE(sensor_uv, struct sensor_uv, print_sensor_uv_message); diff --git a/system/uorb/sensor/uv.h b/system/uorb/sensor/uv.h new file mode 100644 index 000000000..fbdd6ddf9 --- /dev/null +++ b/system/uorb/sensor/uv.h @@ -0,0 +1,38 @@ +/**************************************************************************** + * apps/system/uorb/sensor/uv.h + * + * 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. + * + ****************************************************************************/ + +#ifndef __APPS_SYSTEM_UORB_SENSOR_UV_H +#define __APPS_SYSTEM_UORB_SENSOR_UV_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* register this as object request broker structure */ + +ORB_DECLARE(sensor_uv); + +#endif