system/uorb: add builtin sensor topics
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
This commit is contained in:
parent
d8d1e1e761
commit
46c98420b7
51
system/uorb/sensor/accel.c
Normal file
51
system/uorb/sensor/accel.c
Normal file
@ -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 <sensor/accel.h>
|
||||
|
||||
/****************************************************************************
|
||||
* 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);
|
39
system/uorb/sensor/accel.h
Normal file
39
system/uorb/sensor/accel.h
Normal file
@ -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 <uORB/uORB.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/* register this as object request broker structure */
|
||||
|
||||
ORB_DECLARE(sensor_accel);
|
||||
ORB_DECLARE(sensor_accel_uncal);
|
||||
|
||||
#endif
|
49
system/uorb/sensor/baro.c
Normal file
49
system/uorb/sensor/baro.c
Normal file
@ -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 <sensor/baro.h>
|
||||
|
||||
/****************************************************************************
|
||||
* 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);
|
38
system/uorb/sensor/baro.h
Normal file
38
system/uorb/sensor/baro.h
Normal file
@ -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 <uORB/uORB.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/* register this as object request broker structure */
|
||||
|
||||
ORB_DECLARE(sensor_baro);
|
||||
|
||||
#endif
|
51
system/uorb/sensor/cap.c
Normal file
51
system/uorb/sensor/cap.c
Normal file
@ -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 <sensor/cap.h>
|
||||
|
||||
/****************************************************************************
|
||||
* 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);
|
38
system/uorb/sensor/cap.h
Normal file
38
system/uorb/sensor/cap.h
Normal file
@ -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 <uORB/uORB.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/* register this as object request broker structure */
|
||||
|
||||
ORB_DECLARE(sensor_cap);
|
||||
|
||||
#endif
|
48
system/uorb/sensor/co2.c
Normal file
48
system/uorb/sensor/co2.c
Normal file
@ -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 <sensor/co2.h>
|
||||
|
||||
/****************************************************************************
|
||||
* 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);
|
38
system/uorb/sensor/co2.h
Normal file
38
system/uorb/sensor/co2.h
Normal file
@ -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 <uORB/uORB.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/* register this as object request broker structure */
|
||||
|
||||
ORB_DECLARE(sensor_co2);
|
||||
|
||||
#endif
|
48
system/uorb/sensor/dust.c
Normal file
48
system/uorb/sensor/dust.c
Normal file
@ -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 <sensor/dust.h>
|
||||
|
||||
/****************************************************************************
|
||||
* 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);
|
38
system/uorb/sensor/dust.h
Normal file
38
system/uorb/sensor/dust.h
Normal file
@ -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 <uORB/uORB.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/* register this as object request broker structure */
|
||||
|
||||
ORB_DECLARE(sensor_dust);
|
||||
|
||||
#endif
|
48
system/uorb/sensor/ecg.c
Normal file
48
system/uorb/sensor/ecg.c
Normal file
@ -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 <sensor/ecg.h>
|
||||
|
||||
/****************************************************************************
|
||||
* 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);
|
38
system/uorb/sensor/ecg.h
Normal file
38
system/uorb/sensor/ecg.h
Normal file
@ -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 <uORB/uORB.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/* register this as object request broker structure */
|
||||
|
||||
ORB_DECLARE(sensor_ecg);
|
||||
|
||||
#endif
|
52
system/uorb/sensor/gesture.c
Normal file
52
system/uorb/sensor/gesture.c
Normal file
@ -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 <sensor/gesture.h>
|
||||
|
||||
/****************************************************************************
|
||||
* 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);
|
39
system/uorb/sensor/gesture.h
Normal file
39
system/uorb/sensor/gesture.h
Normal file
@ -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 <uORB/uORB.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/* register this as object request broker structure */
|
||||
|
||||
ORB_DECLARE(sensor_wake_gesture);
|
||||
ORB_DECLARE(sensor_wake_gesture_uncal);
|
||||
|
||||
#endif
|
82
system/uorb/sensor/gps.c
Normal file
82
system/uorb/sensor/gps.c
Normal file
@ -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 <sensor/gps.h>
|
||||
|
||||
/****************************************************************************
|
||||
* 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);
|
39
system/uorb/sensor/gps.h
Normal file
39
system/uorb/sensor/gps.h
Normal file
@ -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 <uORB/uORB.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/* register this as object request broker structure */
|
||||
|
||||
ORB_DECLARE(sensor_gps);
|
||||
ORB_DECLARE(sensor_gps_satellite);
|
||||
|
||||
#endif
|
51
system/uorb/sensor/gyro.c
Normal file
51
system/uorb/sensor/gyro.c
Normal file
@ -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 <sensor/gyro.h>
|
||||
|
||||
/****************************************************************************
|
||||
* 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);
|
39
system/uorb/sensor/gyro.h
Normal file
39
system/uorb/sensor/gyro.h
Normal file
@ -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 <uORB/uORB.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/* register this as object request broker structure */
|
||||
|
||||
ORB_DECLARE(sensor_gyro);
|
||||
ORB_DECLARE(sensor_gyro_uncal);
|
||||
|
||||
#endif
|
48
system/uorb/sensor/hall.c
Normal file
48
system/uorb/sensor/hall.c
Normal file
@ -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 <sensor/hall.h>
|
||||
|
||||
/****************************************************************************
|
||||
* 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);
|
38
system/uorb/sensor/hall.h
Normal file
38
system/uorb/sensor/hall.h
Normal file
@ -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 <uORB/uORB.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/* register this as object request broker structure */
|
||||
|
||||
ORB_DECLARE(sensor_hall);
|
||||
|
||||
#endif
|
48
system/uorb/sensor/hbeat.c
Normal file
48
system/uorb/sensor/hbeat.c
Normal file
@ -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 <sensor/hbeat.h>
|
||||
|
||||
/****************************************************************************
|
||||
* 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);
|
38
system/uorb/sensor/hbeat.h
Normal file
38
system/uorb/sensor/hbeat.h
Normal file
@ -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 <uORB/uORB.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/* register this as object request broker structure */
|
||||
|
||||
ORB_DECLARE(sensor_hbeat);
|
||||
|
||||
#endif
|
48
system/uorb/sensor/hcho.c
Normal file
48
system/uorb/sensor/hcho.c
Normal file
@ -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 <sensor/hcho.h>
|
||||
|
||||
/****************************************************************************
|
||||
* 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);
|
38
system/uorb/sensor/hcho.h
Normal file
38
system/uorb/sensor/hcho.h
Normal file
@ -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 <uORB/uORB.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/* register this as object request broker structure */
|
||||
|
||||
ORB_DECLARE(sensor_hcho);
|
||||
|
||||
#endif
|
48
system/uorb/sensor/hrate.c
Normal file
48
system/uorb/sensor/hrate.c
Normal file
@ -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 <sensor/hrate.h>
|
||||
|
||||
/****************************************************************************
|
||||
* 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);
|
38
system/uorb/sensor/hrate.h
Normal file
38
system/uorb/sensor/hrate.h
Normal file
@ -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 <uORB/uORB.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/* register this as object request broker structure */
|
||||
|
||||
ORB_DECLARE(sensor_hrate);
|
||||
|
||||
#endif
|
48
system/uorb/sensor/humi.c
Normal file
48
system/uorb/sensor/humi.c
Normal file
@ -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 <sensor/humi.h>
|
||||
|
||||
/****************************************************************************
|
||||
* 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);
|
38
system/uorb/sensor/humi.h
Normal file
38
system/uorb/sensor/humi.h
Normal file
@ -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 <uORB/uORB.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/* register this as object request broker structure */
|
||||
|
||||
ORB_DECLARE(sensor_humi);
|
||||
|
||||
#endif
|
49
system/uorb/sensor/impd.c
Normal file
49
system/uorb/sensor/impd.c
Normal file
@ -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 <sensor/impd.h>
|
||||
|
||||
/****************************************************************************
|
||||
* 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);
|
38
system/uorb/sensor/impd.h
Normal file
38
system/uorb/sensor/impd.h
Normal file
@ -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 <uORB/uORB.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/* register this as object request broker structure */
|
||||
|
||||
ORB_DECLARE(sensor_impd);
|
||||
|
||||
#endif
|
48
system/uorb/sensor/ir.c
Normal file
48
system/uorb/sensor/ir.c
Normal file
@ -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 <sensor/ir.h>
|
||||
|
||||
/****************************************************************************
|
||||
* 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);
|
38
system/uorb/sensor/ir.h
Normal file
38
system/uorb/sensor/ir.h
Normal file
@ -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 <uORB/uORB.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/* register this as object request broker structure */
|
||||
|
||||
ORB_DECLARE(sensor_ir);
|
||||
|
||||
#endif
|
50
system/uorb/sensor/light.c
Normal file
50
system/uorb/sensor/light.c
Normal file
@ -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 <sensor/light.h>
|
||||
|
||||
/****************************************************************************
|
||||
* 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);
|
39
system/uorb/sensor/light.h
Normal file
39
system/uorb/sensor/light.h
Normal file
@ -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 <uORB/uORB.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/* register this as object request broker structure */
|
||||
|
||||
ORB_DECLARE(sensor_light);
|
||||
ORB_DECLARE(sensor_light_uncal);
|
||||
|
||||
#endif
|
51
system/uorb/sensor/mag.c
Normal file
51
system/uorb/sensor/mag.c
Normal file
@ -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 <sensor/mag.h>
|
||||
|
||||
/****************************************************************************
|
||||
* 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);
|
39
system/uorb/sensor/mag.h
Normal file
39
system/uorb/sensor/mag.h
Normal file
@ -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 <uORB/uORB.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/* register this as object request broker structure */
|
||||
|
||||
ORB_DECLARE(sensor_mag);
|
||||
ORB_DECLARE(sensor_mag_uncal);
|
||||
|
||||
#endif
|
48
system/uorb/sensor/noise.c
Normal file
48
system/uorb/sensor/noise.c
Normal file
@ -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 <sensor/noise.h>
|
||||
|
||||
/****************************************************************************
|
||||
* 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);
|
38
system/uorb/sensor/noise.h
Normal file
38
system/uorb/sensor/noise.h
Normal file
@ -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 <uORB/uORB.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/* register this as object request broker structure */
|
||||
|
||||
ORB_DECLARE(sensor_noise);
|
||||
|
||||
#endif
|
49
system/uorb/sensor/ots.c
Normal file
49
system/uorb/sensor/ots.c
Normal file
@ -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 <sensor/ots.h>
|
||||
|
||||
/****************************************************************************
|
||||
* 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);
|
38
system/uorb/sensor/ots.h
Normal file
38
system/uorb/sensor/ots.h
Normal file
@ -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 <uORB/uORB.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/* register this as object request broker structure */
|
||||
|
||||
ORB_DECLARE(sensor_ots);
|
||||
|
||||
#endif
|
48
system/uorb/sensor/ph.c
Normal file
48
system/uorb/sensor/ph.c
Normal file
@ -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 <sensor/ph.h>
|
||||
|
||||
/****************************************************************************
|
||||
* 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);
|
38
system/uorb/sensor/ph.h
Normal file
38
system/uorb/sensor/ph.h
Normal file
@ -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 <uORB/uORB.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/* register this as object request broker structure */
|
||||
|
||||
ORB_DECLARE(sensor_ph);
|
||||
|
||||
#endif
|
48
system/uorb/sensor/pm10.c
Normal file
48
system/uorb/sensor/pm10.c
Normal file
@ -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 <sensor/pm10.h>
|
||||
|
||||
/****************************************************************************
|
||||
* 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);
|
38
system/uorb/sensor/pm10.h
Normal file
38
system/uorb/sensor/pm10.h
Normal file
@ -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 <uORB/uORB.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/* register this as object request broker structure */
|
||||
|
||||
ORB_DECLARE(sensor_pm10);
|
||||
|
||||
#endif
|
48
system/uorb/sensor/pm1p0.c
Normal file
48
system/uorb/sensor/pm1p0.c
Normal file
@ -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 <sensor/pm1p0.h>
|
||||
|
||||
/****************************************************************************
|
||||
* 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);
|
38
system/uorb/sensor/pm1p0.h
Normal file
38
system/uorb/sensor/pm1p0.h
Normal file
@ -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 <uORB/uORB.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/* register this as object request broker structure */
|
||||
|
||||
ORB_DECLARE(sensor_pm1p0);
|
||||
|
||||
#endif
|
48
system/uorb/sensor/pm25.c
Normal file
48
system/uorb/sensor/pm25.c
Normal file
@ -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 <sensor/pm25.h>
|
||||
|
||||
/****************************************************************************
|
||||
* 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);
|
38
system/uorb/sensor/pm25.h
Normal file
38
system/uorb/sensor/pm25.h
Normal file
@ -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 <uORB/uORB.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/* register this as object request broker structure */
|
||||
|
||||
ORB_DECLARE(sensor_pm25);
|
||||
|
||||
#endif
|
51
system/uorb/sensor/ppgd.c
Normal file
51
system/uorb/sensor/ppgd.c
Normal file
@ -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 <sensor/ppgd.h>
|
||||
|
||||
/****************************************************************************
|
||||
* 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);
|
38
system/uorb/sensor/ppgd.h
Normal file
38
system/uorb/sensor/ppgd.h
Normal file
@ -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 <uORB/uORB.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/* register this as object request broker structure */
|
||||
|
||||
ORB_DECLARE(sensor_ppgd);
|
||||
|
||||
#endif
|
53
system/uorb/sensor/ppgq.c
Normal file
53
system/uorb/sensor/ppgq.c
Normal file
@ -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 <sensor/ppgq.h>
|
||||
|
||||
/****************************************************************************
|
||||
* 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);
|
38
system/uorb/sensor/ppgq.h
Normal file
38
system/uorb/sensor/ppgq.h
Normal file
@ -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 <uORB/uORB.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/* register this as object request broker structure */
|
||||
|
||||
ORB_DECLARE(sensor_ppgq);
|
||||
|
||||
#endif
|
48
system/uorb/sensor/prox.c
Normal file
48
system/uorb/sensor/prox.c
Normal file
@ -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 <sensor/prox.h>
|
||||
|
||||
/****************************************************************************
|
||||
* 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);
|
38
system/uorb/sensor/prox.h
Normal file
38
system/uorb/sensor/prox.h
Normal file
@ -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 <uORB/uORB.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/* register this as object request broker structure */
|
||||
|
||||
ORB_DECLARE(sensor_prox);
|
||||
|
||||
#endif
|
48
system/uorb/sensor/rgb.c
Normal file
48
system/uorb/sensor/rgb.c
Normal file
@ -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 <sensor/rgb.h>
|
||||
|
||||
/****************************************************************************
|
||||
* 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);
|
38
system/uorb/sensor/rgb.h
Normal file
38
system/uorb/sensor/rgb.h
Normal file
@ -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 <uORB/uORB.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/* register this as object request broker structure */
|
||||
|
||||
ORB_DECLARE(sensor_rgb);
|
||||
|
||||
#endif
|
48
system/uorb/sensor/temp.c
Normal file
48
system/uorb/sensor/temp.c
Normal file
@ -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 <sensor/temp.h>
|
||||
|
||||
/****************************************************************************
|
||||
* 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);
|
38
system/uorb/sensor/temp.h
Normal file
38
system/uorb/sensor/temp.h
Normal file
@ -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 <uORB/uORB.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/* register this as object request broker structure */
|
||||
|
||||
ORB_DECLARE(sensor_temp);
|
||||
|
||||
#endif
|
48
system/uorb/sensor/tvoc.c
Normal file
48
system/uorb/sensor/tvoc.c
Normal file
@ -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 <sensor/tvoc.h>
|
||||
|
||||
/****************************************************************************
|
||||
* 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);
|
38
system/uorb/sensor/tvoc.h
Normal file
38
system/uorb/sensor/tvoc.h
Normal file
@ -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 <uORB/uORB.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/* register this as object request broker structure */
|
||||
|
||||
ORB_DECLARE(sensor_tvoc);
|
||||
|
||||
#endif
|
48
system/uorb/sensor/uv.c
Normal file
48
system/uorb/sensor/uv.c
Normal file
@ -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 <sensor/uv.h>
|
||||
|
||||
/****************************************************************************
|
||||
* 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);
|
38
system/uorb/sensor/uv.h
Normal file
38
system/uorb/sensor/uv.h
Normal file
@ -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 <uORB/uORB.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/* register this as object request broker structure */
|
||||
|
||||
ORB_DECLARE(sensor_uv);
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user