summaryrefslogtreecommitdiff
path: root/test.c
blob: 3fc5a0460903864248d11860809ccffcdd7f3c88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "streamdeck.h"
#include <hidapi/hidapi.h>
#include <unistd.h>
#include <stdio.h>

/* The point of this file is to test the backend */
int main() {
    if (init ())
    {
	return -1;
    }
    // handler* streamdeck_handler = create_hid_handler (); 
    streamdeck* mini = connect();
    if (!mini)
    {
	return -2;
    }
    reset(mini->hid_handle);
    sleep (10);
    printf("butterdog\n");
    if (set_brightness(mini, 10) == -1)
	printf("failed\n");
    sleep (3);
    set_brightness(mini, 100);
    destroy_streamdeck(mini);
    printf("done!\n");
    clean_exit();
    return 0;
}