Example #1
0
TOPIC find(const dds::domain::DomainParticipant& dp, const std::string& topic_name)
{
    (void)dp;
    std::stringstream ss;
    ss << topic_name;
    ss << dp.domain_id();
    TOPIC t =
        org::opensplice::core::EntityRegistry<std::string, TOPIC>::get(ss.str());
    if(t != dds::core::null)
    {
        return t;
    }
    return TOPIC(dds::core::null);
}
Example #2
0
#endif

/** Button 2 value buffer. */
#if ENABLE_SENSOR_BUTTON_2 && ENABLE_SENSOR_BUTTON_2_EVENTS_CHANGE
static char _sensor_button_2_data_str[max(
        __sizeof_str(CONFIG_SENSOR_BUTTON_2_EVENTS_LOW_MESSAGE),
        __sizeof_str(CONFIG_SENSOR_BUTTON_2_EVENTS_HIGH_MESSAGE))];
#endif

/**
 * Topics.
 */
static struct sensor_str _sensor_button_topics[] = {
#if ENABLE_SENSOR_BUTTON_1
    {
        .data = TOPIC(CONFIG_SENSOR_BUTTON_1_TOPIC),
        .len = __sizeof_str(CONFIG_SENSOR_BUTTON_1_TOPIC),
    },
#endif
#if ENABLE_SENSOR_BUTTON_2
    {
        .data = TOPIC(CONFIG_SENSOR_BUTTON_2_TOPIC),
        .len = __sizeof_str(CONFIG_SENSOR_BUTTON_2_TOPIC),
    },
#endif
};

/**
 * Values.
 */
static struct sensor_str _sensor_button_data[] = {