示例#1
0
    void assertHasAdcEvent() {

        EventType   *adcEventType = AdcEventType_get();
        Event       *event        = EventSource_poll(_eventSource);

        CHECK( event != NULL);
        POINTERS_EQUAL(adcEventType, Event_getEventType(event));
    }
示例#2
0
static void BasicAdcService_start(AdcService  *baseSelf) {

    BasicAdcService *self = (BasicAdcService *)baseSelf;
    EventListener *adcListener =
        AdcServiceAdcListener_asEventListener(&self->adcListener);

    EventManager_addListener(
            self->eventManager,
            AdcEventType_get(),
            adcListener);
}
示例#3
0
    void assertHasAdcEventWithSample(int      channelId,
                                     uint16_t value) {

        EventType   *adcEventType = AdcEventType_get();
        Event       *event        = EventSource_poll(_eventSource);

        CHECK( event != NULL);
        POINTERS_EQUAL(adcEventType, Event_getEventType(event));

        AdcEvent  *adcEvent = AdcEvent_fromEvent(event);
        AdcSample *sample   = AdcEvent_getSample(adcEvent);

        CHECK_EQUAL(channelId, AdcSample_getChannelId(sample));
        CHECK_EQUAL(value, AdcSample_getValue(sample))
    }